public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Customize list item label for latex
@ 2018-12-15  3:04 jiewuza
  2018-12-16  3:27 ` jiewuza
       [not found] ` <m2tvjfcwy4.fsf-9Onoh4P/yGk@public.gmane.org>
  0 siblings, 2 replies; 4+ messages in thread
From: jiewuza @ 2018-12-15  3:04 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


Currently, pandoc sets the label automatically according to the text
format. For
```
(1) item
    (a) subitem
         i. subsubitem
```

It generates tex:
```
\begin{enumerate}
\def\labelenumi{(\arabic{enumi})}
\item
  my item

  \begin{enumerate}
  \def\labelenumii{(\alph{enumii})}
  \tightlist
  \item
    subitem

    \begin{enumerate}
    \def\labelenumiii{\roman{enumiii}.}
    \tightlist
    \item
      subsubitem
    \end{enumerate}
  \end{enumerate}
\end{enumerate}
```

This is a great feature. However, sometimes it is required to match a
`hierarchy label format`. It is common that the format is predefined in
scholar paper templates, like:
```
\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\labelenumi}{(\theenumi)}
\renewcommand{\theenumii}{\alpha{enumii}}
\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumiii}{\roman{enumiii}}
\renewcommand{\labelenumiii}{(\theenumiii)}
```

And you just have to make the hierarchy right, forgetting the format
detail.

So I am wondering if it is worth introducing an option to disable generating the
label according to the text, but leaving the format for user customization.


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

* Re: Customize list item label for latex
  2018-12-15  3:04 Customize list item label for latex jiewuza
@ 2018-12-16  3:27 ` jiewuza
       [not found] ` <m2tvjfcwy4.fsf-9Onoh4P/yGk@public.gmane.org>
  1 sibling, 0 replies; 4+ messages in thread
From: jiewuza @ 2018-12-16  3:27 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


Put it another way, I hope pandoc can generate latex for
```
Here is list 1:

1. my item
    1. subitem
         1. subsubitem

...

Here is list 2:
i. my item
    (1) subitem

...
Here is list 3:
...

```
as (leave out all those label format setting stuff):
```
Here is list 1:

\begin{enumerate}
\item
  my item

  \begin{enumerate}
  \tightlist
  \item
    subitem

    \begin{enumerate}
    \tightlist
    \item
      subsubitem
    \end{enumerate}
  \end{enumerate}
\end{enumerate}

...
```

The format is customized in latex template once for all, according to
the hierarchy, like
```
\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\labelenumi}{(\theenumi)}
\renewcommand{\theenumii}{\alph{enumii}}
\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumiii}{\roman{enumiii}}
\renewcommand{\labelenumiii}{(\theenumiii)}
```

One of the benefits is that the writer does not have to care about the
label format at all when writing the markdown. He just has to make sure
the indention/hierarchy is right, and the final label formats (there
would be many ordered lists section in the markdown, as the example
shows above) are consistent, no matter which (arabic/alph/roman) is used
in the markdown.


jiewuza <jiewuza-9Onoh4P/yGk@public.gmane.org> writes:

> Currently, pandoc sets the label automatically according to the text
> format. For
> ```
> (1) item
>     (a) subitem
>          i. subsubitem
> ```
>
> It generates tex:
> ```
> \begin{enumerate}
> \def\labelenumi{(\arabic{enumi})}
> \item
>   my item
>
>   \begin{enumerate}
>   \def\labelenumii{(\alph{enumii})}
>   \tightlist
>   \item
>     subitem
>
>     \begin{enumerate}
>     \def\labelenumiii{\roman{enumiii}.}
>     \tightlist
>     \item
>       subsubitem
>     \end{enumerate}
>   \end{enumerate}
> \end{enumerate}
> ```
>
> This is a great feature. However, sometimes it is required to match a
> `hierarchy label format`. It is common that the format is predefined in
> scholar paper templates, like:
> ```
> \renewcommand{\theenumi}{\arabic{enumi}}
> \renewcommand{\labelenumi}{(\theenumi)}
> \renewcommand{\theenumii}{\alpha{enumii}}
> \renewcommand{\labelenumii}{\theenumii}
> \renewcommand{\theenumiii}{\roman{enumiii}}
> \renewcommand{\labelenumiii}{(\theenumiii)}
> ```
>
> And you just have to make the hierarchy right, forgetting the format
> detail.
>
> So I am wondering if it is worth introducing an option to disable generating the
> label according to the text, but leaving the format for user customization.


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

* Re: Customize list item label for latex
       [not found] ` <m2tvjfcwy4.fsf-9Onoh4P/yGk@public.gmane.org>
@ 2018-12-16 13:21   ` Christophe Demko
  2018-12-17  7:44     ` jiewuza
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Demko @ 2018-12-16 13:21 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2424 bytes --]

You can use

```
#. my item
   #. subitem
      #. subsubitem
```

which does the job (see http://pandoc.org/MANUAL.html#extension-fancy_lists)

It generates 

```
\begin{enumerate}
\tightlist
\item
  my item

  \begin{enumerate}
  \tightlist
  \item
    subitem

    \begin{enumerate}
    \tightlist
    \item
      subsubitem
    \end{enumerate}
  \end{enumerate}
