0

enter image description hereI have installed Miktex and Texworks in Windows 10. How to invoke latex from the command prompt? I want to use Pandocs to convert files into pdf (it uses latex). For example: I want to run this command in cmd: pandoc -f html -t pdf http://najeebkhan.github.io/blog/VecCal.html -s -o try.pdf

In the attached image (see the last line): It can be seen that I have added the miktex to the path variable.

I have reinstalled miktex. On running tex -v . I get this message in the tex.log file: "FATAL tex - The command line options could not be processed." But I am able to compile file with GUI of texstudio. Following is complete content of log file:
2017-04-30 12:59:33,648+0200 INFO tex - starting with command line: tex -v
2017-04-30 12:59:33,653+0200 INFO tex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2017-04-30 12:59:45,185+0200 FATAL tex - The command line options could not be processed.
2017-04-30 12:59:45,185+0200 FATAL tex - Info: optionError="unknown option"
2017-04-30 12:59:45,185+0200 FATAL tex - Source: Libraries\MiKTeX\TeXAndFriends\webapp.cpp
2017-04-30 12:59:45,185+0200 FATAL tex - Line: 339

  • Welcome to TeX.SX! Does tex -v output a TeX version number? – TeXnician Apr 30 '17 at 10:07
  • 1
    Are you able to create a LaTeX hello word document and compile that? Or does the terminal give back: Command pdflatex not found? – Johannes_B Apr 30 '17 at 10:07
  • @TeXnician On typing: tex -v Output: 'tex' is not recognized as an internal or external command, operable program or batch file. Miktex is installed: C:\Users\ASUS\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64 – Nikhil Apr 30 '17 at 10:10
  • @Johannes_B 'pdflatex' is not recognized as an internal or external command, operable program or batch file. Miktex is installed: C:\Users\ASUS\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64 – Nikhil Apr 30 '17 at 10:10
  • That means you didn't install MikTeX, the instalation did not fully succeed, or the PATH varible wasn't set properly and your OS can't find the executable. – Johannes_B Apr 30 '17 at 10:14
1

I had the same issue as Nikhil, saw that the answer was given in the comment from Ulrike Fischer buried near the bottom, and thought I would put it together here with necessary modifications:

  1. Installed Pandoc and Miktex
  2. Verify Pandoc with pandoc -v in CMD
  3. Verify Miktex with tex --version, not tex -v in CMD.
  4. Test OP's conversion code with slight modifications: pandoc -f html+tex_math_dollars -t latex http://najeebk.com/blog/VecCal.html -s --mathjax -o try3.pdf
  5. PDF was generated with proper math formatting thanks to html+tex_math_dollars extension, also had to switch -t pdf to -t latex per Pandoc documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.