Skip to content
/ PDFTex Public

An easy way to generate PDF files which could be imported into overleaf with python/matplotlib

License

Notifications You must be signed in to change notification settings

fvarno/PDFTex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDFTex

An easy way to generate PDF files which could be imported into overleaf with python/matplotlib

Perquisites

apt get install inkscape

Installation

pip install pdftex==1.0.0

Example

import numpy as np
import matplotlib as mpl
mpl.use('module://pdftex.pdftex')

fig, ax = plt.subplots(nrows=1, figsize=(10, 5))
ax.plot(np.arange(5), np.arange(5)*5+1)
ax.set_xlabel("\$\\alpha\$")
fig.savefig('test.pdf_tex')

If everything goes through as it should, two files are generated:

test.pdf_tex test.pdf

Put these two files always together when using in your LaTeX document.

An example of importing the generated figures in LaTex document is:

\begin{figure}
    \centering
    \def\svgwidth{12.0cm}
    \input{test.pdf_tex}
    \caption{A sample figure.}
    \label{fig:test}
\end{figure}

About

An easy way to generate PDF files which could be imported into overleaf with python/matplotlib

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages