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

Substitution issue #1991

Open
NoralK opened this issue Aug 11, 2015 · 2 comments
Open

Substitution issue #1991

NoralK opened this issue Aug 11, 2015 · 2 comments

Comments

@NoralK
Copy link

NoralK commented Aug 11, 2015

I have the following markup:

.. only:: not latex

    .. |mychar| unicode:: U+ABCD

.. only:: latex

    .. |mychar| raw:: latex

        {\Symbola\char"ABCD}

I am getting the following error when I compile make html or make latex:

mychar.txt:7: ERROR: Duplicate substitution definition name: "mychar".

I would expect when I make latex then the html section would not be generated and when I make html the latex section would not be generated.

Any thoughts how to fix this? BTW - I am using xelatex to generate the PDF.

@NoralK
Copy link
Author

NoralK commented Aug 17, 2015

Ping

@shimizukawa
Copy link
Member

it's a current behavior of only directive (see also #1488).

only is a 'rendering control marker' at 'writing stage' instead of 'reading stage'.
Because of that, all definitions under only directive will be parsed at 'reading stage'.

So, to avoid this error, you can use custom sty file for latex to define unicode symbols (Although I'm not familiar to latex, it will work).

@AA-Turner AA-Turner added this to the some future version milestone Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants