scrlttr2:更改字母和电话符号

scrlttr2:更改字母和电话符号

我正在使用文档类撰写一封动机信scrlttr2。我希望在信尾中显示我的地址和电话号码。有什么方法可以更改预定义的符号吗?

我的代码:

\documentclass[a4paper,backaddress=off,foldmarks=false,parskip=half,addrfield=false]{scrlttr2}

\usepackage{fontspec} % Allows font customization
\usepackage{marvosym} % Allows the use of symbol
\usepackage{csquotes}

\defaultfontfeatures{Mapping=tex-text}

\renewcommand{\normalsize}{\fontsize{12.5}{17}\selectfont}
\let\raggedsignature\raggedright

\makeatletter
\@setplength{sigbeforevskip}{\parskip}
\@setplength{refvpos}{\useplength{toaddrvpos}}
\makeatother

\setkomavar{fromname}{LM}
\setkomavar{fromaddress}{abc}
\setkomavar{fromphone}{123}
\setkomavar{fromemail}{[email protected]}
\setkomavar{place}{z}
\setkomavar{signature}{LM}

\setkomavar{firsthead} {
\centering
{\fontsize{18}{18}\selectfont Letter of Motivation}\\[1mm]
\fontsize{12}{12}\selectfont LM} 
\setkomavar{firstfoot}{
\centering

{
\renewcommand{\\}{\ {\textperiodcentered}\ }
\usekomavar{fromaddress}
}\\
{\Letter} \usekomavar{fromemail} \ {\Telefon} \usekomavar{fromphone}}
\begin{document}
\begin{letter}{Company\\Address\\City}

\setkomavar{subject}{Position Title}
\opening{Dear Recruiter,}
Content goes here.

\closing{Sincerely yours,}

\end{letter}
\end{document}

答案1

启用电话号码显示

为了显示您的电话号码,您需要在文档类声明中添加选项fromphone(同上,等等):frommail

\documentclass[fromphone]{scrlttr2}

请注意,您可以稍后在序言中使用以下命令来打开此选项:

\documentclass{scrlttr2}
\KOMAoptions{fromphone}

自定义电话号码前的符号

默认情况下,该类scrlttr2使用marvosym符号(参见§4.10. 便条纸在文档中 -- 更确切地说在第 178 页)。如果您想用您选择的符号更改符号,您应该使用\setkomavar{fromXXX}以下命令的可选参数:

\setkomavar{fromphone}[<the symbol you want to use>]{01234567890}

平均能量损失

(此处仅将电话符号改为指向右方的手)

在此处输入图片描述

\documentclass[fromemail]{scrlttr2}%<== the display of the email is enabled in the documentclass declaration
    \KOMAoptions{fromphone}%<== the display of the phone number is enabled later, in the preamble
    \usepackage{fontawesome}%<== package for using other symbols (check the The Comprehensive LaTeX Symbol List)
\begin{document}
    \setkomavar{fromname}{John Public}
    \setkomavar{fromaddress}{Valley 2\\
        54321 Public-Village}
    \setkomavar{fromphone}[\faHandORight~]{0\,12\,34~56\,78}%<== customize with your own logo
    \setkomavar{fromemail}{[email protected]}%<== no optional argument: default symbol is used

    \begin{letter}{%
            Joana Public\\
            Hillside 1\\
            12345 Public-City%
        }
        \opening{Dear chairman,}

        the last general meeting was about one year ago.
        I want to remind you, that the constitution of our club advises you to make a general meeting every six month.
        Because of this I expect the executive board to detain such a meeting immediately.

        \closing{Expecting an invitation}
        \ps PS: I hope you accept this as an friendly demand note.
    \end{letter}
\end{document}

相关内容