This commit is contained in:
Ridoncules 2014-08-19 14:07:20 +00:00
commit fb216200bf
2 changed files with 31 additions and 6 deletions

View File

@ -3,7 +3,7 @@ pdflatex.sh
=========== ===========
:Author: Michał Kalewski :Author: Michał Kalewski
:Version: 3.2.0 :Version: 3.3.0
:License: MIT License :License: MIT License
:Bug reports: https://github.com/mkalewski/pdflatex.sh/issues :Bug reports: https://github.com/mkalewski/pdflatex.sh/issues
@ -16,7 +16,7 @@ Synopsis
pdflatex.sh [ +3 +b +h +i +o +p +s +sync ] FILE(.tex) pdflatex.sh [ +3 +b +h +i +o +p +s +sync ] FILE(.tex)
pdflatex.sh -2x1 | -2x2 FILE(.pdf) pdflatex.sh -2x1 | -2x2 FILE(.pdf)
pdflatex.sh -gs | -rs | -gd | -rd DIR pdflatex.sh -gs | -rs | -gd | -rd DIR
pdflatex.sh -b | -c | -i | -k | -kk | -l [WIDTH] | -n | -s | -ss pdflatex.sh -b | -c | -i | -g | -k | -kk | -l [WIDTH] | -n | -s | -ss
| -sc [LANG] FILE(.tex) | -sc [LANG] FILE(.tex)
Description Description
@ -85,6 +85,10 @@ Options
Make ONLY index (MakeIndex). Make ONLY index (MakeIndex).
``+i`` ``+i``
Make ALSO index (MakeIndex). Make ALSO index (MakeIndex).
``-g FILE``
Make ONLY glossaries (MakeGlossaries).
``+g``
Make ALSO glossaries (MakeGlossaries).
``-k FILE`` ``-k FILE``
Run the ``chktex`` command (if available). Run the ``chktex`` command (if available).
``-kk FILE`` ``-kk FILE``

View File

