texmath icon indicating copy to clipboard operation
texmath copied to clipboard

handling of soft breaks in omml input

Open redstoneleo opened this issue 6 years ago • 5 comments

Conversion command E:\pandoc-2.7-windows-i386\pandoc.exe -s 2.docx -t markdown-smart --wrap=none -o example35.md After conversion, only the two display style formula left, all other text was striped out.

One could test the problem with 2.docx

redstoneleo avatar Mar 04 '19 12:03 redstoneleo

I think it is the downward pointing arrow that caused the problem, the arrow is in formula format , because if I removed the downward pointing arrow, the conversion went well . image

redstoneleo avatar Mar 04 '19 12:03 redstoneleo

image

The downward pointing arrow also caused the following problem

Conversion command E:\pandoc-2.7-windows-i386\pandoc.exe -s a.docx -t markdown-smart --wrap=none -o example35.md

Wong result : image

One could test the problem with a.docx

redstoneleo avatar Mar 04 '19 13:03 redstoneleo

That symbol is not a regular new line, but a soft return, and pandoc does not treat it as a new paragraph. If you use a regular return, it'll probably work.

I simplified your formulas and tested it with:

$ pandoc -t native a.docx
[Para [Math DisplayMath "\\left( L - \\epsilon_{1} \\right)"]
,Para [Math DisplayMath "{\\Downarrow \n}\\left( L - \\epsilon_{1} \\right)"]
,Para [Math DisplayMath "{\\Downarrow \n}\\left( L - \\epsilon_{1} \\right)"]]

You can see the soft-breaks as \n in the formula, which are lost in the docx writer

agusmba avatar Mar 04 '19 15:03 agusmba

Maybe there's a way texmath can handle this better. Transferring the issue there.

jgm avatar Mar 04 '19 17:03 jgm

It's a <w:br /> element inside math.

jgm avatar Mar 04 '19 17:03 jgm