2017-10-30 09:33:37 -05:00
|
|
|
#!/bin/bash
|
2017-07-15 10:35:02 -05:00
|
|
|
|
|
|
|
|
2017-10-30 09:33:37 -05:00
|
|
|
#echo "Args: $*"
|
|
|
|
|
2017-07-15 10:35:02 -05:00
|
|
|
document=`basename -s .rst ${@:$#}`
|
|
|
|
sources=${@:1:$(($# -1))}
|
|
|
|
|
|
|
|
echo "Document: ${document}.rst"
|
|
|
|
echo "Sources: ${sources}"
|
|
|
|
|
|
|
|
rm -f ${document}.rst
|
|
|
|
for source in ${sources}; do
|
|
|
|
source=`basename ${source}`
|
|
|
|
if [ "${source}" != "pdfHeader.rst" ]; then
|
|
|
|
tail -n +4 ${source} | \
|
|
|
|
sed 's,:ref:`\([^`]*\)`,`\1`_,' \
|
|
|
|
>> ${document}.rst
|
|
|
|
else
|
|
|
|
cat ${source} >> ${document}.rst
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
export TEXINPUTS=../etc/images//:./images//:
|
|
|
|
rst2latex --use-latex-toc --stylesheet=../etc/SoC-ReST.tex ${document}.rst ${document}-raw.tex
|
|
|
|
sed 's, \\& \\\\multicolumn{2}{l|}{, \\& \\\\multicolumn{2}{p{0.6\\\\DUtablewidth}|}{,' ${document}-raw.tex > ${document}.tex
|
|
|
|
pdflatex ${document}
|
|
|
|
pdflatex ${document}
|
|
|
|
|
|
|
|
rm -f ${document}.rst \
|
|
|
|
${document}-raw.tex \
|
|
|
|
${document}.tex \
|
|
|
|
${document}.log \
|
|
|
|
${document}.out \
|
|
|
|
${document}.aux \
|
|
|
|
${document}.toc
|