Auxiliary scripts for latexmk
=============================

John Collins (collins at phys.psu.edu)
20 Jan 2007

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.tug.org/tex-archive/support/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 from latexmk.  They solve
    the problem that when latexmk converts dvi files to pdf, it
    assumes that it is using dvipdf.  If you reconfigure latexmk to
    use dvipdfm or dvipdfmx, the command line arguments are wrong, and
    you will get an error message.  The scripts dvipdfm_call and
    dvipdfmx_call do the appropriate conversion of the command-line
    arguments.   

    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.

    To use these scripts: install the scripts/batch files as
    appropriate, and configure one of latexmk's initialization files
    to use the script you need.  The correct configuration will have
    one of the lines

             $dvipdf = 'dvipdfm_call';
    or
             $dvipdf = 'dvipdfmx_call';

    Then you will need to set to use the dvipdf method of making pdf
    files, either on latexmk's command line, or in a configuration
    file with the line 

         $pdf_mode = 3;

