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

dep*_*ion 4 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}
Run Code Online (Sandbox Code Playgroud)

tmd*_*son 5

您可以使用\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}
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明