Skip to content
David Loureiro edited this page Aug 13, 2013 · 4 revisions

Here are the available macros provided by pandoc-gpp :

  • \include{filepath}
  • \code{language}{filepath}
  • \tabular{title}{data}
  • \u{text}
  • \color{color}{text}
  • \abbr{title}{abbreviation}
  • \relativeSizeImage{caption}{percentage}{path}
  • \graph{chartType}{path}{title}{imgdir}{caption}

\include{filepath}

Object

This macros allows you to include the content of a file inside the current file. This macro is available for every input/output format.

Example

some data

\include{content.md}

other stuff.

Here is the content of content.md :

## Hello my World !

Markdown output

some data

Hello my World !
----------------

other stuff.

\code{language}{filepath}

Object

This macro allows you to include code from a file. This macros is available for every output format but is only available from markdown input format.

Example

\code{java}{HelloWorld.java}

Output

~~~~ {.java}
import java.lang.*;

int public static main(String[] args){
    System.out.println("Hello World !");
    return 0;
}
~~~~

\tabular{title}{data}

Object

This macro allows you to include a table with caption, the data been taken from a csv table included in the data file provided. This macros is available for every output format but is only available from markdown input format.

Example

blabla

\tabular{"What a cool table!"}{test.csv}

yeah some cool stuff

Output

blabla

+-------------+--------------+----------------+-------------+-------------+
|             | january-13   | february-13    | march-13    | april-13    |
+=============+==============+================+=============+=============+
| number      | 7            | 23             | 96          | 79          |
+-------------+--------------+----------------+-------------+-------------+
| quantity    | 17           | 76             | 25          | 21          |
+-------------+--------------+----------------+-------------+-------------+
| sum         | 11124        | 32221          | 43242323    | 44432       |
+-------------+--------------+----------------+-------------+-------------+

: What a cool table!

yeah some cool stuff

\u{text}

Object

This macro is used to underline text. This macros is available for html/epub/latex/pdf output format but is available for every input formats.

Example

some data

\u{This text will by underlined}

other output

HTML output

<p>some data</p>
<p><u>This text will by underlined</u></p>
<p>other output</p>

\color{color}{text}

Object

This macro is used to put text in color. This macros is available for html/epub/latex/pdf output format but is available for every input formats.

Limitations

For the moment only known colors such as "blue", "red", etc are available for both HTML and LaTeX-based output formats.

Example

some text 

\color{blue}{**This one will be in bold face**}

the rest of the text.

HTML output

<p>some text</p>
<p><span style="color:'blue'"><strong>This one will be in bold face</strong></span></p>
<p>the rest of the text.</p>

\abbr{title}{abbreviation}

Object

This macros is create footnotes and abbreviations. This macros is available for html/epub/latex/pdf output format but is available for every input formats. It creates abbreviations in HTML-based output formats and footnotes in LaTeX-based ones.

Example

some text.

Look at me, \abbr{It means NOW!}{right now}

I'm just kidding! :)

HTML output

<p>some text.</p>
<p>Look at me, <abbr title="It means NOW!">right now</abbr></p>
<p>I'm just kidding! :)</p>

\relativeSizeImage{caption}{percentage}{path}

Object

This macros allows you to include images with defined percentage (based on the line width of the image container) with a caption. This macros is available for html/epub/latex/pdf output format but is available for every input formats. The percentage must be a value between 0 and 1 (something like 0.8 for example).

Example

some text

\relativeSizeImage{"Oh yeah!"}{0.8}{hello-world-sandwich.jpg}

This is the end.

HTML output

<p>some text</p>
<figure>
<img style="width:'80.0%'" src="hello-world-sandwich.jpg"/>
<figcaption>
&quot;Oh yeah!&quot;
</figcaption></figure>

\graph{chartType}{path}{title}{imgdir}{caption}

Object

This macro allows you to include graphs based on a csv table from a data file with a caption. The only available chart type is bar chart. The imgdir correspond to the location where the images corresponding to the charts will be stored. This macros is available for html/epub/latex/pdf output format but is available for every input formats.

Example

before the graph

\graph{bar}{test.csv}{"my freaking title"}{.}{"my fraking caption"}

after the graph

HTML output

<p>before the graph</p>
<figure>
<img src="./bar_chart.png"/>
<figcaption>
&quot;my fraking caption&quot;
</figcaption></figure>

<p>after the graph</p>