![]() ![]() Publish_date = Unicode("", config=True, help=""" You can leave this blank if you do not want to render a release name. Release = Unicode("", config=True, help=""" You can leave this blank if you do not want to render a version number. Version = Unicode("", config=True, help=""" The author, version, release, date, and chapter_style traits shouldĪuthor = Unicode("Unknown Author", config=True, help="Author name") You for input during the conversion process. Interactive = Bool(False, config=True, help="""Īllows you to define whether or not the Sphinx exporter will prompt It is mostly scraped out of version 1.x iPython's nbconvert/transformers/sphinx.py and hacked to be a modern Preprocessor:įrom _future_ import print_function, absolute_importįrom import Preprocessorįrom import Bool, UnicodeĬlass MySphinxyLatexPreprocessor(Preprocessor): The first (I called it oldschool.py) does the preprocessing necessary to use the older templates. We'll do this back in the directory where the notebook you want to convert lives. ((*- if *))Ĭut and paste the above code to create the patch file. ((* set cell_style = 'style_ipython.tplx' *)) Nbconvert -to latex yourNotebook.ipynb -template article1 -to PDF Delete my empty "maketitle" block if you want to have a title page with an author and a date. I blank out the "maketitle" block so there's no title page. The "margins" block produces front matter for LaTex, and the "predoc" block produces commands and text that are inserted at the start of the document. The following version creates a different output style that I personally find useful. You can find nice templates to help you make output look like what you want atĪnother approach is to roll a new template, starting with the ones in To make yourself the author, add a line like the following right after the ![]() Since the converter no longer uses the Sphinx documentclass or the Sphinx preprocessing system, you can't use the ![]()
0 Comments
Leave a Reply. |