From 98a791bcc156df953b64c7ec2e85e7d6b9f1e1ec Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 25 Feb 2016 22:37:12 +0000 Subject: latexmk (25feb16) git-svn-id: svn://tug.org/texlive/trunk@39860 c570f23f-e606-0410-a88d-b1316a301751 --- .../latexmk/example_rcfiles/Sweave_latexmkrc | 57 ++++++++++++++++ .../latexmk/example_rcfiles/TeX4ht-latexmkrc | 33 ++++++++++ .../latexmk/example_rcfiles/sweave_latexmkrc | 57 ---------------- .../latexmk/example_rcfiles/tex4ht-latexmkrc | 33 ---------- .../latexmk/example_rcfiles/texinfo-latexmkrc | 76 ++++++++++++++++++++++ 5 files changed, 166 insertions(+), 90 deletions(-) create mode 100644 Master/texmf-dist/doc/support/latexmk/example_rcfiles/Sweave_latexmkrc create mode 100644 Master/texmf-dist/doc/support/latexmk/example_rcfiles/TeX4ht-latexmkrc delete mode 100644 Master/texmf-dist/doc/support/latexmk/example_rcfiles/sweave_latexmkrc delete mode 100644 Master/texmf-dist/doc/support/latexmk/example_rcfiles/tex4ht-latexmkrc create mode 100644 Master/texmf-dist/doc/support/latexmk/example_rcfiles/texinfo-latexmkrc (limited to 'Master/texmf-dist/doc/support/latexmk/example_rcfiles') diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/Sweave_latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/Sweave_latexmkrc new file mode 100644 index 00000000000..19f046be6be --- /dev/null +++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/Sweave_latexmkrc @@ -0,0 +1,57 @@ +# This is to allow the use of Sweave with latexmk, and in addition to +# make synctex work properly with it. +# SEE THE IMPORTANT NOTES below. +# +# Sweave (http://www.stat.uni-muenchen.de/~leisch/Sweave/) is a tool +# that allows to embed the R code for complete data analyses in latex +# documents. The user edits a file with an extension like .Rnw, and +# the .tex file is generated from this. +# +# Four problems are solved by the code below: +# 1. Generate the .tex file automatically. +# 2. Arrange not to re-run unmodified chunks of R code. (A pure +# optimization.) +# 3. Fix the execution environment for (pdf)latex. +# 4. Deal with synctex: If the user wants to use synctex +# (www.tug.org/TUGboat/tb29-3/tb93laurens.pdf) to synchronize the +# pdf file with the source file, by default synctex does the +# synchronization with the generated .tex file, not the original +# source file. Postprocessing of the .synctex.gz file is necessary +# to fix this. +# +# The following version was worked out and tested by a user (thanks +# to Brian Beitzel) on MSWindows. It will need at least one change to +# work on UNIX-like operating systems (which include Linux and OS-X). + +# N.B. ===> IMPORTANT NOTES <=== +# +# 1. The patchDVI package for R needs to be installed from R-Forge, as +# follows: +# +# install.packages("patchDVI", repos="http://R-Forge.R-project.org") +# +# 2. In all Sweave (.Rnw) documents, the following lines must be included: +# +# \usepackage{Sweave} +# \SweaveOpts{concordance=TRUE} + + +# Fix the pdflatex command to run Sweave first, and to postprocess the +# .synctex.gz file: +# !!!!! THIS IS THE VERSION FOR MS-WINDOWS, with && as a command +# separator +$pdflatex = "cmd /c " + . "Rscript -e \"library(cacheSweave); setCacheDir(getwd()); " + . "Sweave('%S', driver=cacheSweaveDriver)\"" + . " && R CMD pdflatex -interaction=nonstopmode -synctex=1 %O %B.tex" + . " && Rscript -e " + . "\"library('patchDVI');patchSynctex('%B.synctex.gz')\""; +# +# !!!TO FIX THIS FOR Linux/OS-X/UNIX, try uncommenting the following: +# (this version hasn't been tested). +#$pdflatex = "Rscript -e \"library(cacheSweave); setCacheDir(getwd()); " +# . "Sweave('%S', driver=cacheSweaveDriver)\"" +# . " ; R CMD pdflatex -interaction=nonstopmode -synctex=1 %O %B.tex" +# . " ; Rscript -e " +# . "\"library('patchDVI');patchSynctex('%B.synctex.gz')\""; + diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/TeX4ht-latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/TeX4ht-latexmkrc new file mode 100644 index 00000000000..de486d8d8be --- /dev/null +++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/TeX4ht-latexmkrc @@ -0,0 +1,33 @@ +# Sometime in the future, latexmk will directly support the use of +# TeX4ht to obtain html from tex. Meanwhile, here is how to use +# latexmk with TeX4ht. There is a script htlatex supplied by the +# TeX4ht package: It simply runs latex a fixed number of times and +# then the programs tex4ht and t4ht. To use latexmk to get optimal +# processing use the following instructions (under UNIX-like operating +# systems, e.g., OS-X and linux): +# +# 1. Put the scripts htlatexonly and myhtlatex2 somewhere in the PATH +# for executables (and make sure they have excutable permissions +# set). +# 2. Set up an initialization file for latexmk like this one. +# +# 3. To process file.tex to make file.html, run +# +# myhtlatex2 file +# + +# Since these instructions use scripts that are UNIX shell scripts, +# the instructions work as written for UNIX-like operating +# systems. Users of other operating systems will have to adjust them +# and modify the scripts suitably. + + +warn "latexmkrc for htlatex\n"; + +$dvi_mode = 1; +$pdf_mode = 0; +$quote_filenames = 0; +$latex = 'htlatexonly %S'; + +$clean_ext .= ' 4ct 4tc idv lg tmp xref'; +$clean_full_ext .= ' css html'; diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/sweave_latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/sweave_latexmkrc deleted file mode 100644 index 19f046be6be..00000000000 --- a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/sweave_latexmkrc +++ /dev/null @@ -1,57 +0,0 @@ -# This is to allow the use of Sweave with latexmk, and in addition to -# make synctex work properly with it. -# SEE THE IMPORTANT NOTES below. -# -# Sweave (http://www.stat.uni-muenchen.de/~leisch/Sweave/) is a tool -# that allows to embed the R code for complete data analyses in latex -# documents. The user edits a file with an extension like .Rnw, and -# the .tex file is generated from this. -# -# Four problems are solved by the code below: -# 1. Generate the .tex file automatically. -# 2. Arrange not to re-run unmodified chunks of R code. (A pure -# optimization.) -# 3. Fix the execution environment for (pdf)latex. -# 4. Deal with synctex: If the user wants to use synctex -# (www.tug.org/TUGboat/tb29-3/tb93laurens.pdf) to synchronize the -# pdf file with the source file, by default synctex does the -# synchronization with the generated .tex file, not the original -# source file. Postprocessing of the .synctex.gz file is necessary -# to fix this. -# -# The following version was worked out and tested by a user (thanks -# to Brian Beitzel) on MSWindows. It will need at least one change to -# work on UNIX-like operating systems (which include Linux and OS-X). - -# N.B. ===> IMPORTANT NOTES <=== -# -# 1. The patchDVI package for R needs to be installed from R-Forge, as -# follows: -# -# install.packages("patchDVI", repos="http://R-Forge.R-project.org") -# -# 2. In all Sweave (.Rnw) documents, the following lines must be included: -# -# \usepackage{Sweave} -# \SweaveOpts{concordance=TRUE} - - -# Fix the pdflatex command to run Sweave first, and to postprocess the -# .synctex.gz file: -# !!!!! THIS IS THE VERSION FOR MS-WINDOWS, with && as a command -# separator -$pdflatex = "cmd /c " - . "Rscript -e \"library(cacheSweave); setCacheDir(getwd()); " - . "Sweave('%S', driver=cacheSweaveDriver)\"" - . " && R CMD pdflatex -interaction=nonstopmode -synctex=1 %O %B.tex" - . " && Rscript -e " - . "\"library('patchDVI');patchSynctex('%B.synctex.gz')\""; -# -# !!!TO FIX THIS FOR Linux/OS-X/UNIX, try uncommenting the following: -# (this version hasn't been tested). -#$pdflatex = "Rscript -e \"library(cacheSweave); setCacheDir(getwd()); " -# . "Sweave('%S', driver=cacheSweaveDriver)\"" -# . " ; R CMD pdflatex -interaction=nonstopmode -synctex=1 %O %B.tex" -# . " ; Rscript -e " -# . "\"library('patchDVI');patchSynctex('%B.synctex.gz')\""; - diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/tex4ht-latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/tex4ht-latexmkrc deleted file mode 100644 index de486d8d8be..00000000000 --- a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/tex4ht-latexmkrc +++ /dev/null @@ -1,33 +0,0 @@ -# Sometime in the future, latexmk will directly support the use of -# TeX4ht to obtain html from tex. Meanwhile, here is how to use -# latexmk with TeX4ht. There is a script htlatex supplied by the -# TeX4ht package: It simply runs latex a fixed number of times and -# then the programs tex4ht and t4ht. To use latexmk to get optimal -# processing use the following instructions (under UNIX-like operating -# systems, e.g., OS-X and linux): -# -# 1. Put the scripts htlatexonly and myhtlatex2 somewhere in the PATH -# for executables (and make sure they have excutable permissions -# set). -# 2. Set up an initialization file for latexmk like this one. -# -# 3. To process file.tex to make file.html, run -# -# myhtlatex2 file -# - -# Since these instructions use scripts that are UNIX shell scripts, -# the instructions work as written for UNIX-like operating -# systems. Users of other operating systems will have to adjust them -# and modify the scripts suitably. - - -warn "latexmkrc for htlatex\n"; - -$dvi_mode = 1; -$pdf_mode = 0; -$quote_filenames = 0; -$latex = 'htlatexonly %S'; - -$clean_ext .= ' 4ct 4tc idv lg tmp xref'; -$clean_full_ext .= ' css html'; diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/texinfo-latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/texinfo-latexmkrc new file mode 100644 index 00000000000..3a21a3c15db --- /dev/null +++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/texinfo-latexmkrc @@ -0,0 +1,76 @@ +# Modifications 2015 Sep 9-10, John Collins +# Copyright 2014 Vincent Belaïche + +# With the settings here, latexmk can be used to process texinfo files +# (typical extension .texi) to pdf files, including the making of +# indices. This version uses a newly documented internal routine +# of latexmk. + +###!!!!!!!!! NOTE THAT THE NAMES OF THE INDEX FILES ARE POSSIBLY +### SUBJECT TO CHANGE IN FUTURE VERSIONS OF texinfo. +### The configuration provided by this file was valid in +### September 2015. (The file texinfo.tex had version +### 2015-07-01.07.) + +$quote_filenames = 1; +$pdflatex = 'internal mylatex %R %Z pdftex %O %S'; +$latex = 'internal mylatex %R %Z etex %O %S'; + +sub mylatex { + my $root = shift; + my $dir_string = shift; + my $ret = system @_; + for my $ext (split " ",$texinfo_indices){ + my $idx = $dir_string.$root.'.'.$ext; + my $ind = $idx.'s'; + if ( (-e $idx) && (-s $idx) ) { + # Only make dependency on the ind-like file + # if the idx-like file both exists and is of + # non-zero length. The test on the length is + # needed because current versions of texindex + # produce no output file if the input file is + # of zero length. + rdb_ensure_file( $rule, $ind ); + } + } + return $ret; +} + +# Please add needed other extensions if there are other user defined indices +$texinfo_indices = 'ky fn cp vr tp pg'; + +$clean_ext .= ' ' . $texinfo_indices; +$clean_full_ext .= ' pdf toc aux'; + +for my $ext (split " ",$texinfo_indices){ + my $index_ext = $ext . 's'; + add_cus_dep( $ext, $index_ext, 1, $ext . '_texindex'); + add_input_ext('pdflatex', $index_ext); + add_input_ext('latex', $index_ext); + $clean_ext .= " $index_ext"; +} + +sub ky_texindex +{ + system( "texindex \"$_[0].ky\"" ); +} +sub fn_texindex +{ + system( "texindex \"$_[0].fn\"" ); +} +sub cp_texindex +{ + system( "texindex \"$_[0].cp\"" ); +} +sub vr_texindex +{ + system( "texindex \"$_[0].vr\"" ); +} +sub tp_texindex +{ + system( "texindex \"$_[0].tp\"" ); +} +sub pg_texindex +{ + system( "texindex \"$_[0].pg\"" ); +} -- cgit v1.2.3