Skip to content
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

Nice references to latex items #7310

Open
catap opened this issue May 22, 2021 · 8 comments
Open

Nice references to latex items #7310

catap opened this issue May 22, 2021 · 8 comments

Comments

@catap
Copy link

catap commented May 22, 2021

Let me share a small example of latex code:

\documentclass[a4paper, DIV=15]{scrartcl}

\usepackage{enumitem}

\begin{document}

Some text
\begin{enumerate}[label={(\alph*)}]
  \item\label{item1} Some item;
  \item Another item;
  \item An item that has references to Item~\ref{item1}.
\end{enumerate}

\end{document}

which is compiled to very nice pdf:
Screenshot 2021-05-22 at 19 16 22

Unfortunately when I compiled it to .docx I have this wired things:
Screenshot 2021-05-22 at 19 17 08

And markdown version looks same to .docx:

Some text

1.  [\[item1\]]{#item1 label="item1"} Some item;

2.  Another item;

3.  An item that has references to
    Item [\[item1\]](#item1){reference-type="ref" reference="item1"}.

Is it possible to add a magic option to achive output at docx similar with nice pdf?

I'm using:

pandoc 2.13
Compiled with pandoc-types 1.22, texmath 0.12.2, skylighting 0.10.5,
citeproc 0.3.0.9, ipynb 0.1.0.1
User data directory: /Users/catap/.local/share/pandoc
Copyright (C) 2006-2021 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
@tarleb
Copy link
Collaborator

tarleb commented May 23, 2021

Slightly related issues: #813 and #1774.

@jgm
Copy link
Owner

jgm commented May 23, 2021

We wouldn't need to make an option for this; it should ideally just be done by default. It shouldn't be too hard to implement.

@jgm
Copy link
Owner

jgm commented May 23, 2021

Note also that in your example the list style information ([label={(\alph*)}]) is being lost.

@catap
Copy link
Author

catap commented May 23, 2021

@jgm yeah, double bug! :)

@wilitp
Copy link

wilitp commented Jun 6, 2024

Hello @jgm! I'm using Pandoc to convert Latex to html and I'm having the same issue. The following latex:

\begin{enumerate}
\item[(E1)] First
\item[(E2)] Second
\end{enumerate}

Outputs the following html:

<ol>
    <li><p>First</p></li>
    <li><p>Second</p></li>
</ol>

Is this still unresolved?

I could try and fix it if you think this is a good first issue.

@jgm
Copy link
Owner

jgm commented Jun 6, 2024

if you think this is a good first issue.

Definitely not. The Pandoc AST has no way to represent a list with arbitrary markers.

@wilitp
Copy link

wilitp commented Jun 6, 2024

I see. Is there any workaround I could try? Thanks

@jgm
Copy link
Owner

jgm commented Jun 7, 2024

@wilitp Your question should better be asked in Discussions. It is not really relevant to this issue, which has to do with references to list items, not list items with custom enumerators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants