diff options
author | Karl Berry <karl@freefriends.org> | 2013-10-07 23:03:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-10-07 23:03:40 +0000 |
commit | 71e1ef7201c8a380aa66cbdeb409aeeeb72ccc7e (patch) | |
tree | 439f2c755b08eeecf6f105c549a8e2bb7280cb23 /Master/texmf-dist/doc/latex/hepnames/mkmacrotables | |
parent | b1c0b4cd7b7d238d2bb2b035d2f88b1969f4e107 (diff) |
hepnames (7oct13)
git-svn-id: svn://tug.org/texlive/trunk@31856 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/hepnames/mkmacrotables')
-rwxr-xr-x | Master/texmf-dist/doc/latex/hepnames/mkmacrotables | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/hepnames/mkmacrotables b/Master/texmf-dist/doc/latex/hepnames/mkmacrotables new file mode 100755 index 00000000000..01c574ddea6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/hepnames/mkmacrotables @@ -0,0 +1,77 @@ +#!/bin/bash + +## For each package... +for package in hepnicenames heppennames; do + echo "Processing package $package" + + ## Make the macro list document fragment + TMP=macrolist-$$.tmp + > $TMP + echo "\begin{multicols}{2}{" >> $TMP + echo "\begin{itemize}" >> $TMP + cat ${package}.sty | egrep "^\\\DeclareRobustCommand|^%\\\DeclareRobustCommand" | \ + while read line; do + item=$( echo $line | sed -e s/'^%'// -e s/"DeclareRobustCommand{\([^}]*\)}[^%]*"/"\1"/g -e s/'%.*'//g ) + description=$( echo $line | sed -e s/'^.*DeclareRobustCommand[^%]*'//g -e s/'^%%.*'//g -e s/'^%\ *'//g ) + if [[ -n $description ]]; then description="$description\newline"; fi + echo "\item ${description} \texcmd{$(echo $item | sed -e s/'\ .*'/''/g)} \$\Rightarrow\$ \\${item}" >> $TMP + done + echo "\end{itemize}" >> $TMP + echo "}\end{multicols}" >> $TMP + + ## Make the LaTeX files + PKGOUT=${package}-macros.tex + echo "Making $PKGOUT" + cat $TMP > $PKGOUT + + for style in it rm; do + PKGOUT=${package}-${style}.tex + echo "Making $PKGOUT" + > $PKGOUT + if [[ "$style" = "rm" ]]; then pkgopts=""; else pkgopts="[italic]"; fi + SECTIONCMD="\section" + echo "\documentclass[12pt]{article}" >> $PKGOUT + echo "\usepackage${pkgopts}{${package}}" >> $PKGOUT + echo "\usepackage{a4wide,multicol,setspace,color}" >> $PKGOUT + echo "\title{Testing \\${package}}" >> $PKGOUT + echo "\author{Generated by \texttt{$USER}}" >> $PKGOUT + echo "\onehalfspacing" >> $PKGOUT + echo '\newcommand{\texcmd}[1]{\textcolor{red}{\texttt{\char`\\#1}}}' >> $PKGOUT + echo "\newcommand{\texenv}[1]{\textcolor{red}{\texttt{#1}}}" >> $PKGOUT + echo "\newcommand{\texopt}[1]{\textcolor{purple}{\texttt{#1}}}" >> $PKGOUT + echo "\newcommand{\texopts}[1]{\textcolor{purple}{\texttt{[#1]}}}" >> $PKGOUT + echo "\newcommand{\texarg}[1]{\textcolor{violet}{\texttt{#1}}}" >> $PKGOUT + echo "\newcommand{\texargs}[1]{\textcolor{violet}{\texttt{\{#1\}}}}" >> $PKGOUT + echo "\newcommand{\texpkg}[1]{\texttt{#1}}" >> $PKGOUT + echo "\newcommand{\texcls}[1]{\texttt{#1}}" >> $PKGOUT + echo "\newcommand{\gen}[1]{\ensuremath{\braket{#1}}}" >> $PKGOUT + echo >> $PKGOUT + echo "\begin{document}" >> $PKGOUT + echo "\maketitle" >> $PKGOUT + echo >> $PKGOUT + echo "$SECTIONCMD{Normal font}" >> $PKGOUT + cat $TMP >> $PKGOUT + echo "\clearpage" >> $PKGOUT + echo >> $PKGOUT + echo "$SECTIONCMD{Bold font}" >> $PKGOUT + echo "\textbf{" >> $PKGOUT + cat $TMP >> $PKGOUT + echo "}" >> $PKGOUT + echo "\clearpage" >> $PKGOUT + echo >> $PKGOUT + echo "$SECTIONCMD{Italic font}" >> $PKGOUT + echo "\textit{" >> $PKGOUT + cat $TMP >> $PKGOUT + echo "}" >> $PKGOUT + echo "\clearpage" >> $PKGOUT + echo >> $PKGOUT + echo "$SECTIONCMD{Bold italic font}" >> $PKGOUT + echo "\textbf{\textit{" >> $PKGOUT + cat $TMP >> $PKGOUT + echo "}}" >> $PKGOUT + echo >> $PKGOUT + echo "\end{document}" >> $PKGOUT + done + rm -f $TMP + +done |