I have a filter that adds the needed raw latex commands:
~~~
#!/usr/bin/env runhaskell
-- addRefEnvItem.hs
import Text.Pandoc.JSON
main :: IO ()
main = toJSONFilter addRefEnvItem
addRefEnvItem :: Maybe Format -> Block -> Block
addRefEnvItem (Just (Format "latex"))
(Div ("",["references"],[]) (h@(Header _ _ _) : blocks)) =
Div ("",["references"],[])
( [h, latex "\\begin{references}\\sloppy"] ++
concatMap addItem blocks ++ [latex "\\end{references}"] )
where latex = RawBlock (Format "latex")
addRefEnvItem _ x = x
addItem :: Block -> [Block]
addItem x = [RawBlock (Format "latex") "\\item", x]
~~~
… but it has stopped working after the latest updates. What are the adjustments needed?
On Monday, August 31, 2015 at 5:54:33 AM UTC, John MacFarlane wrote:
+++ Andrew Dunning [Aug 30 15 13:06 ]:
> Will this also allow for the insertion of extra markup through a
> template? (For instance, a LaTeX class I am using wants the
> bibliography to be surrounded
> by \begin{thebibliography}...\end{thebibliography}, and it would be
> fantastic to be able to achieve that.)
The bibliography was never part of a template and still
isn't. It is inserted directly into the document body.
There are various ways to achieve what you want. One is
write a simple filter that can run after pandoc-citeproc.
It would intercept a Div with id = references, and
add the needed raw latex commands to the beginning and end
of its contents.