[Tex/LaTex] How to change the main font of the Tufte-book style

booksfontstufte

I try to change my main font style in a Tufte book document class. Documentation say that it's possible by using the nofonts class option but nothing works. I tried the \setmainfont function, and other tricky solutions, without result. Here are my packages:

\documentclass[11pt, justified]{tufte-handout}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
  \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
  \graphicspath{{graphics/}}
\usepackage{lmodern}
\usepackage{amsmath, amssymb, amsfonts, euscript}
\usepackage{mathabx, mathrsfs, mathptmx}
\usepackage{booktabs}
\usepackage{units}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{fancyvrb}
\fvset{fontsize=\normalsize}
\usepackage[frenchb]{babel}
\usepackage{titlesec}
\usepackage{bibentry}
\usepackage{xcolor}
\usepackage{enumerate}
\usepackage{enumitem}
\usepackage{microtype}
\usepackage{todonotes}
\usepackage{fontawesome}
\usepackage{listings}
\usepackage{geometry}
\usepackage{theorem}
\usepackage{fancyhdr}
\usepackage[most]{tcolorbox}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{ifthen}
\usepackage{tikz}

\usetikzlibrary{shadows}
\lstset{language=C}

Thanks for your help.

MWE:

Here is a minimal code of what I'm trying to do, remember that I just want to change the text fond of my document.

\documentclass[nofonts, justified]{tufte-handout}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{amsmath, amssymb, amsfonts}
\usepackage{mathabx, mathrsfs, mathptmx}
\usepackage{booktabs}
\usepackage{units}
\usepackage{multicol}
\usepackage{fancyvrb}
\usepackage{titlesec}
\usepackage{bibentry}
\usepackage{xcolor}
\usepackage{enumitem}
\usepackage{microtype}
\usepackage{todonotes}
\usepackage{listings}
\usepackage{theorem}
\usepackage{fancyhdr}
\usepackage[most]{tcolorbox}
\usepackage{ifthen}
\usepackage{tikz}

%-----------For test-----------------------------------
\usepackage{lipsum}
%------------------------------------------------------

\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
\graphicspath{{graphics/}}
\usetikzlibrary{shadows}
\lstset{language=C}

%=======================================================
%                       COLORS
%=======================================================
\definecolor{grey}{rgb}{0.9,0.9,0.9}

%=======================================================
%                  TITLES OPTIONS
%=======================================================
\titleformat*{\section}{\fontfamily{pag}\selectfont\huge\bfseries}
\titleformat*{\subsection}{\fontfamily{pag}\selectfont\LARGE\bfseries}
\titleformat*{\subsubsection}{\large\bfseries}
\titleformat*{\paragraph}{\large\bfseries}
\titleformat*{\subparagraph}{\large\bfseries}

\titlespacing{\section}{0pt}{*0}{*0}
\titlespacing{\subsection}{0pt}{*0}{*0}
\titlespacing{\subsubsection}{0pt}{*0}{*0}
\titlespacing{\paragraph}{0pt}{*2}{*2}

\renewcommand{\thesubsubsection}{\thesection.\thesubsection\alph{subsubsection}}


\title{Test - tex.stackexchange.com}
\author[The Author]{The author}


