Commit 34b7744b authored by Dirk Brömmel's avatar Dirk Brömmel
Browse files

Adding better support for LuaLaTeX and XeLaTeX

Some font issues should be fixed with this. Also section numbering has
been adjusted for headings/references.
parent 72001500
......@@ -25,8 +25,8 @@ The `example` directory contains a full example:
`example.[eps|png]` : figure used in the example white paper
## REQUIREMENTS
Some LaTeX packages are assumed to be present for this class to work: `mathptmx` (for the correct font), `siunitx` (for properly formatted numbers+units), and `fancyhdr` (which should be updated at some point).
The current version of the template is meant for use with `latex` or `pdflatex`, a modern dialect may follow in the future.
Some LaTeX packages are assumed to be present for this class to work: e.g. `siunitx` (for properly formatted numbers+units), `booktabs`, `iftex`, and `fancyhdr` (which should be updated at some point).
To have fonts closely following Times New Roman, `pdflatex` requires `mathptmx` whereas `lualatex` or `xelatex` use `FreeSerif` via the `fontspec` package.
## QUICK HOW-TO
1) copy `template.tex` to `yourname_yourproject.tex`
......
No preview for this file type
......@@ -12,7 +12,7 @@
%%% geometry, graphicx, ifthen, booktabs
%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{prace}[2021/06/29 PRACE Whitepaper class]
\ProvidesClass{prace}[2022/05/18 PRACE Whitepaper class]
\DeclareOption{onecolumn}{\OptionNotUsed}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
......@@ -28,13 +28,33 @@
footskip=8mm
}
% select a font close to Times New Roman (this will depend on the TeX interpreter, more to come)
\RequirePackage{mathptmx}
\RequirePackage{siunitx}
\RequirePackage{graphicx}
\RequirePackage{ifthen}
\RequirePackage{booktabs}
\RequirePackage{iftex}
% select a font close to Times New Roman (this will depend on the TeX interpreter, more to come)
\ifpdftex
\RequirePackage{mathptmx}
\fi
\ifxetex
\RequirePackage{fontspec}
\setmainfont{FreeSerif} % this looks a lot like mathptmx, though metric not fully compatible
%\setmainfont{Liberation Serif} % this looks less like mathptmx, but has metric compatibility
\fi
\ifluatex
\RequirePackage{fontspec}
\setmainfont{FreeSerif}
\fi
% try and make sure \maketitle works when using UTF-8 characters and pdflatex/lualatex
\ifpdftex
\RequirePackage[T1]{fontenc}
\fi
\ifluatex
\RequirePackage[utf8]{luainputenc}
\fi
% spacing between paragraphs and indents
\RequirePackage{parskip}
......@@ -207,11 +227,14 @@
{2.0ex \@plus.67ex}% afterskip, corresponding to 12pt in total
{\normalfont\large\itshape}}
% redefine section, figure etc. format
\def\thesection {\arabic{section}.}
\def\thesubsection {\thesection\arabic{subsection}.}
\def\thesubsubsection {\thesubsection\arabic{subsection}.}
\def\figurename{Figure}
\def\tablename{Table}
\RequirePackage{secdot}
\sectiondot{subsection}
\sectiondot{subsubsection}
%\def\thesection {\arabic{section}}
%\def\thesubsection {\thesection.\arabic{subsection}}
%\def\thesubsubsection {\thesubsection\arabic{subsection}.}
\def\figurename {Figure}
\def\tablename {Table}
% add horizontal lines before and after the abstract
\renewenvironment{abstract}%
......
Supports Markdown
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