我正在尝试默认每周都要写的一封信。每周我都会去不同的医院,但总是会给他们寄同一封信。
有没有办法设置医院名称(和其他参数),这样我只需要在文档上更改一次,它就会替换它们几次?
例如 \set{hospital} {伦敦医院}
\documentclass[a4paper,12pt,draft]{article}
\set{hospital} {The London Hospital}
\begin{document}
Date: \\
Hospital: \{hospital}\\
Dear Scott,\\
Thank you so much for the opportunity to work at \{hospital} last week.
Please let me know, when the opportunity comes up again to work at \{hospital}.
\end{document}
我想更改医院名称、医生姓名和工作人员,又不想忘记,所以在开始时进行替换。我该如何实现?
答案1
scrlttr2 是一款出色的排版字母包。您可以设置“toname”和“toaddress”komavar,如我的 平均能量损失
\documentclass[fontsize=14pt,DIV=calc]{scrlttr2}
\addtokomafont{toname}{\sffamily}
%=========================================
\setkomavar{toname}{The London Hospital}
\setkomavar{toaddress}{SOME place in London\\CODE-Townname}
% =======================================
\setkomavar{signature}{\qquad\qquad\qquad\qquad\qquad%
\qquad\qquad\qquad\qquad \qquad \textit{Me}}
\setkomavar{subject}{MWE}%
\begin{document}
\begin{letter}{}
\opening{Donec at pede.}
Nullam eu ante vel est convallis dignissim. Fusce
suscipit, wisi nec facilisis facilisis, est dui fermentum leo, quis
tempor ligula erat quis odio. Nunc porta vulputate tellus. Nunc
rutrum turpis sed pede. Sed bibendum. Aliquam posuere. Nunc
aliquet, augue nec adipiscing interdum, lacus tellus malesuada
massa, quis varius mi purus non odio.
\closing{Nullam libero mauris, consequat quis, varius et, dictum id, arcu.}
\end{letter}
\end{document}