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

{\em my text} not converting as emphasis in RST #5446

Closed
josephcslater opened this issue Apr 15, 2019 · 4 comments
Closed

{\em my text} not converting as emphasis in RST #5446

josephcslater opened this issue Apr 15, 2019 · 4 comments

Comments

@josephcslater
Copy link

Version 2.3.2.2

{\em my text} doesn't result in *my text* like \emph{my text} does.

This is a problem when converting bibtex output- at least in the case of the format I'm using.

The following has one that works and another that does (using \emph and \em)

pandoc -f latex  pubs.tex.txt -o pubs.rst

Github won't upload files with .tex extension, so I've added .txt.
pubs.tex.txt

@jgm
Copy link
Owner

jgm commented Apr 15, 2019

% pandoc -f latex -t native
{\em ASME Turbo Expo 2018:  Turbomachinery Technical Conference and Exposition\/}
^D
[Para [Span ("",[],[]) [Emph [Str "ASME",Space,Str "Turbo",Space,Str "Expo",Space,Str "2018:",Space,Str "Turbomachinery",Space,Str "Technical",Space,Str "Conference",Space,Str "and",Space,Str "Exposition"]]]]

As you can see, pandoc is recognizing this as Emph(asized), but the Emph element is put inside a Span (because of the { } grouping).

You'll get emphasis in HTML:

<p><span><em>ASME Turbo Expo 2018: Turbomachinery Technical Conference and Exposition</em></span></p>

but the extra span is blocking emphasis in RST output.

@jgm jgm changed the title {\em my text} not converting. {\em my text} not converting as emphasis in RST Apr 15, 2019
@josephcslater
Copy link
Author

Right- so can this be "corrected"?

Note that this is the output of bibtex- I don't necessarily directly control it then. I have written a dirty work around to string replace {\em with \emph{, but I think that this should be done in general by pandoc.

@jgm
Copy link
Owner

jgm commented Apr 15, 2019

Yes, I'll fix it.

@jgm jgm closed this as completed in e409509 Apr 15, 2019
@josephcslater
Copy link
Author

Someday I might understand the code enough. Sorry. I actually tried, but coming from "zero" I couldn't make heads or tales of it.

btw- awesome code. Thanks!

jgm added a commit that referenced this issue Apr 16, 2019
We only treat Span as transparent if it has no attributes.
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

2 participants