Skip to content

Commit

Permalink
Put font loading in template (xdanaux#85)
Browse files Browse the repository at this point in the history
Closes moderncv#73

Signed-off-by: Stephan Lachnit <[email protected]>
  • Loading branch information
stephanlachnit authored Dec 13, 2021
1 parent 8cf759f commit d351149
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
17 changes: 1 addition & 16 deletions moderncv.cls
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
% color
\RequirePackage[table]{xcolor}

% font loading
% tex compiler checking for symbol loading
\RequirePackage{iftex}
\newif\ifxetexorluatex
\ifxetex
Expand All @@ -96,21 +96,6 @@
\fi
\fi

% for luatex and xetex, do not use inputenc and fontenc
% see https://tex.stackexchange.com/a/496643
\ifxetexorluatex
\RequirePackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\RequirePackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmonofont{Latin Modern Mono}
\setmathfont{Latin Modern Math}
\else
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{lmodern}
\fi

% hyper links (hyperref is loaded at the end of the preamble to pass options required by loaded packages such as CJK)
\newcommand*\pdfpagemode{UseNone}% do not show thumbnails or bookmarks on opening (on supporting browsers); set \pdfpagemode to "UseOutlines" to show bookmarks
Expand Down
19 changes: 18 additions & 1 deletion template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,27 @@

% adjust the page margins
\usepackage[scale=0.75]{geometry}
\setlength{\footskip}{122.40004pt} % depending on the amount of information in the footer, you need to change this value. comment this line out and set it to the size given in the warning
\setlength{\footskip}{136.00005pt} % depending on the amount of information in the footer, you need to change this value. comment this line out and set it to the size given in the warning
%\setlength{\hintscolumnwidth}{3cm} % if you want to change the width of the column with the dates
%\setlength{\makecvheadnamewidth}{10cm} % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...

% font loading
% for luatex and xetex, do not use inputenc and fontenc
% see https://tex.stackexchange.com/a/496643
\ifxetexorluatex
\usepackage{fontspec}
\usepackage{unicode-math}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmonofont{Latin Modern Mono}
\setmathfont{Latin Modern Math}
\else
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\fi

% personal data
\name{John}{Doe}
\title{Résumé title} % optional, remove / comment the line if not wanted
Expand Down

0 comments on commit d351149

Please sign in to comment.