![使用文本下标时,如何防止非数学溢出到边距?](https://linux22.com/image/326641/%E4%BD%BF%E7%94%A8%E6%96%87%E6%9C%AC%E4%B8%8B%E6%A0%87%E6%97%B6%EF%BC%8C%E5%A6%82%E4%BD%95%E9%98%B2%E6%AD%A2%E9%9D%9E%E6%95%B0%E5%AD%A6%E6%BA%A2%E5%87%BA%E5%88%B0%E8%BE%B9%E8%B7%9D%EF%BC%9F.png)
我使用 来\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}