LaTeX forum ⇒ 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.
MashII
Posts: 2
Joined: Mon Jan 04, 2021 3:48 pm

Fonts in ECV and what class for the letter

Postby MashII » Mon Jan 04, 2021 3:54 pm

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.

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

Postby Ijon Tichy » Mon Jan 04, 2021 4:15 pm

\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?

MashII
Posts: 2
Joined: Mon Jan 04, 2021 3:48 pm

Postby MashII » Mon Jan 04, 2021 6:32 pm

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: 278
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Mon Jan 04, 2021 10:15 pm

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: 395
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Tue Jan 05, 2021 1:56 pm

As @rais already told, for evc loading package helvet is enough to get Helvetica (or a Helvetica clone):
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[german]{ecv}
  2.  
  3. \ecvName{Frieder Nikolaisen}
  4.  
  5. \usepackage[T1]{fontenc}
  6. \usepackage{helvet}
  7.  
  8. \begin{document}
  9.  
  10. \begin{ecv}
  11.  
  12. \ecvSec{\hypertarget{hypertarget:\ecvPerson}{\ecvPerson}}
  13.  
  14. \ecvEPR{Name} {Test, Nobody}
  15.  
  16. \end{ecv}
  17.  
  18. \end{document}

Only, if footnotes and other elements, that imply \normalfont you have to add \renewcommand\familydefault{\sffamily}:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[german]{ecv}
  2.  
  3. \ecvName{Frieder Nikolaisen}
  4.  
  5. \usepackage[T1]{fontenc}
  6. \usepackage{helvet}
  7. \renewcommand\familydefault{\sfdefault}
  8.  
  9. \begin{document}
  10.  
  11. \begin{ecv}
  12.  
  13. \ecvSec{\hypertarget{hypertarget:\ecvPerson}{\ecvPerson}}
  14.  
  15. \ecvEPR{Name} {Test\footnote{Footnote also in Helvetica}, Nobody}
  16.  
  17. \end{ecv}
  18.  
  19. \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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[german]{ecv}
  2.  
  3. \ecvName{Frieder Nikolaisen}
  4.  
  5. \usepackage[T1]{fontenc}
  6. \usepackage{mathptmx}
  7. \renewcommand\sfdefault{\rmdefault}
  8.  
  9. \begin{document}
  10.  
  11. \begin{ecv}
  12.  
  13. \ecvSec{\hypertarget{hypertarget:\ecvPerson}{\ecvPerson}}
  14.  
  15. \ecvEPR{Name} {Test\footnote{Footnote also in Times}, Nobody}
  16.  
  17. \end{ecv}
  18.  
  19. \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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[german]{ecv}
  2.  
  3. \ecvName{Frieder Nikolaisen}
  4.  
  5. \usepackage[T1]{fontenc}
  6. \usepackage{mathptmx}
  7. \makeatletter
  8. \AtBeginDocument{%
  9. \normalfont
  10. \fancyfoot[R]{%
  11. \begin{minipage}{5cm}
  12. \raggedleft
  13. \footnotesize\ecvPage~\thepage
  14. \end{minipage}
  15. }%
  16. \fancyfoot[L]{%
  17. \begin{minipage}{6cm}
  18. \footnotesize\ecvTitle~\ecv@name
  19. \end{minipage}
  20. }%
  21. }
  22. \makeatother
  23.  
  24. \begin{document}
  25.  
  26. \begin{ecv}
  27.  
  28. \ecvSec{\hypertarget{hypertarget:\ecvPerson}{\ecvPerson}}
  29.  
  30. \ecvEPR{Name} {Test\footnote{Footnote also in Times}, Nobody}
  31.  
  32. \end{ecv}


For other classes like most letter classes, e.g. scrlttr2, you would need
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \usepackage{helvet}
  2. \renewcommand\familydefault{\sfdefault}
to change the default font to Helvetica but only
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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.


Return to “Document Classes”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 guests