summaryrefslogtreecommitdiff
path: root/support/latexmk/extra-scripts
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/latexmk/extra-scripts
Initial commit
Diffstat (limited to 'support/latexmk/extra-scripts')
-rw-r--r--support/latexmk/extra-scripts/README-latexmk-scripts147
-rw-r--r--support/latexmk/extra-scripts/dvipdfm_call14
-rw-r--r--support/latexmk/extra-scripts/dvipdfm_call.bat19
-rw-r--r--support/latexmk/extra-scripts/dvipdfmx_call14
-rw-r--r--support/latexmk/extra-scripts/dvipdfmx_call.bat19
-rw-r--r--support/latexmk/extra-scripts/htlatexonly10
-rw-r--r--support/latexmk/extra-scripts/kickxdvi22
-rw-r--r--support/latexmk/extra-scripts/l1122
-rw-r--r--support/latexmk/extra-scripts/l2143
-rw-r--r--support/latexmk/extra-scripts/myhtlatex219
-rw-r--r--support/latexmk/extra-scripts/pst2pdf_for_latexmk49
-rw-r--r--support/latexmk/extra-scripts/pst2pdf_for_latexmk_README.txt13
-rw-r--r--support/latexmk/extra-scripts/startacroread231
13 files changed, 822 insertions, 0 deletions
diff --git a/support/latexmk/extra-scripts/README-latexmk-scripts b/support/latexmk/extra-scripts/README-latexmk-scripts
new file mode 100644
index 0000000000..a1c35e471d
--- /dev/null
+++ b/support/latexmk/extra-scripts/README-latexmk-scripts
@@ -0,0 +1,147 @@
+Auxiliary scripts for latexmk
+=============================
+
+John Collins (jcc8 at psu.edu)
+13 Oct 2016
+
+Latexmk can be configured to use different programs than the standard
+ones to perform its tasks. If a user finds that the default behavior
+is not what is desired, it is frequently possible to use a script
+replacing a standard program to acheive the desired effect. It is
+also possible to have a script to run some other programs as well as
+latexmk to do certain tasks. A certain amount of creativity works
+wonders.
+
+In this directory are some scripts that you may find useful. They
+have been provided by other users (who I thank) or by myself. They
+were written to perform certain jobs desired by these users, so they
+may have some very special features that are not useful to everytone.
+You may well need to modify them for your own needs, and you will
+probably need to read through them in detail to understand what they
+do. They can also be quite operating system specific.
+
+For all these scripts, the instructions assumes that the script is in
+the path for executables, and that you have done whatever your OS
+needs you to do to make the script executable.
+
+1. startacroread
+
+ This is specific for UNIX/LINUX systems (script running under
+ bash). It solves a problem that when acroread is used as a pdf
+ viewer and latexmk is used in preview-continuous mode, acroread
+ does not automatically update its display when the pdf file
+ changes.
+
+ Prerequisites:
+ UNIX-style OS
+ bash (command shell)
+ acroread
+ pdfopen and pdfclose from the xpdfopen package
+ (see http://www.ctan.org/pkg/xpdfopen/)
+
+ To use:
+
+ Put the following lines in a startup file for latexmk
+
+ $pdf_previewer = "start startacrobat";
+ $pdf_update_method = "2";
+
+ This will, of course, only have an effect when latexmk will
+ have you view pdf files.
+
+ Advantage:
+
+ Use of acroread (under UNIX/LINUX) for viewing pdf files, with
+ automatic update when latexmk -pvc is used.
+
+ Disadvantage:
+
+ Acroread does not retain its page position; it returns to the
+ first page. (Both gv and xpdf are better for this.)
+
+ Notes:
+
+ The viewer window disappears and then reappears as the
+ foreground window.
+
+ This solution cannot be easily adapted under MSWindows, since
+ the MSWindows version of acroread locks the pdf file, so that a
+ new version cannot be written.
+
+ Thanks: Thorsten Bonow
+
+
+
+2. l1
+
+ For UNIX/LINUX, possibly cygwin, although I haven't tried.
+
+ It is a replacement for latex that brings up a window there are
+ errors. It first runs latex to completion (without a stop if
+ there are errors). Then if there are errors, it makes their
+ description (from the log file) into a dvi file, which it brings
+ up in a separate window.
+
+ Advantage:
+
+ Automatic display of log file, in middle of workflow when using
+ latexmk in preview-continuous mode.
+
+ Disadvantage:
+
+ Log files are verbose. A single line error message in a latex
+ run is often easier to read.
+
+ Thanks: Tom Schneider
+
+
+3. l2
+
+ A version of l1 with command-line options for changing its
+ behavior.
+
+
+4. kickxdvi
+
+ A script for making xdvi update its display. Used by l1.
+
+5. dvipdfm_call
+ dvipdfmx_call
+ dvipdfm_call.bat
+ dvipdfmx_call.bat
+
+ Scripts for using dvipdfm or dvipdfmx with the same command-line
+ syntax as dvipdf.
+
+ To get latexmk to use dvipdfm or dvipdfmx to convert dvi files to
+ pdf files, it USED to be necessary to configure latexmk to use one
+ of these scripts. But since v. 4.01, latexmk has more flexible
+ configuration methods. Currently, to use dvipdfm, just put the
+ following in one of latexmk's initialization files (e.g.,
+ ~/.latexmkrc):
+
+ $dvipdf = "dvipdfm %O -o %D %S";
+
+ (To use dvipdfmx, just change the string dvipdfm to dvipdfmx.)
+ The command specified here is used when latexmk is requested to
+ make pdf files by conversion from dvi files, e.g., by the
+ latexmk's command-line option -pdfdvi.
+
+ But I leave the scripts here. For OLD versions of latexmk, you
+ would have used the configuration line
+
+ $dvipdf = 'dvipdfm_call'; #OBSOLETE
+ or
+ $dvipdf = 'dvipdfmx_call'; #OBSOLETE
+
+ These still work, but they are obsolete.
+
+ For Unix-like systems, including linux and Mac OS-X, use the
+ scripts dvipdfm_call and dvipdfmx_call.
+ For MS-Windows systems use the batch files dvipdfm_call.bat and
+ dvipdfmx_call.bat.
+
+6. completion.bash
+
+ Bash script by Christoph Junghans that implements a bash
+ completion function for latexmk.
diff --git a/support/latexmk/extra-scripts/dvipdfm_call b/support/latexmk/extra-scripts/dvipdfm_call
new file mode 100644
index 0000000000..896dce71fc
--- /dev/null
+++ b/support/latexmk/extra-scripts/dvipdfm_call
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Run dvipdfm from dvipdf-style command-line
+# Assume no options specified
+# If this script is called from latexmk,
+# we have $1=source.dvi, $2=dest.pdf
+# But for safety, let's handle correctly a one argument call,
+# i.e., $1=source, with no $2
+
+if [ "$2" = "" ]; then
+ dvipdfm $1
+else
+ dvipdfm -o $2 $1
+fi
diff --git a/support/latexmk/extra-scripts/dvipdfm_call.bat b/support/latexmk/extra-scripts/dvipdfm_call.bat
new file mode 100644
index 0000000000..104bbabe85
--- /dev/null
+++ b/support/latexmk/extra-scripts/dvipdfm_call.bat
@@ -0,0 +1,19 @@
+@echo off
+REM Run dvipdfm from dvipdf-style command-line
+REM Assume no options specified
+REM If this script is called from latexmk,
+REM we have %1=source.dvi, %2=dest.pdf
+REM But for safety, let's handle correctly a one argument call,
+REM i.e., %1=source, with no %2
+
+if "%2" == "" goto onearg
+
+:twoarg
+dvipdfm -o %2 %1
+goto done
+
+:onearg
+dvipdfm %1
+
+
+:done \ No newline at end of file
diff --git a/support/latexmk/extra-scripts/dvipdfmx_call b/support/latexmk/extra-scripts/dvipdfmx_call
new file mode 100644
index 0000000000..9ff04c4bdc
--- /dev/null
+++ b/support/latexmk/extra-scripts/dvipdfmx_call
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Run dvipdfmx from dvipdf-style command-line
+# Assume no options specified
+# If this script is called from latexmk,
+# we have $1=source.dvi, $2=dest.pdf
+# But for safety, let's handle correctly a one argument call,
+# i.e., $1=source, with no $2
+
+if [ "$2" = "" ]; then
+ dvipdfmx $1
+else
+ dvipdfmx -o $2 $1
+fi
diff --git a/support/latexmk/extra-scripts/dvipdfmx_call.bat b/support/latexmk/extra-scripts/dvipdfmx_call.bat
new file mode 100644
index 0000000000..01a140a65f
--- /dev/null
+++ b/support/latexmk/extra-scripts/dvipdfmx_call.bat
@@ -0,0 +1,19 @@
+@echo off
+REM Run dvipdfmx from dvipdf-style command-line
+REM Assume no options specified
+REM If this script is called from latexmk,
+REM we have %1=source.dvi, %2=dest.pdf
+REM But for safety, let's handle correctly a one argument call,
+REM i.e., %1=source, with no %2
+
+if "%2" == "" goto onearg
+
+:twoarg
+dvipdfmx -o %2 %1
+goto done
+
+:onearg
+dvipdfmx %1
+
+
+:done \ No newline at end of file
diff --git a/support/latexmk/extra-scripts/htlatexonly b/support/latexmk/extra-scripts/htlatexonly
new file mode 100644
index 0000000000..ea50bf9bf2
--- /dev/null
+++ b/support/latexmk/extra-scripts/htlatexonly
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Replacement for latex executable when latexmk is used for htlatex
+# See TeX4ht-latexmkrc in the example-rcfiles directory of the latexmk
+# distribution for how to use this.
+#
+# This is a shell script suitable for UNIX-like operating systems (including
+# OS-X and linux, and presumably Cygwin under MS-Windows).
+
+latex --recorder $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
diff --git a/support/latexmk/extra-scripts/kickxdvi b/support/latexmk/extra-scripts/kickxdvi
new file mode 100644
index 0000000000..f0809637aa
--- /dev/null
+++ b/support/latexmk/extra-scripts/kickxdvi
@@ -0,0 +1,22 @@
+#!/bin/csh -f
+#(ie run the cshell on this but don't read the .cshrc)
+
+echo version = 1.05 of kickxdvi 2002 Nov 12
+# 2002 Nov 12, 1.05: (John Collins) Simplify
+# 2002 Nov 5, 1.04: (John Collins) Simplify
+# 2002 Oct 21, 1.04: functional!
+# origin 1999Feb15.17:23:04
+
+echo refresh xdvi processes:
+
+# It picks up multiple processes just fine.
+
+set whoami = `whoami`
+
+set pid=`ps -f -u $whoami | grep xdvi.bin | grep -v grep | cut -c10-14`
+if ( "$pid" != "" ) then
+ echo pid: $pid
+ /usr/bin/kill -s USR1 $pid
+else
+ echo No xdvi.bin processes
+endif
diff --git a/support/latexmk/extra-scripts/l1 b/support/latexmk/extra-scripts/l1
new file mode 100644
index 0000000000..cf8d1c4b64
--- /dev/null
+++ b/support/latexmk/extra-scripts/l1
@@ -0,0 +1,122 @@
+#!/bin/csh -f
+#(ie run the cshell on this but don't read the .cshrc)
+
+clear
+echo version = 2.17 of l 2002 Nov 5
+# 2002 Nov 5, 2.17: (John Collins) Make work with latexmk
+# 2002 Oct 21, 2.16: replace popcross with kickxdvi
+# 2000 Mar 6, 2.14: done is created as a directory (more useful than a file)
+# 1999 Nov 18: removal of a paper triggers bibtex call now
+# 1999 Aug 19: when done, `touch done` so that other
+# programs can be triggered (ie latex2html!)
+
+set myname=l1
+
+if ( "$1" == "") then
+ set paper=paper
+else
+ set paper=$1
+endif
+
+if ( "$paper:e" == "" ) then
+ set base=$paper
+ set paper=${base}.tex
+else
+ set base=$paper:r
+endif
+
+if !(-f $paper) then
+ echo $paper does not exist\!
+ exit 1;
+endif
+
+# popcross refreshes the xdvi display by briefly putting
+# a window in front of the xdvi window. This is crude but effective.
+# A better way is to use the kickxdvi routine.
+set kickxdvi = popcross # old method.
+set kickxdvi = kickxdvi
+
+# set overfull = Overfull
+set overfull = NoOverfull
+echo ALL $overfull MESSAGES WILL BE SUPPRESSED
+# see Lamport page 177 for dealing with overfull boxes.
+# basically, do this:
+# \documentclass[12pt,draft]{article}
+# draft will mark the overfull boxes and the solution
+# will become obvious...
+
+# run latex. The cat /dev/null prevents
+# latex from stopping. Errors are reported to paper.log
+cat /dev/null | latex $paper | grep -v $overfull
+
+# determine if there was an error, by looking at paper.log:
+grep "! Emergency stop." $base.log
+@ EmergencyStop = ($status == 0)
+# Also find if no output produced:
+# Examine only the last line of the file to pick out only the
+# message produced by TeX, and not something else with the same
+# string.
+tail -1 $base.log | grep "No pages of output."
+@ NoOutput = ($status == 0)
+
+if ($EmergencyStop || $NoOutput)then
+
+ # begin latexerrors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ echo create and display latex errors
+
+ set err = `whoami`-$base
+ set tmperr = /tmp/$err.tex
+
+ echo "\documentclass[12pt]{article}" > $tmperr
+ echo "\textwidth 7.5in" >> $tmperr
+ echo "\begin{document}" >> $tmperr
+ if ( $EmergencyStop ) then
+ echo "Error(s) in tex file ($paper): " >> $tmperr
+ else if ( $NoOutput ) then
+ echo "No output from tex file ($paper): " >> $tmperr
+ endif
+ echo "\begin{verbatim}" >> $tmperr
+
+ cat $base.log >> $tmperr
+
+ echo "\end{verbatim}" >> $tmperr
+ echo "\end{document}" >> $tmperr
+
+ pushd /tmp
+ latex $err.tex
+ if ( $EmergencyStop ) then
+ echo xdvi display shows the last page of the errors
+ set page = '+'
+ else
+ set page = ''
+ endif
+ xdvi $err.dvi $page &
+ popd
+ # end latexerrors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ cp /tmp/$err.dvi $base.dvi
+ $kickxdvi
+ echo "****************************************"
+ echo "* ERROR IN PAPER - fix paper.tex file\! *"
+ echo "****************************************"
+ # beep
+ echo -n ""
+ sleep 2
+ # beep
+ echo -n ""
+ cd /tmp
+ rm -f $err.aux $err.dvi $err.log $err.tex
+
+ exit 1
+else
+ echo Successful run
+ $kickxdvi
+ if !(-f done || -d done) then
+ mkdir done
+ endif
+ touch done
+
+ exit
+
+endif
diff --git a/support/latexmk/extra-scripts/l2 b/support/latexmk/extra-scripts/l2
new file mode 100644
index 0000000000..f179bf36a5
--- /dev/null
+++ b/support/latexmk/extra-scripts/l2
@@ -0,0 +1,143 @@
+#!/bin/csh -f
+#(ie run the cshell on this but don't read the .cshrc)
+
+# l2: 2002 Nov 12. John Collins.
+# l2: 2002 Nov 11. John Collins.
+# l2: 2002 Nov 6. John Collins.
+# l2: 2002 Nov 5. John Collins. Simplified from l v. 2.17
+
+set myname=l2
+set displayErrors = 0
+set mainCwd = $cwd
+
+
+#alias beep '(echo -n ""; sleep 1; echo -n "")'
+alias beep '(echo -n "")'
+
+
+nextarg:
+if ( "$1" == "-d" ) then
+ set displayErrors=1
+ shift
+ goto nextarg
+endif
+if ( "$1" == "-d-" ) then
+ set displayErrors=0
+ shift
+ goto nextarg
+endif
+
+if ( ("$1" == "") || ("$1" == "-h") || ("$1" == "--help") ) then
+ echo "Usage $myname [-d|-d-] paper.tex"
+ echo ""
+ echo " -d ==> display errors"
+ echo " -d- ==> do not display errors (default)"
+ echo " -h, --help ==> show this message"
+ exit 0
+endif
+
+set paper=$1
+if ( "$paper:e" == "" ) then
+ set base=$paper
+ set paper=${base}.tex
+else
+ set base=$paper:r
+endif
+
+if !(-f $paper) then
+ echo $paper does not exist\!
+ exit 1
+endif
+
+# set overfull = Overfull
+set overfull = NoOverfull
+echo ALL $overfull MESSAGES WILL BE SUPPRESSED
+# see Lamport page 177 for dealing with overfull boxes.
+# basically, do this:
+# \documentclass[12pt,draft]{article}
+# draft will mark the overfull boxes and the solution
+# will become obvious...
+
+# run latex. The cat /dev/null prevents
+# latex from stopping. Errors are reported to paper.log
+cat /dev/null | latex $paper | grep -v $overfull
+
+# determine if there was an error, by looking at paper.log:
+grep "Emergency stop" $base.log
+@ emergencyStop = ($status == 0)
+
+# Also find if no output produced:
+# Examine only the last line of the file to pick out only the
+# message produced by TeX, and not something else with the same
+# string.
+tail -1 $base.log | grep "No pages of output."
+@ noOutput = ($status == 0)
+
+if ($emergencyStop || $noOutput)then
+ # begin latexerrors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ echo create and display latex errors
+ beep&
+ set err = /tmp/`whoami`-$base:t
+ set tmperr = $err.tex
+
+ echo "\documentclass[12pt]{article}" > $tmperr
+ echo "\textwidth 7.5in" >> $tmperr
+ echo "\begin{document}" >> $tmperr
+ if ( $emergencyStop ) then
+ echo "Error(s) in tex file ($paper): " >> $tmperr
+ else if ( $noOutput ) then
+ echo "No output from tex file ($paper): " >> $tmperr
+ endif
+ echo "\begin{verbatim}" >> $tmperr
+
+ cat $base.log >> $tmperr
+
+ echo "\end{verbatim}" >> $tmperr
+ echo "\end{document}" >> $tmperr
+
+ # latex puts its generated files in the current directory, rather
+ # than the directory of the source file. So change to the
+ # temporary directory, and run latex with the path removed from the
+ # filename argument:
+ pushd /tmp
+ latex $err:t
+ popd
+
+ # Give the original latex file a valid dvi file containing the error log.
+ cp $err.dvi $base.dvi
+
+ # Make a dummy aux file. And also make a .aux.bak file. This
+ # solves the following:
+ # 1. Sometimes a run with errors results from or has produced
+ # a bad .aux file. This gets read in on the next run and
+ # an infinite error loop results unless the .aux file is
+ # deleted or replaced by something innocuous.
+ # 2. Latexmk is liable to make extra runs of latex after an
+ # error is produced. In simple cases, this can be avoided
+ # if the aux file is later than the tex file and the
+ # aux.bak file has the same contents.
+ echo "\relax" > $base.aux
+ echo "\relax" > $base.aux.bak
+
+ rm -f $err.aux $err.log $err.tex
+
+ if ( $displayErrors) then
+ # Popup a new window containing the error log
+ if ( $emergencyStop ) then
+ echo xdvi display shows the last page of the errors
+ set page = '+'
+ else
+ set page = ''
+ endif
+ xdvi $err.dvi $page &
+ sleep 2
+ endif
+ rm -f $err.dvi
+
+ exit 1
+ # end latexerrors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+else
+ echo Successful run
+ exit 0
+endif
diff --git a/support/latexmk/extra-scripts/myhtlatex2 b/support/latexmk/extra-scripts/myhtlatex2
new file mode 100644
index 0000000000..f2db06fd66
--- /dev/null
+++ b/support/latexmk/extra-scripts/myhtlatex2
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# This is a replacement for htlatex from the TeX4ht package. It allows
+# latexmk to be used to do the latex part of the processing.
+# See TeX4ht-latexmkrc in the example-rcfiles directory of the latexmk
+# distribution for how to use this.
+#
+# This is a shell script suitable for UNIX-like operating systems (including
+# OS-X and linux, and presumably Cygwin under MS-Windows).
+
+if [[ $# -lt 1 || $1 == "--help" || $1 == "-help" || $1 == "-h" ]]; then
+ echo "Convert tex file to html. Simplest usage"
+ echo " myhtlatex2 file"
+ exit 1
+fi
+
+latexmk $1
+tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644
diff --git a/support/latexmk/extra-scripts/pst2pdf_for_latexmk b/support/latexmk/extra-scripts/pst2pdf_for_latexmk
new file mode 100644
index 0000000000..8dae4d26c9
--- /dev/null
+++ b/support/latexmk/extra-scripts/pst2pdf_for_latexmk
@@ -0,0 +1,49 @@
+#! /bin/bash
+# pst2pdf_for_latexmk
+# PSTricks 2 PDF converter :
+# Usage:
+# pst2pdf_for_latexmk
+# produces PDF files for all files of the form *-fig*.tex
+# pst2pdf_for_latexmk <FILE>
+# only considers FILE-fig*.tex
+
+# Modified from pst2pdf distributed with pdftricks.sty to use latexmk
+
+# IT REQUIRES VERSION 3.21 OR HIGHER OF latexmk
+
+# For each pdf file will only be made if the tex source is out-of-date
+# This version of pst2pdf does not clean up generated files: they are
+# needed by latexmk to determine whether or not the pdf file is
+# out-of-date.
+#
+# To use this automatically with latexmk (linux/UNIX system assumed)
+# 1. Install this script (pst2pdf_for_latexmk) somewhere in your PATH
+# 2. Put a line like the following in an initialization file for latexmk:
+# $pdflatex = 'pdflatex %O %S; pst2pdf_for_latexmk %B';
+
+# 13 Oct 2016 John Collins: Remove outdated URL and version information
+# 1 Oct 2007 John Collins: Remove path from latexmk
+# 28 Sep 2007 Herb Schulz processing steprs of figure files changed for no rotation and better BoundingBox
+# 27 Sep 2007 John Collins
+# 26 Sep 2007 John Collins
+
+Myname='Pst2pdf_for_latexmk'
+myname='pst2pdf_for_latexmk'
+
+echo "This is $myname modified to use latexmk, by John Collins"
+
+FILE=$1
+if test -z $FILE; then
+ FIGURES=`ls *-fig*.tex`;
+else
+ FIGURES=`ls -- $FILE-fig*.tex`;
+fi
+
+
+if test -z "$FIGURES"; then
+ echo $Myname: No files to process
+else
+ echo $Myname: Using latexmk to process: $FIGURES
+# latexmk -pdfdvi -ps- -dvi- -e '$dvipdf = q{dvips -E -o %B.eps %S && epstopdf %B.eps --outfile=%D}' $FIGURES
+ latexmk -pdfdvi -ps- -dvi- -e '$dvipdf = q{dvips -o %B.ps %S ; ps2pdf13 -dAutoRotatePages=/None %B.ps ; pdfcrop %B.pdf ; /bin/mv %B-crop.pdf %D}' $FIGURES
+fi
diff --git a/support/latexmk/extra-scripts/pst2pdf_for_latexmk_README.txt b/support/latexmk/extra-scripts/pst2pdf_for_latexmk_README.txt
new file mode 100644
index 0000000000..5ca5586266
--- /dev/null
+++ b/support/latexmk/extra-scripts/pst2pdf_for_latexmk_README.txt
@@ -0,0 +1,13 @@
+Pdftricks implementation for TeXShop.
+
+The files ``pdftricksmkrc'' and ``pst2pdf_for_latexmk'' (as well as latexmk, etc.) are stored in ~/Library/TeXShop/bin/
+
+The file pdftrciskmk.engine is stored in ~/Library/TeXShop/Engines/.
+
+When instructed to Typeset a the file TeXShop cd's to the tex files directory and calls pdftricksmk.engine passing the file name (with extension). This executes latexmk using the pdftricksmkrc file for initialization.
+
+The call to pdflatex in the rc file DOES use shell escape (just in case eps files are also being input using epstopdf) so you MUST use the [noshell] option for pdftricks (\usepackage[noshell]{pdftricks}) to avoid a run condition.
+
+The processing steps I use for the -fig* files differs from that used in the standard pdftricks (and what you used). We've discovered that the original processing sometimes rotates figures and also sometimes produces a BoundingBox that cuts off descenders on letters at the edge of the figure. (I've changed my pdftricks package to use these steps too and have let the authors of that package know.)
+
+So far it seems to work. I'll get to work on a pst-pdf package example but, now that I'm beginning to understand what is happening with your new extensions to latexmk, I also suspect it should be fairly easy to accomodate that package. I don't see a case where anyone would use both pdftricks and pst-pdf while I do see cases where eps images, included using epstopdf, will be mixed with pstricks type images.
diff --git a/support/latexmk/extra-scripts/startacroread b/support/latexmk/extra-scripts/startacroread
new file mode 100644
index 0000000000..a1e98fce6b
--- /dev/null
+++ b/support/latexmk/extra-scripts/startacroread
@@ -0,0 +1,231 @@
+#!/bin/bash
+
+# -------------------------------------------------------------------
+#
+# Shell program to start an instance of "acroread" on localhost via
+# "pdfopen" and call "pdfopen" again every time when catching the SIGUSR1
+# signal. This provides the same behaviour as "xdvi" for reloading changed
+# files. Acrobat Reader doesn't come with a "watch file" option, hence
+# this workaround, sigh...
+#
+# Copyright 2005, Thorsten Bonow
+# ( thorsten.bonow at post.rwth-aachen.de ).
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# Description:
+#
+#
+#
+# Usage:
+#
+# startacrobat [ -h | --help ] [PDF document]
+#
+# Options:
+#
+# -h, --help Display this help message and exit.
+#
+# Known Bugs:
+#
+# No other instance of Acrobat Reader should be running: this script kills
+# all of them on exit!
+#
+# Revision History:
+#
+# 01/05/2005 Initial version, adapted from "startxpdf"
+# 28/08/2005 Adapted to "pdfopen" and "acrobat"
+# 01/14/2006 Use HUP or USR1 signal for update to be fully
+# compatible with latexmk 3.07 and 3.08
+# (modification by John Collins (collins at phys.psu.edu))
+#
+#
+# -------------------------------------------------------------------
+
+
+# -------------------------------------------------------------------
+# Constants
+# -------------------------------------------------------------------
+
+ PROGNAME=$(basename $0)
+ VERSION="0.95A"
+ ACRO_RELOAD_EXEC="pdfopen --file"
+ ACROBAT_EXEC="acroread"
+
+# -------------------------------------------------------------------
+# Functions
+# -------------------------------------------------------------------
+
+
+function clean_up
+{
+
+# -----------------------------------------------------------------------
+# Function to kill remote instance of acrobat
+# No arguments
+# -----------------------------------------------------------------------
+
+ return
+}
+
+
+function error_exit
+{
+
+# -----------------------------------------------------------------------
+# Function for exit due to fatal program error
+# Accepts 1 argument:
+# string containing descriptive error message
+# -----------------------------------------------------------------------
+
+
+ echo "${PROGNAME}: ${1:-"Unknown Error"}" >&2
+ clean_up
+ exit 1
+}
+
+
+function graceful_exit
+{
+
+# -----------------------------------------------------------------------
+# Function called for a graceful exit
+# No arguments
+# -----------------------------------------------------------------------
+
+ clean_up
+ exit
+}
+
+
+function usage
+{
+
+# -----------------------------------------------------------------------
+# Function to display usage message (does not exit)
+# No arguments
+# -----------------------------------------------------------------------
+
+ echo "Usage: ${PROGNAME} [-h | --help] [PDF document]"
+}
+
+
+function helptext
+{
+
+# -----------------------------------------------------------------------
+# Function to display help message for program
+# No arguments
+# -----------------------------------------------------------------------
+
+ local tab=$(echo -en "\t\t")
+
+ cat <<- -EOF-
+
+ ${PROGNAME} ver. ${VERSION}
+ Shell program to start an instance of "acroread" on localhost via
+ "acro-reload" and call "acro-reload" again every time when catching the
+ SIGUSR1 signal. This provides the same behaviour as "xdvi" for reloading
+ changed files. Acrobat Reader doesn't come with a "watch file" option,
+ hence this workaround, sigh...
+
+ $(usage)
+
+ Options:
+
+ -h, --help Display this help message and exit.
+
+
+
+
+-EOF-
+}
+
+
+function signal_handle
+{
+
+# -----------------------------------------------------------------------
+# Function to handle signals
+# Accepts 1 argument:
+# signal_spec
+# -----------------------------------------------------------------------
+
+ case $1 in
+ INT) echo "$PROGNAME: Program aborted by user" >&2
+ clean_up
+ exit
+ ;;
+ TERM) echo "$PROGNAME: Program terminated" >&2
+ clean_up
+ exit
+ ;;
+ USR1) echo "$PROGNAME: Reloading..." >&2
+ $ACRO_RELOAD_EXEC $PDF_FILE
+ ;;
+ *) error_exit "$PROGNAME: Terminating on unknown signal"
+ ;;
+ esac
+}
+
+
+# -------------------------------------------------------------------
+# Program starts here
+# -------------------------------------------------------------------
+
+
+##### Command Line Processing #####
+
+if [ "$1" = "--help" ]; then
+ helptext
+ graceful_exit
+fi
+
+while getopts ":h" opt; do
+ case $opt in
+
+ h ) helptext
+ graceful_exit ;;
+ * ) usage
+ clean_up
+ exit 1
+ esac
+done
+
+PDF_FILE="$1"
+
+##### Initialization And Setup #####
+
+# Trap TERM and INT signals and properly exit
+
+trap "signal_handle TERM" TERM
+trap "signal_handle INT" INT
+
+# Trap HUP and USR1 signals for reloading the PDF document
+# Convert to USR1
+# (Note HUP is used by gv, and USR1 by xdvi, so both signals have precedent)
+
+trap "signal_handle USR1" HUP USR1
+
+
+##### Main Logic #####
+
+$ACRO_RELOAD_EXEC $PDF_FILE
+
+while [ 1 ];
+ do
+ # sleeps again after being interrupted by SIGUSR1, breaks if Acrobat Reader is
+ # killed
+ sleep 1
+ eval pgrep "-f" "$ACROBAT_EXEC" ">/dev/null" || break
+done
+
+graceful_exit
+