LaTeX 中的缩进自动换行
我正在用 LaTeX 编写文档,当我有一行文本环绕时遇到问题。我需要的是文本在环绕时缩进,以便与标签匹配(很像 \item[Label:] Text 函数,除了我不能使用 {description} 上下文。有什么想法吗?
这发生在
\newcommand{\objectiveresheading}[1]{%
{\parashade[.9]{sharpcorners{\textbf{\Large{Objective: }\large{#1}}}}}
I'm writing a document in LaTeX, and am encountering a problem when I have a line of text that wraps around. What I need is for the text, when it wraps around, to indent so that it matches the label (much like the \item[Label:] Text function, except I can't use a {description} context. Any ideas?
This happens in the context of
\newcommand{\objectiveresheading}[1]{%
{\parashade[.9]{sharpcorners{\textbf{\Large{Objective: }\large{#1}}}}}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个名为
\@hangfrom
的内部 LaTeX 宏来执行此功能。下面是一个示例:请注意,换行文本只能是单个段落。如果您需要多个段落,那么类似于列表环境的东西会更好。
There is an internal LaTeX macro to perform this function called
\@hangfrom
. Here is an example:Note that the wrapped text can only be a single paragraph. If you need multiple paragraphs, something more similar to a list environment would be better.
您可以将标签放入编号框中,获取该框的宽度,然后使用
\hangindent
和\hangafter
制作缩进段落。要了解如何使用\setbox
、\wd
、\hangindent
和\hangafter
,最好的来源是可能是马嘴:The TeXbook。You can put the label into a numbered box, take the width of that box, and use
\hangindent
and\hangafter
to make an indented paragraph. To learn how to use\setbox
,\wd
,\hangindent
, and\hangafter
, the best source is probably the horse's mouth: The TeXbook.