使用文本下标时,如何防止非数学溢出到边距?

使用文本下标时,如何防止非数学溢出到边距?

我使用 来\textsubscript对非数学数据进行下标。但它太长,会导致溢出到边距。可能的解决方案是什么?(可能像在两行中写下标一样)

答案1

请始终提供示例文档,

有两种可能性

首先展示一个在单词空格处换行的可拆分下标

第二段显示一个段落,其边距中有过多的行,并且\sloppy\raggedright


在此处输入图片描述

\documentclass{article}

\def\xsubscript#1{{\scriptsize \xxsubscript#1 ^ }}
\def\xxsubscript#1 {%
\ifx^#1\else
{\normalsize\textsubscript{#1}} %space needed
\expandafter\xxsubscript
\fi
}
\begin{document}


\hrule

\bigskip

a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\textsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}!


\hrule

\bigskip

a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}
a paragraph\xsubscript{with a long subscript that
could go on for more than a line, it is really really really really really really long}!


\bigskip

\hrule
\end{document}

在此处输入图片描述

\documentclass{article}

\begin{document}


\hrule

\bigskip

a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}!


\bigskip

\hrule

\bigskip

{\sloppy
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}!

}
\bigskip

\hrule

{\raggedright
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}
a paragraph\textsubscript{with a long subscript}!

}
\bigskip

\hrule
\end{document}

相关内容