%=======================================================
%                        MACROS
%=======================================================
\newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}
\newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}
\newcommand{\docarg}[1]{\textrm{\textit{#1}}}
\newcommand{\docenv}[1]{\textsf{#1}}
\newcommand{\docpkg}[1]{\texttt{#1}}
\newcommand{\doccls}[1]{\texttt{#1}}
\newcommand{\docclsopt}[1]{\texttt{#1}}
\renewcommand{\rmdefault}{pplx}

\newcommand{\etal}{\textit{et al}.}
\newcommand{\ie}{\textbf{\textit{i}.\textit{e}. }}
\newcommand{\eg}{\textbf{\textit{e}.\textit{g}. }}
\newcommand{\cfr}{\textit{cfr}. }

\geometry{
  left=15mm,
  textwidth=140mm,
  headsep=10mm,
  headheight = 0mm,
  marginparsep=7mm,
  marginparwidth=50mm,
  bottom = 1.5cm, 
  top = 1.7cm
}

%=======================================================
%                    HEADER/FOOTER
%=======================================================
\pagestyle{fancy}{
\fancyhf{}
\rhead{The Author}
\lhead{TEST - tex.stackexchange.com}
\rfoot{Page \thepage}
}

%=======================================================
%                      DOCUMENT
%=======================================================
\begin{document}

%---------------------------------------------------------------
\begin{titlepage}
    \fontfamily{pag}
    \begin{center}
        \noindent\begin{minipage}{1\textwidth}
            \includegraphics[draft]{example-image}
        \end{minipage}
    \end{center}
    \vfill
    \centering
    \colorbox{grey}{
        \parbox[t]{1.2\textwidth}{
            \parbox[t]{1.2\textwidth}{
                \vspace{0.2cm}
                \begin{center}
                \fontsize{13pt}{0pt}\selectfont
                \text{TEST - tex.stackexchange.com}\\
                \fontsize{50pt}{0pt}\selectfont\bfseries
                \vspace{0.3cm}\underline{Base project}\end{center} {\Huge2019}
                \vspace{0.7cm}
            }
        }
    }

    \vfill
    %------------------------------------------------
    %   Author name and informations
    %------------------------------------------------

    \parbox[t]{1.2\textwidth}{
        \raggedleft
        \large
        {\Large Author}\\[4pt]
        University\\
        \hfill\rule{0.2\linewidth}{1pt}
    }

\end{titlepage}
%---------------------------------------------------------------

\renewcommand{\headrulewidth}{1pt}

\section{Chapter 1:}
\lipsum[2]
\lipsum[3]

\begin{marginfigure}
\lipsum[1]
\end{marginfigure}
\end{document}

Best Answer

The problem with your code was, that you were overriding any font settings in the preamble by explicitly selecting fonts with commands like \renewcommand{\rmdefault}{pplx}.

After removing all the explicit font selections and several other things that dindn't spark joy from your code you can now use a font of your choosing. I tried the Linux Libertine and Biolinum Fonts with \usepackage{libertine}:

\documentclass[nobib,nofonts,justified]{tufte-handout}
\usepackage{graphicx}
\usepackage{microtype}


\usepackage{libertine} % <-- Here



%-----------For test-----------------------------------
\usepackage{lipsum}
%------------------------------------------------------
%                  TITLES OPTIONS
%=======================================================
\titleformat*{\section}{\huge\bfseries}
\titleformat*{\subsection}{\LARGE\bfseries}
\titleformat*{\subsubsection}{\large\bfseries}
\titleformat*{\paragraph}{\large\bfseries}
\titleformat*{\subparagraph}{\large\bfseries}

\titlespacing{\section}{0pt}{*0}{*0}
\titlespacing{\subsection}{0pt}{*0}{*0}
\titlespacing{\subsubsection}{0pt}{*0}{*0}
\titlespacing{\paragraph}{0pt}{*2}{*2}

\renewcommand{\thesubsubsection}{\thesection.\thesubsection\alph{subsubsection}}


\title{Test - tex.stackexchange.com}
\author[The Author]{The author}


%=======================================================
%                      DOCUMENT
%=======================================================
\begin{document}

%---------------------------------------------------------------
\begin{titlepage}
    \begin{center}
        \noindent\begin{minipage}{1\textwidth}
            \includegraphics[draft]{example-image}
        \end{minipage}
    \end{center}
    \vfill
    \centering
    \colorbox{gray}{
        \parbox[t]{1.2\textwidth}{
            \parbox[t]{1.2\textwidth}{
                \vspace{0.2cm}
                \begin{center}
                \fontsize{13pt}{0pt}\selectfont
                TEST - tex.stackexchange.com\\
                \fontsize{50pt}{0pt}\selectfont\bfseries
                \vspace{0.3cm}\underline{Base project}\end{center} {\Huge2019}
                \vspace{0.7cm}
            }
        }
    }

    \vfill

    %------------------------------------------------
    %   Author name and informations
    %------------------------------------------------

    \parbox[t]{1.2\textwidth}{
        \raggedleft
        \large
        {\Large Author}\\[4pt]
        University\\
        \hfill\rule{0.2\linewidth}{1pt}
    }

\end{titlepage}
%---------------------------------------------------------------

\renewcommand{\headrulewidth}{1pt}

\section{Chapter 1:}
\lipsum[2]
\lipsum[3]

\begin{marginfigure}
\lipsum[1]
\end{marginfigure}
\end{document}

pdffonts shows, that no other fonts were loaded:

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
QFROIV+LinLibertineMT                Type 1            Custom           yes yes no      13  0
GYBFUK+LinLibertineT                 Type 1            Custom           yes yes no      14  0
AWSGUC+LinLibertineTB                Type 1            Custom           yes yes no      15  0
GYBFUK+LinLibertineT                 Type 1            Custom           yes yes no      21  0
Related Question