Using Perl in your LaTeX Design Flow


Anyone who typesets with LaTeX has probably grown tired of creating new LaTeX top level or lower level modules. I have generated a couple of Perl Scripts that will automatically generate the top level module and lower level module for you. These Perl Scripts can be invoked from within a bash terminal, Cygwin or a DOS Command Window. These files are hosted on GitHub at the link below:

Below are the scripts available in the GitHub LaTeXTools project:

Follow LaTeXTools on GitHub


How to use latex_new.pl?


This utility is intended to make creating new LaTeX modules easier.

The script will generate the empty LaTeX template for you in the file "new_module_name.tex". Note: "new_module_name.tex" is the name of the new LaTeX file and can be anything you like. You can either use a bash terminal, Cygwin or a DOS Command prompt to run this script. If you want to use a bash terminal, Cygwin or a DOS Command prompt, then see the instructions below:

  1. Change directory to the desired directory; if necessary create a directory to store the new document.
  2.                                 [user@machine ../doc] 
                                    $ mkdir top/
                                    [user@machine ../doc] 
                                    $ cd top/
                                    [user@machine ../doc/top] 
                                    $ 
                                
  3. Type the following: perl latex_new.pl new_module_name.tex
  4.                                 [user@machine ../doc/top] 
                                    $ perl latex_new.pl new_module_name.tex
    
                                    The script has finished successfully! You can now use new_module_name.tex
    
                                    [user@machine ../doc/top] 
                                    $ 
                                
  5. When the script is finished you will see the message: "The script has finished successfully! You can now use new_module_name.tex."
Back to Top

How to use latex_bot.pl?


This utility is intended to make creating new LaTeX modules easier.

The script will generate the empty LaTeX template for you in the file "new_module_name.tex". Note: "new_module_name.tex" is the name of the new LaTeX file and can be anything you like. You can either use a bash terminal, Cygwin or a DOS Command prompt to run this script. If you want to use a bash terminal, Cygwin or a DOS Command prompt, then see the instructions below:

  1. Change directory to the desired directory; if necessary create a directory to store the new document.
  2.                                 [user@machine ../doc] 
                                    $ mkdir top/
                                    [user@machine ../doc] 
                                    $ cd top/
                                    [user@machine ../doc/top] 
                                    $ 
                                
  3. Type the following: perl latex_bot.pl new_module_name.tex
  4.                                 [user@machine ../doc/top] 
                                    $ perl latex_bot.pl new_module_name.tex
    
                                    The script has finished successfully! You can now use new_module_name.tex.
    
                                    [user@machine ../doc/top] 
                                    $ 
                                
  5. When the script is finished you will see the message: "The script has finished successfully! You can now use new_module_name.tex."
Back to Top