Closed hugoroy closed 8 years ago
Je n'ai pas ce soucis ici:
$ pandoc --filter pandoc-citeproc --filter pandoc-latex-environment -t latex
Avec
---
header-includes:
- \newenvironment{loi}{\begin{quote}\sffamily\itshape}{\end{quote}}
- \newenvironment{parl}{\begin{quote}\itshape}{\end{quote}}
- \newenvironment{jpref}{\sffamily\parindent 0pt \noindent}{}
latex-environment:
loi: [loi, law]
parl: [parl]
jpref: [jpref]
...
<div id="refs" class="jpref"></div>
produit
\hypertarget{refs}{}
\begin{jpref}
\end{jpref}
Il faut spécifier une bibliographie et citer une référence bibliographique (sinon pandoc-citeproc ne fait rien)
---
header-includes:
- \newenvironment{loi}{\begin{quote}\sffamily\itshape}{\end{quote}}
- \newenvironment{parl}{\begin{quote}\itshape}{\end{quote}}
- \newenvironment{jpref}{\sffamily\parindent 0pt \noindent}{}
latex-environment:
loi: [loi, law]
parl: [parl]
jpref: [jpref]
references:
- type: article-journal
id: WatsonCrick1953
author:
- family: Watson
given: J. D.
- family: Crick
given: F. H. C.
issued:
date-parts:
- - 1953
- 4
- 25
title: 'Molecular structure of nucleic acids: a structure for deoxyribose
nucleic acid'
title-short: Molecular structure of nucleic acids
container-title: Nature
volume: 171
issue: 4356
page: 737-738
DOI: 10.1038/171737a0
URL: http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html
language: en-GB
...
@WatsonCrick1953
<div id="refs" class="jpref"></div>
donnera
Watson and Crick (1953)
\hyperdef{}{refs}{\label{refs}}
\begin{jpref}
\hyperdef{}{ref-WatsonCrick1953}{\label{ref-WatsonCrick1953}}
\begin{parl}
Watson, J. D., and F. H. C. Crick. 1953. ``Molecular Structure of
Nucleic Acids: A Structure for Deoxyribose Nucleic Acid.'' \emph{Nature}
171 (4356): 737--38.
doi:\href{http://doi.org/10.1038/171737a0}{10.1038/171737a0}.
\end{parl}
\end{jpref}
It was because pandoc-citeproc generates div whose classes are empty. I've added a test for dealing with div without classes. Fixed in 0.0.3
Previous code was incorrect. Fixed in 0.0.4
Becarefull
loi: [loi, law]
means classes must contains loi
and law
Oui j'ai modifié :-)
Merci
Il semble y avoir un conflit avec
<div id="refs">
Par exemple, un document produit d'abord avec le filtre pandoc-citeproc puis avec le filtre pandoc-latex-environement contenant :
Produira :
Le problème se pose aussi simplement avec
<div id="refs">