1

this is my first post here, so please bear with me.

I am having a hard time configuring textadept to use ConTeXt.

Following instructions on ConTeXtwiki I found out that Hans Hagen wrote configuration files for textadept which are included in the CTX distribution. But I can't find those files anywhere in my CTX directory. There are only settings for SciTE, texworks and texfont.

Another link on CTXwiki points to https://github.com/stephengaito/ta-context-latex . I downloaded and extracted the package but yet when I try to build or compile a *.tex file textadept gives me a pdfTeX error. I know that CTX mkiv uses LuaTeX as engine but I don't know why textadept doesn't use it. Installation instructions for the module package are for Linux only and it says that the package has to be setup first. But how does this work on Windows?

I have the latest (beta) CTX version, no MiKTeX or LaTeX at all, and my CTX is in the system path. So far I've been using SciTE and with Scintillua and the configuration files from the CTX distribution it works fine.

So, does anybody of you use textadept as main editor and/or can tell me how to set it up properly to use with CTX?

Thanks in advance.

  • Works fine here. Did you install textredux and ctags? What errors do you get in the log? Does TA recognize your files as ConTeXt or LaTeX? Which OS do you use (I suppose Windows as you happen to mention MiKTeX) – DG' Feb 25 '17 at 19:55
  • No, I didn't install any of these. I am not sure whether I need the github package by Stephen Gaito as textadept seems to have an own ConTeXt lexer. – Koenich Feb 27 '17 at 18:19
3

I have it now: you need to edit textadept's init.lua and add one of the following lines:

textadept.run.run_commands.tex = 'mtxrun --autogenerate --script context --autopdf "%f"'

or:

textadept.run.compile_commands.tex = 'mtxrun --autogenerate --script context --autopdf "%f"'

Then you can use Tools -> Run (or) Compile in textadept to compile a CTX PDF.

Note that your CTX executables folder has to be in the Windows system PATH. Otherwise you have to add the full path to the CTX executables before MTXRUN. For example:

[...] = 'C:/ConTeXt/tex/texmf-mswin/bin/mtxrun --autogenerate [...]'

Also note that you have to use slash ( / ) instead of backslash ( \ ) in the file path, since Lua interprets a backslash as the beginning of a command, while for Windows it doesn't make any difference.

Furthermore note that there is two init.lua for textadept. One is in the program folder (don't modify this one though, as your changes will be lost when you update TA). The second init.lua is created when you start TA for the first time. It's the one to which you should add the line mentioned above and it's located in SYSDRIVE/users/USERNAME/.textadept/init.lua

Now you should be able to have fun with textadept (one of the fastest, most customizable, lightweight coding editors) and ConTeXt ([hopefully] the future of advanced text processing).

  • Why use --purgeall. That option removes the .tuc file. It is generally better to leave it around so that subsequent runs are faster. – Aditya Feb 27 '17 at 20:07
  • Good question. So far I never thought about the . tuc files other that they filled my directory. Now that I know their sense I surely will think about keeping them. Is there a way to make mtxrun save them all in a seperate folder? – Koenich Feb 27 '17 at 22:39
  • Not really. ConTeXt only generates two files .log and .tuc, so it isn't as bad. You could use --purge instead of --purgeall, which removes the .log file. – Aditya Feb 28 '17 at 20:50

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.