Latex 字母:发件人地址左对齐
这是我第一次使用 Latex 写信。我正在使用字母类。当我使用时:
\address{100 From Address \\ City, State \\ Pin}
发件人地址变为右对齐。有什么办法可以让它左对齐吗?我正在寻找的信件的格式是:发件人地址左对齐,然后是日期左对齐,然后是收件人地址左对齐,然后是开头和正文,最后是签名左对齐。
我设法使用以下方法使签名左对齐:\longindentation=0pt
,其余项目已正确对齐 - 它只是右对齐的发件人地址。
This is my first time using Latex to write a letter. I am using the letter class. When I use:
\address{100 From Address \\ City, State \\ Pin}
The from address becomes right aligned. Is there someway I can make this left aligned. The format of the letter I am looking for is: the from address left aligned, followed by the date left aligned, followed by the to address left aligned, then opening and body, and finally signature left aligned.
I managed to get the signature left aligned by using: \longindentation=0pt
, the rest of the items are properly aligned - its just the from address that is right aligned.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
答案是使用完整的大写字母样式 - 一切都左对齐。在 LaTeX 中,这是 block.sty,您可能需要安装它。您可以在这里找到它 http://www.ctan.org/tex-archive/macros/latex /contrib/block 。用法非常简单:
The answer is to use the full block letter style - everything left-aligned. In LaTeX that is the block.sty, which you will probably have to install. You can find it here http://www.ctan.org/tex-archive/macros/latex/contrib/block . Usage is quite simple:
我假设“左对齐”意味着您希望地址块位于页面的左边距,因为该块的各个行是左对齐的,但该块位于右边距。
我发现调整 LaTeX 样式的最佳方法是找到定义原始样式的 LaTeX 源代码,将其复制到样式文件,然后进行修改。在本例中,原始源是 letter.cls 文件,我通过查找 \address 宏来跟踪地址格式,这导致了 \fromaddress 宏,然后是 \opening 宏。在原文中,它是:
删除 \raggedleft 宏将地址块移动到右侧,但留下一些额外的间距,因此我也删除了表格环境。
此 \renewcommand 调用需要放入 .sty 样式文件中,因为它使用包含 @ 字符的宏。 (我刚刚看到 Alexey Malistov 的回答;另一个选择是 \makeatletter 和 \makeatother 宏。)用于
引入新样式。
I assume by "left aligned" you mean that you want the address block to be on the left margin of the page, since the individual lines of the block are left aligned, but the block is at the right margin.
The best way I have found to adjust LaTeX styles is to locate in the LaTeX source where the original style is defined, copy it to a style file, and fiddle. In this case, the original source is the letter.cls file, and I tracked down the address formatting by looking for the \address macro, which led to the \fromaddress macro, and then to the \opening macro. In the original, it is:
Removing the \raggedleft macro moves the address block to the right side, but leaves some extra spacing, so I removed the tabular environment as well.
This \renewcommand call needs to be put in a .sty style file, since it uses macros containing the @ character. (I just saw Alexey Malistov's answer; the other alternative is the \makeatletter and \makeatother macros.) Use
to bring in the new style.