summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pythontex/pythontex_gallery.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/pythontex/pythontex_gallery.tex')
-rw-r--r--Master/texmf-dist/doc/latex/pythontex/pythontex_gallery.tex8
1 files changed, 5 insertions, 3 deletions
diff --git a/Master/texmf-dist/doc/latex/pythontex/pythontex_gallery.tex b/Master/texmf-dist/doc/latex/pythontex/pythontex_gallery.tex
index 29feb22c309..b74a3672547 100644
--- a/Master/texmf-dist/doc/latex/pythontex/pythontex_gallery.tex
+++ b/Master/texmf-dist/doc/latex/pythontex/pythontex_gallery.tex
@@ -4,19 +4,19 @@
% Detect pdftex/xetex/luatex, and load appropriate font packages.
% This is inspired by the approach in the iftex package.
% pdftex:
-\expandafter\ifx\csname pdfmatch\endcsname\relax
+\ifx\pdfmatch\undefined
\else
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\fi
% xetex:
-\expandafter\ifx\csname XeTeXinterchartoks\endcsname\relax
+\ifx\XeTeXinterchartoks\undefined
\else
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\fi
% luatex:
-\expandafter\ifx\csname directlua\endcsname\relax
+\ifx\directlua\undefined
\else
\usepackage{fontspec}
\fi
@@ -152,6 +152,8 @@ h = Integral(exp(-phi**2), (phi, 0, oo))
We can create plots with matplotlib, perfectly matching the plot fonts with the document fonts. No more searching for the code that created a figure!
+It is possible to pass page dimensions and similar contextual information from the \LaTeX\ side to the Python side. If you want your figures to be, for example, a particular fraction of the page width, you can pass the value of \pygment{latex}{\textwidth} to the Python side, and use it in creating your figures. See \pygment{latex}{\setpythontexcontext} in the main documentation for details.
+
You may want to use matplotlib's PGF backend when creating plots.
\begin{pylabblock}