Thanks a lot for your comments.
Interesting, if I do the same thing with pypandoc, it does not work:

s = "I have : <i><λv<sub>1</sub>,w> + <v<sub>2</sub>,w></i>"
text = pypandoc.convert_text(s,'latex', format = "markdown", extra_args = ['--wrap=preserve'] )

'I have : 1,w\\textgreater{} + 2,w\\textgreater{}\r\n'



On Friday, April 12, 2019 at 6:54:37 AM UTC+2, John MacFarlane wrote:
tot...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org writes:

> I see, thank you very much for your help !
> So, you replaced basically all `<`with `&lt`, correct ?

All the < except the ones that are parts of HTML tags.

> Also: Do you understand, why, if you go on my Stackoverflow question
> https://stackoverflow.com/q/55642183/6114310, the string can be perfectly
> represented, if I just type it as is into Stackoverflow ?

StackOverflow is parsing as Markdown, which allows raw HTML.
And it's more forgiving of invalid HTML, apparently,
than pandoc's HTML parser.

Interestingly, pandoc does the same thing. If you read
markdown, it allows this:

% pandoc -f markdown -t latex
<i><λv<sub>1</sub>,w> + <v<sub>2</sub>,w></i>
\textless λv1,w\textgreater{} + \textless v2,w\textgreater{}

Here the emphasis disappears, though, because teh HTML
tag <i> is parsed as raw HTML which won't be passed
through to latex:

% pandoc -f markdown -t native
<i><λv<sub>1</sub>,w> + <v<sub>2</sub>,w></i>
[Para [RawInline (Format "html") "<i>",Str "<\955v",RawInline (Format "html") "<sub>",Str "1",RawInline (Format "html") "</sub>",Str ",w>",Space,Str "+",Space,Str "<v",RawInline (Format "html") "<sub>",Str "2",RawInline (Format "html") "</sub>",Str ",w>",RawInline (Format "html") "</i>"]]

But if you read HTML, it doesn't like the unescaped <.

% pandoc -f html -t latex
\emph{1,w\textgreater{} + 2,w\textgreater{}}

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7711d138-8d66-44bb-bc74-d3102bfe30d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.