diff --git a/converters/latex.py b/converters/latex.py index ca70e90..c85acfc 100755 --- a/converters/latex.py +++ b/converters/latex.py @@ -34,6 +34,7 @@ class ConverterLaTeX(Converter): extension = 'tex' documentclass = 'article' documentclass_options = '11pt,english' + equation_env = 'equation*' heading_map = {1: r'\section', 2: r'\subsection', 3: r'\subsubsection', @@ -71,7 +72,7 @@ class ConverterLaTeX(Converter): # tex file. # Tag the document at the top and set latex class - final = [r'%% This file was auto-generated by IPython, do NOT edit', + final = [r'%% This file was auto-generated by IPython.', r'%% Conversion from the original notebook file:', r'%% {0}'.format(self.infile), r'%%', @@ -133,8 +134,10 @@ class ConverterLaTeX(Converter): return lines def _img_lines(self, img_file): - return self.in_env('center', - [r'\includegraphics[width=0.7\textwidth]{%s}' % os.path.relpath(img_file, self.infile_dir), r'\par']) + rel_img_position = os.path.relpath(img_file, self.infile_dir) + return self.in_env('center', + [r'\includegraphics[width=0.7\textwidth]{%s}' % rel_img_position, + r'\par']) def _svg_lines(self, img_file): base_file = os.path.splitext(img_file)[0] @@ -151,8 +154,8 @@ class ConverterLaTeX(Converter): # output is a dictionary like object with type as a key if 'latex' in output: - lines.extend(self.in_env('equation', output.latex.lstrip('$$').rstrip('$$'))) - + lines.extend(self.in_env(self.equation_env, + output.latex.lstrip('$$').rstrip('$$'))) #use text only if no latex representation is available elif 'text' in output: lines.extend(self.in_env('verbatim', output.text)) @@ -182,7 +185,8 @@ class ConverterLaTeX(Converter): return [] def render_display_format_latex(self, output): - return self.in_env('equation', output.latex.lstrip('$$').rstrip('$$')) + return self.in_env(self.equation_env, + output.latex.lstrip('$$').rstrip('$$')) def render_display_format_json(self, output): # latex ignores json