forked from IMAGINARY/SURFER-Galleries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
usefulls_commands.txt
executable file
·19 lines (14 loc) · 1.28 KB
/
usefulls_commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
% convert a tex file into a png image
pdflatex jDM08_expl.tex ; pdftoppm -f 1 -l 1 -aa yes jDM08_expl.pdf /tmp/jDM08_expl ; convert -geometry 300x600 /tmp/jDM08_expl-000001.ppm jDM08_expl.png
% compile all tex files within one directory
find . -name "*.tex" | xargs -I {} pdflatex {}
% remove byte order mark from unicode files (UTF8-BOM -> UTF8), since latex does not understand BOM; LANG must be e.g. de, sr, ru, ...
find . -name "*_LANG.tex" | xargs -I {} sh -c 'uconv --remove-signature -o "{}2" {} && mv -f "{}2" {}'
% add new language based on old one (here: en -> es)
% must be executed in each of the gallery folders (i.e. fantasy, record, tutorial)
mkdir -p "es" && svn add es && find en -name "*.tex" | sed "s/^en\/\(.*\)_en.tex/svn cp \0 es\/\1_es.tex/g" | xargs -I {} bash -c {}
find en -name "*.pdf" | sed "s/^en\/\(.*\)_en.pdf/svn cp \0 es\/\1_es.pdf/g" | xargs -I {} bash -c {}
% change the language option in _LANG2 files from LANG1 to LANG2
find -name "*_LANG2.tex" | xargs sed -r -i 's/\\documentclass\[LANG1\]\{\.\/\.\.\/\.\.\/common\/SurferDesc\}(.*)/\\documentclass[LANG2]{\.\/\.\.\/\.\.\/common\/SurferDesc}\1/g'
% assure PDF compatibility for inclusion in JFXSURFER gallery
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf