Kako lahko v LaTeX napišem to vrstico?
How Can I Write This Bar Latex
Rešitev:
Upam, da vam bo spodnja koda v pomoč ...
documentclass {book} begin {document} [ overline {S}^{2} _ {n} ] [ overline {S_ {n}}^{2} ] [ bar {S_ { n}}^{2} ] konec {document} Izhod

Če v odgovoru na to vprašanje uporabite kodo Hendrika Vogta, imate widebar ukaz, ki upošteva poševni kot glifa:
documentclass {article} usepackage [utf8] {inputenc}% usepackage {mathtools, nccmath} makeatletter let [email protected] mathaccent newcommand* [email protected] [3] {% setbox0 hbox { $ { mathaccent'0362 {#1}}^H $}% setbox2 hbox {$ { mathaccent'0362 { kern0pt#1}}^H $}% ifdim ht0 = ht2#3 else #2 fi} %Vrstica bo premaknjena na desno za polovico [zaščiteno z e -pošto], ki jo izračuna amsmath: newcommand* [zaščiteno z e -pošto] [1] { kern#1 dimexpr [ zaščiteno po e -pošti]} %Če je za vrstico nadnapis, potem vrstici ne sme slediti negativno jedro; %dodatni {} poskrbi, da je v tem primeru nadnapis dovolj visok: DeclareRobustCommand widebar [1] {@ifnextchar^{{ [email protected] {#1} {0}}} { [email protected ] {#1} {1}}} %Uporabite ločen algoritem za posamezne simbole: newcommand* [[email protected] [2] { [email protected] {#1} { [email protected] @{#1 } {#2} {1}} { [email protected] @{#1} {#2} {2}}} newcommand* [email protected] @[3] {% begingroup def mathaccent# #1 ## 2 { % %Omogoči gnezdenje naglasov: let mathaccent [email protected] %Če obstaja več kot en simbol, namesto tega uporabite prvi znak (glejte spodaj): if#32 let [email protected] [email protected] fi % Določite poševni popravek: setbox [email protected] hbox {$ [email protected] { [email protected]} _ {} $} % setbox [email protected ] hbox {$ [email protected] { [email protected]} {} _ {} $}% [email protected] wd [email protected] vnaprej [email protected] wd [email protected ] %Zdaj [e -pošta zaščitena] je poševni popravek simbola. divide [email protected] 3 @tempdima wd [email protected] advance @tempdima- scriptspace %Zdaj @tempdima je širina simbola. divide @tempdima 10 advance [email protected] @tempdima %Now [email protected] = (poševnica / 3) - (Breite / 10) ifdim [email protected]> [email protected] [zaščiteno po e -pošti] fi %Vrstica se bo v tem primeru skrajšala [zaščitena po e -pošti]<0 ! [email protected] {0.6}kern- [email protected] if#31 overline{ [email protected] {-0.6}kern [email protected] [email protected] [email protected] {0.4}kern [email protected] }% advance [email protected] dimexpr [email protected] %Place the combined final kern (- [email protected] ) if it is >0 ali če sledi nadnapis: let [email protected] #2% ifdim [email protected]< [email protected] let [email protected] fi if [email protected] kern- [email protected] fi else overline{ [email protected] {-0.6}kern [email protected] #1}% fi }% [email protected] @ne let [email protected] @empty let [email protected] [email protected] @skewchar mathsurround [email protected] [email protected] {mathgroup [email protected]
elax}% [email protected] @skewchar
elax letmathaccentV [email protected] @a %The following initialises [email protected] and calls mathaccent: if#31 [email protected] @a
elax111{#1}% else %If the argument consists of more than one symbol, and if the first token is %a letter, use that letter for the computations: def [email protected] @marker##1endmarker{}% futurelet [email protected] [email protected] @marker#1endmarker ifcat
oexpand [email protected] Aelse def [email protected] {}% fi [email protected] @a
elax111{ [email protected] }% fi endgroup } makeatother egin{document} [ widebar{S}_n^2 = mfrac{1}{n}sum_{i=1}^{n}(X_{i} - M_{n})^{2} ]% end{document} 
jaz bi rekel
documentclass [] {article} begin {document} $$ overline {S} _n^2 = frac {1} {n} sum limits_ {i = 1}^{n} (X_i - M_n)^ 2 $$ end {document}