\texto en cuadro como subíndice

\texto en cuadro como subíndice

Ya configuramos \boxedel contenido como subíndice,

ingrese la descripción de la imagen aquí

pero el tamaño del subíndice no está actualizado. Indique cómo configurar el tamaño del subíndice usando \boxeddefiniciones.

Encuentre el archivo MWE:

\documentclass{book}
\usepackage{amsmath}


\makeatletter
\renewcommand{\boxed}[1]{\fboxsep1pt\arraycolsep1pt\fbox{\m@th$#1$}}
\makeatother

\begin{document}

the passenger moving with a velocity of +11 m/s, due in part to the walking motion and in part to the train's motion. As  $\boxed{\begin{array}{c}
{PT}\\
{AT}\\
{CT}\\
\end{array}}$ the passenger moving with a velocity of +11 m/s, due in part to the walking motion and in part to the train's motion. As

$$\vec{\mathbf{V}}_{\boxed{\begin{array}{c}
{PT}\\
{AT}\\
{CT}\\
\end{array}}}$$

\end{document}

Respuesta1

Un método con TABstacks:

\documentclass{book}
\usepackage{amsmath,scalerel,tabstackengine}
\TABstackMath
\TABstackMathstyle{\SavedStyle}

\renewcommand{\boxed}[1]{\ThisStyle{\fboxsep1pt\fbox{%
  \setstackgap{L}{12\LMpt}\tabbedCenterstack{#1}}}}

\begin{document}

the passenger moving with a velocity of +11 m/s, due in part to the walking 
motion and in part to the train's motion. As  $\boxed{PT\\AT\\CT}$ the 
passenger moving with a velocity of +11 m/s, due in part to the walking 
motion and in part to the train's motion. As
\[
\vec{\mathbf{V}}_{\boxed{PT\\AT\\CT}}
\]
\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

Puedes usar \textfrom amsmath, pero necesitas ayudarlo con respecto a la línea de base.

\documentclass{book}
\usepackage{amsmath}
\usepackage{array}
\usepackage{siunitx}

\sisetup{retain-explicit-plus}

\makeatletter
\newcommand{\boxedarray}[2][c]{%
  \begingroup
  \let\current@f@size\f@size
  \setlength\fboxsep{1pt}%
  \text{\fbox{\fix@baseline$\begin{array}[#1]{c}#2\end{array}$}}%
  \endgroup
}
\newcommand{\fixbaseline}{%
  \ifx\f@size\current@f@size\else\ifx\f@size\sf@size\linespread{0.7}\else\linespread{0.5}\fi\fi
  \selectfont
}
\makeatother

\begin{document}

The passenger moving with a velocity of \SI{+11}{m/s}, due in part to the 
walking motion and in part to the train's motion. As
$\boxedarray{ PT \\ AT \\ CT }$ 
the passenger moving with a velocity of \SI{+11}{m/s}, due in part to the 
walking motion and in part to the train's motion. As
\[
\vec{\mathbf{V}}_{\boxedarray{ PT \\ AT \\ CT }}
\]

\end{document}

Para las unidades, como ya se sugirió, utilice siunitxlas instalaciones.

ingrese la descripción de la imagen aquí

Respuesta3

Propongo un \subboxedcomando muy simple, que garantiza que las matemáticas estén en \scriptstyle y que el valor de \boxsepesté ajustado. En el texto principal, simplemente usaría un cuadro \Vectorstackde stackengine.

No relacionado con el problema: utilicé las flechas vectoriales extensibles de esvec, que se ven mejor que \veccon una V en negrita.

\documentclass{book}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage[b]{esvect}
\usepackage[usestackEOL]{stackengine}

\newcommand{\subboxed}[1]{{\setlength{\fboxsep}{1pt}\boxed{\everymath{\scriptstyle}#1}}}

\begin{document}

The passenger moving with a velocity of \SI{+11}{\meter/\second}, due in part to the walking
motion and in part to the train's motion. As $\boxed{\Vectorstack{PT \\ AT \\ CT}}$ the passenger moving with a velocity of \SI{+11}{\meter/\second},
due in part to the walking motion and in part to the train's motion. As
\[\vv{\mathbf{V}}_{\subboxed{\substack{PT\\ AT \\ CT}}}
\]

\end{document} 

ingrese la descripción de la imagen aquí

Respuesta4

Esto puede resultar demasiado ingenuo, pero no se necesitan \makeatletterelementos complicados para encuadrar una matriz.

\documentclass{book}
\usepackage{amsmath}
\usepackage{siunitx}

\begin{document}

The passenger moving with a velocity of \SI{+11}{\meter/\second}, due in part to the walking
motion and in part to the train's motion.  As  $\begin{array}{|@{\,}c@{\,}|}
\hline
{PT}\\
{AT}\\
{CT}\\
\hline
\end{array}$ the passenger moving with a velocity of \SI{+11}{\meter/\second},
due in part to the walking motion and in part to the train's motion. As
\[\vec{\mathbf{V}}_{\begin{array}{|@{\,}c@{\,}|}
\hline
{PT}\\
{AT}\\
{CT}\\
\hline
\end{array}}\]

\end{document}

ingrese la descripción de la imagen aquí

Por supuesto, la pregunta es si el lector quiere esas cajas. (Al menos agregué siunitxy reemplacé $$ ... $$por \[ ... \]para que esto no sea completamente inútil).

información relacionada