universvm / obsidian-pandoc-templates

A repository for pandoc templates. Geared for Obsidian.
Other
89 stars 2 forks source link

Change fonts #5

Open Shash-Sen opened 3 months ago

Shash-Sen commented 3 months ago

Is there a way to change the default fonts in dissertation.tex template?

universvm commented 3 months ago

Hi @Shash-Sen ,

I have not tried this, but I believe you should edit this section: https://github.com/universvm/obsidian-pandoc-templates/blob/0356dcac7760e1944eea0507cba76d296da3fca0/dissertation/dissertation.tex#L191-L213

To include your font:

\setmainfont{YourMainFont}
\setsansfont{YourSansFont}
\setmonofont{YourMonoFont}

Like this:

$if(mainfont)$
  \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$else$
  \setmainfont{YourMainFont}
$endif$
$if(sansfont)$
  \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
$else$
  \setsansfont{YourSansFont}
$endif$
$if(monofont)$
  \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
$else$
  \setmonofont{YourMonoFont}
$endif$
$for(fontfamilies)$
  \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
$endfor$
$if(mathfont)$
$if(mathspec)$
  \ifXeTeX
    \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  \else
    \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  \fi
$else$
  \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
$endif$
$endif$

Let me know if it works :)