Document ClassesFonts in ECV and what class for the letter

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
MashII
Posts: 2
Joined: Mon Jan 04, 2021 3:48 pm

Fonts in ECV and what class for the letter

Post by MashII »

Hi,
(1) I did write my CV with \documentclass[german]{ecv}. Now I want to write my letter, what documentclass should I use for making sure that I do have the same style? Just a letter class? Or is there a ecv class for the letter?

(2) I want to know what font the \documentclass[german]{ecv} uses. How can I look that up? How can I change the font? I tried:
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{helvet}


Thanks alot.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Fonts in ECV and what class for the letter

Post by Ijon Tichy »

\usepackage{helvet} only changes the \sffamily. If you want to make the \sffamily the normal document font, please see, e.g.: What is the simplest way to typeset an entire document in sans-serif?
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
MashII
Posts: 2
Joined: Mon Jan 04, 2021 3:48 pm

Fonts in ECV and what class for the letter

Post by MashII »

Thanks for your answer. I do not get to the point that it changes all my words. It only changes the Word: Lebenslauf. I would also like to know, what the default font is. How can I look up the font used in my document? Then I would use the font of my CV in my letter as well.

My example of code, what do I neet to write to set a helvit or times as the font?

\documentclass[german]{ecv}

\ecvName{Frieder Nikolaisen}

\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}
%\renewcommand{\familydefault}{\sfdefault}
%\setupbodyfont{helvet}
%\renewcommand{\familydefault}{\sfdefault}
%\usepackage{times}

\begin{document}



\begin{ecv}

%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Person
%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bigskip

\ecvSec{\hypertarget{hypertarget:\ecvPerson}{\ecvPerson}}

\ecvEPR{Name} {Test, Nobody}


\end{ecv}




\end{document}
%\end
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Fonts in ECV and what class for the letter

Post by rais »

Unless you're using another class called `ecv' than available through CTAN, the class already uses helvet and switches to sans serif at document start.
So for `helvet', you don't need to change anything.

For using `times', you'd need to not only load the package, but issue
\normalfont just after \begin{document}.

Note, however, that this switch won't affect the footer line: it switches its text to sans serif (helvetica, in this case).

You can check what fonts are used in a LaTeX-produced pdf by either looking for `properties->fonts' in your pdf viewer or by calling `pdffonts <name-of-pdf-file-to-check>'

KR and Happy New Year
Rainer
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Fonts in ECV and what class for the letter

Post by Ijon Tichy »

As @rais already told, for evc loading package helvet is enough to get Helvetica (or a Helvetica clone):

Code: Select all

\documentclass[german]{ecv}

\ecvName{Frieder Nikolaisen}

\usepackage[T1]{fontenc}
\usepackage{helvet}

\begin{document}

\begin{ecv}

\ecvSec{\hypertarget{hypertarget:\ecvPerson}{\ecvPerson}}

\ecvEPR{Name} {Test, Nobody}

\end{ecv}

\end{document}
Only, if footnotes and other elements, that imply \normalfont you have to add \renewcommand\familydefault{\sffamily}:

Code: Select all

\documentclass[german]{ecv}

\ecvName{Frieder Nikolaisen}

\usepackage[T1]{fontenc}
\usepackage{helvet}
\renewcommand\familydefault{\sfdefault}

\begin{document}

\begin{ecv}

\ecvSec{\hypertarget{hypertarget:\ecvPerson}{\ecvPerson}}

\ecvEPR{Name} {Test\footnote{Footnote also in Helvetica}, Nobody}

\end{ecv}

\end{document}
For Times it is not enough to add a \normalfamily via \AtBeginDocument, because the class also uses explicit \textsf. So if everything should be in Times, you either have to redefine the sans serif font to use the roman one:

Code: Select all

\documentclass[german]{ecv}

\ecvName{Frieder Nikolaisen}

\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\renewcommand\sfdefault{\rmdefault}

\begin{document}

\begin{ecv}

\ecvSec{\hypertarget{hypertarget:\ecvPerson}{\ecvPerson}}

\ecvEPR{Name} {Test\footnote{Footnote also in Times}, Nobody}

\end{ecv}

\end{document}
In this case you cannot switch to sans serif with \sffamily or \textsf. So the other suggestion would be to change the footer definition:

Code: Select all

\documentclass[german]{ecv}

\ecvName{Frieder Nikolaisen}

\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\makeatletter
\AtBeginDocument{%
  \normalfont
  \fancyfoot[R]{%
    \begin{minipage}{5cm}
      \raggedleft
      \footnotesize\ecvPage~\thepage
    \end{minipage}
  }%
  \fancyfoot[L]{%
    \begin{minipage}{6cm}
      \footnotesize\ecvTitle~\ecv@name
    \end{minipage}
  }%
}
\makeatother

\begin{document}

\begin{ecv}

\ecvSec{\hypertarget{hypertarget:\ecvPerson}{\ecvPerson}}

\ecvEPR{Name} {Test\footnote{Footnote also in Times}, Nobody}

\end{ecv}
For other classes like most letter classes, e.g. scrlttr2, you would need

Code: Select all

\usepackage{helvet}
\renewcommand\familydefault{\sfdefault}
to change the default font to Helvetica but only

Code: Select all

\usepackage{mathptmx}
for Times.

BTW: I've replaced flushright environment in the right foot definition by \raggedright to avoid the extra vertical space before and after it on left pages. Also I've used extra % to avoid orphan spaces.

BTW: There are better Times like and Helvetica like fonts, e.g., TeX Gyre Termes and TeX Gyre Heros. Those are also available as OTF and can be uses with LuaLaTeX and XeLaTeX using fontspec.

Last but not least: Please use the code tag/button not the latex tag/button for several lines of code.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply