I have solved this question after consulting the author of pkuthss.cls.
Following his advice, there are two way to solve my problem.
It's not necessary to use packge unicode-math to meet my requirement of changing math font. Two optional approach:
a) Use document class with a parameter nopkufont
: \documentclass[UTF8, nopkufont]{pkuthss}
. The current font style are according to the regulations of our university, negate the parameter to use traditional latex font(latexsym).
b) Change the cls file content:
\ifpkuthss@opt@pkufont
% Use Times New Roman / Arial according to school regulation.
% Option used to prevent newtxtext from manipulating footnote marks.
\RequirePackage[defaultsups]{newtxtext}
\RequirePackage{newtxmath}
\else
% Provides `\Box' for originauth.tex if newtx is absent.
\RequirePackage{latexsym}
\fi
Delete the line of \RequirePackage{newtxmath}
will change the font of math contents to latin modern math without violating the PKU regulations.
You can use the above two solutions at the same time, that's what I did since no matter in which case I would like to use latin modern math as the math font and I might have to change the normal text to the newtx font if asked by the university.
- If sticking to the unicode-math package, reinstalltion has solved my problem.
Also noticed @egreg did not reproduce my errors, so there might be something wrong in my configuration of tex. As suggested by the author, I uninstalled the tex live and re-install the latest tex live version following the bootstrap guide given by the author (https://bbs.pku.edu.cn/attach/boards/MathTools/M.1435670549.A/pkuthss-bootstrap-0.1.5-r1.pdf?t=1464095057, in Chinese) (not too much changes compared with the normal installation progress).
After re-installation, my errors disappeared... I don't know why and how...
Anyway, my problem has been solved. I think this is such a specific issue only related to the thesis template of our university, may not be helpful to others. Anyway I posted the answer here, in case another PKU student encountered the same problem...
The problem with the fonts is caused by making T2A
default rather than T1
when loading fontenc
. This is easily fixed: just reverse the order if you need T2A
.
More generally, the document is not well-designed. For a thesis, you want report
or book
. Then you have \chapter
and you don't constantly need \newpage
and \maketitle
could even do something sensible.
However, you might want titlepage
as you need a custom title page. That's fine, but much easier than setting the style etc. by hand.
\hyperref
is loaded too late. Apart from hypcap
, it should be last.
times
is deprecated, tabu
is to be avoided and algorithm2e
is causing an error every time you load it. It doesn't stop compilation, but it messes up the grouping.
Consider using booktabs
for tables.
Only load packages you need.
I've added some more comments in the code itself, which is still very far from being in a good state, but not in as poor a state as it was when I started :(.
Substitute american
for british
if you want US, rather than UK, English. english
is ambiguous. (But if your university put english
, they probably want american
, although it is not 100% certain.)
\begin{filecontents}{\jobname.bib}
@online{omgwebsite,
author = "OMG",
title = "BPMN 2.0 by Example",
year = {2010},
url = "http://www.omg.org/spec/BPMN/20100601/10-06-02.pdf",
keywords = "bpm by example"
}
@online{bpmn20,
author = "OMG",
title = "Business Process Model and Notation(BPMN)",
year = {2011},
url = "http://www.omg.org/spec/BPMN/2.0/PDF/",
keywords = "bpm by example"
}
@online{eth,
author = "Vitalik Buterin",
title = "Ethereum White Paper",
year = {2013},
url = "https://github.com/ethereum/wiki/wiki/White-Paper",
keywords = "ethereum"
}
\end{filecontents}
\documentclass[12pt,a4paper,estonian,british]{report}% or american, if you want US English
\usepackage{geometry}
\usepackage{setspace}
\usepackage[utf8]{inputenc}
% default encoding *last*
\usepackage[T2A,T1]{fontenc}
\usepackage{babel} %the thesis is in English
\usepackage[backend=biber,style=numeric]{biblatex}
\usepackage{csquotes}
\addbibresource{\jobname.bib}
\usepackage[parfill]{parskip}
% times is deprecated - pick a modern times clone instead
\usepackage{tgtermes}
\usepackage{amsmath,amsthm,amssymb}
% are you sure about this?
\usepackage[mathscr]{eucal}
%Add other fonts I guess?
% if you don't know what it is for, don't load it!
% this will change the fonts used for maths, which may or may not overwrite the effects of loading eucal
\usepackage{mathptmx}
% do you need this?
\usepackage{float}
\usepackage[labelsep=period]{caption}
%Add images side by side - do you need this?
\usepackage{subcaption}
% consider using booktabs
% Packages for building tables and tabulars
\usepackage{array}
% avoid tabu !!
% \usepackage{tabu} % Wide lines in tables
% add table inline
% are you using wrapfig?
\usepackage{wrapfig}
% be wary of using this, especially of overusing it - you need to ensure you don't get spaces where you don't want them and don't get the *wrong* spaces where you want the *right* ones.
\usepackage{xspace} % Non-eatable spaces in macros
% Including graphical images and setting the figure directory
\usepackage{graphicx}
\graphicspath{{img/}}
% Packages for defining colourful text together with some colours
% color is pointless if loading xcolor
\usepackage{xcolor}
% % Nice todo notes
\usepackage{todonotes}
% loading algorithm2e causes things to go wrong, even if you don't use it, due to a bug in the Packages
% so think carefully about how much you need this!
% here's a fix from David Carlisle: http://chat.stackexchange.com/transcript/message/37476446#37476446
\usepackage{ifthen}
\let\zz\setboolean
\def\setboolean{\ifnum\currentgrouplevel=1 \egroup\let\setboolean\zz\fi\zz}
\usepackage[ruled,vlined,linesnumbered]{algorithm2e}
% % comments and verbatim text (code)
\usepackage{verbatim}
% % % Proper way to create coloured code listings
\usepackage{listings}
\usepackage{proof}
\usepackage{semantic}
% Packages for getting clickable links in PDF file
% hyperref must be loaded LATE - last with certain exceptions e.g. hypcap
\usepackage[hidelinks]{hyperref} %hide red (blue,green) boxes around links
\usepackage[all]{hypcap}
% note the -ing if this is for the whole document
\onehalfspacing
\addto\captionsestonian{%
\renewcommand{\refname}{Viidatud kirjandus}%
\renewcommand{\appendixname}{Lisad}%
}
\definecolor{mauve}{rgb}{0.58,0,0.82}
%
% % are you sure about this? maybe you should be using book or report rather than article?
% % \let\chapter\section
%
\SetKw{True}{true}
\SetKw{False}{false}
\SetKwData{typeInt}{Int}
\SetKwData{typeRat}{Rat}
\SetKwData{Defined}{Defined}
\SetKwFunction{parseStatement}{parseStatement}
%
\setlength{\inferLineSkip}{4pt}
% % sizing and spacing are going to get screwed up unless you are very careful with this
% % don't use \def unless you know why you need it and are prepared to accept the consequences
% % this does not look at all right ...
\def\predicatebegin #1\predicateend{$\Gamma \vdash #1$}
%
\newcommand{\proveit}{ProveIt\xspace}
%
% % Macros that make sure that the math mode is set
% % shouldn't these be defined as maths elements with maths spacing?
% % I don't know what these are for, but this looks wrong ....
\newcommand{\typeF}[1] {\ensuremath{\mathsf{type_{#1}}}\xspace}
\newcommand{\opDiv}{\ensuremath{\backslash \mathsf{div}}\xspace}
%
% % Nice Todo box
\newcommand{\TODO}{\todo[inline]}
%
% % A way to define theorems and lemmata
\newtheorem{theorem}{Theorem}
% you're using \selectlanguage, so use this patch
\makeatletter
% fix for bug in babel o ateb joseph wright: http://tex.stackexchange.com/a/361849/
\def\bbl@ensure#1#2#3{%
\def\bbl@tempb##1{% elt for \bbl@ensured list
\ifx##1\@empty\else
\in@{##1}{#2}%
\ifin@\else
\toks@\expandafter{##1}%
\edef\bbl@tempa{%
\noexpand\DeclareRobustCommand
\bbl@csarg\noexpand{ensure@\languagename}[1]{%
\noexpand\foreignlanguage{\languagename}%
{\ifx\relax#3\else
\noexpand\fontencoding{#3}\noexpand\selectfont
\fi
########1}}}%
\bbl@tempa
\edef##1{%
\bbl@csarg\noexpand{ensure@\languagename}%
{\the\toks@}}% The unprotected line end was here!
\fi
\expandafter\bbl@tempb
\fi}%
\expandafter\bbl@tempb\bbl@ensured\@empty
\def\bbl@tempa##1{% elt for include list
\ifx##1\@empty\else
\bbl@csarg\in@{ensure@\languagename\expandafter}\expandafter{##1}%
\ifin@\else
\bbl@tempb##1\@empty
\fi
\expandafter\bbl@tempa
\fi}%
}
\makeatother
%%% BEGIN DOCUMENT
\begin{document}
\begin{titlepage}
\begin{center}
\iflanguage{british}{%
\large
}{}%\iflanguage
\iflanguage{british}{%
\Large
}{%
\Large
}%\iflanguage
\end{center}
\vspace{2mm}
\begin{flushright}
\setlength{\extrarowheight}{5pt}
\begin{tabular}{r l}
\end{tabular}
\end{flushright}
\end{titlepage}
%=== Info in English
\newcommand\EngInfo{{%
\selectlanguage{british}%
% \noindent\textbf{\large}% what is this meant to do?
\vspace*{3ex}
\noindent\textbf{Abstract:}% why not use the abstract environment?
\noindent
\textsc{Whitespace}
\textsc{Whitespace} language.
\vspace*{1ex}
\noindent\textbf{Keywords:}\par\noindent%\\ don't use \\ to end paragraphs or enter line breaks outside special contexts (e.g. tabular, array, center)
\TODO{List of keywords}
%Layout, formatting, template
\vspace*{1ex}
\vspace*{1ex}
}}%\newcommand\EngInfo
%=== Info in Estonian
\newcommand\EstInfo{{%
\selectlanguage{estonian}%
\noindent\textbf{\large Tüübituletus neljandat järku loogikavalemitele}% the line spacing is going to be wrong here
\vspace*{1ex}
\noindent\textbf{Lühikokkuvõte:}
%\noindent ...
\vspace*{1ex}
\noindent\textbf{Võtmesõnad:}\par\noindent
\TODO{List of keywords}
%Layout, formatting, template
\vspace*{1ex}
\noindent\textbf{CERCS:}\TODO{CERCS kood ja nimetus:~\url{https://www.etis.ee/Portal/Classifiers/Details/d3717f7b-bec8-4cd9-8ea4-c89cd56ca46e}}
\vspace*{1ex}
}}%\newcommand\EstInfo
%=== Determine the order of languages on Info page
\iflanguage{british}{\EngInfo}{\EstInfo}
%\iflanguage{estonian}{\EngInfo}{\EstInfo}
\tableofcontents
Remember to remove this from the final thesis version
\listoftodos[Unsolved issues]
% END OF TODO PAGE
\chapter{Introduction}
Bitcoin \cite{bitcoin} is probably the most well-known example of a digital technology implementing the idea of a ledger or a blockchain. Bitcoin has not only shown that the use of cryptology, replication and consensus make it possible to implement a digital ledger, but also that this technology can be a platform for performing safe exchange of cryptocurrencies. Along the same lines, in 2015 an open source project called Ethereum \cite{eth} entered the arena of blockchain technologies by providing not only a simile of Bitcoin, but a more flexible platform by the introduction of the so-called smart contracts, which have opened new opportunities for development on top of blockchain.
It is in this context that my Masters’ thesis work takes place. More specifically, my work aims at providing support to Timer Events as defined in the BPMN standard. Timer events are an interesting construct in BPMN because they provide ways to specify temporal constraints such as deadlines and/or \textbf{milestones} in the underlying business process. However, the notion of time in a technology such as Ethereum does not have a clear meaning: there is not \textit{global} clock, and the time for a transaction completion is not fixed (the same transaction can take a few seconds or several minutes). \textsc{Nevertheless}, we are aware of one existing solution that provides a sort of timer for Ethereum and, in discussion forums, it is also \texttt{claimed} that a timer service for Ethereum can implemented via an external service. However, it is unclear if such solutions can be applied into, and what would the implications of using them in a BPMN execution engine. Those are in fact the main goals of my research.
% Use Biblatex if you have problems with Estonian keywords
\printbibliography %biblatex
\end{document}
Best Answer
Your log-file says
LaTeX then falls back to cmr and so you are missing the bold font. The missing file is from the TeX-Gyre fonts. You will have to install them, or remove the code which change to this font, or add something like
\usepackage{mathptmx}
in your document to switch to another font.