diff options
author | Karl Berry <karl@freefriends.org> | 2013-11-22 00:03:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-11-22 00:03:01 +0000 |
commit | f7eb2c6a23e6a15f86a636186d8bd77f16b2061d (patch) | |
tree | 64a683b7e93c8de9a577168e5d1be3c565adaed3 /Master/texmf-dist/doc/support/latexmk/example_rcfiles | |
parent | 50936fcbf8d7c6fafc2b9e43b2b9ca4715d954f2 (diff) |
latexmk (21nov13)
git-svn-id: svn://tug.org/texlive/trunk@32200 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/latexmk/example_rcfiles')
3 files changed, 120 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/clean_pattern_latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/clean_pattern_latexmkrc new file mode 100644 index 00000000000..b15507c6238 --- /dev/null +++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/clean_pattern_latexmkrc @@ -0,0 +1,30 @@ +# To allow more general pattern in $clean_ext instead of just an +# extension or something containing %R. +# This is done by overriding latexmk's cleanup1 subroutine. + +# Here is an example of a usefule application: +$clean_ext = "*-eps-converted-to.pdf"; + +sub cleanup1 { + # Usage: cleanup1( directory, pattern_or_ext_without_period, ... ) + # + # The directory is a fixed name, so I must escape any glob metacharacters + # in it: + print "========= MODIFIED cleanup1 cw latexmk v. 4.39 and earlier\n"; + my $dir = fix_pattern( shift ); + + # Change extensions to glob patterns + foreach (@_) { + # If specified pattern is pure extension, without period, + # wildcard character (?, *) or %R, + # then prepend it with directory/root_filename and period to + # make a full file specification + # Else leave the pattern as is, to be used by glob. + # New feature: pattern is unchanged if it contains ., *, ? + (my $name = (/%R/ || /[\*\.\?]/) ? $_ : "%R.$_") =~ s/%R/$dir$root_filename/; + unlink_or_move( glob( "$name" ) ); + } +} #END cleanup1 + + + 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'; |