diff options
author | Jose Luis Duran <jlduran@users.noreply.github.com> | 2014-08-27 20:35:57 +0000 |
---|---|---|
committer | Jose Luis Duran <jlduran@users.noreply.github.com> | 2014-09-01 05:08:24 +0000 |
commit | 9557eb6f8efafaff2e3a61e43e4cc7e4717ad9eb (patch) | |
tree | 4fc9e1c06cf8269b1aa92407ad89c4c1df783e01 /tests/Tests/Writers | |
parent | 3533218d6d7e15384262bf478d5ebf5e191f96ff (diff) | |
download | pandoc-9557eb6f8efafaff2e3a61e43e4cc7e4717ad9eb.tar.gz |
LaTeX writer: Use a declaration for tight lists
Currently, pandoc has hard-coded the following in order to make tight lists in
LaTeX:
```hs
text "\\itemsep1pt\\parskip0pt\\parsep0pt"
```
Which is fine, but does not allow customizations. For example, the `memoir`
class already has a `\tightlist` declaration for this purpose:
```tex
\newcommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
```
I'm proposing to use a similar solution:
```diff
@@ In Writers/LaTeX.hs:
-then text "\\itemsep1pt\\parskip0pt\\parsep0pt"
+then text "\\tightlist"
@@ In templates/default.latex:
+\newcommand{\tightlist}{%
+ \setlength{\itemsep}{1pt}\setlength{\parskip}{0pt}\setlength{\parsep}{0pt}}
```
This allows us to customize the tightness to our needs.
Backward Compatibility
If a person is using a custom LaTeX template (not based upon the `memoir`
class), the `\tightlist` declaration must be added.
Diffstat (limited to 'tests/Tests/Writers')
-rw-r--r-- | tests/Tests/Writers/LaTeX.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/Tests/Writers/LaTeX.hs b/tests/Tests/Writers/LaTeX.hs index 78b2495c7..965589965 100644 --- a/tests/Tests/Writers/LaTeX.hs +++ b/tests/Tests/Writers/LaTeX.hs @@ -42,7 +42,7 @@ tests = [ testGroup "code blocks" , testGroup "definition lists" [ "with internal link" =: definitionList [(link "#go" "" (str "testing"), [plain (text "hi there")])] =?> - "\\begin{description}\n\\itemsep1pt\\parskip0pt\\parsep0pt\n\\item[{\\hyperref[go]{testing}}]\nhi there\n\\end{description}" + "\\begin{description}\n\\tightlist\n\\item[{\\hyperref[go]{testing}}]\nhi there\n\\end{description}" ] , testGroup "math" [ "escape |" =: para (math "\\sigma|_{\\{x\\}}") =?> |