LaTeXでこのバーを書くにはどうすればよいですか?
How Can I Write This Bar Latex
解決:
以下のコードがお役に立てば幸いです...
documentclass {book} begin {document} [ overline {S} ^ {2} _ {n} ] [ overline {S_ {n}} ^ {2} ] [ bar {S_ { n}} ^ {2} ] end {document} 出力
この質問への回答にヘンドリック・フォークトのコードを使用すると、グリフのイタリック角度を考慮した widebarコマンド:
documentclass {article} usepackage [utf8] {inputenc}% usepackage {mathtools、nccmath} makeatletter let [メール保護] mathaccent newcommand * [メール保護] [3] {% setbox0 hbox { $ { mathaccent'0362 {#1}} ^ H $}% setbox2 hbox {$ { mathaccent'0362 { kern0pt#1}} ^ H $}% ifdim ht0 = ht2#3 else #2 fi}%バーは [メール保護]の半分だけ右に移動します。これはamsmathによって計算されます: newcommand * [メール保護] [1] { kern#1 dimexpr [電子メールで保護]}%バーの後に上付き文字がある場合、否定的なカーンがバーの後に続くことはありません。 %追加の{}は、この場合、上スクリプトが十分に高いことを確認します: DeclareRobustCommand widebar [1] { @ ifnextchar ^ {{ [email protected] {#1} {0}}} { [email protected ] {#1} {1}}}%単一のシンボルに別のアルゴリズムを使用する: newcommand * [email protected] [2] { [email protected] {#1} { [email protected] @ {#1 } {#2} {1}} { [メール保護] @ {#1} {#2} {2}}} newcommand * [メール保護] @ [3] {% begingroup def mathaccent# #1 ## 2 {%%アクセントのネストを有効にする: let mathaccent [メールで保護]%複数のシンボルがある場合は、代わりに最初の文字を使用してください(以下を参照): if#32 let [email保護された] [電子メールで保護された] fi%イタリック体の修正を決定します: setbox [電子メールで保護された] hbox {$ [電子メールで保護された] { [電子メールで保護された]} _ {} $}% setbox [電子メールで保護された] hbox {$ [メール保護] { [メール保護]} {} _ {} $}% [メール保護] wd [メール保護] Advance [メール保護] wd [メール保護]%Now [email protected]は、記号のイタリック体の修正です。 divide [メール保護] 3 @tempdima wd [メール保護] Advance @ tempdima- scriptspace%Now @tempdimaはシンボルの幅です。 divide @tempdima 10 Advance [メール保護] @ tempdima%Now [メール保護] =(イタリック修正/ 3)-(ブライト/ 10) ifdim [メール保護]> [メール保護] [メール保護] fi% [メール保護]の場合はバーが短くなります<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または上付き文字が続く場合: let [メール保護]#2% ifdim [メール保護]< [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}
私は言うだろう
documentclass [] {article} begin {document} $$ overline {S} _n ^ 2 = frac {1} {n} sum limits_ {i = 1} ^ {n}(X_i --M_n)^ 2 $$ end {document}