Not sure if this is a strictly appropriate question (I hope so, because it has to do with TeX-related tools) but I need to know whether or not my texliveonfly.py script runs successfully on OS X. Unfortunately, I don't have access to a mac, or I would test it myself! While it seems theoretically solid, I need practical test results before submitting the update to CTAN.
Steps to testing:
0) Please make sure you have python 3 (can be downloaded here). Python 2 should be available by default (though feel free to try using python 3 as well).
1) Right click and save this link as texliveonfly.py and make sure the file is executable. (Addendum: if you just want to read the script, see here.)
*Update: Script is now version 1.10 and should graphically prompt you for the admin password. Furthermore, run with option --speech_when=always to test the speech-synthesized notifications.*
2) Create a minimal .tex file of the following form (though, of course, you should feel free to test with arbitrary .tex files):
\documentclass{memoir}
\usepackage{package(s) you have not yet downloaded}
\usepackage{package(s) you have not yet downloaded}
\begin{document}
placeholder
\end{document}
3) Run the command texliveonfly.py yourfilename.tex
in a terminal (once assuring everything's in the same folder, of course).
Expected output: new terminals should pop up, at least one asking your sudo password in order to perform updates. The new terminals should quit when they're done. Most will start with text similar to:
This is texliveonfly.py's 'install packages on the fly' feature.
-------------
Attempting to install LaTeX packages [packagenames].
The terminals might take 3-20 seconds to pop up, depending on internet connection (the tlmgr repository access is slower than you're used to). Several may pop up in total, because what the script does is keeps recompiling and searching for missing package errors until there are none left.
Should the script fail to update packages or for whatever reason, please paste its terminal output somewhere (if it's too long, perhaps on pastebin!)
If the applescript command is somehow messed up (unlikely), there is also the possibility of an infinite loop. Just Ctl + C or kill your terminal if that's the case, though please wait a while to allow for repository lag.
(As of version 1.00, the default compiler is now the more mainstream "pdflatex". You can change it by, for example, texliveonfly.py --compiler=lualatex yourfilename.tex
).
Additional things you can test for, if you're feeling eager:
The script should allow you to interact with the compiler when you don't pass
-interaction=nonstopmode
. You can do this by setting--arguments=""
in the texliveonfly.py command.The script should provide (with a few added lines) the same terminal output as your compiler.
And finally, the ultimate test:
The script should allow you to, starting from a minimal TeX Live installation, download precisely the additional packages you require.
os.name
yieldsposix
. This should be fixed by replacing the condition withplatform.system() == 'Darwin'
, see this post. (Do not forget toinclude platform
.) – Franklin Yu Oct 13 '15 at 5:32