在维基教科书的这封信中,
\documentclass{letter}
\usepackage{hyperref}
\signature{Joe Bloggs}
\address{21 Bridge Street \\ Smallville \\ Dunwich DU3 4WE}
\begin{document}
\begin{letter}{Director \\ Doe \& Co \\ 35 Anthony Road
\\ Newport \\ Ipswich IP3 5RT}
\opening{Dear Sir or Madam:}
I am writing to you on behalf of the Wikipedia project (http://www.wikipedia.org/),
an endeavour to build a fully-fledged multilingual encyclopaedia in an entirely
open manner, to ask for permission to use your copyrighted material.
% The \ldots command produces dots in a way that will not upset
% the typesetting of the document.
\ldots
That said, allow me to reiterate that your material will be used to the noble end of
providing a free collection of knowledge for everyone; naturally enough, only if you
agree. If that is the case, could you kindly fill in the attached form and post it
back to me? We shall greatly appreciate it.
Thank you for your time and consideration.
I look forward to your reply.
\closing{Yours Faithfully,}
\ps{P.S. You can find the full text of GFDL license at
\url{http://www.gnu.org/copyleft/fdl.html}.}
\encl{Copyright permission form}
\end{letter}
\end{document}`
我想做以下更改,但我不知道如何做,
我希望地址和日期右对齐,我试过了,
\begin{flushright}
\end{flushright}
但没有成功。签名和的左对齐方法也类似\closing{Yours Faithfully,}
。更改边距。
在文档的顶部中心(开头)添加“斯莫维尔大学”。
谢谢
答案1
一种可能性是,使用geometry
包来更改页面布局(在本例中为边距),并使用xpatch
包来修补\opening
命令;设置\longindentation
为,0pt
您可以使结束部分左对齐:
\documentclass{letter}
\usepackage{xpatch}
\usepackage[lmargin=3cm,rmargin=3.5cm,tmargin=4.5cm,bmargin=4cm]{geometry}
\usepackage{hyperref}
\newcommand\Heading{University of Smallville}
\setlength\longindentation{0pt}
\xpatchcmd{\opening}{l@}{r@}{}{}
\xpatchcmd{\opening}{\thispagestyle{empty}}{\thispagestyle{empty}{\centering\Heading\par\bigskip}}{}{}
\signature{Joe Bloggs}
\address{21 Bridge Street \\ Smallville \\ Dunwich DU3 4WE}
\begin{document}
\begin{letter}{Director \\ Doe \& Co \\ 35 Anthony Road
\\ Newport \\ Ipswich IP3 5RT}
\opening{Dear Sir or Madam:}
I am writing to you on behalf of the Wikipedia project (http://www.wikipedia.org/),
an endeavour to build a fully-fledged multilingual encyclopaedia in an entirely
open manner, to ask for permission to use your copyrighted material.
% The \ldots command produces dots in a way that will not upset
% the typesetting of the document.
\ldots
That said, allow me to reiterate that your material will be used to the noble end of
providing a free collection of knowledge for everyone; naturally enough, only if you
agree. If that is the case, could you kindly fill in the attached form and post it
back to me? We shall greatly appreciate it.
Thank you for your time and consideration.
I look forward to your reply.
\closing{Yours Faithfully,}
\ps{P.S. You can find the full text of GFDL license at
\url{http://www.gnu.org/copyleft/fdl.html}.}
\encl{Copyright permission form}
\end{letter}
\end{document}
由此产生的开头部分的片段:
以下是结尾部分的片段: