unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Haines Brown <haines@histomat.net>
To: help-gnu-emacs@gnu.org
Subject: Having .emacs distinguish betweeen LaTeX and XeLaTeX
Date: Sun, 27 May 2012 07:00:44 -0400	[thread overview]
Message-ID: <87mx4tkhwj.fsf@engels.HistoricalMaterialism.info> (raw)


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


             reply	other threads:[~2012-05-27 11:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-27 11:00 Haines Brown [this message]
2012-05-27 11:16 ` Having .emacs distinguish betweeen LaTeX and XeLaTeX 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mx4tkhwj.fsf@engels.HistoricalMaterialism.info \
    --to=haines@histomat.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).