更改为英文,主题为 letteracdp

更改为英文,主题为 letteracdp

在 letteracdp 包中,你输入信件主题,编译文档时,TeXLive 会将主题放在Oggetto:前面。我想将其改为Subject:

答案1

letteracdp课程是专门为意大利语量身定制的。但是,它定义了一些具有常见模式的“固定词”:

\newcommand*\subjectname     {Oggetto:}
\newcommand*\registeredname  {Raccomandata}
\newcommand*\registeredRRname{\registeredname~A.R.}
\newcommand*\andccname       {e~p.~c.}
\newcommand*\ccname          {P.~c.:}
\newcommand*\enclname        {Allegati:}
\newcommand*\PSname          {P.S.:}
\newcommand*\headtoname      {A:}
\newcommand*\lettername      {Lettera}

因此,在这种情况下,只需重新定义适当的命令即可

\renewcommand\subjectname{Subject:}

或者

\addto\captionsenglish{\renewcommand\subjectname{Subject:}}

如果您正在使用babel

答案2

实际上有一个更好的解决方案,我计划将其包含在下一个版本的CDP 捆绑包(顺便说一句,我从 2010 年起就一直承诺会发布这样的“下一个版本”,版本 0.34 可以追溯到 2006 年;但该软件包的大部分内容都是十五年前编写的,现在需要彻底重新设计...)。

首先,将以下包添加到您的本地 TeX 树中,名称如下cdpbabel.sty

%%-------------  Identification  -------------%%

\NeedsTeXFormat{LaTeX2e}[1998/09/02] % LaTeX2e is required!
\ProvidesPackage{cdpbabel}
                [2014/07/20 v0.03 (**development**)]
\@ifdefinable\@cdpbabel{\def\@cdpbabel{cdpbabel}}

%%--------------  Initial Code  --------------%%

\def\do#1{\@ifdefinable #1{\let #1\@empty}}
\do\@cdpbabel@perform@redefinitions
\do\@cdpbabel@letter@names
\do\@cdpbabel@artlet@names

%%---------  Declaration of Options  ---------%%

\DeclareOption*{%
  \IfFileExists{cdpnames\CurrentOption.ldf}{%
    \input{cdpnames\CurrentOption.ldf}%
    \edef\do##1{%
      \noexpand\g@addto@macro
        \noexpand\@cdpbabel@perform@redefinitions
        {%
          \noexpand\addto \csname captions\CurrentOption \endcsname
            {##1}%
        }%
    }%
    \@ifclassloaded{letteracdp}{%
      \expandafter\do \expandafter{\@cdpbabel@letter@names}%
    }{}%
    \@ifclassloaded{articoletteracdp}{%
      \expandafter\do \expandafter{\@cdpbabel@artlet@names}%
    }{}%
    \PackageInfo{\@cdpbabel}{%
      Redefined the names of "C.D.P. Bundle" captions\MessageBreak
      for the language `\CurrentOption'%
    }%
  }{%
    \PackageError{\@cdpbabel}{%
      Name def. file `cdpnames\CurrentOption.ldf' not found%
    }{%
      Files of the form `cdpnames<language>.ldf' are meant
      to define the names\MessageBreak
      in the language <language> of some captions used by
      the "C.D.P. Bundle".\MessageBreak
      You requested\MessageBreak
      \space\space<language> = `\CurrentOption',\MessageBreak
      but the corresponding file is missing; therefore,
      probably some of these\MessageBreak
      captions will not be printed as intended.\MessageBreak
      This error affects only the \@cdpbabel\space package,
      but not the babel package.\MessageBreak
      You may continue:
      type \space <return> \space to proceed.%
    }%
  }%
  \PassOptionsToPackage{\CurrentOption}{babel}%
}

%%-----------  Options Processing  -----------%%

\ProcessOptions*

\let \do = \@undefined
\let \@cdpbabel@letter@names = \@undefined
\let \@cdpbabel@artlet@names = \@undefined

%%--------  Package and Class Loading  -------%%

\RequirePackage{babel}

%%----------------  Main Code  ---------------%%

\@cdpbabel@perform@redefinitions
\let \@cdpbabel@perform@redefinitions = \@undefined

%%---------------  End of Code  --------------%%

\endinput

其次,添加以下语言定义文件(针对英语),名为cdpnamesenglish.ldf

\ProvidesFile{cdpnamesenglish.ldf}[2014/07/20]

\def\@cdpbabel@letter@names{%
  \def\subjectname      {Subject:}%
  \def\registeredname   {Registered}%
  \def\registeredRRname {\registeredname~R.R.}%
  \def\andccname        {cc}%
  \def\ccname           {cc:}%
  \def\enclname         {Encl:}%
  \def\PSname           {P.S.:}%
  \def\headtoname       {To:}%
}
\def\@cdpbabel@artlet@names{%
  \def\contentsname     {Contents}%
%   \def\listfigurename   {List of figures}%
%   \def\listtablename    {List of tables}%
%   \def\refname          {References}%
%   \def\indexname        {Index}%
%   \def\figurename       {Figure}%
%   \def\tablename        {Table}%
}

\endinput

其他语言以相同的方式处理;例如,对于意大利语,请添加以下cdpnamesitalian.ldf文件:

\ProvidesFile{cdpnamesitalian.ldf}[2014/07/20]

\def\@cdpbabel@letter@names{%
  \def\subjectname      {Oggetto:}%
  \def\registeredname   {Raccomandata}%
  \def\registeredRRname {\registeredname~A.R.}%
  \def\andccname        {e~p.~c.}%
  \def\ccname           {P.~c.:}%
  \def\enclname         {Allegati:}%
  \def\PSname           {P.S.:}%
  \def\headtoname       {A:}%
}
\def\@cdpbabel@artlet@names{%
  \def\contentsname     {Sommario}%
  \def\listfigurename   {Indice delle figure}%
  \def\listtablename    {Indice delle tabelle}%
  \def\refname          {Testi citati}%
%   \def\indexname        {Indice analitico}%
%   \def\figurename       {Figura}%
%   \def\tablename        {Tabella}%
}

\endinput

(当然,任何人只要愿意承担这项非常简单的任务,即为另一种语言编写类似的文件,我们都非常欢迎。)

现在您可以使用新的cdpbabel反而babel

\documentclass
    [boldsubject,italicsignature,shortindent]
    {letteracdp}
\usepackage[T1]{fontenc}
\usepackage[english]{cdpbabel}
% Note that we do **not** load "babel" directly.

\address{
    Gustavo \textsc{Mezzetti}\\
    L.S.U. <<A.~di~Savoia Duca d'Aosta>>\\
    Via del Santo, 57\\
    I--35123\quad Padova\quad Italy
}
\signature{Gustavo}
\place{Padova}

\pagestyle{headings}



\begin{document}

\begin{letter}[Whom it may concern]{
    To whom it may concern
}[
    The optional subject of the letter.
]

\opening{Dear Someone,}

this is the text of the letter.  We start another page to show that
\verb|\headtoname| produces ``\headtoname''.

\newpage

See?

A list of enclosures is added at the end, too, just to demonstrate that
\verb|\enclname| produces ``\enclname''.

\closing{Best regards.}

\begin{enclosures}
    \item  The first document.
    \item  The second document.
    \item  And so on.
\end{enclosures}

\end{letter}

\end{document}

就这样!结果如下:

上述示例的打印输出

相关内容