\ボックス付きテキストを下付き文字として

\ボックス付きテキストを下付き文字として

すでに\boxedコンテンツは下付き文字として設定されています。

ここに画像の説明を入力してください

ただし、下付き文字のサイズは更新されません。定義を使用してスクリプト サイズを設定する方法についてアドバイスをお願いします\boxed

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}

答え1

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}

ここに画像の説明を入力してください

答え2

\textから使用することもできますamsmathが、ベースラインに関してはそれを支援する必要があります。

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

ユニットについては、すでに提案されているように、siunitx施設を使用します。

ここに画像の説明を入力してください

答え3

\subboxed私は、数式が \scriptstyle になり、 の値が調整されることを保証する非常に単純なコマンドを提案します\boxsep。本文では、\Vectorstackのボックス化されたものを単に使用しますstackengine

問題とは関係ありませんが、 の拡張可能なベクター矢印を使用しました。これは太字の V esvecよりも見栄えがよいです。\vec

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

ここに画像の説明を入力してください

答え4

\makeatletterこれはあまりにも単純すぎるかもしれませんが、配列をボックス化するのに複雑なものは必要ありません。

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

ここに画像の説明を入力してください

もちろん、読者がそのようなボックスを望んでいるかどうかが問題です。(少なくとも、 を追加してにsiunitx置き換えたので、これは完全に無意味ではないかもしれません。)$$ ... $$\[ ... \]

関連情報