##// END OF EJS Templates
Use equation_env variable, PEP8 adaptation
jakobgager -
Show More
@@ -34,6 +34,7 b' class ConverterLaTeX(Converter):'
34 34 extension = 'tex'
35 35 documentclass = 'article'
36 36 documentclass_options = '11pt,english'
37 equation_env = 'equation*'
37 38 heading_map = {1: r'\section',
38 39 2: r'\subsection',
39 40 3: r'\subsubsection',
@@ -71,7 +72,7 b' class ConverterLaTeX(Converter):'
71 72 # tex file.
72 73
73 74 # Tag the document at the top and set latex class
74 final = [r'%% This file was auto-generated by IPython, do NOT edit',
75 final = [r'%% This file was auto-generated by IPython.',
75 76 r'%% Conversion from the original notebook file:',
76 77 r'%% {0}'.format(self.infile),
77 78 r'%%',
@@ -133,8 +134,10 b' class ConverterLaTeX(Converter):'
133 134 return lines
134 135
135 136 def _img_lines(self, img_file):
136 return self.in_env('center',
137 [r'\includegraphics[width=0.7\textwidth]{%s}' % os.path.relpath(img_file, self.infile_dir), r'\par'])
137 rel_img_position = os.path.relpath(img_file, self.infile_dir)
138 return self.in_env('center',
139 [r'\includegraphics[width=0.7\textwidth]{%s}' % rel_img_position,
140 r'\par'])
138 141
139 142 def _svg_lines(self, img_file):
140 143 base_file = os.path.splitext(img_file)[0]
@@ -151,8 +154,8 b' class ConverterLaTeX(Converter):'
151 154
152 155 # output is a dictionary like object with type as a key
153 156 if 'latex' in output:
154 lines.extend(self.in_env('equation', output.latex.lstrip('$$').rstrip('$$')))
155
157 lines.extend(self.in_env(self.equation_env,
158 output.latex.lstrip('$$').rstrip('$$')))
156 159 #use text only if no latex representation is available
157 160 elif 'text' in output:
158 161 lines.extend(self.in_env('verbatim', output.text))
@@ -182,7 +185,8 b' class ConverterLaTeX(Converter):'
182 185 return []
183 186
184 187 def render_display_format_latex(self, output):
185 return self.in_env('equation', output.latex.lstrip('$$').rstrip('$$'))
188 return self.in_env(self.equation_env,
189 output.latex.lstrip('$$').rstrip('$$'))
186 190
187 191 def render_display_format_json(self, output):
188 192 # latex ignores json
General Comments 0
You need to be logged in to leave comments. Login now