在 LaTeX 中包裹一个单词

发布于 2024-08-03 19:29:28 字数 166 浏览 1 评论 0原文

如何在表格环境中将单词 longWord_anotherLongWord_long_again 换行到多行?

该单词应该是

LongWord_
anotherLongWord_
long_again

How can you wrap the word longWord_anotherLongWord_long_again to many lines in the tabular environment?

The word should be

LongWord_
anotherLongWord_
long_again

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

卖梦商人 2024-08-10 19:29:28
\bgroup
  \catcode`\_=13%
  \def_{\textunderscore\hskip0pt}%
  \begin{tabular}{|l|l|p{4.5cm}}
    test_444 & 555 & longWord_anotherLongWord_long_again_too_long_very_long_ha_ha_ha_ha\\\hline
  \end{tabular}
\egroup

但要小心;这将产生所需的结果,但 TeX 会抱怨盒子未满。

\bgroup
  \catcode`\_=13%
  \def_{\textunderscore\hskip0pt}%
  \begin{tabular}{|l|l|p{4.5cm}}
    test_444 & 555 & longWord_anotherLongWord_long_again_too_long_very_long_ha_ha_ha_ha\\\hline
  \end{tabular}
\egroup

Be careful though; this will produce the desired result, but TeX will complain about underfull boxes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文