##// END OF EJS Templates
Fixed all broken references, refactored some stuff here and there,...
Fixed all broken references, refactored some stuff here and there, standardized nomenclature. Ready to test...

File last commit:

r10624:bfa8f97c
r10624:bfa8f97c
Show More
latex.py
43 lines | 1.5 KiB | text/x-python | PythonLexer
"""Latex transformer.
Module that allows latex output notebooks to be conditioned before
they are converted.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import print_function, absolute_import
# Our own imports
# Needed to override transformer
from .activatable import (ActivatableTransformer)
from filters import latex
#-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
class LatexTransformer(ActivatableTransformer):
"""
Converter for latex destined documents.
"""
def cell_transform(self, cell, other, index):
"""
Apply a transformation on each cell,
receive the current cell, the resource dict and the index of current cell as parameter.
Returns modified cell and resource dict.
"""
if hasattr(cell, "source") and cell.cell_type == "markdown":
cell.source = latex.rm_math_space(cell.source)
return cell, other