1

I'm a french writer, I'm writing using LaTeX in Visual Studio Code. I need to be able to export my *.tex files to word and *.docx.

I've found this terminal comman line that is doing the magic :

pandoc foo.tex --from latex --to docx > foo.docx 

I'd like now to have a LaTeX Workshop command that allow me to launch that command line inside Visual Studio Code.

I've search in their wiki after one told me to use recipes, but I don't really understand how to use their latex-workshop.latex.recipes and latex-workshop.latex.tools files, and not much how to pass my command line inside those files.

Any help very very welcome.

Best regards

Update 1

Still digging, I have now

{
"name": "tex2docx",
"tools": [
         "tex2docx"
         ]
 }

in the "latex-workshop.latex.recipes" part of settings.json

and

{
 "name": "tex2docx",
 "command": "pandoc",
 "args": [
          "-o",
          "%DOCFILE%.docx"
        ],
        "env": {}
 }

in the "latex-workshop.latex.tools" part of that same settings.json

So I've an now an tex2docx entry in the Tex menu of VSC

BUT when I launch it, the process never stops and there's no output. When I kill VSC, I see a docx appearing in the right place with the right name but he is empty...

1 Answer 1

1

Ok, got it

One must put

{
        "name": "tex2docx",
        "command": "pandoc",
        "args": [
            "%DOCFILE%.tex"
            "-o",
            "%DOCFILE%.docx"
        ],
        "env": {}
      }

in the "latex-workshop.latex.tools" section of settings.json

and

{
"name": "tex2docx",
"tools": [
     "tex2docx"
     ]
 }

in the "latex-workshop.latex.recipes" section of settings.json

Then, it's working :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .