aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.md2
-rw-r--r--tests/pandoc/citeproc-bug.md67
-rw-r--r--tests/pandoc/citeproc-bug.tex45
3 files changed, 113 insertions, 1 deletions
diff --git a/TODO.md b/TODO.md
index d3029e2..620425f 100644
--- a/TODO.md
+++ b/TODO.md
@@ -20,7 +20,7 @@
## Issues
* [ ] Bug no `pandoc` ou `citeproc` ignorando citações dentro de blocos LaTeX.
- Afetando o formato PDF. Vide projeto `test`, em `~/code/test/pandoc`.
+ Afetando o formato PDF. Vide teste em `test/pandoc`.
Considerar um relatório upstream.
Se necessário, aplicar também correções também nos repositórios downstream.
diff --git a/tests/pandoc/citeproc-bug.md b/tests/pandoc/citeproc-bug.md
new file mode 100644
index 0000000..e6dd452
--- /dev/null
+++ b/tests/pandoc/citeproc-bug.md
@@ -0,0 +1,67 @@
+---
+ title: "Test"
+ biblio-style: apalike
+ link-citations: true
+ references:
+ - type: article-journal
+ id: test
+ author:
+ - family: Doe
+ given: J.
+ issued:
+ date-parts:
+ - - 1900
+ - 1
+ - 1
+ title: 'Test article'
+ title-short: Test
+ container-title: Nurture
+ volume: 1
+ issue: 1
+ page: 1-10
+
+---
+
+# Pandoc issues with Citeproc
+
+## About
+
+This shows where citations are not properly converted by Pandoc/Citeproc.
+
+## How to use
+
+Compile with:
+
+ pandoc -i citeproc-bug.md -t latex -o citeproc-bug.md --citeproc
+
+## Tests
+
+Normal: @test
+
+Brackets syntax: [@test]
+
+Brace syntax: @{test}
+
+Inside braces: {@test}
+
+Braces within braces: {@{test}}
+
+Escaped braces: \{@test\}
+
+Slash: \ @test
+
+LaTeX block: \emph{@test}
+
+LaTeX block 2: \emph{Reference to @test inside braces}
+
+LaTeX block with escaped braces: \emph\{@test\}
+
+LaTeX block with braces within braces: \emph{@{test}}
+
+LaTeX protect block: \protect\emph{@test}
+
+Preformatted:
+
+ > @test
+ >
+ > \emph{@test}
diff --git a/tests/pandoc/citeproc-bug.tex b/tests/pandoc/citeproc-bug.tex
new file mode 100644
index 0000000..f96cebf
--- /dev/null
+++ b/tests/pandoc/citeproc-bug.tex
@@ -0,0 +1,45 @@
+Compile with:
+
+\begin{verbatim}
+pandoc -i test.md -t latex -o test.tex --citeproc
+\end{verbatim}
+
+Normal: Doe (\protect\hyperlink{ref-test}{1900})
+
+Brackets syntax: (\protect\hyperlink{ref-test}{Doe 1900})
+
+Brace syntax: Doe (\protect\hyperlink{ref-test}{1900})
+
+Inside braces: \{Doe (\protect\hyperlink{ref-test}{1900})\}
+
+Braces within braces: \{Doe (\protect\hyperlink{ref-test}{1900})\}
+
+Escaped braces: \{Doe (\protect\hyperlink{ref-test}{1900})\}
+
+Slash: ~Doe (\protect\hyperlink{ref-test}{1900})
+
+LaTeX block: \emph{@test}
+
+LaTeX block 2: \emph{Reference to @test inside braces}
+
+LaTeX block with escaped braces: \emph\{Doe
+(\protect\hyperlink{ref-test}{1900})\}
+
+LaTeX block with braces within braces: \emph{@{test}}
+
+Preformatted:
+
+\begin{quote}
+Doe (\protect\hyperlink{ref-test}{1900})
+
+\emph{@test}
+\end{quote}
+
+LaTeX protect block: \protect\emph{@test}
+
+\hypertarget{refs}{}
+\begin{CSLReferences}{1}{0}
+\leavevmode\vadjust pre{\hypertarget{ref-test}{}}%
+Doe, J. 1900. {``Test Article.''} \emph{Nurture} 1 (1): 1--10.
+
+\end{CSLReferences}