-
Notifications
You must be signed in to change notification settings - Fork 31
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Alphabetical lists #84
Comments
Dear @nopria,
If you need all your ordered lists to be alphabetic, then you can restyle Markdown as follows: \documentclass{article}
\usepackage{markdown, paralist}
\markdownSetup{
startNumber = false,
renderers = {
olBegin = {\begin{enumerate}[a)]},
olEnd = {\end{enumerate}}
}
}
\begin{document}
\begin{markdown}
1. first item
2. second item
3. third item
\end{markdown}
\end{document} This is in line with the philosophy that markdown does not contain presentation markup, only structural markup. The author types an ordered list between
it is difficult to see what the cause of your error is without a minimal working example of your code. |
If I need to alternate alphabetical with numbered lists how can I do? About the error, it seems that just loading
|
The markdown package uses the
Not in Markdown (yet), since the appearance of lists is related to presentation, not content. As a general rule, markdown does not contain presentation markup. To change the presentation of your lists, you will need to use TeX. \documentclass{article}
\usepackage[shortlabels]{enumitem}
\usepackage[startNumber = false, tightLists = false]{markdown}
\newcommand\alphabeticallists{%
\markdownSetup{
renderers = {
olBegin = {\begin{enumerate}[a)]},
olEnd = {\end{enumerate}}
}
}%
}
\newcommand\numberedlists{%
\markdownSetup{
renderers = {
olBegin = {\begin{enumerate}[1.]},
olEnd = {\end{enumerate}}
}
}%
}
\begin{document}
\begin{markdown*}{hybrid}
\alphabeticallists
The following list will be alphabetical:
1. first item
2. second item
3. third item
\numberedlists
The following list will be numbered:
1. first item
2. second item
3. third item
\end{markdown*}
\end{document} If you would rather not use the % preamble omitted for brevity
\begin{document}
\alphabeticallists
\begin{markdown}
The following list will be alphabetical:
1. first item
2. second item
3. third item
\end{markdown}
\numberedlists
\begin{markdown}
The following list will be numbered:
1. first item
2. second item
3. third item
\end{markdown}
\end{document} Does this help you solve your issue? |
Yes, this solution suits nicely my need. Just one last question. Why an |
It should not be ignored. You can debug this by taking a look at the TeX documents produced in the _markdown_(name of your document) dictionary. These are what is actually typeset by LaTeX. The conversion from Markdown to TeX removes newlines, perhaps the |
I found out that it was ignored because of a commented line (%) just before |
Yes, since the conversion from Markdown to TeX does not obey newlines, this introduces the non-intuitive behavior, where TeX comments consume more than one line of your markdown input. This non-intuitive behavior has been fixed in v2.10.0, which I'm planning to release by TUG 2021 this August, but which you can try out by using the version from this repository: comments are now disabled in |
It seems that a simple macro can replace all the macros possibly needed to render custom ordered lists. The following macro lets the user define "on the fly" the type of list, using the options of
So, for example, With just one macro the user can take advantage of the versatility and power of LaTeX ordered lists. I think that's wonderful. |
Thank you. The ability to easily change the design of markdown elements on the fly is one of the unique features of this package. |
I didn't pay attention to the Is there a solution working with |
You can redefine the \markdownSetup{
renderers = {
olItemWithNumber = {\item[\romannumeral#1\relax)]},
}
} However, this makes it difficult to use the 1. One
2. Two
\mdlists{[resume]}
3. Three
4. Four |
Thanks, |
Definitely. There are many ways to achieve what you want. |
Would there be any way to auto-magically detect the enumeration of the list? As in, one could add both numbered and alphabetical lists to a markdown document without the use of any in-document latex commands, and have the latex package correctly format them both? This would be inline with what the folks at pandoc are doing:
|
@nbubis It is not difficult to implement (the basic version of) this, but the philosophy of markdown is one of separation of presentation from content. In the words of Michael Thompson from the pandoc-discuss mailing list:
I am not convinced that the choice between alphabetical and numbered lists is not related to presentation and should lie with the writer rather than the design person. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I need to create an ordered list of type
a) first item
b) second item
c) third item
and since I did not find a way to do it in plain markdown, I tried with LaTeX
enumerate
environment, activating thehybrid
option, but I get the errorIs there a solution?
The text was updated successfully, but these errors were encountered: