From 2f86a5b5ef8c8d8f579250bc9e8e0f9965a570cc Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 21 Nov 2020 18:59:40 +0100 Subject: [PATCH] build script for draft and final versions --- .gitignore | 16 ++++++++++++++++ README.md | 11 ++++++----- build.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- clean.sh | 4 ---- comp.tex | 31 +++++++++++++++++++------------ 5 files changed, 87 insertions(+), 23 deletions(-) delete mode 100755 clean.sh diff --git a/.gitignore b/.gitignore index a2e45f9..a27aeb2 100644 --- a/.gitignore +++ b/.gitignore @@ -290,3 +290,19 @@ TSWLatexianTemp* # Uncomment the next line to have this generated file ignored. #*Notes.bib +# MacOS +.DS_Store? +ehthumbs.db +Icon? +Thumbs.db +*.DS_Store + +# Emacs +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* diff --git a/README.md b/README.md index 8c2a457..d60341a 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,14 @@ Référentiel de compétences BUT R&T. -Pour compiler: +Pour compiler la version finale: + ./build.sh pub - pdflatex comp.tex - pdflatex comp.tex +La version de travail (avec table des matières et annotations): + ./build.sh draft -ou simplement: - ./build.sh +Utiliser l'option `--fast`(ou `-f`) pour ne lancer qu'une seule passe `pdflatex`: + ./build.sh --fast draft ## A propos du format diff --git a/build.sh b/build.sh index a6378cc..ec40d44 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,49 @@ #!/bin/bash -pdflatex comp.tex -pdflatex comp.tex +BASENAME=referentiel-competences +NBPASS=3 # il faut 3 passes de compilation + +usage () { + echo "Usage: $0 [-f|--fast] help|draft|pub|clean" + echo " draft: generates draft version, including toc and comments" + echo " pub: generates publication ready version" + echo " clean: cleanup all (non versioned) tex files" + echo "--fast (or -f) option just make one compilation pass instead of $NBPASS" + + exit 1 +} + +if [ "$1" == "-f" ] || [ "$1" == "--fast" ]; then + NBPASS1=1 + shift +else + NBPASS1=$NBPASS +fi + +if [ $# != 1 ] || [ "$1" == "help" ]; then + usage +fi + +if [ "$1" = "clean" ]; then + /bin/rm -f "$BASENAME"*.aux "$BASENAME"*.pdf "$BASENAME"*.toc "$BASENAME"*.snm "$BASENAME"*.nav "$BASENAME"*.log + exit 0 +fi + +if [ "$1" != "pub" ] && [ "$1" != "draft" ] +then + usage +fi + +build () { + for (( i=1; i<=$NBPASS1; i++ )) + do + echo "----------------- pass $i" + pdflatex -jobname "$1"-"$2" '\def\'$2'{}\input{comp}' + done +} + + +build "$BASENAME" "$1" + + diff --git a/clean.sh b/clean.sh deleted file mode 100755 index e143c29..0000000 --- a/clean.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -/bin/rm -f *.aux comp.pdf comp.toc comp.snm comp.nav - diff --git a/comp.tex b/comp.tex index bf3473f..5591f76 100644 --- a/comp.tex +++ b/comp.tex @@ -22,8 +22,12 @@ % ******************************************************** % Macros et contrôle de l'affichage des mots-clés +% \draft est defini pour la verison de travail avec annotations et table des matières +\ifdef{\draft}{ +\usepackage[motscles]{macros} % avec mots-clés +}{ \usepackage{macros} % sans mots-clés -%\usepackage[motscles]{macros} % avec mots-clés +} % ******************************************************** \title{Référentiel de compétences} @@ -59,17 +63,20 @@ %\frameTitre{} % Titre principal \frameTitreBUT{} -\begin{frame}[plain]{} - \frametitle{\Large Table des matières} - \begin{columns}[t] - \begin{column}{.5\textwidth} - \tableofcontents[sections={1-3}] - \end{column} - \begin{column}{.5\textwidth} - \tableofcontents[sections={4-5}] - \end{column} - \end{columns} -\end{frame} +% ------ TABLE DES MATIERES (en version draft seulement) +\ifdef{\draft}{ + \begin{frame}[plain]{} + \frametitle{\Large Table des matières} + \begin{columns}[t] + \begin{column}{.5\textwidth} + \tableofcontents[sections={1-3}] + \end{column} + \begin{column}{.5\textwidth} + \tableofcontents[sections={4-5}] + \end{column} + \end{columns} + \end{frame} +}{} \frameMetier{} % Les parcours et les métiers