I'm using Elementary OS and I have the latest TexLive, Textadept, and Okular installed in the default locations, Textadept is using the configuration files from the ConTeXt distribution. Compiling and pdf creation works fine, but Okular doesn't startup after PDF creation, I'm getting the message below. Any ideas why is it trying to use a Windows executable and how to get it to open the PDF properly and automatically? Thanks everyone.

mtx-context     | pdfview methods: auto default okular pdfxcview sumatra, 
current method: sumatra (directives_pdfview_method) pdfview   | command: wine 
"sumatrapdf.exe" -reuse-instance -bg-color 0xCCCCCC "Adept_test_file.pdf" 
1>/dev/null 2>/dev/null & mtx-context     | pdfview overhead: 0.004 seconds 
system          | total runtime: 1.087 seconds
  • In short: --autopdf doesn't work very well. Best to adjust the compile_commands in textadept directly. – DG' Sep 23 '19 at 8:32
  • Which files would those be? – rosebud Sep 23 '19 at 14:15
  • init.lua in your ~/.textadept directory – DG' Sep 23 '19 at 14:18

You need to put something like this in your init.lua:

textadept.run.compile_commands.tex = 'mtxrun --autogenerate --script context --purge --synctex=-1 "%f"' and 'xdg-open "%e.pdf"'
|improve this answer|||||
  • Textadept is working again after installing textredux, but neither okular or xdg-open works, even when I tried them explicitly by /usr/bin/xdg-open etc – rosebud Sep 23 '19 at 17:26
  • Maybe try again: remove ~/.textadept, start textadept, add the following line to init.luatextadept.run.compile_commands.tex = 'mtxrun --autogenerate --script context --purge --synctex=-1 "%f"' and 'xdg-open "%e.pdf"' – DG' Sep 23 '19 at 19:50
  • Yes!! That was it. Thanks so much!! I'll mark this as the right aswer. – rosebud Sep 23 '19 at 20:04

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.