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.
