diff --git a/Dockerfile b/Dockerfile index 9d38f70..adfe519 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,11 @@ RUN tlmgr update --self && \ catchfile \ ragged2e \ enumitem \ - mathtools + mathtools \ + fontspec \ + unicode-math \ + titlesec \ + newunicodechar RUN apk upgrade && apk add --no-cache \ bash \ @@ -49,6 +53,15 @@ RUN apk upgrade && apk add --no-cache \ py3-pip \ yarn +# Install MS core fonts, including Arial +RUN apk --no-cache add msttcorefonts-installer fontconfig && \ + update-ms-fonts && \ + fc-cache -f + +# Install the Arial Unicode MS font as well +RUN wget https://github.com/kaienfr/Font/raw/master/font/ARIALUNI.TTF -P /usr/share/fonts/TTF/ && \ + fc-cache -f + RUN pip install pandocfilters ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ diff --git a/build.sh b/build.sh index cfb879f..9d4c85b 100755 --- a/build.sh +++ b/build.sh @@ -259,7 +259,7 @@ export MERMAID_FILTER_FORMAT="pdf" if [ -n "${pdf_output}" ]; then echo "Generating PDF Output" pandoc \ - --trace \ + --pdf-engine=lualatex \ --embed-resources \ --standalone \ --template=eisvogel.latex \ @@ -292,6 +292,7 @@ fi if [ -n "${latex_output}" ]; then echo "Generating LaTeX Output" pandoc \ + --pdf-engine=lualatex \ --embed-resources \ --standalone \ --template=eisvogel.latex \ @@ -324,6 +325,7 @@ fi if [ -n "${docx_output}" ]; then echo "Generating DOCX Output" pandoc \ + --pdf-engine=lualatex \ --embed-resources \ --standalone \ --filter=/resources/filters/info.py \ diff --git a/sample3.md b/sample3.md index 71527eb..3653c55 100644 --- a/sample3.md +++ b/sample3.md @@ -165,15 +165,15 @@ This section contains an HTML Table. -CEIL(x) +⌈x⌉ the smallest integer not less than x -FLOOR(x) +⌊x⌋ the largest integer not greater than x -A $\coloneqq$ B +A ≔ B assignment of the results of the expression on the right (B) to the parameter on the left diff --git a/template/eisvogel.latex b/template/eisvogel.latex index f3290c3..37809e0 100644 --- a/template/eisvogel.latex +++ b/template/eisvogel.latex @@ -135,11 +135,6 @@ $if(beamerarticle)$ $endif$ \usepackage{amsmath,amssymb} \usepackage{mathtools} -$if(fontfamily)$ -\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} -$else$ -\usepackage{lmodern} -$endif$ $if(linestretch)$ \usepackage{setspace} $else$ @@ -162,69 +157,17 @@ $if(mathspec)$ $else$ \usepackage{unicode-math} $endif$ - \defaultfontfeatures{Scale=MatchLowercase} - \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} -$if(mainfont)$ - \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} -$endif$ -$if(sansfont)$ - \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$} -$endif$ -$if(monofont)$ - \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$} -$endif$ -$for(fontfamilies)$ - \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$} -$endfor$ -$if(mathfont)$ -$if(mathspec)$ - \ifxetex - \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} - \else - \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} - \fi -$else$ - \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} -$endif$ -$endif$ -$if(CJKmainfont)$ - \ifxetex - \usepackage{xeCJK} - \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} - \fi -$endif$ + +\defaultfontfeatures{Scale=MatchLowercase} +\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} + $if(luatexjapresetoptions)$ \ifluatex \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset} \fi $endif$ -$if(CJKmainfont)$ - \ifluatex - \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec} - \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} - \fi -$endif$ \fi -$if(beamer)$ -$if(theme)$ -\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} -$endif$ -$if(colortheme)$ -\usecolortheme{$colortheme$} -$endif$ -$if(fonttheme)$ -\usefonttheme{$fonttheme$} -$endif$ -$if(mainfont)$ -\usefonttheme{serif} % use mainfont rather than sansfont for slide text -$endif$ -$if(innertheme)$ -\useinnertheme{$innertheme$} -$endif$ -$if(outertheme)$ -\useoutertheme{$outertheme$} -$endif$ -$endif$ + % Use upquote if available, for straight quotes in verbatim environments \IfFileExists{upquote.sty}{\usepackage{upquote}}{} \IfFileExists{microtype.sty}{% use microtype if available @@ -639,45 +582,29 @@ $endif$ \unskip\unskip\endlist\end{customblockquote} } -% -% Source Sans Pro as the de­fault font fam­ily -% Source Code Pro for monospace text -% -% 'default' option sets the default -% font family to Source Sans Pro, not \sfdefault. -% -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex - $if(fontfamily)$ - $else$ - \usepackage[default]{sourcesanspro} - \usepackage{sourcecodepro} - $endif$ -\else % if not pdftex - $if(mainfont)$ - $else$ - \usepackage[default]{sourcesanspro} - \usepackage{sourcecodepro} +\usepackage{fontspec} +\setmainfont{Arial} +\setsansfont{Arial} +\setmonofont{Source Code Pro} - % XeLaTeX specific adjustments for straight quotes: https://tex.stackexchange.com/a/354887 - % This issue is already fixed (see https://github.com/silkeh/latex-sourcecodepro/pull/5) but the - % fix is still unreleased. - % TODO: Remove this workaround when the new version of sourcecodepro is released on CTAN. - \ifxetex - \makeatletter - \defaultfontfeatures[\ttfamily] - { Numbers = \sourcecodepro@figurestyle, - Scale = \SourceCodePro@scale, - Extension = .otf } - \setmonofont - [ UprightFont = *-\sourcecodepro@regstyle, - ItalicFont = *-\sourcecodepro@regstyle It, - BoldFont = *-\sourcecodepro@boldstyle, - BoldItalicFont = *-\sourcecodepro@boldstyle It ] - {SourceCodePro} - \makeatother - \fi - $endif$ -\fi +\usepackage{newunicodechar} +% Use Arial Unicode to display various unicode symbols that might be present +\newfontfamily{\fallbackfont}{Arial Unicode MS}[Scale=MatchLowercase] +\DeclareTextFontCommand{\textfallback}{\fallbackfont} +% TODO: Cover more characters with a nice loop or macro. +\newunicodechar{≔}{\textfallback{≔}} +\newunicodechar{⌊}{\textfallback{⌊}} +\newunicodechar{⌋}{\textfallback{⌋}} +\newunicodechar{⌈}{\textfallback{⌈}} +\newunicodechar{⌉}{\textfallback{⌉}} +\newunicodechar{⊕}{\textfallback{⊕}} +\newunicodechar{·}{\textfallback{·}} +\newunicodechar{≥}{\textfallback{≥}} +\newunicodechar{≤}{\textfallback{≤}} +\newunicodechar{≠}{\textfallback{≠}} +\newunicodechar{©}{\textfallback{©}} +\newunicodechar{™}{\textfallback{™}} +\newunicodechar{→}{\textfallback{→}} % % heading color