LaTeX Exporter
Inserts buttons to export to LaTeX in the Export UI (internally using the Output Filter to trigger the export) |
Type | JAR |
Category | UI Extension |
Developed by | |
Active Installs | 44 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Compatibility | Since v1.5 requires XWiki 10.2RC1 |
Table of contents
Description
Provide an entry point to export a wiki page into:
- LaTeX content (you get a zip file containing the LaTeX files)
- Latex 1.10+ PDF directly (the LaTeX files are converted to PDF)
See Output Filter for more details about the generated package.
Usage
Export
You will get 2 entries in the export menu for LaTeX as follows:
Exporting to PDF requires one of the following:
- Docker is installed, see the LaTeX to PDF documentation. If Docker is not set up on the XWiki server, then no "Export as PDF" button will be shown.
- Latex 1.18+ The LaTeX extension is configured to convert to PDF by using a local process.
Alternatively you can export a page by changing the /view/ action in the browser address bar into /latexexport/. For example to export the wiki home page you can use http://myhost/xwiki/bin/latexexport/Main/. If you pass the pdf=true query string parameter, the export will generate a PDF.
Options
Then you'll get various export options that you can select/configure:
Progress
Latex 1.12+
Since the export can take some time (especially on the first run if you're exporting to PDF and the Docker image used to convert from LaTeX to PDF hasn't been downloaded yet - this is needed only once), the export progress is shown with a progress bar.
Convert to PDF
If you export to LaTeX and wish to manually generate a PDF from it, you can achieve this, using, for example, this LaTeX Docker image. Put yourself at the root of the unzipped ZIP and do the following (after having installed Docker if you don't have it already):
chmod +x latexdockercmd.sh
./latexdockercmd.sh pdflatex -shell-escape index.tex
This will generate an index.pdf file.
Example
Here's an example of the
.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.
By default, the export to PDF will use Docker and thus it requires Docker to be installed, see the LaTeX to PDF documentation.
latex 1.18+
However, it's possible to configure an alternate method that doesn't mandate Docker but that requires some local executable to be present to perform the conversion. See the LaTeX PDF Process extension for details. To configure the export to use the process-based method, configure the following in your xwiki.properties file:
To explicitly configure it to use the Docker-based method, either comment the property or set it to docker, as in:
Dependencies
Dependencies for this extension (org.xwiki.contrib.latex:latex-export 1.25.3):
- org.xwiki.contrib.latex:latex-filter 1.25.3
- org.xwiki.contrib.latex:latex-pdf-docker 1.25.3
- org.xwiki.platform:xwiki-platform-uiextension-api 14.10
- org.xwiki.platform:xwiki-platform-filter-script 14.10
- org.xwiki.platform:xwiki-platform-classloader-xwiki 14.10
- org.eclipse.sisu:org.eclipse.sisu.plexus 0.3.5
- org.iq80.snappy:snappy 0.5
- org.codehaus.plexus:plexus-archiver 4.8.0