GeanyLATEX – A LATEX plugin for Geany

Version 0.4

Frank Lanitz
frank@frank.uvena.de

May 25, 2009
Note: Please note the document has been created on May 25, 2009. If you are using devel version from SVN, please compile and check doc/geanylatex.tex from sources. Please check page 5, section 4.2 how to do so.

Contents

List of Tables
1 About the plugin
2 News
3 Requirements
4 Installation
 4.1 Compiling the plugin itself
 4.2 Compiling of documentation
5 Usage
6 Features
 6.1 LATEX-Wizard
 6.2 Inserting References and Labels
 6.3 BibTeX templates for catalogue entries
 6.4 Replacement of special characters
 6.5 Inserting of special character
 6.6 Inserting of Environment
 6.7 Format
7 Configuration
 7.1 GeanyLaTeX’s configuration dialog
 7.2 Key bindings
8 Donating to the plugin
 8.1 Extending plugin
 8.2 Testing & bug reporting
 8.3 Packaging
 8.4 Improving and extending of documentation
 8.5 Propaganda
9 Development
 9.1 Development version
10 Known issues
11 Recommendations to improve work with LATEX and Geany
 11.1 Geany’s code snippet function
 11.2 Other useful plugins
12 License
13 Bugs, questions, homepage

List of Tables

List of available keybindings

1 About the plugin

GeanyLATEX is a little plugin to improve support of LATEX on Geany. It implements a couple of maybe useful functions:

2 News

GeanyLaTeX 0.4 – 2009-05-26

3 Requirements

For compiling the plugin yourself, you will need the GTK (>= 2.6.0) libraries and header files. You will also need its dependency libraries and header files, such as Pango, Glib and ATK. All these files are available at http://www.gtk.org.

And obviously, you will need have Geany with its header files installed (in case you are compiling the plugin on your own). If you have Geany installed from the sources, you should be ready to go. If you used a prepared package e.g. from your distribution you probably need to install an additional package, this might be called geany-dev or geany-devel. Please note that in order to compile and use this plugin, you need Geany 0.16 or later (Geany Plugin API v130 or higher).

Furthermore you need, of course, a C compiler and the Make tool. The GNU versions of these tools are recommended. Also there should be a working LATEX-environment on your System.

There is no special need in RAM or CPU so the plugin should run on all systems Geany is able to run.

4 Installation

4.1 Compiling the plugin itself

Compiling and installing the code is done by the following three commands:


$ ./configure 
$ make 
$ make install %$

For more configuration details run ./configure --help

If there are any errors during compilation, check your build environment and try to find the error, otherwise contact one of the authors1

4.2 Compiling of documentation

Sources of this documentation are available throught doc/geanylatex.tex inside source tree. To compile the sources, usage of pdflatex (should be delivered with your favorite LATEX distribution) is recommended. For compiling into HTML format you might like to use htlatex. The HTML version of this documentation shipped with source tarball has been compiled with


htlatex geanylatex.tex xhtml -cvalidate -interaction=batchmode

5 Usage


PIC

Figure 1: Plugin manager with GeanyLATEX of Geany 0.16

After GeanyLATEX has been installed successfully the plugin can be loaded through Geany’s plugin manager and a new sub menu in the Tools menu will appear as well as new key bindings will be available inside Geany’s key binding interface. Inside the sub menu you will find entries for functions supported by this version of the plugin. It will be called LaTeX.

Also if the option for showing the toolbar is activated on configuration dialog, the toolbar with common used format functions appears on at top of editor widget. This feature is turned off by default.

6 Features

Let’s go into more detail on some features.

6.1 LATEX-Wizard

The LATEX-Wizard is implementing a easy way creating a number of default documents.


PIC

Figure 2: LATEX-Wizard of version 0.4

Document types that are currently supported by the wizard are:

This can be set by choosing the needed entry form Documentclass pulldown menu.

Encoding is configuring the packages inputenc to for example \usepackage[utf8]{inputenc} in case of the document encoding should be UTF-8. Also it sets the encoding Geany is using for the newly created document.

Font size as well as Paper size will set class option for font/paper size of the new created document. Author, Date, Title will be also passed to the corresponding command inside the file header.

Option Use draft mode will add draft to list of document options which allows some help during debugging of document.

Since KOMA script is quiet popular the option Use KOMA script if possible allows to activate the usage of KOMA script. If this options is activated instead of book, scrbook will be used as document class. Default is activated here. This option is deactivated by default and can be set through GeanyLATEX’s configuration dialog mentioned earlier in this document.

This wizard can also be called by a shortcut. Please have a look onto section 1, page 38.

6.2 Inserting References and Labels

An often used feature on writing of documents is adding and referring to labels. GeanyLATEX is adding some support here for more comfortable adding new labels and reference offering a GUI.


PIC

Figure 3: Insert label dialog on GeanyLATEX 0.4

After an label was added GeanyLATEX is offering a dialog for inserting normal references and page references to an label.


PIC

Figure 4: Insert reference dialog on GeanyLATEX 0.4

The suggestions inside the pull down are based on the aux file creating by processing of *.tex file. The plugin is searching for a aux file for the current open *.tex file inside current directory. When first step was successful the file is parsed for \newlabel{}{}{} and tries to interpret them properly. The found entries will be inserted into pull down sorted by alphabet.

Both, the inserting labels as well as the inserting reference dialog can be accessed by key binding also. See chapter 1 and 1 here.

6.3 BibTeX templates for catalogue entries

GeanyLATEX is offering a number of often used templates for BibTeX catalogue entries. They can be access by the plugin submenu in Geany’s tools menu:

When choosing an entry from list on menu a templace with common used fields will be generated and inserted into the document. The template will be inserted on position of cursor which will no be moved during the process. As an example for a book, this will be inserted to the document:


@Book{ 
Author = {}, 
Editor = {}, 
Publisher = {}, 
Title = {}, 
Year = {}, 
}

6.4 Replacement of special characters

GeanyLATEX is able to replace special characters to their there TEX substitute. This can be done in two different ways:

  1. On input: If this switch is active all special characters will be replaced during typing of text. You can turn the switch on/off at Replacement of special characters submenu inside.
  2. Bulk replace of selected text: A selected text will be parsed and all known special characters will be replaced by their TEX substitute. This can be very useful on importing a large amount of text into your document including characters like ö or . This function is available through the Replacement of special characters submenu on plugin’s submenu of Geany’s Tools menu.

For both functions there are also shortcuts available.

6.5 Inserting of special character

The plugin is offering a number of special characters with their TEX substitutes to be inserted on easy accessing through the plugin menu.

6.6 Inserting of Environment

GeanyLATEX is offering a feature for inserting environments into your documents. It can be chosen from a pulldown menu and will be inserted at current position of cursor. If there is a selection activ, the selection will be included into environment.


\begin{your_environment} 
    % ... selected text ... 
\end{your_environment}

In case of an empty (= no selection) an empty environment with


\begin{your_environment} 
... 
\end{your_environment}

will be inserted to the document.


PIC

Figure 5: Insert environment dialog on GeanyLATEX 0.4

6.7 Format

GeanyLATEX is able to help on formation of text. For doing this its offering you to insert often use format patterns to your document. Patterns that are currently supported are:

GeanyLATEX will add the correct format pattern to the document. If there is an selection active, that pattern will be placed around so the selected text will be formatted with this chosen style.

Following items are also accessible using the GeanyLATEX toolbar:

7 Configuration

GeanyLaTeX can be configured in two major ways:

  1. GeanyLaTeX’s configuration dialog
  2. Geany’s keybindings interface

7.1 GeanyLaTeX’s configuration dialog

With version 0.4 the configuration dialog is offering two options which can be changed:

7.1.1 Use KOMA script by default

KOMA script bei Markus Kohm is a very popular set of document classes mainly used in Europe. With this option the default setting for e.g. LATEX-Wizard can be configured2 . Option is turned off by default.

7.1.2 Show extra toolbar

Decides whether toolbar with some format icons should appear in the top of editor widget. Option is turned off by default. Just give it a try.

7.2 Key bindings

Keybindings which are available:


Table 1: List of available keybindings
Shortcut

Description





Run LaTeX-Wizard

Starts the LaTeX-Wizard for creating a new document



Insert \label

Runs the dialog for inserting a new label into your document.



Insert \ref

Starts an dialog for easy inserting \ref and\pageref into your document. The dialog is supporting easy parsing of aux files so it can suggest a couple of already set labels.



Insert linebreak \\

Inserts a a newline \\ into the document.



Turn input replacement on/off

A shortcut for turning input replacement on or off. When input replacement is activated special characters like ě are replaced by there TEX substitute like \v{e}



Replacement of special characters

A selected text will be parsed and all known special characters will be replaced by their TEX substitute. This can be very useful on importing a large amount of text into your document including characters like ö or .



Run insert environment dialog

Runs a dialog for easy inserting an environment. If there is some text selected, the environment will be placed around.



Insert \item

This shortcut will add an simple \item to the document. This can be very useful during writing of lists with a huge number of items.



Format selection in bold font face

Format a selection with bold font face. This is done be adding \textbf{...} around selection.



Format selection in italic font face

Format a selection with italic font face. This is done be adding \textit{...} around selection.



Format selection in typewriter font face

Format a selection with typewriter font face. This is done be adding \texttt{...} around selection.



Format selection centered

