Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

closed as off topic by Loop Space, lockstep, Qrrbrbirlbel, percusse, Paulo Cereda Oct 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.

1  
There's been a thread about it in pandoc-discuss list –  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
add comment

1 Answer

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}
$endif$

$body$
...

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. :)

share|improve this answer
    
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
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.