[PATCH v2] Add optional flag 'LATEX_OPT' in run{first}latex.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Balbir Singh <bsingharora@xxxxxxxxx>

Add synctex=-1 to prevent pdf readers like
evince from complaining to the pdflatex command
line.

[akiyks: Split from the original patch [1].
    Instead of always generating .synctex{.gz} files, add an optional
    flag to pdflatex commands in run{first}latex.sh scripts.

    .synctex files can be generated by defining the environment variable
    "LATEX_OPT", e.g.:

	$ export LATEX_OPT="--synctex=-1"

    , and run "make".

    Update .gitignore and "claen" in Makefile as well to ignore/remove
    SyncTeX files.

    [1]: https://www.spinics.net/lists/perfbook/msg02350.html
]

Signed-off-by: Balbir Singh <bsingharora@xxxxxxxxx>
Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 .gitignore                 | 1 +
 Makefile                   | 1 +
 utilities/runfirstlatex.sh | 2 +-
 utilities/runlatex.sh      | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index ebd5e98c..dfeb9e1b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,7 @@
 *.ltms
 *.pdfp
 *.pdfq
+*.synctex*
 perfbook_flat.tex
 qqz.tex
 contrib.tex
diff --git a/Makefile b/Makefile
index 13eddfc8..236b0bb2 100644
--- a/Makefile
+++ b/Makefile
@@ -350,6 +350,7 @@ clean:
 	rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex
 	rm -f $(LATEXGENERATED)
 	rm -f CodeSamples/snippets.d
+	rm -f *.synctex*
 	@rm -f $(OBSOLETE_FILES)
 
 distclean: clean
diff --git a/utilities/runfirstlatex.sh b/utilities/runfirstlatex.sh
index 1a2a7a58..2b25b9f1 100644
--- a/utilities/runfirstlatex.sh
+++ b/utilities/runfirstlatex.sh
@@ -40,7 +40,7 @@ fi
 basename=`echo $1 | sed -e 's/\.tex$//'`
 
 echo "pdflatex 1 for $basename.pdf"
-pdflatex $basename > /dev/null 2>&1 < /dev/null || :
+pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || :
 if grep -q '! Emergency stop.' $basename.log
 then
 	grep -B 15 -A 5 '! Emergency stop.' $basename.log
diff --git a/utilities/runlatex.sh b/utilities/runlatex.sh
index 289364d7..18dd7fd6 100644
--- a/utilities/runlatex.sh
+++ b/utilities/runlatex.sh
@@ -51,7 +51,7 @@ identical_warnings () {
 }
 
 iterate_latex () {
-	pdflatex $basename > /dev/null 2>&1 < /dev/null || :
+	pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || :
 	if grep -q '! Emergency stop.' $basename.log
 	then
 		grep -B 15 -A 5 '! Emergency stop.' $basename.log
-- 
2.17.1





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux