\boxed Text als Index

\boxed Text als Index

Wir haben \boxedden Inhalt bereits als Index festgelegt.

Bildbeschreibung hier eingeben

aber die Indexgröße wurde nicht aktualisiert. Bitte geben Sie mir einen Rat, wie ich die Skriptgröße mithilfe von \boxedDefinitionen festlegen kann.

Hier finden Sie die MWE-Datei:

\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}

Antwort1

Eine Methode mit 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}

Bildbeschreibung hier eingeben

Antwort2

Sie können \textvon verwenden amsmath, müssen es aber in Bezug auf die Grundlinie unterstützen.

\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}

Für Einheiten, wie bereits vorgeschlagen, nutzen Sie siunitxEinrichtungen.

Bildbeschreibung hier eingeben

Antwort3

Ich schlage einen sehr einfachen \subboxedBefehl vor, der sicherstellt, dass die Mathematik in \scriptstyle steht und der Wert von \boxsepangepasst wird. Im Haupttext würde ich einfach ein eingerahmtes \Vectorstackvon verwenden stackengine.

Unabhängig vom Problem: Ich habe die erweiterbaren Vektorpfeile von verwendet esvec, die besser aussehen als \vecmit einem fetten V.

\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} 

Bildbeschreibung hier eingeben

Antwort4

\makeatletterDas ist vielleicht zu naiv, aber um ein Array zu boxen, braucht man keine komplizierten Dinge.

\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}

Bildbeschreibung hier eingeben

Natürlich stellt sich die Frage, ob der Leser solche Boxen möchte. (Zumindest habe ich hinzugefügt siunitxund $$ ... $$durch ersetzt \[ ... \], also ist das vielleicht nicht ganz sinnlos.)

verwandte Informationen