Extensions#
Current Limitations#
The issues currently facing this plugin are the following:
The
pdfcrop
CLI tool has issues cropping to content, we need to tweak this so that the rendered pages are contiguous and enlarged properly. There are two parts involved in changing this: (1) withpdfcrop
and (2) adjusting the default<xml>
header that jupytexmagic prepends to each.svg
.Once the cropping is fixed, we need to find a way to automatically change the tags of
%%tex
code cells to have eitherhide-input
orhide-code
so that the large tex source code is hidden upon compilation. There’s code to do this provided by Jupyter, so this shouldn’t be too hard to incorporate.The
svg
files render fine in Jupyter Lab and Jupyter Book, but when displayed on other platforms (e.g. GitHub or Jupyter Notebook) the glyph sizing gets thrown into disarray as text size varies across the document. Not sure how to fix this, but isn’t a problem related to publishing or authoring Jupyter Books with Jupyter Lab.
Future Extensions#
I’d like to develop code which uses the jupytexmagic
plugin to port LaTeX projects into OPE automatically. This feature would be immensly powerful because it would provide an avenue for publishing existing projects online with the click of a button. Almost all scientific papers, textbooks, and documents are written using LaTeX, so if OPE provides a unique way for people to easily display their LaTeX projects online, this would exponentially increase the adoption of OPE worldwide.
This tool would operate as follows:
copy the entire file tree of the source code project into the OPE book created by
ope new_book
copy the metadata of this project into
$books/conent/{BOOKNAME}_toc.yml
run
make
inside the$books/{BOOKNAME}/content
directory to initialize all of the.ipynb
files for each correspondingtex
source file as specified in$books/content/{BOOKNAME}_toc.yml
for formatting documents, leave the .tex source code in the directory to allow for proper imports (e.g. you cannot import formatting code from another
%%tex
code cell currently, so needs to be separate)copy all of the LaTeX source code into
%%tex
cells for each corresponding fileInside
$books/${BOOKNAME}
runmake
andmake pub
and enjoy viewing your content on GitHub pages (link is automatically printed bymake pub
)