-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
LaTeX writer: Use a declaration for tight lists #1571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
This would be a great addition! I wonder if the same could be done for the horizontal rule. On a side note, it would also be possible to use another environment, such as compactlist/compactenum from package enumitem. But this would only work if all items of the list are compact, which I believe is what pandoc AST does. |
I'm getting a tightlist error when I try and convert documents now - is there some extra configuration required.
|
@jiuks Are you getting this with Pandoc 1.14? It was released a few hours ago. |
@jiuks You are probably using a custom template. Pandoc now uses a \providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} To the preamble of your custom template. |
Thanks - I downloaded the default template and re-configured mine, so all now fixed. |
pandoc 1.14 introduced \tightlist Related links: jgm/pandoc#1571 (comment) ozanmakes/markup.rocks#4 rstudio/rmarkdown#439
This change could influence lots of customized templates by resulting in an LaTeX error:
Since Pandoc doesn't show the specific In addition, in the world of LaTeX, we don't recommend one to use this kind of tricky to define a tight list. The better way, and also the suggested way of making a tight list is to use the package \usepackage{enumitem}
\setlist{nosep, noitemsep} |
The advantage of the present method is that it doesn't add a If you use the default template, you'll be all right. I think this issue needs more discussion, but it should be +++ Liam Huang [Jul 22 15 23:28 ]:
|
@LiamHuang0205 looking at the source of enumitem, the current declaration of Also remember that pandoc differentiates between loose and compact lists. Wouldn't the use of your suggestion affect both types of lists? |
pandoc 1.14 introduced \tightlist Related links: jgm/pandoc#1571 (comment) ozanmakes/markup.rocks#4 rstudio/rmarkdown#439
Pandoc >= 1.14 introduced the `\tightlist` command when generating lists. The declaration must be added when using a custom Latex template : see the "Backward compatibility" section here : jgm/pandoc#1571. Closes #334 ;)
See [1] [1]: jgm/pandoc#1571
pandoc 1.14 introduced \tightlist Related links: jgm/pandoc#1571 (comment) ozanmakes/markup.rocks#4 rstudio/rmarkdown#439
Currently, pandoc has hard-coded the following in order to make tight lists in LaTeX:
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:I'm proposing to use a similar solution:
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.