Skip to content

Commit

Permalink
Added test cases for #1390, #2118, #3236, #3779, #934, #982.
Browse files Browse the repository at this point in the history
Not all passing yet.
  • Loading branch information
jgm committed Jul 7, 2017
1 parent c4a2bcf commit aa55995
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/command/1390.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```
% pandoc -f latex -t native
\newcommand\foo{+}
Testing: $\mu\foo\eta$.
^D
[Para [Str "Testing:",Space,Math InlineMath "\\mu+\\eta"]]
```

```
% pandoc -f latex -t native
\newcommand{\vecx}{a + b}
$\hat\vecx$
^D
[Para [Math InlineMath "\\hat{a+b}"]]
```
12 changes: 12 additions & 0 deletions test/command/2118.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```
% pandoc -f latex -t native
\newcommand{\inclgraph}{\includegraphics[width=0.8\textwidth]}
\begin{figure}[ht]
\centering
\inclgraph{setminus.png}
\caption{Set subtraction}
\label{fig:setminus}
\end{figure}
^D
[]
```
9 changes: 9 additions & 0 deletions test/command/3236.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
```
pandoc -f latex -t native
\newcommand{\mycolor}{red}
\includegraphics[width=17cm]{\mycolor /header}
Magnificent \mycolor{} header.
^D
[Para [Image ("",[],[("width","17cm")]) [Str "image"] ("red/header",""),SoftBreak,Str "Magnificent",Space,Str "red",Space,Str "header."]]
```
28 changes: 28 additions & 0 deletions test/command/3779.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
```
% pandoc -f latex -t native
\newcommand{\fakeitemize}[1]{
\begin{itemize}
#1
\end{itemize}
}
\newcommand{\testcmd}[1]{
#1
}
\fakeitemize{
\item Pandoc is 100\% awesome.
}
\begin{itemize}
\item Pandoc is 200\% awesome.
\end{itemize}
\testcmd{
Pandoc is 300\% awesome.
}
^D
[BulletList
[[Para [Str "Pandoc",Space,Str "is",Space,Str "100%",Space,Str "awesome."]]
,BulletList
[[Para [Str "Pandoc",Space,Str "is",Space,Str "200%",Space,Str "awesome."]]]
,Para [Str "Pandoc",Space,Str "is",Space,Str "300%",Space,Str "awesome."]]]
```
12 changes: 12 additions & 0 deletions test/command/934.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```
% pandoc -f latex -t native
\newcommand{\ddb}[2]{
\textit{``#1''}
\textbf{#2}
}
\ddb{This should be italic and in quotes}{And this is the attribution}
^D
[Para [Emph [Quoted DoubleQuote [Str "This",Space,Str "should",Space,Str "be",Space,Str "italic",Space,Str "and",Space,Str "in",Space,Str "quotes"]]]
,Para [Strong [Str "And",Space,Str "this",Space,Str "is",Space,Str "the",Space,Str "attribution"]]]
```
11 changes: 11 additions & 0 deletions test/command/982.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```
% pandoc -f latex -t native
\newcommand{\BEQ}{\begin{equation}}
\newcommand{\EEQ}{\end{equation}}
\BEQ
y=x^2
\EEQ
^D
[Para [Math DisplayMath "y=x^2"]]
```

0 comments on commit aa55995

Please sign in to comment.