all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Having .emacs distinguish betweeen LaTeX and XeLaTeX
@ 2012-05-27 11:00 Haines Brown
  2012-05-27 11:16 ` Teemu Likonen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Haines Brown @ 2012-05-27 11:00 UTC (permalink / raw)
  To: help-gnu-emacs


I would like to specify the TeX engine with the emacs command line, such
as with C-c C-c latex and C-c C-c xelatex, rather than having it only
call whichever TeX-engine is specified in AUCTeX configuration or in
.emacs init file. At present I can only switch between processing LaTeX
and XeLaTeX files by inserting or commenting a line in .emacs (setq
TeX-engine 'xetex) and reload emacs.

Simplest would be to have AUCTeX not specify any TeX-engine and instead
use the engine specified at the command prompt. There does not seem to
be any way to do this, and so an alternative might be for .emacs to
specify the TeX engine by distinguishing between LaTeX and XeLaTeX
files.

Someone using the Jed editor does this. He sets the default TeX-engine to
xetex if the document uses packages peculiar to XeTeX:

   if (re_fsearch("\\usepackage.*unicode-math") or
       re_fsearch("\\usepackage.*fontspec") or
       re_fsearch("\\usepackage.*polyglossia")
      )
      define_blocal_var("latex_output", "xetex");

Is it possible to something comparable to this if construction in .emacs
init? I know nothing of lisp, but guess it would be something like:

   ( if 
        (search-forward "\usepackage*fontspec") or
        (search-forward "\usepackage*polyglossia")
     (setq TeX-engine 'xetex))

Haines Brown


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-27 19:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-27 11:00 Having .emacs distinguish betweeen LaTeX and XeLaTeX Haines Brown
2012-05-27 11:16 ` Teemu Likonen
2012-05-27 13:31   ` Haines Brown
2012-05-27 17:06   ` Haines Brown
2012-05-27 12:51 ` XeCycle
2012-05-27 19:08 ` Ralf Angeli

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.