

Just by changing several lines of code, we can create completely different figures. The Elsevier article class helps you to format the frontmatter of your manuscript properly. Change output to whatever name you like in both in this step and below. Notice how we create these figures in batch. Follow these few steps: Create a batch file containing the command mkdir output, which will create a folder named output when run. We can see that now the style of text in the article is the same as the style in figures. OutArray = NoEscape(r'$\sqrt\linewidth'.format(1.0 / len(graphInfo) * 0.9))įigure.add_image(filenameFormat.format(i), width=lineWidthStr) # the '$' character should not be escaped OutArray = * 10 for _ in range(20)]ĬolIndex, rowIndex = divmod(number - 1, 20) # the output is gonna be of 20 rows, 10 columns % I am using article class because pythontex doesn't seem

To use the package, first include the package in the preamble, and compile it as usual. I usually create a symbolic link to this file in my working directory so that I can refer to this file by pythontex.py. The key component of the package is pythontex.py under the package directory (usually it is /texmf/scripts/pythontex). For MikTex, it can be installed by the package manager. For texlive, the package is probably already installed. The installation of pythontex package varies for different \(\TeX\) distributions. Accompanied by the Python package PyLaTeX, we can do many amazing things at high efficiency. The idea behind pythontex is simple: when you print something with your Python code, instead of writing your outputs to stdout, they are actually redirected to the \(\LaTeX\) document. There is a very interesting solution, however, that is compatible with all tex compilers and constructs an interface between Python and \(\LaTeX\). But due to the prevalence of pdflatex and xetex, I seldom use LuaTex. A \cite (or \autocite) command is inserted in TeXstudio and its mandatory argument contains the (list of) key (s) of the reference (s) you have selected. Switch to Jabref, select the reference (s) you want to cite and click on the TeXstudio plugin icon. LuaTex is already a very unique and successful attempt to expose the low-level features of the \(\TeX\) compiler to a generic programming language. Put the cursor in TeXstudio where you want to cite reference (s). Fortunately, being a compiled (scripting) language, \(\LaTeX\) has a much larger room for customization, and it can do many things that WYSIWYG editors can only dream of. Using pythontex and matplotlib to generate beautiful scientific figures rapidlyĭespite being lengthy and obscure, \(\LaTeX\) is still one of the most popular typesetting systems for academic literature.
