Class LatexConverter#

Full name: org.wikiwizard.jspwiki.latex.LatexConverter.

The LatexConverter Plugin allows conversion of WikiPages to LaTeX and the Portable Document Format (PDF). You can specify which WikiPages should be converted. This is done by specifiying the pages in the plugin body. The required syntax is explained below. By default (if no plugin body exists), only the current page is included.

Parameters#

  • template - Specifies the used template. This can be one of the templates found in WEB-INF/templates/latex, without file extension, or the name of a Wiki page which contains the LaTeX code to use. This parameter is optional. The configured default template will be used if no template parameter is found.
  • author - The name of the author of the generated document.
  • title - The title of the generated document.
  • filename - The filename of the PDF. Optional, the page name will be used if omitted.
  • mode - Either 'normal' or 'compact'. Compact mode only displays a button, normal also includes a table showing the chosen document settings. This parameter is optional, the configured default mode is used if omitted.
  • abstract - The name of a wiki page containing the text for the abstract. Optional.
  • bibliography - The name of a wiki page containing the bibliography. The bibliography page must contain a Bibliography plugin. Optional.

Handling of plugins#

If a plugin is found on a Wiki page, it is ignored, unless it is one of these specially handled plugins:

  • com.ecyrd.jspwiki.plugin.Image - The referenced image is included into the result document. Only works for JPEG and PNG. The caption parameter is handled. Given width and height parameters are ignored.
  • org.stringfellow.jspwiki.ImageX - Same as the Image plugin above.
  • com.ecyrd.jspwiki.plugin.Math - The Math plugin uses LaTeX code, so it's copied into the result document and surrounded by a Math environment.
  • com.ecyrd.jspwiki.plugin.InsertPage - Included pages are parsed and included in the result document.
  • org.wikiwizard.jspwiki.latex.Bibliography - The BibTeX code found in the plugin body is written to a bibtex file and the bibliography is included into the result document.
  • org.wikiwizard.jspwiki.latex.Cite - The Cite code is converted to a LaTeX bibliography reference.

The document structure#

This section describes how to define the document structure. Examples are given below.

The document structure is defined in the plugin body. Including pages is done by creating a link to them. To include a page named Introduction, a line [Introduction] is inserted in the body. The largest heading found on the Introduction page is mapped to a section heading. Smaller headings are subsections, and so on. One page can contain many sections, or no section at all. So it is also possible to split sections across multiple pages and including them all.

To include subsections, a * symbol is inserted before the link, like *[PageWithSubsections]. That means, the largest heading on the included page is mapped to a subsection. This can be used to split sections in several subsections.

Chapters are not included. Instead just the chapter heading is given and the content of the chapters is included as normal sections, as described above. Typically a chapter heading is followed by one or more links to Wiki pages, which define the sections of the chapters. It depends on the used template, whether chapters are used. When using a book or report template, chapters are necessary. If no chapters are defined, all sections have numbers from 0.1 to 0.n. On the other hand, when using an article template, no chapters are allowed.

Examples#

[{LatexConverter author='Steffen' title='Test document'

 [SamplePage]
 [AnotherSamplePage]
}]

This code is used to create a PDF of two WikiPages. The default template is used, typically this is an article. No chapters are used, as article only have sections.

[{LatexConverter author='Steffen' title='Test document' 
  template='MyTwoColumnReport' abstract='AbstractPage' 
  mode='compact'

Chapter 1
 [Chapter1Part1]
 [Chapter1Part2]
Chapter 2
 [Chapter2IntroductionSection]
  *[Chapter2Subsection]
  *[Chapter2SecondSubsection]
 [Chapter2AnotherSection]
------
Sample code
  [SampleCode]
}]

Here a custom template is loaded from a Wiki page containing LaTeX code. An abstract is included from another wiki page. The document consists of two chapters. The first chapter is splitted in to two pages. Note: That doesn't mean the chapter consists of two sections. Instead, the two pages can contain any number of sections and subsections.

The second chapter is splitted in four pages. It starts with an introduction section. The subsections are defined on their own pages. Then another section follows. Note: The last section can also contain subsections, if they are defined directly in the included section page.

Everything following a line starting with "--" is an appendix and given letters from A to Z instead of numbers.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-3) was last changed on 13-Jun-2009 21:44 by 81.217.131.136