From 5fe7c81f93b45f8f85ca01c15ac06cf7cb2d1a4e Mon Sep 17 00:00:00 2001 From: Constantine Evans Date: Tue, 28 Dec 2021 11:33:21 +0000 Subject: [PATCH] Modernize latex greek math handling (partially fixes #1673) (#1687) --- .../nbconvert/templates/latex/base.tex.j2 | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/share/jupyter/nbconvert/templates/latex/base.tex.j2 b/share/jupyter/nbconvert/templates/latex/base.tex.j2 index ce28fcb79..a6d2a5a27 100644 --- a/share/jupyter/nbconvert/templates/latex/base.tex.j2 +++ b/share/jupyter/nbconvert/templates/latex/base.tex.j2 @@ -14,13 +14,6 @@ override this.-=)) ((* block docclass *))\documentclass[11pt]{article}((* endblock docclass *)) ((* block packages *)) - \usepackage{iftex} - \ifPDFTeX - \usepackage[T1]{fontenc} - \usepackage{mathpazo} - \else - \usepackage{fontspec} - \fi % Basic figure setup, for now with no caption control since it's done % automatically by Pandoc (which extracts ![](path) syntax from Markdown). @@ -48,7 +41,21 @@ override this.-=)) } \usepackage{upquote} % Upright quotes for verbatim code \usepackage{eurosym} % defines \euro - \usepackage[mathletters]{ucs} % Extended unicode (utf-8) support + + \usepackage{iftex} + \ifPDFTeX + \usepackage[T1]{fontenc} + \IfFileExists{alphabeta.sty}{ + \usepackage{alphabeta} + }{ + \usepackage[mathletters]{ucs} + \usepackage[utf8x]{inputenc} + } + \else + \usepackage{fontspec} + \usepackage{unicode-math} + \fi + \usepackage{fancyvrb} % verbatim replacement that allows latex \usepackage{grffile} % extends the file name processing of package graphics % to support a larger range