From 6204f961764f1ecb8838e5d98eaa33ec5eb082af Mon Sep 17 00:00:00 2001 From: Tyler Makaro Date: Sat, 7 Oct 2017 13:23:50 -0700 Subject: [PATCH 1/4] Added MathJax compatibility definitions Added definitions for \TeX and \LaTeX similar to those that MathJax uses to allow LaTeX to properly compile these. --- nbconvert/templates/latex/base.tplx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nbconvert/templates/latex/base.tplx b/nbconvert/templates/latex/base.tplx index 3c4e39475..650d529c1 100644 --- a/nbconvert/templates/latex/base.tplx +++ b/nbconvert/templates/latex/base.tplx @@ -100,7 +100,8 @@ This template does not define a docclass, the inheriting class must define this. \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}} \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} - \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} + +\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} @@ -138,6 +139,8 @@ This template does not define a docclass, the inheriting class must define this. % Math Jax compatability definitions \def\gt{>} \def\lt{<} + \def\TeX{\mbox{T\kern-.14em\lower.5ex\hbox{E}\kern-.115em X}} + \def\LaTeX{\mbox{L\kern-.325em\raise.21em\hbox{$\scriptstyle{A}$}\kern-.17em}\TeX} % Document parameters % Document title ((* block title -*)) From 7c85cb823fab5891c706b66e027ad7776dc3bba9 Mon Sep 17 00:00:00 2001 From: Tyler Makaro Date: Sat, 7 Oct 2017 13:29:33 -0700 Subject: [PATCH 2/4] indentation error --- nbconvert/templates/latex/base.tplx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbconvert/templates/latex/base.tplx b/nbconvert/templates/latex/base.tplx index 650d529c1..b9b003f6b 100644 --- a/nbconvert/templates/latex/base.tplx +++ b/nbconvert/templates/latex/base.tplx @@ -101,7 +101,7 @@ This template does not define a docclass, the inheriting class must define this. \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} -\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} + \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} From a496b6b621b31d370a98b406b942e49ce1d5a109 Mon Sep 17 00:00:00 2001 From: Tyler Makaro Date: Sat, 7 Oct 2017 13:35:54 -0700 Subject: [PATCH 3/4] removed blank line My first commit added the extra blank line, so this fixes it. --- nbconvert/templates/latex/base.tplx | 1 - 1 file changed, 1 deletion(-) diff --git a/nbconvert/templates/latex/base.tplx b/nbconvert/templates/latex/base.tplx index b9b003f6b..3da12a5bd 100644 --- a/nbconvert/templates/latex/base.tplx +++ b/nbconvert/templates/latex/base.tplx @@ -100,7 +100,6 @@ This template does not define a docclass, the inheriting class must define this. \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}} \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} - \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} From 69285de43df5b96859c7784f97f70e910ee74c21 Mon Sep 17 00:00:00 2001 From: Tyler Makaro Date: Tue, 17 Oct 2017 15:20:32 -0700 Subject: [PATCH 4/4] Updated compatibility definitions These new definitions allow for the original LaTeX and TeX logos inside of math mode. --- nbconvert/templates/latex/base.tplx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nbconvert/templates/latex/base.tplx b/nbconvert/templates/latex/base.tplx index 3da12a5bd..222ea40f4 100644 --- a/nbconvert/templates/latex/base.tplx +++ b/nbconvert/templates/latex/base.tplx @@ -138,8 +138,10 @@ This template does not define a docclass, the inheriting class must define this. % Math Jax compatability definitions \def\gt{>} \def\lt{<} - \def\TeX{\mbox{T\kern-.14em\lower.5ex\hbox{E}\kern-.115em X}} - \def\LaTeX{\mbox{L\kern-.325em\raise.21em\hbox{$\scriptstyle{A}$}\kern-.17em}\TeX} + \let\Oldtex\TeX + \let\Oldlatex\LaTeX + \renewcommand{\TeX}{\textrm{\Oldtex}} + \renewcommand{\LaTeX}{\textrm{\Oldlatex}} % Document parameters % Document title ((* block title -*))