1

While running the package-supplied *.tex samples for pagelayout.cls, I am getting error messages. That alone is odd, because I would expect those examples to be rock-solid. The errors claim that the compiler didn't have shell access, and so it aborted the run.

I have tried the same files in TexWorks and in Kile....same errors reported. And neither of them suggest a way of resolving the problem.

Any ideas about why this error is occurring?

PS--would someone with a reputation >300 please add the "pagelayout" tag (tag zfpagelayout exists, but it is not the same package)

*******************Update, reply to Friedmann ************ ImageMagick version is 6.9.11.60. I cannot find a way to upgrade to 7 or higher. there are no higher versions in the Linux_Mint synaptic repository. I tried updating via sudo apt update but that failed.

I ran xelatex example-borders-and-shadows.tex as you suggested and I got this error message at the end of several dozen lines:

/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
runpopen command not allowed: extractbb

! I can't find file `"|extractbb --version"'. <to be read again> \scan_stop: l.72 \l__sys_internal_tl

(Press Enter to retry, or Control-D to exit) Please type another input file name:

Birdman
  • 135
  • The package pagelayouts needs shell-escape to run as can be seen in /scripts/pagelayoutapi and the errors present in pagelayout.cls (if you CTRL+F and type "shell" you can see the error messages/commands). The way around it is to enable shell-escape, if you have a full installation of TeXlive (where TeXworks comes from) then you can use arara to do shell-escape like % arara: pdflatex: {shell: yes, options: [-halt-on-error]}, you need to setup the path to arara in TeXworks like this: https://tex.stackexchange.com/a/98795/273733 – JamesT Feb 24 '23 at 07:02
  • I am not sure how to do it in native LaTeX or with latexmk as I use arara exclusively, hopefully someone else can help with that (note: the -halt-on-error option is so that if errors cause the programme to end without compiling it doesn't leave pdflatex.exe hanging and not being able to delete aux files, if that happens you need to kill the process manually) – JamesT Feb 24 '23 at 07:03
  • I wouldn't run examples with --shell-escape without first inspecting them carefully. --shell-escape gives them access to your computer. – Ulrike Fischer Feb 24 '23 at 08:31
  • Ulrike: Are you suggesting that the examples included by the creator of pagelayout.cls (Mssr. F. Bartels) would actually have malicous content? Is the shell script actually capable of behaving maliciously? – Birdman Feb 24 '23 at 19:57
  • I set up arara, and got further (that is, fewer error messages). But I still got an error message execcv forbidden – Birdman Feb 25 '23 at 06:41
  • Discovered that you need to add the pagelayout api file to the "personal" texmf.cnf file. This file was essentially empty, except for a "readme" header. So this has been updated, but I cannot run "sudo texhash". If I run texhash (no sudo), I get replies that the files are not writeable. If I try sudo texhash, I get an error saying that texhash command does not exist . Very strange, because I do remember running sudo texhash in the past, and it worked. Any ideas? – Birdman Feb 25 '23 at 06:55
  • @Birdman Nobody is suggesting that the creators of whatever packages are trying to hack your computer. But consider this: 1) As (La)TeX software is mostly open source, virtually everybody can edit code or upload files which may end up on your computer as examples. 2) Even if nobody intentionally wants to harm you, errors in the code can still affect your computer. Therefore, you should avoid using --shell-escape with files that you do not fully know the contents of. – Jasper Habicht Mar 01 '23 at 00:56

1 Answers1

0

Troubleshooting shell access with pagelayout class:

  1. Make sure Inkscape version 1.0 or higher is installed by running inkscape --version.

  2. Make sure ImageMagick version 7.0 or higher is installed by running magick --version.

  3. Make sure the pagelayoutapi script is installed by running pagelayoutapi --version.

  4. Try to build the example example-borders-and-shadows.tex by running xelatex example-borders-and-shadows.tex. If an error occurs type H for help and follow the instructions.

If you still run into errors, please let me know:

  • the exact error
  • your TeX distribution
  • how you installed the package

Note: after updating the texmf.cnf you do not need to run sudo texhash. This command is only required when manually installing the package.

  • Inkscape is OK. Pagelayoutapi is OK. ImageMagick version is 6.9.11.60 (see edits in the original question). Xelatex run fails (see edits in the original question). Thanks, Friedemann, for your response...very much appreciated. – Birdman Mar 01 '23 at 05:20
  • Oh, I had installed the pagelayout.cls package using the tlmgr --gui. That was on 24th Feb, after nuke-and-pave and reinstall of TexLive 2022. Today, tlmgr does NOT work anymore. See my latest question on this forum, added today. – Birdman Mar 01 '23 at 05:22
  • Is there a particular Path setting that pagelayout.cls (or, indeed, LaTeX) uses to locate Imagemagick, Inkscape when those supporting programs are called? – Birdman Mar 02 '23 at 22:02
  • It seems like I have resolved problems with shell access now. – Birdman Mar 05 '23 at 17:58
  • But, issues with "inkscape not found" and "imagemagick not found" are still present even though they are in my $PATH. I checked $PATH from the directory of TeXLive 2022 and they are both there. These error messages are definitely generated by the code 'pagelayout.cls' (for examples, at lines 3660, 3661), but I've been unable to discover where 'pagelayout.cls' expects to find these accessory programs. And with particular reference to Imagemagick, which of the individual routines of I.M. does it require? – Birdman Mar 05 '23 at 18:03
  • I fixed a bug with version 1.0.4 where the "inkscape not found" error was shown when Inkscape was installed, but not ImageMagick 7. Even if ImageMagick 7 is not installed, now you should be able to build the file example-borders-and-shadows.tex. ImageMagick is called with the command magick when using image optimization or the preflight mode. – Friedemann Mar 06 '23 at 16:32
  • PS: I recognized that the installation of ImageMagick 7 on Linux is not always possible with the default package manager. So I am considering to support ImageMagick 6 too in the future. – Friedemann Mar 06 '23 at 16:36
  • Hello, Friedemann: You say 'ImageMagick is called with the command `magick'. But when I run 'whereis magick' and 'magick --version' from the terminal, 'magick' is not found. So...what file, or script...etc...is the command 'magick' supposed to point to? – Birdman Mar 07 '23 at 22:35
  • Friedemann: I have updated pagelayout.cls on my computer and, as you predicted, the file 'example-borders-and-shadows.tex' now functions properly. Meanwhile, Imagemagick isn't working (for example, compile of 'example-graphic.tex' fails). – Birdman Mar 10 '23 at 06:17
  • I took the plunge: downloaded Imagemagick v7, updated the dependencies, installed etc and now I have a working copy of v7. Pagelayout.cls seems to work seamlessly now, no faults with the file example-graphic.tex now! I just need to resolve a hiccup with Imagemagick v7 linkage within the 'desktop menu' now. Thanks for all the help; now I can get down to using the pagelayout.cls and generating REAL questions about the vagaries of that class's application to the work at hand! – Birdman Mar 10 '23 at 21:04