我正在使用 LaTeX,我希望沿着页面左侧、上边距到下边距、距离页面左边缘 0.5 英寸有垂直线。我希望每个页面上都有这个,所以我认为这意味着它必须以某种方式绑定到页眉或页脚?
我完全没有取得任何进展,因此我需要帮助(1)制定完整的规则本身以及(2)使其在文档的每一页上自动发生。
有人可以告诉我该怎么做吗?
I'm using LaTeX and I would like to have vertical rule along left side of page, topmargin to bottommargin, 0.5in from the left edge of the page. I want this on every page, so I assume that means it must somehow be tied to the header or the footer?
I've made no progress at all, so I need help with (1) making the full-length rule itself and (2) making it happen automatically on every page of the document.
Can someone tell me how to do that?
发布评论
评论(3)
我在 Latex 社区论坛上得到了我的问题的有效答案:http://www.latex-community.org/forum/viewtopic.php?f=5&t=9072&p=34877#p34877
我得到的答案使用“背景” ' 包和这段代码:
效果很好,很容易调整,将一个 vrule 放在左边距区域,一个放在右边距区域。
I got a working answer to my question on the Latex Community forum: http://www.latex-community.org/forum/viewtopic.php?f=5&t=9072&p=34877#p34877
The answer I got uses the 'Background' package and this code:
Works great and was easy to adjust to put one vrule in left margin area and one in the right margin area.
可能有一个 LaTeX 包可以为你做到这一点,但我更像是一个 TeX 人,所以我尝试提出一个 TeX 解决方案(将纯 TeX 与 LaTeX 混合并不总是最好的主意,但我想我有它在职的)。
试试这个。框 255 是框寄存器,TeX 在输出页面之前将页面内容放入其中。我所做的是采用现有的输出例程,并将其更改为插入框 255:一组 0 高度、0 宽度无限收缩但溢出的框,其中包含页面高度 0.4 的规则pt 厚,运气好的话,距左侧半英寸。然后将框255的现有内容添加到该规则之后。然后我调用前面的输出例程,该例程输出页面(现在包括规则)以及页眉和页脚。
将其放在
\begin{document}
命令之前。这可能无法完全解决您的问题,但希望它可以帮助您开始。 这里是一个学习 TeX 原语和内置内容的绝佳页面。There could be a LaTeX package to do this for you, but I'm more of a TeX person, so I tried to come up with a TeX solution (not always the best idea to mix plain TeX with LaTeX but I think I have it working).
Try this. Box 255 is the box register that TeX places the page contents into before the page is output. What I've done is taken the existing output routine, and changed it to insert into box 255: a 0-height, 0-width infinitely shrinkable-but-overflowing set of boxes containing a rule that is the height of the page, 0.4pt thick and with any luck, half an inch away into the left. The existing contents of box 255 is then added after this rule. Then I call the previous output routine which outputs the page (which now includes a rule), and also the headers and footers.
Put it before your
\begin{document}
command. This might not solve your problem completely, but hopefully it should get you started. Here's a great page for learning about TeX primitives and built-in things.看看
eso-pic
包。从记忆中,您想要的看起来像这样:
您的问题不清楚您是否希望该行跨越文本区域或整个纸张高度。根据情况,您必须将
\topmargin
和\textheight
替换为正确的值,0pt
或您的上边距是什么,或者通过\paperheight
。如果您尚未使用geometry
包来了解如何控制这些尺寸,请参阅该包。Have a look at the
eso-pic
package. From memory, what you want would look like this:It's not clear in your question if you want the line to span the text area or the whole paper height. Depending on the case, you have to replace
\topmargin
and\textheight
by the correct values, either0pt
or whatever your top margin is, or by\paperheight
. See thegeometry
package if you don't already use it for how to control those dimensions.