在整个文档中重复Latex中的短语

时间:2015-08-19 14:08:30

标签: latex

我想在Latex文档的开头设置一个引用,这样我以后可以在文档中引用它,它会插入我的短语。

目的是创建一个为每个公司个性化的求职信模板。后来我只能更改参考短语,Latex将完成其余的工作,在整个文档中更改公司名称。

,例如,

\documentclass[]{letter}

\include{*company reference package*}

\ref{Company XYZ}{Manufacturing and Distribution Company of the Americas, Inc.}
\begin{document}

Dear \ref{Company XYZ}, I have heard it is great to work at \ref{Company XYZ}. As a member of \ref{Company XYZ}

\end{document}

1 个答案:

答案 0 :(得分:3)

您可以使用\newcommand,如下所示:

\documentclass[]{letter}

\newcommand{\CompanyXYZ}{Manufacturing and Distribution Company of the Americas, Inc.}

\begin{document}

Dear \CompanyXYZ, I have heard it is great to work at \CompanyXYZ. As a member of \CompanyXYZ

\end{document}

enter image description here