cogLaTeX Export API for the Glossary Application
Developed by

Sarthak Gupta, Vincent Massol

Active Installs17
0 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager



  • Custom templates overriding the default LaTeX templates, used to generate glossary entries and a glossary in the exported LaTeX content (and in the generated PDF).
  • Scripting APIs used by the custom templates (and also by the UIXP from the Glossary LaTeX Export UI extension).

Script API

public class LaTeXGlossaryScriptService implements ScriptService
     * Save the glossary data in the script context so that it can be later accessed when saving it to disk.
     * @param entryId the glossary entry id to save
     * @throws GlossaryException in case an error happens to retrieve the document containing the glossary entry

   public void saveGlossaryEntryInContext(String entryId) throws GlossaryException

     * Save glossary entries to a file ({@code glossary.tex} that is LaTeX-included in the preamble.
     * @throws GlossaryException in case of an error writing to file

   public void saveGlossaryEntriesToFile() throws GlossaryException

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.

Note that this extension modifies the default latex.pdf.dockerCommands configuration property value to add the call makeglossaries to generate the Glossary (the default command is: pdflatex -shell-escape index.tex; makeglossaries index; pdflatex -shell-escape index.tex). 

If you're overriding the latex.pdf.dockerCommands configuration property value, make sure to add a call to makeglossaries if you wish to generate the Glossary.


Dependencies for this extension (org.xwiki.contrib.glossary:application-glossary-latex-api 1.0.2):


Get Connected