The "commands" panel of LaTeX.bsh

Version 11-October-2007.



All the macros presented here can be invoked from the LaTeX.bsh dialog (a small icon represents the corresponding button). These macros can also be invoked from the Macros > LaTeX menu (the name of the macro is given in the corresponding button syntax).


Invocation of system commands

Buttons for compilation and for viewers invoke system commands. These commands are defined as strings in the configuration file LaTeX.c. For example:
  • latexString = "\"C:\\texmf\\miktex\\bin\\latex\" -interaction nonstopmode -c-style-errors |";
  • latexString = "latex -interaction nonstopmode -file-line-error-style |";.
The options -c-style-errors (MiKTeX) or -file-line-error-style are required for identifying compilation errors. The string "|" is automatically replaced by the project main file name. Similar remark for the pdflatex. "BiBTeX", "Dvips" and so on are defined in a similar way.

Button syntax for latex compilation:
{"st", latexString, "LaTeX"},

Concerning viewers, it is better to add "&" at the end of the command string, for example xdviString = "xdvi | &";.

Note that some actions depend on other ones, for example for viewing in PDF format (buttons "Acrobat" and "Pdf"), it is necessary to generate before the PDF file e.g. (buttons "pdfTeX" (which invokes pdflatex) or TeX2pdf or Ps2pdf). But, before using Ps2pdf you must generate the postscript file ("button Dvips"), etc....

You can reduce compilation steps and display in viewers to a single command by combining command strings (system commands must be separated by \n), for example a button defined as follows
{"st", latexString + "\n" + bibtexString + "\n" + latexString + "\n" + latexString + "\n" + xdviString, "View DVI"},
will launch latex, bibtex, then twice latex and finally xdvi.

TOP


Perl-based labels parser

The button "Parse" opens a buffer listing labels and project files. From this buffer, you can:

  • insert references into a .tex document using the "\ref{}" button ("Gene1" panel).
  • navigate your project using the "Go to" button.
The macro behind calls a Perl script latexLabelParser.pl (if Perl is not available, remove this button).

Button syntax for invoking this macro:
{"lt", "Macros.getMacro(\"LaTeX/latexLabelParser\").invoke(view);", "Parse"},

TOP


Perl-based errors/warnings parser

The button "Errors" opens a buffer listing all errors and warnings identified from the log file. This macro is especially useful for warnings on two lines (most warnings) because they are ignored by the Console/Error plugins. The macro behind calls a Perl script latexLogFileParser.pl (if Perl is not available, remove this button, in this case try the "Log" button).

Note that there are some limitations if you use the "Go to" button if some file (say file1.tex) "includes" another file (say file2.tex). In this case, some errors and warnings encountered after return to file1.tex will still be considered as occuring in file2.tex. In order to avoid this problem it suffices to "include" all .tex files from the master document.

Button syntax for invoking this macro:
{"lt", "Macros.getMacro(\"LaTeX/latexLogFileParser\").invoke(view);",
"Errors"},

TOP


Go to label or error/warning

The button "Go to" is for navigation within a project. It must be used after having parsed the labels (button "Parse") or the errors/warnings (button "Errors"). Move the caret in the buffer which is automatically opened after parsing to some line containing a line number, then click the "Go to" button.

Button syntax for invoking this macro:
{"lt", "Macros.getMacro(\"LaTeX/latexGoto\").invoke(view);", "Go to"},

TOP


Open log file

The button "Log" opens the LaTeX log file generated by latex and pdflatex compilations. The latexlog.xml file of the goodies sub-directory is for syntax highlighting of LaTeX log files.

Button syntax for invoking this macro:
{"lt", "Macros.getMacro(\"LaTeX/latexOpenLogFile\").invoke(view);", "Log"},

TOP


Help for the LaTeX.bsh macro

The button "Help" opens an HTML files contained in the doc subdirectory in the Info Viewer (if it disappears immediately, change the "auto hide" feature of the docker plugin).

These files are better viewed in an external browser (the Info Viewer plugins can be configured so that an external browser replaces jEdit browser). For configuring the Info Viewer, select the "Plugin Options" entry of the "Plugin" menu and click "Info Viewer > Choose Browser > External Browser". Then enter the required command, for example: "C:\Program Files\Mozilla Firefox\firefox.exe" $u.

Button syntax for invoking this macro:
{"lt", "Macros.getMacro(\"LaTeX/latexMacroHelp\").invoke(view);", "Help"},

It can also be invoked in order to open a specified HTML file, for example:
{"lt","jEdit.setProperty(\"helpChoice\",\"customization.html#perso\"); Macros.getMacro(\"LaTeX/latexMacroHelp\").invoke(view);", "Help"},

TOP


Edit the configuration file

The button "Edit macro" opens a buffer containing the configuration file LaTeX.c. In this file you can customize size and position of the dialog window, number of tabbed panes, number of buttons, actions, colors and so on (extension .c in order to avoid this file to be an entry of the macro menu and in order to preserve colored syntax). If you change this file, close the dialog and reopen it.

TOP