Formats selected text centered on page (uses \centering



Format selection left-aligned

Formats selected text left-aligned on page (uses \raggedleft



Format selection right-alignedm

Formats selected text right-aligned on page (uses \raggedright




8 Donating to the plugin

If you like the plugin, there are a number of ways, how to donate the development of the plugin.

8.1 Extending plugin

8.1.1 Adding a new translation

Currently the plugin is available in English and German language but we are always looking for other translations to. There are two major topics in translation:

  1. Translation of plugin: Adding a new translation and improving an existing one is easy to do. After catching the source tarball and extracting you can find all needed files inside the po folder.
    Please contact the authors if you plan to update/add a translation to ensure nobody else is currently working on and avoid double work and to get some further information about translation (see chapter 13).
  2. Translation of documentation: Since this document is currently only available in English it would be helpful for not English speaking people to have a translated version. If you like to do an translation, please also contact one of the authors for details (see chapter 13).

8.1.2 Adding a new feature

New features are always highly welcome. The TODO file inside source code archive gives a good idea of current wished features and which are being worked on. Also you can have a look onto the feature request tracker of geany-plugins project at http://sourceforge.net/tracker/?group\_id=222729 whether you find something interesting. Of course we are also open for not in the sources mentioned before listed items. Just contact one of the authors (see chapter 13).

8.2 Testing & bug reporting

GeanyLATEX is tested mainly on x86 and x86_64 architecture running GNU/Linux. Also it was tested on some Windows 32 versions like XP SP3 very briefly. Since there are also other systems available, testing on other platforms and maybe reporting of issues is highly appreciate.

8.3 Packaging

GeanyLATEX is part of the geany-plugins project even though there are releases independent of a major release of the project. Therefor there are two things you can do here:

  1. Package the plugin for your operating system or distribution. As you might can imagine, the authors unfortunately cannot support all possible platforms.
  2. Help to keep releases and packages of geany-plugins project up to date for current version of Geany.

8.4 Improving and extending of documentation

Documentation is never complete. There are spelling mistakes, paragraphs that needs to be extended or rewritten because they are not clear or topics that were missed out at all.

The documentation is written in LATEX so all you need is to get the tex file from doc folder and add or update the content. After this, just send a diff or complete file to one of the authors.

8.5 Propaganda

And of course, tell others of Geany and this plugin. If you like to do a talk about GeanyLATEX and/or Geany in general, there is some code available on http://git.geany.org/talks/ you might can use as a start point for preparing your own presentation. If your favourite language is not yet available there, please feel free to do your own translation and in best case send your translation to one of Geany’s3 development team so it can be added to archive.

9 Development

9.1 Development version

You can checkout the current source code from the Subversion repository at Sourceforge.net. Get the code from:

svn checkout http://geany-plugins.svn.sourceforge.net/svnroot/geany-plugins/trunk/geanylatex

9.1.1 Sending a patch

If you want to create a patch, please respect the license of GeanyLATEX as well as intellectual property of third. Patches that should be included to the default distribution must be licensed under the same conditions as GeanyLATEX by the copyright owner.

10 Known issues

At time of the the documentation was created no issue were known. Since this is only a snapshot, you will find more recent information for all reported issues bug tracking system of SF at
http://sourceforge.net/tracker/?group\_id=222729

11 Recommendations to improve work with LATEX and Geany

Geany is offering a number of nice features, that can be used to make daily work more easy without need to write a new plugin or extend GeanyLATEX.

11.1 Geany’s code snippet function

Geany is allowing you to define code snippets and inserting them easy during writing a document. This gives you some more flexibility than to create new commands.

A possible snippet for snippets.conf could be:


[LaTeX] 
frame=\\begin{frame}\n%ws%\\frametitle{%cursor%}\n%ws%%cursor%\n\\end{frame} 
block=\\begin{block}{%cursor%}\n%ws%%cursor%\n\\end{block} 
itemize=\\begin{itemize}\n%ws%\\item %cursor%\n\\end{itemize} 
enumerate=\\begin{enumerate}\n%ws%\\item %cursor%\n\\end{enumerate} 
description=\\begin{description}\n%ws%\\item %cursor%\n\\end{description}

A snapshot of authors’ last version for LaTeX can be found on http://www.geany.org/Download/Extras

11.2 Other useful plugins

As mentioned before a number of useful functions were already implemented with other plugins. Below you will find a list with the authors’s recommendations. More nice plugins can be found on Geany’s plugins page at http//www.geany.org.

11.2.1 GeanyLipsum

This plugin implements an easy way for inserting Lorem Ipsum text into a document. The length of the inserted text if configurable so the plugin can be very helpful on testing layout.
Homepage: http://frank.uvena.de/en/Geany/geanylipsum/

11.2.2 geanyVC

When working on bigger documents a version control system like Subversion could be useful to keep versions. GeanyVC is adding a easy to use frontend for a number of popular version controll systems such as git, Subversion, CVS, Bazaar or Mercural.
Homepage: http://plugins.geany.org/geanyvc/

11.2.3 tasks out of the addons plugins

A plugin that is recognising TODO or FIXME tags inside a document and allows to easy jump to these entries. This function is similar to the todo package but doesn’t require recompiling of the document. Recognised tags will be inserted to another tab in Geany’s message widget.
Homepage: http://plugins.geany.org/addons/

12 License

GeanyLATEX and all its parts is distributed 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. A copy of this license can be found in the file COPYING included with the source code of this program. If not, you will be able to get a copy by contacting the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

13 Bugs, questions, homepage

If you found any bugs or want to provide a patch, please contact Frank Lanitz (frank(at)geany(dot)org). Please also do so, if you got any questions and visiting
http://frank.uvena.de/en/Geany/geanylatex/ didn’t help you to figure out the answer. Visiting the website is also a good start if you want to check for any update on this plugin.