Inspired by my question How to create a PDF presentation for each available Beamer theme automatically?, now I want to compile my input file for each available LaTeX font package installed in my machine.
Listing each font name in \foreach
as follows does not seem a good idea as it will not accommodate all available packages as well as it is not up-to-date.
% the file name of this code is inputfile.tex
% compile it with pdflatex -shell-escape inputfile.tex
\documentclass[preview,border=12pt,multi]{standalone}
\usepackage{filecontents}
\begin{filecontents*}{template.tex}
\documentclass[preview,border=12pt,12pt]{standalone}
\usepackage{\loadfont}
\usepackage{pgffor}
\usepackage{amsmath}
\usepackage{mathrsfs}
\begin{document}
\foreach \x in {1,...,26}{\char\numexpr\x+64\relax\char\numexpr\x+96\relax\space}
\begin{align*}
\sin (\alpha \pm\beta) &=\sin\alpha \cos \beta \pm \cos\alpha \sin\beta\\
\mathscr{L}\left\{f(t)\right\} &= F(s)\\
\vec{F} &= m\frac{\textrm{d}\vec{v}(t)}{\textrm{d}t}\\
\int_a^b f(x)\, \textrm{d}x &= F(b) -F(a)\\
\vec \nabla \cdot \vec \nabla \times A &= \vec\nabla \times \nabla U
\end{align*}
\end{document}
\end{filecontents*}
\usepackage{graphicx}
\usepackage{pgffor}
\def\dojob#1{\immediate\write18{pdflatex -jobname=template-#1 "\def\noexpand\loadfont{#1} \noexpand\input{template}"}}
\begin{document}
\foreach \x in {bera,palatino,mathpazo,helvet,libertine}
{%
\dojob{\x}%
\preview
\section{\x}
\includegraphics{template-\x}
\endpreview
}
\end{document}
A list of all installed packages (the list includes not only font packages but also other packages) can be done easily with this method How to print the list of packages installed on TeX Live to a file?. However, I have no idea to filter the list and remove the non-font packages.
How to compile the same input file for each of LaTeX font packages installed in our machine?
cygwin
etc..