Pandoc .docx to .md with math and images - pandoc

I am trying to export .docx file to a .md file with math and images. However, only the image is present on the new file, but not the math in mathjax. Any idea how to solve this?
The code I use is: pandoc --extract-media=.-s file.docx -t markdown -o file.md

Related

Is there a way to convert a code-file to an image with syntaxhiglighting

I try to convert Pascal-Code Files to an image (jpg, png) an find pongo-view as a good solution. Is there a way to add syntax-highlighting in the Output files?
I am happy about any hints :)
Thanks
I found an old repo to add syntax highligthing with pango markup (https://github.com/LinuxJedi/pango-syntax-highlighter/). So the new one can now convert Pascal files to images with syntax highligthing.
https://github.com/thiemol/pango-syntax-highlighter
python3 pangosyntaxhighlight.py cpp myfile.cpp output.txt && pango-view --markup --font=mono -qo image.png output.txt
Works with:C,C++,Java, Go', Python,Scala, GLShaderLexer, xml.
Now also with Delphi/Pacal, PhP. You can simple add the right lexer.

Convert from slidy to powerpoint with pandoc or something else?

I'd like to convert a slidy presentation to powerpoint. I tried using pandoc:
pandoc -f html+tex_math_dollars+tex_math_single_backslash test.html -o test.pptx
Does create a powerpoint file, but the file doesn't have separate slides, all the text is one slide, probably because the above command doesn't tell pandoc to recognize that the html is slidy.
I found commands for pandoc to convert TO slidy but nothing about converting FROM slidy.

pandoc command param --epub-cover-image generate fail

I wanna generate docx from markdown files ,and insert into the conver picture, From pandoc metada , I can use --epub-cover-image.
My directory :
then command:
pandoc -s a.md b.md c.md -o example.docx --epub-cover-image cover.png
It generate example.docx file, but the cover.png does not insert into the docx file ?
Quoting the pandoc manual section on --epub-cover-image:
Use the specified image as the EPUB cover.
Since you are not generating a EPUB ebook but a docx word file, the option has simply no effect.

Left-align text when converting from md to pdf

I'm converting a markdown file to pdf with:
pandoc -o out.pdf in.md
The results are justified alignment, a pet hate. Is there any way to render regular text as left-aligned instead? Nothing appears in help for 'left' or 'align'..
You could use the latex package ragged2e.
For one document
Add this to your yaml front matter:
---
header-includes:
- \usepackage[document]{ragged2e}
---
For all documents
Edit your pandoc latex template; to create it:
pandoc -D latex > ~/.pandoc/templates/default.latex
Then open the file and add somewhere before the \begin{document}:
\usepackage[document]{ragged2e}

graphviz pdf generation from .dot failing with both Tpdf and Tps2

I have a .dpt file I am trying to output a .png and .pdf files out of it and I am using my command line expression as: dot -Tpng SPU123.dot -o SPU123.png to generate .png and it works fine. First, I tried to generate (following graphviz documentation) .pdf by: dot -Tpdf SPU123.dot -o SPU123.pdf but it just generated a blank .pdf and the documentation says there is something buggy with Tpdf option and instead use Tps2 option so I did: dot -Tps SPU123.dot -o SPU123.ps but I got this error:
Error: canvas size (34642,3608) exceeds PDF limit (14400)
(suggest setting a bounding box size, see dot(1))
How to generate .pdf output out of my .dot file?

Resources