git.iko.soy/typeable/pandoc
on master help sign in
Merge branch 'jlduran-latex-tightlist'
commitaaf5e67624c6b9dcc2615e0e3f4ad4e622d516af authorJohn MacFarlane <jgm@berkeley.edu> dateFri 17 Apr 2015, 19:37 (12 years ago) parent28ca856764f677
6 files changed+40−34
data/templates+1−1 src/Text/Pandoc/Writers/LaTeX.hs+3−3 tests/Tests/Writers/LaTeX.hs+1−1 tests/lhs-test.latex+2 tests/lhs-test.latex+lhs+2 tests/writer.latex+31−29
data/templates+1−1

Submodule changed.

src/Text/Pandoc/Writers/LaTeX.hs+3−3
@@ -416,7 +416,7 @@ blockToLaTeX (BulletList lst) = do
416416 let inc = if incremental then "[<+->]" else ""
417417 items <- mapM listItemToLaTeX lst
418418 let spacing = if isTightList lst
419− then text "\\itemsep1pt\\parskip0pt\\parsep0pt"
419+ then text "\\tightlist"
420420 else empty
421421 return $ text ("\\begin{itemize}" ++ inc) $$ spacing $$ vcat items $$
422422 "\\end{itemize}"
@@ -451,7 +451,7 @@ blockToLaTeX (OrderedList (start, numstyle, numdelim) lst) = do
451451 else "\\setcounter" <> braces enum <>
452452 braces (text $ show $ start - 1)
453453 let spacing = if isTightList lst
454− then text "\\itemsep1pt\\parskip0pt\\parsep0pt"
454+ then text "\\tightlist"
455455 else empty
456456 return $ text ("\\begin{enumerate}" ++ inc)
457457 $$ stylecommand
@@ -465,7 +465,7 @@ blockToLaTeX (DefinitionList lst) = do
465465 let inc = if incremental then "[<+->]" else ""
466466 items <- mapM defListItemToLaTeX lst
467467 let spacing = if all isTightList (map snd lst)
468− then text "\\itemsep1pt\\parskip0pt\\parsep0pt"
468+ then text "\\tightlist"
469469 else empty
470470 return $ text ("\\begin{description}" ++ inc) $$ spacing $$ vcat items $$
471471 "\\end{description}"
tests/Tests/Writers/LaTeX.hs+1−1
@@ -42,7 +42,7 @@ tests = [ testGroup "code blocks"
4242 , testGroup "definition lists"
4343 [ "with internal link" =: definitionList [(link "#go" "" (str "testing"),
4444 [plain (text "hi there")])] =?>
45− "\\begin{description}\n\\itemsep1pt\\parskip0pt\\parsep0pt\n\\item[{\\hyperref[go]{testing}}]\nhi there\n\\end{description}"
45+ "\\begin{description}\n\\tightlist\n\\item[{\\hyperref[go]{testing}}]\nhi there\n\\end{description}"
4646 ]
4747 , testGroup "math"
4848 [ "escape |" =: para (math "\\sigma|_{\\{x\\}}") =?>
tests/lhs-test.latex+2
@@ -64,6 +64,8 @@
6464\setlength{\parindent}{0pt}
6565\setlength{\parskip}{6pt plus 2pt minus 1pt}
6666\setlength{\emergencystretch}{3em} % prevent overfull lines
67+\newcommand{\tightlist}{%
68+ \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
6769\setcounter{secnumdepth}{0}
6870
6971\date{}
tests/lhs-test.latex+lhs+2
@@ -45,6 +45,8 @@
4545\setlength{\parindent}{0pt}
4646\setlength{\parskip}{6pt plus 2pt minus 1pt}
4747\setlength{\emergencystretch}{3em} % prevent overfull lines
48+\newcommand{\tightlist}{%
49+ \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
4850\setcounter{secnumdepth}{0}
4951
5052\date{}
tests/writer.latex+31−29
@@ -57,6 +57,8 @@
5757\setlength{\parindent}{0pt}
5858\setlength{\parskip}{6pt plus 2pt minus 1pt}
5959\setlength{\emergencystretch}{3em} % prevent overfull lines
60+\newcommand{\tightlist}{%
61+ \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
6062\setcounter{secnumdepth}{0}
6163\VerbatimFootnotes % allows verbatim text in footnotes
6264
@@ -141,7 +143,7 @@ A list:
141143
142144\begin{enumerate}
143145\def\labelenumi{\arabic{enumi}.}
144−\itemsep1pt\parskip0pt\parsep0pt
146+\tightlist
145147\item
146148 item one
147149\item
@@ -196,7 +198,7 @@ These should not be escaped: \$ \\ \> \[ \{
196198Asterisks tight:
197199
198200\begin{itemize}
199−\itemsep1pt\parskip0pt\parsep0pt
201+\tightlist
200202\item
201203 asterisk 1
202204\item
@@ -219,7 +221,7 @@ Asterisks loose:
219221Pluses tight:
220222
221223\begin{itemize}
222−\itemsep1pt\parskip0pt\parsep0pt
224+\tightlist
223225\item
224226 Plus 1
225227\item
@@ -242,7 +244,7 @@ Pluses loose:
242244Minuses tight:
243245
244246\begin{itemize}
245−\itemsep1pt\parskip0pt\parsep0pt
247+\tightlist
246248\item
247249 Minus 1
248250\item
@@ -268,7 +270,7 @@ Tight:
268270
269271\begin{enumerate}
270272\def\labelenumi{\arabic{enumi}.}
271−\itemsep1pt\parskip0pt\parsep0pt
273+\tightlist
272274\item
273275 First
274276\item
@@ -281,7 +283,7 @@ and:
281283
282284\begin{enumerate}
283285\def\labelenumi{\arabic{enumi}.}
284−\itemsep1pt\parskip0pt\parsep0pt
286+\tightlist
285287\item
286288 One
287289\item
@@ -331,17 +333,17 @@ Multiple paragraphs:
331333\subsection{Nested}\label{nested}
332334
333335\begin{itemize}
334−\itemsep1pt\parskip0pt\parsep0pt
336+\tightlist
335337\item
336338 Tab
337339
338340 \begin{itemize}
339− \itemsep1pt\parskip0pt\parsep0pt
341+ \tightlist
340342 \item
341343 Tab
342344
343345 \begin{itemize}
344− \itemsep1pt\parskip0pt\parsep0pt
346+ \tightlist
345347 \item
346348 Tab
347349 \end{itemize}
@@ -352,14 +354,14 @@ Here's another:
352354
353355\begin{enumerate}
354356\def\labelenumi{\arabic{enumi}.}
355−\itemsep1pt\parskip0pt\parsep0pt
357+\tightlist
356358\item
357359 First
358360\item
359361 Second:
360362
361363 \begin{itemize}
362− \itemsep1pt\parskip0pt\parsep0pt
364+ \tightlist
363365 \item
364366 Fee
365367 \item
@@ -381,7 +383,7 @@ Same thing but with paragraphs:
381383 Second:
382384
383385 \begin{itemize}
384− \itemsep1pt\parskip0pt\parsep0pt
386+ \tightlist
385387 \item
386388 Fee
387389 \item
@@ -424,7 +426,7 @@ Same thing but with paragraphs:
424426 \begin{enumerate}
425427 \def\labelenumii{\roman{enumii}.}
426428 \setcounter{enumii}{3}
427− \itemsep1pt\parskip0pt\parsep0pt
429+ \tightlist
428430 \item
429431 sublist with roman numerals, starting with 4
430432 \item
@@ -432,7 +434,7 @@ Same thing but with paragraphs:
432434
433435 \begin{enumerate}
434436 \def\labelenumiii{(\Alph{enumiii})}
435− \itemsep1pt\parskip0pt\parsep0pt
437+ \tightlist
436438 \item
437439 a subsublist
438440 \item
@@ -445,27 +447,27 @@ Nesting:
445447
446448\begin{enumerate}
447449\def\labelenumi{\Alph{enumi}.}
448−\itemsep1pt\parskip0pt\parsep0pt
450+\tightlist
449451\item
450452 Upper Alpha
451453
452454 \begin{enumerate}
453455 \def\labelenumii{\Roman{enumii}.}
454− \itemsep1pt\parskip0pt\parsep0pt
456+ \tightlist
455457 \item
456458 Upper Roman.
457459
458460 \begin{enumerate}
459461 \def\labelenumiii{(\arabic{enumiii})}
460462 \setcounter{enumiii}{5}
461− \itemsep1pt\parskip0pt\parsep0pt
463+ \tightlist
462464 \item
463465 Decimal start with 6
464466
465467 \begin{enumerate}
466468 \def\labelenumiv{\alph{enumiv})}
467469 \setcounter{enumiv}{2}
468− \itemsep1pt\parskip0pt\parsep0pt
470+ \tightlist
469471 \item
470472 Lower alpha with paren
471473 \end{enumerate}
@@ -476,14 +478,14 @@ Nesting:
476478Autonumbering:
477479
478480\begin{enumerate}
479−\itemsep1pt\parskip0pt\parsep0pt
481+\tightlist
480482\item
481483 Autonumber.
482484\item
483485 More.
484486
485487 \begin{enumerate}
486− \itemsep1pt\parskip0pt\parsep0pt
488+ \tightlist
487489 \item
488490 Nested.
489491 \end{enumerate}
@@ -502,7 +504,7 @@ B. Williams
502504Tight using spaces:
503505
504506\begin{description}
505−\itemsep1pt\parskip0pt\parsep0pt
507+\tightlist
506508\item[apple]
507509red fruit
508510\item[orange]
@@ -514,7 +516,7 @@ yellow fruit
514516Tight using tabs:
515517
516518\begin{description}
517−\itemsep1pt\parskip0pt\parsep0pt
519+\tightlist
518520\item[apple]
519521red fruit
520522\item[orange]
@@ -556,7 +558,7 @@ orange block quote
556558Multiple definitions, tight:
557559
558560\begin{description}
559−\itemsep1pt\parskip0pt\parsep0pt
561+\tightlist
560562\item[apple]
561563red fruit
562564
@@ -592,7 +594,7 @@ orange fruit
592594
593595\begin{enumerate}
594596\def\labelenumi{\arabic{enumi}.}
595−\itemsep1pt\parskip0pt\parsep0pt
597+\tightlist
596598\item
597599 sublist
598600\item
@@ -718,7 +720,7 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
718720\section{LaTeX}\label{latex}
719721
720722\begin{itemize}
721−\itemsep1pt\parskip0pt\parsep0pt
723+\tightlist
722724\item
723725 \cite[22-23]{smith.1899}
724726\item
@@ -741,7 +743,7 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
741743These shouldn't be math:
742744
743745\begin{itemize}
744−\itemsep1pt\parskip0pt\parsep0pt
746+\tightlist
745747\item
746748 To get the famous equation, write \texttt{\$e\ =\ mc\^{}2\$}.
747749\item
@@ -768,7 +770,7 @@ Cat & 1 \\ \hline
768770Here is some unicode:
769771
770772\begin{itemize}
771−\itemsep1pt\parskip0pt\parsep0pt
773+\tightlist
772774\item
773775 I hat: Î
774776\item
@@ -892,7 +894,7 @@ Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
892894With an ampersand: \url{http://example.com/?foo=1\&bar=2}
893895
894896\begin{itemize}
895−\itemsep1pt\parskip0pt\parsep0pt
897+\tightlist
896898\item
897899 In a list?
898900\item
@@ -958,7 +960,7 @@ Notes can go in quotes.\footnote{In quote.}
958960
959961\begin{enumerate}
960962\def\labelenumi{\arabic{enumi}.}
961−\itemsep1pt\parskip0pt\parsep0pt
963+\tightlist
962964\item
963965 And in list items.\footnote{In list.}
964966\end{enumerate}