[texhax] latex2rtf?

Susan Dittmar Susan.Dittmar at gmx.de
Tue Aug 7 09:26:05 CEST 2012


Quoting William F Hammond (hmwlfsr at yahoo.com):
> I think the following distills the issue:
> 
>   : echo "He said, ``No'', and then he left." | pandoc --from=latex --to=html
> 
>     STDOUT:
>     <p
>     >He said, No
> 
>     STDERR:
>     pandoc: <stdout>: commitAndReleaseBuffer: invalid argument
>     (Invalid or incomplete multibyte or wide character)
> 
> It seems that pandoc is tripping on the LaTeX markup for
> double quotes.  It also seems to trip on forced linebreaks
> indicated by "\\".

Stop. Now we might be mixing problems...

You are using the command line here, which means it will first be
interpreted by bash (or whatever command line interpreter you use) before
even echo and then pandoc is called. You use double quotes, which tell bash
to look inside and expand there aswell. This means, it will try to call the
command between backquotes ` and `, and substitute the result at its place.
And it will read \\ as an escaped backslash.

You would have to call it like that:

echo "He said, \`\`No'', and then he left." | pandoc --from=latex --to=html

(You can test the echo command first to make sure the output is valid TeX
code, then append the pipe to pandoc.)

Hope that helps,

	Susan



More information about the texhax mailing list