From 1644213518295b4f29c515be45aeadac0cfa7165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jari-Matti=20M=C3=A4kel=C3=A4?= <jmjm@iki.fi> Date: Tue, 2 Oct 2018 21:56:10 +0300 Subject: [PATCH] Add support for locally provided fonts in sharelatex --- latex/thesis.lyx | 9 +++++++-- latex/thesis.tex | 8 ++++++-- latex/utuftthesis.cls | 13 ++++++++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/latex/thesis.lyx b/latex/thesis.lyx index 7b1a7a5..4c0dbcb 100644 --- a/latex/thesis.lyx +++ b/latex/thesis.lyx @@ -158,9 +158,9 @@ The utuftthesis.cls defines a new thesis class, which is based on the report \begin_layout Plain Layout - includereferences: true / false (default:false) include reference pages when calculating the total number of pages -\begin_inset Newline newline -\end_inset +\end_layout +\begin_layout Plain Layout - realtimesnewroman: true / false (default:false) use Times New Roman instead of LaTeX fonts with XeLaTeX. Requires the font to be installed on the system / provided in the document @@ -168,6 +168,11 @@ The utuftthesis.cls defines a new thesis class, which is based on the report Other fonts can be defined with \backslash setmainfont. +\end_layout + +\begin_layout Plain Layout +- sharelatex: true / false (default: false) don't attempt to use (c) system + fonts, instead read them from the project repository \begin_inset Newline newline \end_inset diff --git a/latex/thesis.tex b/latex/thesis.tex index 04e5036..cd6d370 100644 --- a/latex/thesis.tex +++ b/latex/thesis.tex @@ -42,11 +42,15 @@ document appearance and hyphenation text at the beginning of each Chapter - includereferences: true / false (default:false) include reference -pages when calculating the total number of pages\\ +pages when calculating the total number of pages + - realtimesnewroman: true / false (default:false) use Times New Roman instead of LaTeX fonts with XeLaTeX. Requires the font to be installed on the system / provided in the document directory. Other fonts can -be defined with \textbackslash setmainfont.\\ +be defined with \textbackslash setmainfont. + +- sharelatex: true / false (default: false) don't attempt to use (c) +system fonts, instead read them from the project repository\\ \\ Traditionally the best places to learn (La)TeX are probably the manual pages for each package http://www.ctan.org/ and http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf. diff --git a/latex/utuftthesis.cls b/latex/utuftthesis.cls index ddfc89b..3413f57 100644 --- a/latex/utuftthesis.cls +++ b/latex/utuftthesis.cls @@ -28,6 +28,7 @@ \DeclareStringOption[true]{hidechapters} \DeclareStringOption[false]{includereferences} \DeclareStringOption[false]{realtimesnewroman} +\DeclareStringOption[false]{sharelatex} %% Process given options \ProcessKeyvalOptions* @@ -59,7 +60,17 @@ \setotherlanguage{english} \else \fi - \ifthenelse{\equal{\utuftthesis@realtimesnewroman}{true}}{\setmainfont{Times New Roman}}{} + \ifthenelse{\equal{\utuftthesis@realtimesnewroman}{true}}{ + \ifthenelse{\equal{\utuftthesis@sharelatex}{true}}{ + \setmainfont[ + BoldFont=timesbd.ttf, + ItalicFont=timesi.ttf, + BoldItalicFont=timesbi.ttf + ]{times.ttf} + }{ + \setmainfont{Times New Roman} + } + }{} \else % JH: modified latin to UTF-8 encoding cues to make Scandinavian characters works \RequirePackage[T1]{fontenc} -- GitLab