乳胶计算机输出段
我有一个包含计算机输出文本的逐字环境。该文本在语义上由两个部分组成,每个部分之间用空行分隔。
部分的数量及其内容是已知的,因此我不需要解析文本,但部分之间的线非常重要(因为它为“文本”提供了语义)。
每个段由多条线组成。我怎样才能在每段中间的左侧写上(1)和(2)?
示例输出:
hello world
(1) out there
how are you?
I am
fine
(2) thanks
and
you?
数字 (1) 和 (2) 不得位于环境内部,它们必须位于外部且位于左侧,而不是作为 marginpar。
我怀疑这归结为在“out”和“thanks”前面放置一个 \box{} 或其他东西,并将它们向左移动负数。但我不知道如何实现这一目标。
I have a verbatim environment containing computer output as text. This text is sematically made of two sections, each section being separated from the other by an empty line.
The number of sections and their content is known, so I don't need to parse the text, but the line between the sections is very important (as it gives semantics to the "text").
Each segment is made of multiple lines. How could I write (1) and (2) on the left handside at the centre of each segment?
Sample output:
hello world
(1) out there
how are you?
I am
fine
(2) thanks
and
you?
The numbers (1) and (2) MUST NOT be inside the environment, they must be outside, and on the left, not as marginpar.
I suspect it comes down to putting a \box{} or something in front of the words "out" and "thanks" and moving them to the left by a negative amount. But I don't know how to achieve that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许使用
minipage
:Perhaps use
minipage
:我已经设法按照我想要的方式做到这一点,并且仍然保留单个逐字环境的语义,如下所示:
以及用法:
I have managed to do it the way I wanted and still keep the semantics of a single verbatim environment like this:
And the usage: