sphinx_howto.py
45 lines
| 1.6 KiB
| text/x-python
|
PythonLexer
|
r10677 | """ | ||
Exporter for exporting notebooks to Sphinx 'HowTo' style latex. Latex | ||||
formatted for use with PDFLatex. | ||||
""" | ||||
|
r10588 | #----------------------------------------------------------------------------- | ||
# 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 | ||||
#----------------------------------------------------------------------------- | ||||
|
r10677 | from IPython.utils.traitlets import Unicode | ||
|
r10880 | from IPython.config import Config | ||
|
r10677 | |||
|
r10588 | # local import | ||
|
r11089 | from .latex import LatexExporter | ||
|
r10677 | |||
|
r11089 | from IPython.nbconvert import transformers | ||
|
r10677 | |||
|
r10588 | #----------------------------------------------------------------------------- | ||
# Classes | ||||
#----------------------------------------------------------------------------- | ||||
|
r11089 | class SphinxHowtoExporter(LatexExporter): | ||
|
r10677 | """ | ||
Exports Sphinx "HowTo" LaTeX documents. The Sphinx "HowTo" exporter | ||||
produces short document format latex for use with PDFLatex. | ||||
""" | ||||
|
r10624 | template_file = Unicode( | ||
|
r10630 | 'sphinx_howto', config=True, | ||
|
r10624 | help="Name of the template file to use") | ||
|
r10880 | |||
|
r10588 | def _register_transformers(self): | ||
#Register the transformers of the base class. | ||||
|
r10639 | super(SphinxHowtoExporter, self)._register_transformers() | ||
|
r10588 | |||
|
r10624 | #Register sphinx latex transformer | ||
|
r11367 | self.register_transformer(transformers.SphinxTransformer, True) | ||