[DEPRECATE] pdfcrop utility for image production

75 views
Skip to first unread message

Rob Beezer

unread,
Jul 7, 2020, 8:12:29 PM7/7/20
to pretext-...@googlegroups.com
If you use the pretext/pretext script (née script/mbx) to, for example,
generate tikz images for HTML output, read on. Otherwise you can skip this.

The "pdfcrop" key in the pretext.cfg file has long been set to the pdfcrop
utility, which has been problematic, especially for Windows users. It now needs
the "pdf-crop-margins" utility, which is a PyPi (Python) package and so is "pip
installable" with

pip install pdfCropMargins

Notes:

1. If you have a personal pretext.cfg file you need to edit

pdfcrop = pdfcrop => pdfcrop = pdf-crop-margins

2. If Python's "pip" drives you crazy, you might enjoy a virtual environment.
See steps (2) and (3), and adapt step (4):

https://pretextbook.org/doc/guide/html/runestone-build.html

3. I used Ubuntu's version of "pip" which has a mind of its own. I eventually
found the executable and had to set

pdfcrop = /home/rob/.local/bin/pdf-crop-margins

Note the dot. ;-) Your mileage will definitely vary.

4. Why the disruptive change?

(i) Accomodating pdfcrop on 32-bit Windows systems was the last bit of
Windows-specific code in the pretext/pretext script. Gone now. This is a big
win for attracting and supporting authors with Windows systems (I hear some
people have no choice!).

(ii) More and more, PreTeXt is maturing to depend on/assume a Python
installation, rather than xsltproc at the command-line. This should largely
be a cross-platform solution, or at least will be more manageable. So if (1)
and (2) above make you throw your hands up, realize it will be a big win for
attracting and supporting authors on every operating system.

(iii) This change is motivated by the current work on a CLI being developed by
Steven C and Oscar L, which will hasten (ii).

Please use -support or -dev with questions or gotchas.

Rob
Reply all
Reply to author
Forward
0 new messages