Ejemplo n.º 1
0
 def render_markdown(self, cell):
     return [markdown2latex(cell.source)]
Ejemplo n.º 2
0
 def render_markdown(self, cell):
     return [markdown2latex(cell.source)]
Ejemplo n.º 3
0
	def render_markdown(self, cell):
        return [markdown2latex(cell.source)]
	def render_pyout(self, output):
        lines = []

                if 'latex' in output:
            lines.extend(output.latex)

        if 'text' in output:
            lines.extend(self.in_env('verbatim', output.text))

        return lines
	def render_pyerr(self, output):
                return self.in_env('traceback',                        self.in_env('verbatim',                                  remove_ansi('\n'.join(output.traceback))))
	def render_raw(self, cell):
        if self.raw_as_verbatim:
            return self.in_env('verbatim', cell.source)
        else:
            return [cell.source]
	def _unknown_lines(self, data):
        return [r'{\vspace{5mm}\bf WARNING:: unknown cell:}'] + \
          self.in_env('verbatim', data)
	def render_display_format_text(self, output):
        lines = []

        if 'text' in output:
            lines.extend(self.in_env('verbatim', output.text.strip()))

        return lines
	def render_display_format_html(self, output):
        return []
	def render_display_format_latex(self, output):
        if type(output.latex) == type([]):
            return output.latex
        return [output.latex]
	def render_display_format_json(self, output):
                return []
	def render_display_format_javascript(self, output):
                return []
	
	"""Converts a notebook to a .tex file suitable for pdflatex.

    Note: this converter *needs*:

    - `pandoc`: for all conversion of markdown cells.  If your notebook only
       has Raw cells, pandoc will not be needed.
    
    -  `inkscape`: if your notebook has SVG figures.  These need to be
       converted to PDF before inclusion in the TeX file, as LaTeX doesn't
       understand SVG natively.
    
    You will in general obtain much better final PDF results if you configure
    the matplotlib backend to create SVG output with 

    %config InlineBackend.figure_format = 'svg'

    (or set the equivalent flag at startup or in your configuration profile).
    """
	    user_preamble = None
	    exclude_cells = []


if sys.platform == 'darwin':
    inkscape = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape'
    if not os.path.exists(inkscape):
        inkscape = None