Skip to content

Tex Template

Daniel Katzberg edited this page Jul 13, 2016 · 7 revisions
  • [Tex Template Zip Structure](#Tex Template Zip Structure)
  • [Labels and Crossreferences](#Labels and Crossreferences)

Tex Template Zip Structure

A full functional example of the tex template can be found in the https://github.com/dzhw/metadatamanagement-io under datasetreport.

The templates are a combination of Latex and Freemarker. Freemarker scripts will be interpreted and replaced by the metadatamanagement backend server.

The zip structure is as follows:

TemplateExample.zip
 |--Introduction.tex
 |--Main.tex
 |--References.bib
 |--variables
         |--variable.tex

Main.tex

The central tex template. The Main.tex will be include all tex files within the variables folder and the Introduction.tex. The preamble is also define in this tex.

Introduction.tex

If you want to add data from the database to the introduction, you have to replace this introduction before an upload to the server for the freemarker interpretation. The primary idea of the introduction is a place for manually written text for introducing the report.

variables/Variable.tex

The Variable.tex is the basic template for all variables. The Freemarker code within the tex template can differ between different scale levels for example. Variables with different scale levels get different diagramms, tables and so on. Every variable will be save as one single file after the interpretation of the Freemarker Code by the server. For example: If you have 1234 variables in a data set, 1234 files should be in the variables folder.

Labels and cross references

Defined labels:

  • \label{subSection:${variable.name}}
  • \label{tableVariable:${variable.name}}
  • \label{tableQuestion:${variable.name}}
  • \label{tableStatistics:${variable.name}}
  • \label{tableValues:${variable.name}}
  • \label{boxPlot:${variable.name}}
  • \label{histogram:${variable.name}}

Example: ${variable.name} will be replaced by Freemarker with 'testProject_AnyIds'

The labels are:

  • \label{subSection:testProject_AnyIds}
  • \label{tableVariable:testProject_AnyIds}
  • ...

The correct ref call for the references are:

  • \ref{subSection:testProject_AnyIds}
  • \ref{tableVariable:testProject_AnyIds}
  • ...

Important notice:

Special signs like the underscore will not be escaped within the labels! A support for this sign is given by the underscore package.

Bibtex Support

The Bibtex is fully supported by the template. It supported the APA - Style, which is need for the DZHW Style Guide.

1.) Add the Bibtex Elements to the References.bib (or replace it with your own References.bib file), like the standard.

@article{exampleRef,
  title={ExampleTitle},
  author={Mustermann, Max and Musterfrau, Marina},
  journal={Example Jornal},
  volume={1},
  number={2},
  pages={123--456},
  year={2016},
  publisher={Example Publisher}
}

2.) In the tex Files you have to use:

\parencite{exampleRef}

3.) The compile command order has to be:

 pdflatex Main.tex
 biber Main
 pdflatex Main.tex
 pdflatex Main.tex

4.) Have a look into the new compiled PDF File.

Clone this wiki locally