TransWikia.com

LaTeX compiller and editor interaction

TeX - LaTeX Asked on April 10, 2021

When pdflatex finds an error it stops and asks for a user reply. If I press "e" the editor should open the file at the place of the error. However, I use a different (nonstandard for LaTeX) editor. So, the question is, how does the TeX compiler informs at exit that an editor should be launched and position the file at a specific point. Certainly, it is possible to write a script and analyze the log file, but this is a roundabout.
I am using Windows 7, Mik TeX and FAR Manager. I run pdflatex from the internal editor of FAR Manager with the help of a macro.

2 Answers

If e is used at all (rather rare these days) it uses the TEXEDIT environment (or kpathse) variable to know what to open. The usual editor interaction these days (ie any time since the 1990s) is that you start from the editor which calls tex to process the current file, rather than starting tex then starting a new instance of the editor on each error. however for texlive at least the defaults could be changed in texmf.cnf or your environment like other path configuration settings, with the initial settings being shown as comments as shown below.

% These variables specify the external program called for the
% interactive `e' option.  %d is replaced by the line number and %s by
% the current filename.  The default is specified at compile-time, and
% we let that stay in place since different platforms like different values.
%TEXEDIT = vi +%d '%s'                    % default for Unix
%TEXEDIT = texworks --position=+%d "%s"   % default for Windows
%MFEDIT = ${TEXEDIT}
%MPEDIT = ${TEXEDIT}

So setting TEXEDIT=emacs in your environment before starting tex would save you from entering vi.

Answered by David Carlisle on April 10, 2021

For Mik Tex the environment is MIKTEX_EDITOR and the notations are: %l for the line number and %f for the filename.

Answered by ivan on April 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP