PSTricks

29 views
Skip to first unread message

Rob Beezer

unread,
Feb 5, 2018, 2:58:28 AM2/5/18
to pretext...@googlegroups.com
Is anybody using PSTricks successfully via latex-image and
latex-image-preamble? I've had a request off-list to support such a thing, and
am moving the discussion here.

Edited transcript follows:

Rob -
> I strongly suspect you can use the PreTeXt "latex-image" and
> "latex-image-preamble" elements to incorporate PSTricks diagrams. I may give
> it a try later today in hopes of putting it into the documentation.


Alex -
> In PTX, the "latex-image" element (formerly "latex-image-code" if you see that
> in any discussions or documentation) is supposed to take /any/ relatively
> self-contained snippet of latex code. Almost, if not all examples up right now
> use a \begin{tikzpicture}...\end{tikzpicture} environment.
>
> In the book's docinfo, you need to have "latex-image-preamble". Again, right now
> pretty much all examples are using tikz, so this element has lines like
> \usepackage{tikz} or \usepackage{pgfplots}, plus some other tikz global settings.
>
> But I believe you could put all pstricks-related preamble stuff in the
> "latex-image-preamble", and then use "latex-image" elements with
> \begin{pspicture}...\end{pspicture} and all should work out well as long as the
> code doesn't need shell-escape or something like that.
>
> Note that you want to put pstricks preamble stuff in "latex-image-preamble", but
> not in any other PTX preamble insertion device, like say latex.preamble.late.


Alex -
> OK, remembered one thing. Once upon a time pstricks did not play with pdflatex.
> It only played with latex, dvips, etc. I stopped using it, and I have an inkling
> that now it works with pdflatex...maybe?
>
> But anyway, with PTX, you may want to stick with something that works with
> xelatex, and maybe Rob can tell you under what conditions pdflatex will be
> acceptable. Unsure about just plain old latex though. Hopefully that is not an
> impediment to using pstricks.


Rob -
Thanks, Alex, for both messages, which jibe well with my own recollections.

Almost never is xelatex a bad idea. Perhaps the default mbx.cfg file will
need to specify one or the other latex engine for success with PSTricks.

Rob Beezer

unread,
Feb 5, 2018, 10:21:00 AM2/5/18
to pretext...@googlegroups.com
Answering my own question. Success with one example, but it required xelatex
as the tex engine (for both plain LaTeX, and SVG generation with the mbx
script). And the SVG looks quite compact (ie good quality).

Maybe a [pdf] option to the package, along with "--shell-escape" can succeed
with pdflatex, but I gave up after a few tries.

I'm going to get into the (rough) documentation now - stay tuned.

Rob

Rob Beezer

unread,
Feb 5, 2018, 11:45:13 AM2/5/18
to pretext...@googlegroups.com
No new code, just a working example. But it lives in the "Characters, Fonts,
and Languages" document, since it is meant to be processed with xelatex. Find
it at the very end.

Any progress with pdflatex would be welcome, but I don't intend to pursue it
myself.

http://mathbook.pugetsound.edu/examples/fonts/html/section-11.html

http://mathbook.pugetsound.edu/examples/fonts/fonts-and-characters.pdf
Reply all
Reply to author
Forward
0 new messages