public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Empty item introduced in list inside description for md to tex
@ 2021-06-08 17:00 Clément Aubert
       [not found] ` <CAPGHSeyhW5Cj4nrBdtaNgpkj_=pcEXLusFQgkz86ivEtQZBtbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Clément Aubert @ 2021-06-08 17:00 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]

If a definition list ( https://pandoc.org/MANUAL.html#definition-lists )
starts with a list, then an empty item seems to be inserted when converting
to latex.

Problem 1
~
    #. Circle the keywords

produces in latex

\begin{description}
\item[Problem 1]
\begin{enumerate}
\tightlist
\item[] % This is what I'm talking about
\item
  Circle the keywords
\end{enumerate}
\end{description}

Note the \item[].

This problem does not seem to occur with html, as this markdown is rendered
as

<dl>
<dt>Problem 1</dt>
<dd><ol>
<li>Circle the keywords</li>
</ol>
</dd>
</dl>

Is this a bug or am I missing something?

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAPGHSeyhW5Cj4nrBdtaNgpkj_%3DpcEXLusFQgkz86ivEtQZBtbw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 1724 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Empty item introduced in list inside description for md to tex
       [not found] ` <CAPGHSeyhW5Cj4nrBdtaNgpkj_=pcEXLusFQgkz86ivEtQZBtbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-06-09 22:32   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2021-06-09 22:32 UTC (permalink / raw)
  To: Clément Aubert, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Clément Aubert <aubert.clement-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> If a definition list ( https://pandoc.org/MANUAL.html#definition-lists )
> starts with a list, then an empty item seems to be inserted when converting
> to latex.
>
> Problem 1
> ~
>     #. Circle the keywords

This doesn't parse as a definition list at all.

I assume you meant

Problem 1
~   #. Circle the keywords

where I do see the \item[].

The answer can be found in the source code for the LaTeX writer:

  return $ text ("\\begin{enumerate}" <> inc)
         $$ stylecommand
         $$ resetcounter
         $$ spacing
         -- force list at beginning of definition to start on new line
         $$ (if isFirstInDefinition then "\\item[]" else mempty)
         $$ vcat items
         $$ "\\end{enumerate}"

The empty \item[] was added for a reason: because without it,
the list will start on the same line as the definition, and
subsequent items won't be aligned.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m2mtryvfdi.fsf%40MacBook-Pro-2.hsd1.ca.comcast.net.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-09 22:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 17:00 Empty item introduced in list inside description for md to tex Clément Aubert
     [not found] ` <CAPGHSeyhW5Cj4nrBdtaNgpkj_=pcEXLusFQgkz86ivEtQZBtbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-09 22:32   ` John MacFarlane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).