Saltar al contenido

¿Cómo puedo escribir esta barra en LaTeX?

Solución:

Espero que el siguiente código te ayude …

documentclass{book}

begin{document}

[
overline{S}^{2}_{n}
]

[
overline{S_{n}}^{2}
]

[
bar{S_{n}}^{2}
]
end{document}

Producción

ingrese la descripción de la imagen aquí

Usando el código de Hendrik Vogt en su respuesta a esta pregunta, tiene una widebar comando que tiene en cuenta el ángulo en cursiva del glifo:

    documentclass{article}
    usepackage[utf8]{inputenc}%
    usepackage{mathtools, nccmath}

makeatletter
let[email protected]mathaccent
newcommand*[email protected][3]{%
  setbox0hbox{${mathaccent"0362{#1}}^H$}%
  setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
  ifdimht0=ht2 #3else #2fi
  }
%The bar will be moved to the right by a half of [email protected], which is computed by amsmath:
newcommand*[email protected][1]{kern#1dimexpr[email protected]}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
DeclareRobustCommandwidebar[1]{@ifnextchar^{{[email protected]{#1}{0}}}{[email protected]{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*[email protected][2]{[email protected]{#1}{[email protected]@{#1}{#2}{1}}{[email protected]@{#1}{#2}{2}}}
newcommand*[email protected]@[3]{%
  begingroup
  defmathaccent##1##2{%
%Enable nesting of accents:
    letmathaccent[email protected]
%If there's more than a single symbol, use the first character instead (see below):
    if#32 let[email protected][email protected] fi
%Determine the italic correction:
    setbox[email protected]hbox{$[email protected]{[email protected]}_{}$}%
    setbox[email protected]hbox{$[email protected]{[email protected]}{}_{}$}%
    [email protected]wd[email protected]
    advance[email protected]wd[email protected]
%Now [email protected] is the italic correction of the symbol.
    divide[email protected] 3
    @tempdimawd[email protected]
    advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
    divide@tempdima 10
    advance[email protected]@tempdima
%Now [email protected] = (italic correction / 3) - (Breite / 10)
    ifdim[email protected]>[email protected] [email protected]fi
%The bar will be shortened in the case [email protected]<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 or if a superscript follows:
      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]relax}%
  [email protected]@skewcharrelax
  letmathaccentV[email protected]@a
%The following initialises [email protected] and calls mathaccent:
  if#31
    [email protected]@arelax111{#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
    ifcatnoexpand[email protected] Aelse
      def[email protected]{}%
    fi
    [email protected]@arelax111{[email protected]}%
  fi
  endgroup
}
makeatother

    begin{document}

    [ widebar{S}_n^2 = mfrac{1}{n}sum_{i=1}^{n}(X_{i} - M_{n})^{2} ]%

    end{document}

yo diría

  documentclass[]{article}

  begin{document}

  $$overline{S}_n^2 = frac{1}{n}sumlimits_{i=1}^{n}(X_i - M_n)^2$$

  end{document}
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *