unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tariq <tariq.perwez@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to get xetex/xelatex option in the Emacs menu?
Date: Fri, 23 Apr 2010 12:11:35 -0700 (PDT)	[thread overview]
Message-ID: <45f0c259-d394-4ab8-9f44-2a4d85a86302@g23g2000yqn.googlegroups.com> (raw)
In-Reply-To: 87ljcem3jb.fsf@mithlond.arda

On Apr 23, 2:23 pm, Teemu Likonen <tliko...@iki.fi> wrote:
> * 2010-04-23 10:54 (-0700), Tariq wrote:
>
> > I would like to include in one of these menus (preferably under the
> > Command menu) the option to run xetex/xelatex also so that I can use
> > Emacs to compile XeLaTeX files.
>
> You could do it with hook:
>
>     (add-hook 'LaTeX-mode-hook #'my-latex-mode-hook)
>
>     (defun my-latex-mode-hook ()
>       (add-to-list 'TeX-command-list
>                    '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t)))
>
> The following is a fancier version of the hook. It sets XeLaTeX the
> default compiler when it finds fontspec or mathspec package being loaded
> with \usepackage{}.
>
>     (defun my-latex-mode-hook ()
>       (add-to-list 'TeX-command-list
>                    '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t))
>       (setq TeX-command-default
>             (save-excursion
>               (save-restriction
>                 (widen)
>                 (goto-char (point-min))
>                 (let ((re (concat "^\\s-*\\\\usepackage\\(?:\\[.*\\]\\)?"
>                                   "{.*\\<\\(?:font\\|math\\)spec\\>.*}")))
>                   (if (re-search-forward re 3000 t)
>                       "XeLaTeX"
>                     "LaTeX"))))))

Perhaps I am being too demanding here (but considering this is Emacs
we are talking about, it should come as no surprise):  it possible to
have a little icon or something show up (along with other icons below
the main menu) indicating XeLaTeX and one could just click with mouse
to run xelatex? I see LaTeX (or pdf) icons among others that do this
for pdflatex or latex.

Best regards,

Tariq



  parent reply	other threads:[~2010-04-23 19:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23 17:54 How to get xetex/xelatex option in the Emacs menu? Tariq
2010-04-23 18:23 ` Teemu Likonen
2010-04-23 19:04   ` Tariq
2010-04-23 19:45     ` Teemu Likonen
2010-04-23 20:13       ` Tariq
2010-04-23 19:11   ` Tariq [this message]
2010-04-23 21:32     ` Ralf Angeli
2010-04-23 21:40       ` Tariq

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=45f0c259-d394-4ab8-9f44-2a4d85a86302@g23g2000yqn.googlegroups.com \
    --to=tariq.perwez@gmail.com \
    --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).