Add polyglossia for supporting Greek/English

We have an issue with fonts, try to figure out how to make this
parametric.  We also have an issue with appendix numbers in Greek
(that's why I have "numerals=arabic" for greek).
parent 5e29de03
...@@ -262,28 +262,52 @@ ...@@ -262,28 +262,52 @@
% Required packages % Required packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{graphicx} \RequirePackage{graphicx}
\RequirePackage[english]{babel}
\RequirePackage{fontspec} \RequirePackage{fontspec}
\RequirePackage{xunicode} \RequirePackage{xunicode}
\RequirePackage{xltxtra} \RequirePackage{xltxtra}
\defaultfontfeatures{Mapping=tex-text} \defaultfontfeatures{Mapping=tex-text}
\RequirePackage{xgreek}
% XeLaTeX fonts % XeLaTeX fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% roman font % roman font
\setmainfont{Times New Roman} \def\font@roman{Times New Roman}
%\def\font@roman{Liberation Serif}
% sans serif font % sans serif font
\setsansfont[Scale=MatchLowercase]{Arial} \def\font@sans{Arial}
%\def\font@sans{Liberation Sans}
% typewriter font % typewriter font
\setmonofont[Scale=MatchLowercase]{Liberation Mono} \def\font@tt{Liberation Mono}
%\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono} %\def\font@tt{DejaVu Sans Mono}
%\setmonofont[Scale=MatchLowercase]{Lucida Sans Typewriter} %\def\font@tt{Lucida Sans Typewriter}
%\setmonofont[Scale=MatchLowercase]{Free Monospaced} %\def\font@tt{Free Monospaced}
%\setmonofont[Scale=MatchLowercase]{Bitstream Vera Sans Mono} %\def\font@tt{Bitstream Vera Sans Mono}
\setromanfont{\font@roman}
\setsansfont[Scale=MatchLowercase]{\font@sans}
\setmonofont[Scale=MatchLowercase]{\font@tt}
% Polyglossia
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{polyglossia}
\if@greek
\newfontfamily\greekfont{\font@roman}
\newfontfamily\greekfontsf[Scale=MatchLowercase]{\font@sans}
\newfontfamily\greekfonttt[Script=grek,Scale=MatchLowercase]{\font@tt}
%\newfontfamily\greekfont{Times New Roman}
%\newfontfamily\greekfont[Script=grek]{Liberation Serif}
%\newfontfamily\greekfontsf[Scale=MatchLowercase]{Arial}
%\newfontfamily\greekfontsf[Script=grek,Scale=MatchLowercase]{Liberation Sans}
%\newfontfamily\greekfonttt[Script=grek,Scale=MatchLowercase]{Liberation Mono}
\setdefaultlanguage[variant=mono,numerals=arabic]{greek}
\setotherlanguage{english}
\else
\setdefaultlanguage{english}
\fi
% Headings % Headings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...@@ -719,17 +743,23 @@ ...@@ -719,17 +743,23 @@
\let\maketitle\relax% \let\maketitle\relax%
} }
\def\abstractgr{% \def\abstractgr{%
\setlanguage{monogreek}% \begin{greek}%
\chapter*{\abstractnamegr\@mkboth{\abstractnamegr}{\abstractnamegr}}% \chapter*{\abstractnamegr\@mkboth{\abstractnamegr}{\abstractnamegr}}%
\addcontentsline{toc}{chapter}{\abstractnamegr}% \addcontentsline{toc}{chapter}{\abstractnamegr}%
\noindent\ignorespaces} \noindent\ignorespaces}
\def\endabstractgr{\par\vfil\null} \def\endabstractgr{%
\par%
\end{greek}%
\vfil\null}
\def\abstracten{% \def\abstracten{%
\selectlanguage{english}% \begin{english}%
\chapter*{\abstractnameen\@mkboth{\abstractnameen}{\abstractnameen}}% \chapter*{\abstractnameen\@mkboth{\abstractnameen}{\abstractnameen}}%
\addcontentsline{toc}{chapter}{\abstractnameen}% \addcontentsline{toc}{chapter}{\abstractnameen}%
\noindent\ignorespaces} \noindent\ignorespaces}
\def\endabstracten{\par\vfil\null} \def\endabstracten{%
\par%
\end{english}%
\vfil\null}
% Sectioning % Sectioning
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...@@ -810,7 +840,11 @@ ...@@ -810,7 +840,11 @@
\fi \fi
\fi% \fi%
\refstepcounter{chapter}% \refstepcounter{chapter}%
\typeout{\chaptername\space\thechapter.} \if@mainmatter%
\typeout{\chaptername\space\thechapter.}
\else%
\typeout{\appendixname\space\thechapter.}
\fi%
\addcontentsline{toc}{chapter}{% \addcontentsline{toc}{chapter}{%
\protect\numberline{\thechapter.}#1}% \protect\numberline{\thechapter.}#1}%
\else \else
...@@ -907,9 +941,9 @@ ...@@ -907,9 +941,9 @@
\part*{\appendixname\@mkboth{\appendixname}{\appendixname}%% \part*{\appendixname\@mkboth{\appendixname}{\appendixname}%%
\@addappendixtocontents} \@addappendixtocontents}
\else% \else%
\renewcommand{\@chapapp}{\appendixname}% \gdef\@chapapp{\appendixname}%
\fi \fi
\renewcommand{\thechapter}{\Alph{chapter}}} \gdef\thechapter{\@Alph\c@chapter}}
% Space lengths % Space lengths
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...@@ -1411,8 +1445,10 @@ ...@@ -1411,8 +1445,10 @@
% More environments % More environments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{keywordsgr}{\section*{\keywordsnamegr}}{} \newenvironment{keywordsgr}{\section*{\keywordsnamegr}%
\newenvironment{keywordsen}{\section*{\keywordsnameen}}{} \noindent\ignorespaces}{}
\newenvironment{keywordsen}{\section*{\keywordsnameen}%
\noindent\ignorespaces}{}
\newcommand{\footacknowledgement}[1]{% \newcommand{\footacknowledgement}[1]{%
\let\footnotesize\small% \let\footnotesize\small%
\let\@tmp@makefntext\@makefntext% \let\@tmp@makefntext\@makefntext%
...@@ -1423,7 +1459,7 @@ ...@@ -1423,7 +1459,7 @@
\let\@makefntext\@tmp@makefntext% \let\@makefntext\@tmp@makefntext%
} }
\newenvironment{acknowledgementsgr}{% \newenvironment{acknowledgementsgr}{%
\setlanguage{monogreek}% \begin{greek}%
\chapter*{\acknowledgementsnamegr}% \chapter*{\acknowledgementsnamegr}%
\addcontentsline{toc}{chapter}{\acknowledgementsnamegr}% \addcontentsline{toc}{chapter}{\acknowledgementsnamegr}%
\begingroup% \begingroup%
...@@ -1448,9 +1484,10 @@ ...@@ -1448,9 +1484,10 @@
} }
\newpage% \newpage%
\endgroup% \endgroup%
\end{greek}%
} }
\newenvironment{acknowledgementsen}{% \newenvironment{acknowledgementsen}{%
\selectlanguage{english}% \begin{english}%
\chapter*{\acknowledgementsnameen}% \chapter*{\acknowledgementsnameen}%
\addcontentsline{toc}{chapter}{\acknowledgementsnameen}% \addcontentsline{toc}{chapter}{\acknowledgementsnameen}%
\begingroup% \begingroup%
...@@ -1475,6 +1512,7 @@ ...@@ -1475,6 +1512,7 @@
} }
\newpage% \newpage%
\endgroup% \endgroup%
\end{english}%
} }
% Font customization % Font customization
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment