From c40857b38905b9ea298a777354eb4cb0da2213c6 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Mon, 16 Oct 2017 22:03:57 -0700
Subject: Improved handling of include files in LaTeX reader.

Previously `\include` wouldn't work if the included file
contained, e.g., a begin without a matching end.

We've changed the Tok type so that it stores a full SourcePos,
rather than just a line and column.  So tokens keeep track
of the file they came from. This allows us to use a simpler
method for includes, which doesn't require parsing the included
document as a whole.

Closes #3971.
---
 test/command/3971.md   | 9 +++++++++
 test/command/3971b.tex | 2 ++
 2 files changed, 11 insertions(+)
 create mode 100644 test/command/3971.md
 create mode 100644 test/command/3971b.tex

(limited to 'test/command')

diff --git a/test/command/3971.md b/test/command/3971.md
new file mode 100644
index 000000000..923609f4e
--- /dev/null
+++ b/test/command/3971.md
@@ -0,0 +1,9 @@
+```
+% TEXINPUTS=command pandoc -f latex -t native
+\documentclass{article}
+\include{3971b}
+\code{f}
+\end{document}
+^D
+[Para [Code ("",[],[]) "f"]]
+```
diff --git a/test/command/3971b.tex b/test/command/3971b.tex
new file mode 100644
index 000000000..0d1dc3e02
--- /dev/null
+++ b/test/command/3971b.tex
@@ -0,0 +1,2 @@
+\newcommand{\code}[1]{\texttt{#1}}
+\begin{document}
-- 
cgit v1.2.3