1

I want my

  1. Chapter names, section/subsection/... and other similar titles to be in gfsneohellenic
  2. Main text to be in libertine and libertinust1math.
  3. The captions of figures and tables will be some sans serif font as well, which I have not decided yet.

Using either

%\usepackage[default]{gfsneohellenic}
%\usepackage[LGR,T1]{fontenc}

OR

\usepackage[LGR, T1]{fontenc}
\usepackage{libertine}
\usepackage{libertinust1math}
\usepackage{titlesec}

sets the whole document to be in the respective fonts.

I am not being able to set the fonts specifically in titlesec, i.e. I am not being able to understand how to pass the specific fonts as parameters in the following -

\titleformat*{\section}{\Large\sffamily}
\titleformat*{\subsection}{\large\sffamily}
\titleformat*{\subsubsection}{\medium}

PS - I am using Overleaf.

1
  • Welcome to TeX.SE... Overleft have its own supporting team, if possible please approach them...
    – MadyYuvi
    Commented Sep 23, 2019 at 6:24

1 Answer 1

1

When you use the default option with gfsneohellenic it sets both \rmdefault and \sfdefault to gfsneohellenic. If you leave out that option, you have finer control:

\documentclass{article}
\usepackage[LGR, T1]{fontenc}
\usepackage{libertine}
\usepackage{libertinust1math}
\usepackage{gfsneohellenic}
\renewcommand{\sfdefault}{neohellenic}

\usepackage{titlesec}
\titleformat*{\section}{\Large\sffamily}
\titleformat*{\subsection}{\large\sffamily}
\titleformat*{\subsubsection}{\normalsize\sffamily}

\usepackage{blindtext}
\begin{document}

\blinddocument
\end{document}

The particular fontname neohellenic is learned from gfsneohellenic.sty. Result:

enter image description here

Note that I have changed your definition for \subsubsection, since there is no \medium command in LaTeX.

1
  • Thank you thank you thank you, this worked. :D Commented Sep 24, 2019 at 8:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .