Skip to content

Commit

Permalink
Merge pull request #22 from michaelroland/luatex-support
Browse files Browse the repository at this point in the history
Add LuaLaTeX support
  • Loading branch information
michaelroland authored Oct 21, 2024
2 parents 31e28c1 + 0e44e8e commit 9764cdb
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 39 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test-build-latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ jobs:
job_source: ${{ env.SOURCE_NAME_THESIS }}
job_artifact_suffix: -xelatex

build-thesis-lualatex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/latexmk-and-output
with:
job_engine: pdflua
job_source: ${{ env.SOURCE_NAME_THESIS }}
job_artifact_suffix: -lualatex

build-report-pdflatex:
runs-on: ubuntu-latest
steps:
Expand All @@ -56,6 +68,18 @@ jobs:
job_source: ${{ env.SOURCE_NAME_REPORT }}
job_artifact_suffix: -xelatex

build-report-lualatex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/latexmk-and-output
with:
job_engine: pdflua
job_source: ${{ env.SOURCE_NAME_REPORT }}
job_artifact_suffix: -lualatex

build-seminar-pdflatex:
runs-on: ubuntu-latest
steps:
Expand All @@ -79,3 +103,16 @@ jobs:
job_engine: pdfxe
job_source: ${{ env.SOURCE_NAME_SEMINAR }}
job_artifact_suffix: -xelatex

build-seminar-lualatex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/latexmk-and-output
with:
job_engine: pdflua
job_source: ${{ env.SOURCE_NAME_SEMINAR }}
job_artifact_suffix: -lualatex

2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include:
parallel:
matrix:
- LATEX_BUILDPDF_SOURCE_NAME: [main-thesis, main-report, main-seminarreport]
LATEX_BUILDPDF_TEX_COMMAND: [pdflatex, xelatex]
LATEX_BUILDPDF_TEX_COMMAND: [pdflatex, xelatex, lualatex]

latex_build_pdf:
extends:
Expand Down
50 changes: 34 additions & 16 deletions jkureport.sty
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@
\RequirePackage{booktabs}
\RequirePackage{rotating}
\RequirePackage{colortbl}
\RequirePackage{ifxetex}
\RequirePackage{iftex}
% legacy packages prior to merge into iftex; still relevant?
\@ifundefined{ifluatex}{%
\RequirePackage{ifluatex}
}{}
\@ifundefined{ifxetex}{%
\RequirePackage{ifxetex}
}{}
\RequirePackage{verbatim}
\RequirePackage{tcolorbox}
\tcbuselibrary{skins}
Expand Down Expand Up @@ -132,7 +139,7 @@
fontpath=fonts,
}

% Option [no]fancyfonts: use custom TTF fonts with XeTeX (defaults to true)
% Option [no]fancyfonts: use custom TTF fonts with XeTeX/LuaTeX (defaults to true)
\newbool{jkureport@xetexfonts}
\pgfkeys{%
/jkureport/pkg/.cd,
Expand Down Expand Up @@ -437,8 +444,19 @@
\setlength{\jkureport@authoring@titlepage@offset}{60mm}

% General page sizing
\setlength{\pdfpagewidth}{\paperwidth}
\setlength{\pdfpageheight}{\paperheight}

\@ifundefined{pdfpagewidth}{}{%
\setlength{\pdfpagewidth}{\paperwidth}
}
\@ifundefined{pagewidth}{}{%
\setlength{\pagewidth}{\paperwidth}
}
\@ifundefined{pdfpageheight}{}{%
\setlength{\pdfpageheight}{\paperwidth}
}
\@ifundefined{pageheight}{}{%
\setlength{\pageheight}{\paperwidth}
}
\setlength{\hoffset}{0in}
\setlength{\voffset}{0in}

Expand Down Expand Up @@ -478,29 +496,29 @@

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Fancy fonts with XeTeX
%% Fancy fonts with LuaTeX/XeTeX
%%

\ifxetex\else%
\ifbool{jkureport@xetexfonts}{%
\PackageWarning{jkureport}{True-type fonts are only supported on XeLaTeX. Please consider switching to XeLaTeX to get the full look and feel of this template. Note that you can silence this warning with the `nofancyfonts' option.}%
}{}%
\boolfalse{jkureport@xetexfonts}%
\fi

\ifbool{jkureport@xetexfonts}{}{%
\RequirePackage{lmodern}
}%
\RequirePackage{inconsolata}
\RequirePackage{helvet}
\ifxetex\else%
\ifluatex\else\ifxetex\else%
\RequirePackage{euler}
\fi
\fi\fi
\RequirePackage{fontawesome5}
\ifxetex\else%
\ifluatex\else\ifxetex\else%
% fix potentially mis-packaged FA5 in TeX Live 2017, see https://tex.stackexchange.com/q/497792/290236
\pdfmapfile{=fontawesome5.map}%
\fi
\fi\fi

\ifluatex\else\ifxetex\else%
\ifbool{jkureport@xetexfonts}{%
\PackageWarning{jkureport}{True-type fonts are only supported on LuaLaTeX/XeLaTeX. Please consider switching to LuaLaTeX (or XeLaTex) to get the full look and feel of this template. Note that you can silence this warning with the `nofancyfonts' option.}%
}{}%
\boolfalse{jkureport@xetexfonts}%
\fi\fi

\ifbool{jkureport@xetexfonts}{%
\ifbool{jkureport@mathastext}{
Expand Down
26 changes: 17 additions & 9 deletions main-report.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
%%
%% You can safely use "pdflatex" instead of "xelatex" if you prefer the pdfLaTeX toolchain.
%% However, pdfLaTeX will not be able to deliver the professional font experience that you
%% will get with XeLaTeX.
%% will get with XeLaTeX. You can also safely use "lualatex" instead of "xelatex" while
%% preserving the professional font experience if you prefer the LuaLaTeX toolchain.
%%
%% _Important_: These magic comments should be on the first lines of your source file.
%%
Expand All @@ -27,8 +28,8 @@
%% JJJJJJJJJJJJJ KKKKKKKKKKKKKKKKKKKKKKKKKKK UUUUUUUUUUUUUUU
%% JJJJJJJJJ KKKKKKKKKKKKKKKKKKKKKKKKKKK UUUUUUUUUUU
%%
%% This is an example file for using the JKU LaTeX technical report template for
%% your technical report.
%% This is an example file for using the JKU LaTeX technical report template
%% for your technical report.
%%
%% Template created by Michael Roland (2021)
%%
Expand Down Expand Up @@ -74,7 +75,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Treat input files as UTF-8 encoded. Make sure to always load this when you use pdfLaTeX
%% so that pdfLaTeX knows how to read and interpret characters this source file.
%% so that pdfLaTeX knows how to read and interpret characters in this source file.
%%
\usepackage[utf8]{inputenc}
%%
Expand Down Expand Up @@ -107,23 +108,23 @@
%% * SOWI ... Use SOWI faculty color scheme.
%% * TNF ... Use TNF faculty color scheme.
%%
%% Space-efficient monospace font options (requires XeTeX):
%% Space-efficient monospace font options (requires XeTeX/LuaTeX):
%% * compactmono ... Use condensed fixed-width font everywhere.
%% * nocompactverb ... Do not use condensed fixed-width font for verbatim and listings.
%%
%% Style-breaking options:
%% * noimprint ... Do not insert imprint on title pages.
%% * nojkulogo ... Do not insert JKU & K logos on title pages.
%% * capstitle ... Set document title in capital letters.
%% * nofancyfonts ... Do not use custom TTF fonts with XeTeX / supress pdfLaTeX warning.
%% * nofancyfonts ... Do not use custom TTF fonts with XeTeX/LuaTeX / supress pdfLaTeX warning.
%% * equalmargins ... Decrease the outer page margin to have both page margins of equal size
%% (the additional outer margin is intentional and to be used for
%% anotations; equalmargins also causes the text width to be
%% significantly larger than optimal for reading).
%%
%% Experimental options:
%% * mathastext ... Use standard document fonts (enhanced with symbols from Fira Math font)
%% in math mode.
%% * mathastext ... Use standard document fonts (enhanced with symbols from Fira Math font
%% when using XeTeX/LuaTeX) in math mode.
%%
%% Advanced options:
%% * noautopdfinfo ... Do not automatically try to add pdfinfo with hyperref from document
Expand Down Expand Up @@ -153,6 +154,7 @@
\usepackage{import}
\usepackage{amsfonts}
\usepackage{subfigure}
%\usepackage{acronym}

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down Expand Up @@ -235,6 +237,11 @@
%% Print the table of contents
\tableofcontents

%% Make sure to start the list of acronyms on a new odd page (odd is only relevant in twoside layout)
%\cleardoubleoddpage
%% Include list of acronyms (optional and often not necessary)
%\import{./}{acronyms}

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Expand Down Expand Up @@ -340,7 +347,7 @@ \section{Conclusion}
%%
%% Print the bibliography
%%
%% Make sure to start the bibliography on a new odd page (odd is only relevant in twoside layout)
%% (Optionally) let the bibliography start on a new odd page (odd is only relevant in twoside layout)
%\cleardoubleoddpage
\printbibliography
%%
Expand All @@ -366,6 +373,7 @@ \section{An Appendix}

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\cleardoubleoddpage

\end{document}
Expand Down
14 changes: 8 additions & 6 deletions main-seminarreport.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
%%
%% You can safely use "pdflatex" instead of "xelatex" if you prefer the pdfLaTeX toolchain.
%% However, pdfLaTeX will not be able to deliver the professional font experience that you
%% will get with XeLaTeX.
%% will get with XeLaTeX. You can also safely use "lualatex" instead of "xelatex" while
%% preserving the professional font experience if you prefer the LuaLaTeX toolchain.
%%
%% _Important_: These magic comments should be on the first lines of your source file.
%%
Expand Down Expand Up @@ -74,7 +75,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Treat input files as UTF-8 encoded. Make sure to always load this when you use pdfLaTeX
%% so that pdfLaTeX knows how to read and interpret characters this source file.
%% so that pdfLaTeX knows how to read and interpret characters in this source file.
%%
\usepackage[utf8]{inputenc}
%%
Expand Down Expand Up @@ -107,23 +108,23 @@
%% * SOWI ... Use SOWI faculty color scheme.
%% * TNF ... Use TNF faculty color scheme.
%%
%% Space-efficient monospace font options (requires XeTeX):
%% Space-efficient monospace font options (requires XeTeX/LuaTeX):
%% * compactmono ... Use condensed fixed-width font everywhere.
%% * nocompactverb ... Do not use condensed fixed-width font for verbatim and listings.
%%
%% Style-breaking options:
%% * noimprint ... Do not insert imprint on title pages.
%% * nojkulogo ... Do not insert JKU & K logos on title pages.
%% * capstitle ... Set document title in capital letters.
%% * nofancyfonts ... Do not use custom TTF fonts with XeTeX / supress pdfLaTeX warning.
%% * nofancyfonts ... Do not use custom TTF fonts with XeTeX/LuaTeX / supress pdfLaTeX warning.
%% * equalmargins ... Decrease the outer page margin to have both page margins of equal size
%% (the additional outer margin is intentional and to be used for
%% anotations; equalmargins also causes the text width to be
%% significantly larger than optimal for reading).
%%
%% Experimental options:
%% * mathastext ... Use standard document fonts (enhanced with symbols from Fira Math font)
%% in math mode.
%% * mathastext ... Use standard document fonts (enhanced with symbols from Fira Math font
%% when using XeTeX/LuaTeX) in math mode.
%%
%% Advanced options:
%% * noautopdfinfo ... Do not automatically try to add pdfinfo with hyperref from document
Expand Down Expand Up @@ -356,6 +357,7 @@ \section{An Appendix}

%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\cleardoubleoddpage

\end{document}
Expand Down
16 changes: 9 additions & 7 deletions main-thesis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
%%
%% You can safely use "pdflatex" instead of "xelatex" if you prefer the pdfLaTeX toolchain.
%% However, pdfLaTeX will not be able to deliver the professional font experience that you
%% will get with XeLaTeX.
%% will get with XeLaTeX. You can also safely use "lualatex" instead of "xelatex" while
%% preserving the professional font experience if you prefer the LuaLaTeX toolchain.
%%
%% _Important_: These magic comments should be on the first lines of your source file.
%%
Expand Down Expand Up @@ -73,7 +74,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Treat input files as UTF-8 encoded. Make sure to always load this when you use pdfLaTeX
%% so that pdfLaTeX knows how to read and interpret characters this source file.
%% so that pdfLaTeX knows how to read and interpret characters in this source file.
%%
\usepackage[utf8]{inputenc}
%%
Expand Down Expand Up @@ -106,23 +107,23 @@
%% * SOWI ... Use SOWI faculty color scheme.
%% * TNF ... Use TNF faculty color scheme.
%%
%% Space-efficient monospace font options (requires XeTeX):
%% Space-efficient monospace font options (requires XeTeX/LuaTeX):
%% * compactmono ... Use condensed fixed-width font everywhere.
%% * nocompactverb ... Do not use condensed fixed-width font for verbatim and listings.
%%
%% Style-breaking options:
%% * noimprint ... Do not insert imprint on title pages.
%% * nojkulogo ... Do not insert JKU & K logos on title pages.
%% * capstitle ... Set document title in capital letters.
%% * nofancyfonts ... Do not use custom TTF fonts with XeTeX / supress pdfLaTeX warning.
%% * nofancyfonts ... Do not use custom TTF fonts with XeTeX/LuaTeX / supress pdfLaTeX warning.
%% * equalmargins ... Decrease the outer page margin to have both page margins of equal size
%% (the additional outer margin is intentional and to be used for
%% anotations; equalmargins also causes the text width to be
%% significantly larger than optimal for reading).
%%
%% Experimental options:
%% * mathastext ... Use standard document fonts (enhanced with symbols from Fira Math font)
%% in math mode.
%% * mathastext ... Use standard document fonts (enhanced with symbols from Fira Math font
%% when using XeTeX/LuaTeX) in math mode.
%%
%% Advanced options:
%% * noautopdfinfo ... Do not automatically try to add pdfinfo with hyperref from document
Expand Down Expand Up @@ -286,7 +287,8 @@
%%
%% Print the bibliography
%%
\cleardoubleoddpage% Make sure to start bibliography on a new odd page
%% Make sure to start the bibliography on a new odd page (odd is only relevant in twoside layout)
\cleardoubleoddpage
\printbibliography
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down

0 comments on commit 9764cdb

Please sign in to comment.