Books/NT/latex/chapters/w.sh
2026-06-30 08:19:02 -07:00

32 lines
558 B
Bash

#!/bin/bash
for f in *.tex; do
# Skip files that are already wrappers or special files
[[ "$f" == *-w.tex ]] && continue
[[ "$f" == _* ]] && continue
[[ "$f" == BiblioRef.tex ]] && continue
base="${f%.tex}"
wrapper="${base}-w.tex"
cat > "$wrapper" << EOF
% !TEX root = ${wrapper}
% ${wrapper}
\input {_header}
\excludecomment{glossarytext}
\input {_glossary}
\begin{document}
\input{_BiblioRef}
\input{${base}}
\includecomment{glossarytext}
\input {_glossary}
\end{document}
EOF
echo "Created ${wrapper}"
done