Skip to content

Commit

Permalink
Support versions of XeLaTeX pre-march 2016. fixes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
t-makaro committed Sep 16, 2018
1 parent d9cc9b4 commit 4c99034
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
11 changes: 9 additions & 2 deletions nb_pdf_template/templates/style_jupyter.tplx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
\expandafter\def\csname PY@tok@o\endcsname{\def\PY@tc##1{\textcolor[HTML]{AA22FF}{\codetrue##1\codefalse}}} %operator
\makeatother

\makeatletter
\newcommand*\@iflatexlater{\@ifl@t@r\fmtversion}
\@iflatexlater{2016/03/01}{
\newcommand{\wordboundary}{4095}}{
\newcommand{\wordboundary}{255}}
\makeatother

\newif\ifcode
\codefalse
\definecolor{Grey}{rgb}{0.40,0.40,0.40}
Expand All @@ -33,10 +40,10 @@
\XeTeXcharclass `. \mycharclassGrey
\XeTeXinterchartoks 0 \mycharclassGrey = {\bgroup\ifcode\color{Grey}\else\fi}

\XeTeXinterchartoks 4095 \mycharclassGrey = {\bgroup\ifcode\color{Grey}\else\fi}
\XeTeXinterchartoks \wordboundary \mycharclassGrey = {\bgroup\ifcode\color{Grey}\else\fi}

\XeTeXinterchartoks \mycharclassGrey 0 = {\egroup}
\XeTeXinterchartoks \mycharclassGrey 4095 = {\egroup}
\XeTeXinterchartoks \mycharclassGrey \wordboundary = {\egroup}
\fi %end magical operator highlighting
%End Reconfigured Pygments
((* endblock repygments *))
Expand Down
11 changes: 9 additions & 2 deletions nb_pdf_template/templates/style_jupyter_minted.tplx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
((( super() )))
% Pygments definitions
((* block repygments *))
\makeatletter
\newcommand*\@iflatexlater{\@ifl@t@r\fmtversion}
\@iflatexlater{2016/03/01}{
\newcommand{\wordboundary}{4095}}{
\newcommand{\wordboundary}{255}}
\makeatother

\newif\ifcode
\codefalse
\definecolor{Grey}{rgb}{0.40,0.40,0.40}
Expand All @@ -24,10 +31,10 @@
\XeTeXcharclass `. \mycharclassGrey
\XeTeXinterchartoks 0 \mycharclassGrey = {\bgroup\ifcode\color{Grey}\else\fi}

\XeTeXinterchartoks 4095 \mycharclassGrey = {\bgroup\ifcode\color{Grey}\else\fi}
\XeTeXinterchartoks \wordboundary \mycharclassGrey = {\bgroup\ifcode\color{Grey}\else\fi}

\XeTeXinterchartoks \mycharclassGrey 0 = {\egroup}
\XeTeXinterchartoks \mycharclassGrey 4095 = {\egroup}
\XeTeXinterchartoks \mycharclassGrey \wordboundary = {\egroup}
\fi %end magical operator highlighting
%End Reconfigured Pygments
((* endblock repygments *))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
long_description = f.read()

setup(name='nb_pdf_template',
version='2.1.dev1',
version='2.0.1',
description='LaTeX templates for jupyter notebook conversion to pdf',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 4c99034

Please sign in to comment.