\end{enumerate}
```

in LaTeX

Le samedi 15 décembre 2018 04:04:27 UTC+1, jiewuza a écrit :
>
>
> Currently, pandoc sets the label automatically according to the text 
> format. For 
> ``` 
> (1) item 
>     (a) subitem 
>          i. subsubitem 
> ``` 
>
> It generates tex: 
> ``` 
> \begin{enumerate} 
> \def\labelenumi{(\arabic{enumi})} 
> \item 
>   my item 
>
>   \begin{enumerate} 
>   \def\labelenumii{(\alph{enumii})} 
>   \tightlist 
>   \item 
>     subitem 
>
>     \begin{enumerate} 
>     \def\labelenumiii{\roman{enumiii}.} 
>     \tightlist 
>     \item 
>       subsubitem 
>     \end{enumerate} 
>   \end{enumerate} 
> \end{enumerate} 
> ``` 
>
> This is a great feature. However, sometimes it is required to match a 
> `hierarchy label format`. It is common that the format is predefined in 
> scholar paper templates, like: 
> ``` 
> \renewcommand{\theenumi}{\arabic{enumi}} 
> \renewcommand{\labelenumi}{(\theenumi)} 
> \renewcommand{\theenumii}{\alpha{enumii}} 
> \renewcommand{\labelenumii}{\theenumii} 
> \renewcommand{\theenumiii}{\roman{enumiii}} 
> \renewcommand{\labelenumiii}{(\theenumiii)} 
> ``` 
>
> And you just have to make the hierarchy right, forgetting the format 
> detail. 
>
> So I am wondering if it is worth introducing an option to disable 
> generating the 
> label according to the text, but leaving the format for user 
> customization. 
>
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e4d2283d-f272-40b2-92fb-e5ddfa5d4ba7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3446 bytes --]

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

* Re: Customize list item label for latex
  2018-12-16 13:21   ` Christophe Demko
@ 2018-12-17  7:44     ` jiewuza
  0 siblings, 0 replies; 4+ messages in thread
From: jiewuza @ 2018-12-17  7:44 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


Thank you.
This is what I want.

Christophe Demko <chdemko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
writes:

> You can use
>
> ```
> #. my item
>    #. subitem
>       #. subsubitem
> ```
>
> which does the job (see http://pandoc.org/MANUAL.html#extension-fancy_lists)
>
> It generates 
>
> ```
> \begin{enumerate}
> \tightlist
> \item
>   my item
>
>   \begin{enumerate}
>   \tightlist
>   \item
>     subitem
>
>     \begin{enumerate}
>     \tightlist
>     \item
>       subsubitem
>     \end{enumerate}
>   \end{enumerate}
> \end{enumerate}
> ```
>
> in LaTeX
>
> Le samedi 15 décembre 2018 04:04:27 UTC+1, jiewuza a écrit :
>
>  Currently, pandoc sets the label automatically according to the text 
>  format. For 
>  ``` 
>  (1) item 
>      (a) subitem 
>           i. subsubitem 
>  ``` 
>
>  It generates tex: 
>  ``` 
>  \begin{enumerate} 
>  \def\labelenumi{(\arabic{enumi})} 
>  \item 
>    my item 
>
>    \begin{enumerate} 
>    \def\labelenumii{(\alph{enumii})} 
>    \tightlist 
>    \item 
>      subitem 
>
>      \begin{enumerate} 
>      \def\labelenumiii{\roman{enumiii}.} 
>      \tightlist 
>      \item 
>        subsubitem 
>      \end{enumerate} 
>    \end{enumerate} 
>  \end{enumerate} 
>  ``` 
>
>  This is a great feature. However, sometimes it is required to match a 
>  `hierarchy label format`. It is common that the format is predefined in 
>  scholar paper templates, like: 
>  ``` 
>  \renewcommand{\theenumi}{\arabic{enumi}} 
>  \renewcommand{\labelenumi}{(\theenumi)} 
>  \renewcommand{\theenumii}{\alpha{enumii}} 
>  \renewcommand{\labelenumii}{\theenumii} 
>  \renewcommand{\theenumiii}{\roman{enumiii}} 
>  \renewcommand{\labelenumiii}{(\theenumiii)} 
>  ``` 
>
>  And you just have to make the hierarchy right, forgetting the format 
>  detail. 
>
>  So I am wondering if it is worth introducing an option to disable generating the 
>  label according to the text, but leaving the format for user customization. 

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m2o99kr40s.fsf%40163.com.
For more options, visit https://groups.google.com/d/optout.


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

end of thread, other threads:[~2018-12-17  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-15  3:04 Customize list item label for latex jiewuza
2018-12-16  3:27 ` jiewuza
     [not found] ` <m2tvjfcwy4.fsf-9Onoh4P/yGk@public.gmane.org>
2018-12-16 13:21   ` Christophe Demko
2018-12-17  7:44     ` jiewuza

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).