@ -34,7 +34,7 @@
# VERSION # VERSION
# ======= # =======
VERSION=3.2.0 VERSION=3.3.0
# PROGRAMS # PROGRAMS
@ -48,6 +48,7 @@ DIA_PROGRAM="dia"
INKSCAPE_PROGRAM="inkscape" INKSCAPE_PROGRAM="inkscape"
LATEX_PROGRAM="latex" LATEX_PROGRAM="latex"
MAKEINDEX_PROGRAM="makeindex" MAKEINDEX_PROGRAM="makeindex"
MAKEGLOSSARIES_PROGRAM="makeglossaries"
PDF_VIEWER_PROGRAM="evince" PDF_VIEWER_PROGRAM="evince"
PDFLATEX_PROGRAM="pdflatex" PDFLATEX_PROGRAM="pdflatex"
PDFNUP_PROGRAM="pdfnup" PDFNUP_PROGRAM="pdfnup"
@ -77,7 +78,7 @@ OUTPUT_DIRECTORY=
# Extensions of auxiliary files: # Extensions of auxiliary files:
AUXILIARYEXTS=\ AUXILIARYEXTS=\
"aux idx ilg ind out toc lot lof loa nav snm vrb bbl blg svn" "aux idx ilg ind out toc lot lof loa nav snm vrb bbl blg svn acn acr alg glsdefs ist"
# + " log dvi synctex.gz" # + " log dvi synctex.gz"
AUXILIARYEXTS_BIBTEX=\ AUXILIARYEXTS_BIBTEX=\
"aux idx ilg ind out toc lot lof loa nav snm vrb blg svn dvi pdf synctex.gz" "aux idx ilg ind out toc lot lof loa nav snm vrb blg svn dvi pdf synctex.gz"
@ -85,6 +86,8 @@ AUXILIARYEXTS_BIBTEX=\
AUXILIARYEXTS_INDEX=\ AUXILIARYEXTS_INDEX=\
"aux ilg ind out toc lot lof loa nav snm vrb bbl blg svn dvi log pdf synctex.gz" "aux ilg ind out toc lot lof loa nav snm vrb bbl blg svn dvi log pdf synctex.gz"
# + " idx" # + " idx"
AUXILIARYEXTS_GLOSSARIES=\
"aux ilg ind out toc lot lof loa nav snm vrb bbl blg svn dvi log pdf synctex.gz acn acr alg glsdefs ist"
# Base name of the script: # Base name of the script:
THENAME="$(basename $0)" THENAME="$(basename $0)"
@ -148,7 +151,7 @@ ${txtbld}Usage${txtrst}:
pdflatex.sh -gs | -rs | -gd | -rd DIR pdflatex.sh -gs | -rs | -gd | -rd DIR
Convert images. Convert images.
pdflatex.sh -b | -c | -i | -k | -kk | -l [WIDTH] | -n | -s | -ss pdflatex.sh -b | -c | -i | -g | -k | -kk | -l [WIDTH] | -n | -s | -ss
| -sc [LANG] FILE(.tex) | -sc [LANG] FILE(.tex)
Miscellaneous operations. Miscellaneous operations.
@ -171,6 +174,8 @@ ${txtbld}Options${txtrst}:
will be in a FILE-handout.pdf file) will be in a FILE-handout.pdf file)
-i FILE make ONLY index (MakeIndex) -i FILE make ONLY index (MakeIndex)
+i make ALSO index (MakeIndex) +i make ALSO index (MakeIndex)
-g FILE make ONLY glossaries (MakeGlossaries)
+g make ALSO glossaries (MakeGlossaries)
-k FILE run the 'chktex' command (if available) -k FILE run the 'chktex' command (if available)
-kk FILE the same as '-k' but only errors are shown -kk FILE the same as '-k' but only errors are shown
-l [WIDTH] FILE check if the length of each line in FILE does not exceed -l [WIDTH] FILE check if the length of each line in FILE does not exceed
@ -251,7 +256,7 @@ function cleanup() {
rm -f *-pics.* >&- 2>&- rm -f *-pics.* >&- 2>&-
echo -ne "." echo -ne "."
fi fi
echo -e "\t\t${txtgrn}[done]${txtrst}" echo -e "\t${txtgrn}[done]${txtrst}"
} }
# Converts SVG & DIA images # Converts SVG & DIA images
@ -454,6 +459,8 @@ while [[ -n $1 ]] ; do
+h) MAKEHANDOUT="true" ; shift ;; +h) MAKEHANDOUT="true" ; shift ;;
+i) MAKEINDEXARG="true" ; shift ;; +i) MAKEINDEXARG="true" ; shift ;;
-i) MAKEONLYINDEXARG="true" ; shift ; break ;; -i) MAKEONLYINDEXARG="true" ; shift ; break ;;
+g) MAKEGLOSSARIESARG="true" ; shift ;;
-g) MAKEONLYGLOSSARIESARG="true" ; shift ; break ;;
-k) CHKTEX="true" ; shift ; break ;; -k) CHKTEX="true" ; shift ; break ;;
-kk) CHKTEX_OPT="$CHKTEX_OPT -n all" ; \ -kk) CHKTEX_OPT="$CHKTEX_OPT -n all" ; \
CHKTEX="true" ; shift ; break ;; CHKTEX="true" ; shift ; break ;;
@ -563,6 +570,20 @@ if [[ -n $MAKEONLYINDEXARG ]] ; then
mquit $? mquit $?
fi fi
# Glossary
if [[ -n $MAKEGLOSSARIESARG || -n $MAKEONLYGLOSSARIESARG ]] ; then
check_programs "$MAKEGLOSSARIES_PROGRAM"
echo -ne "${txtund}MAKEGLOSSARIES${txtrst}...\t\t\t"
$MAKEGLOSSARIES_PROGRAM -q "$FILENAME" 2>&- || die
echo "${txtgrn}[done]${txtrst}"
run_pdflatex
fi
if [[ -n $MAKEONLYGLOSSARIESARG ]] ; then
AUXILIARYEXTS=$AUXILIARYEXTS_GLOSSARIES
cleanup "$FILENAME"
mquit $?
fi
# Final (pdf)latex compilation # Final (pdf)latex compilation
for X in `seq 1 $THRICE` ; do for X in `seq 1 $THRICE` ; do
if [[ -z $USEPS4PDFARG ]] ; then if [[ -z $USEPS4PDFARG ]] ; then