# Can an 'Abstract' parameter be passed to pandoc to create a latex file? [closed]

Similar to $title$, $author$, and $date$, is there an $abstract$ parameter that one can pass to a latex file from the title block? Example:

\begin{abstract}
$abstract$
\end{abstract}

-

## closed as off topic by Loop Space, lockstep, Qrrbrbirlbel, percusse, Paulo CeredaOct 5 '12 at 14:28

Questions on TeX - LaTeX Stack Exchange are expected to relate to TeX, LaTeX or related typesetting systems within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

–  henrique Oct 5 '12 at 13:05
Although you've gotten an answer from Paulo here, questions about pandoc's input are generally off-topic here as they don't really involve TeX and therefore you would be more likely to get help on the pandoc mailing list that henrique links to. –  Loop Space Oct 5 '12 at 13:30

I had a look at the documentation and found out that you can easily set new variables. Sadly, I don't think pandoc is able to automatically extract custom variables, since the documentation states that some variables are automatically set, other aren't.

We can extend default.latex from $PANDOC_HOME/templates to include an abstract verification. I made a copy from https://github.com/jgm/pandoc-templates/blob/master/default.latex and added the following code before the $body$ markup: ...$if(abstract)$\begin{abstract}$abstract$\end{abstract}$endifbody$...  I saved my new file as article.latex. Now I can call: $ pandoc --template=article.latex --variable abstract="I'm an abstract" INPUT -o OUTPUT.tex


The new block

\begin{abstract}
I'm an abstract
\end{abstract}


will be available in the generated file.

Hope it helps. :)

-
Gracias. Helped quite much. Not exactly what I'm looking for though, since you're passing the abstract in as arguments, whereas I want to define ALL my variables and parameters at the beginning of the .rst file in the header. –  mt3 Oct 6 '12 at 7:06