* How to get xetex/xelatex option in the Emacs menu?
@ 2010-04-23 17:54 Tariq
2010-04-23 18:23 ` Teemu Likonen
0 siblings, 1 reply; 8+ messages in thread
From: Tariq @ 2010-04-23 17:54 UTC (permalink / raw)
To: help-gnu-emacs
Hi Everyone,
I am using Gnu Emacs 22 GTK with AucTeX under Ubuntu. I am not a
programmer but I have built up a nice .emacs file with help from all
the kind folks. When I load a (La)TeX file, I can get all the nice
menus related to LaTeX such as Preview, LaTeX, Command, Math, Ref etc.
Under he Command menu, I see a set of options called TeXing Options
which has things like PDF Mode, Run Interactively, and others.
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. So far, I am having to go to the
Terminal to issue
xelatex
command while I edit these files in Emacs. This seems rather awkward
(if not an outright insult to Emacs!).
I would appreciate some advice and help.
Regards,
Tariq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to get xetex/xelatex option in the Emacs menu?
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:11 ` Tariq
0 siblings, 2 replies; 8+ messages in thread
From: Teemu Likonen @ 2010-04-23 18:23 UTC (permalink / raw)
To: help-gnu-emacs
* 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"))))))
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to get xetex/xelatex option in the Emacs menu?
2010-04-23 18:23 ` Teemu Likonen
@ 2010-04-23 19:04 ` Tariq
2010-04-23 19:45 ` Teemu Likonen
2010-04-23 19:11 ` Tariq
1 sibling, 1 reply; 8+ messages in thread
From: Tariq @ 2010-04-23 19:04 UTC (permalink / raw)
To: help-gnu-emacs
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"))))))
Thank you so much for the code for two hooks. Consider this my naivity
but I cannot tell the difference (if any) in the behaviour of Emacs
when using the first or the second (fancier) hook. Specifically, I see
the appearance of XeLaTeX under the Command menu after opening a .tex
file and this is the case with either code. Similarly, when I select
(in TeXing Options) PDF Mode, I still need to press XeLaTeX in Command
menu.
I got the impression from your description that with the fancier code,
the LaTeX option would execute XeLaTeX if the file has
\usepackage{fontspec} in it. this does not appear to be the case. Most
likely, I am confused about something. What specifically is the
difference in the expected behaviour of these two codes? I would
appreciate if you could elaborate. Regards,
Tariq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to get xetex/xelatex option in the Emacs menu?
2010-04-23 18:23 ` Teemu Likonen
2010-04-23 19:04 ` Tariq
@ 2010-04-23 19:11 ` Tariq
2010-04-23 21:32 ` Ralf Angeli
1 sibling, 1 reply; 8+ messages in thread
From: Tariq @ 2010-04-23 19:11 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to get xetex/xelatex option in the Emacs menu?
2010-04-23 19:04 ` Tariq
@ 2010-04-23 19:45 ` Teemu Likonen
2010-04-23 20:13 ` Tariq
0 siblings, 1 reply; 8+ messages in thread
From: Teemu Likonen @ 2010-04-23 19:45 UTC (permalink / raw)
To: help-gnu-emacs
* 2010-04-23 12:04 (-0700), Tariq wrote:
> Thank you so much for the code for two hooks. Consider this my naivity
> but I cannot tell the difference (if any) in the behaviour of Emacs
> when using the first or the second (fancier) hook. Specifically, I see
> the appearance of XeLaTeX under the Command menu after opening a .tex
> file and this is the case with either code. Similarly, when I select
> (in TeXing Options) PDF Mode, I still need to press XeLaTeX in Command
> menu.
The "fancy" version sets the default compiler command for the document
when you load a tex file or switch to latex-mode. I think you'll notice
the difference when you use C-c C-c to compile a document. With the
"fancy" version it's either XeLaTeX or LaTeX, depending on whether there
is \usepackage{fontspec} (or mathspec) within the first 3000 characters
of the document.
Or that's how it works in my system. I don't know Auctex very deeply and
its different versions may behave differently.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to get xetex/xelatex option in the Emacs menu?
2010-04-23 19:45 ` Teemu Likonen
@ 2010-04-23 20:13 ` Tariq
0 siblings, 0 replies; 8+ messages in thread
From: Tariq @ 2010-04-23 20:13 UTC (permalink / raw)
To: help-gnu-emacs
On Apr 23, 3:45 pm, Teemu Likonen <tliko...@iki.fi> wrote:
> * 2010-04-23 12:04 (-0700), Tariq wrote:
>
> > Thank you so much for the code for two hooks. Consider this my naivity
> > but I cannot tell the difference (if any) in the behaviour of Emacs
> > when using the first or the second (fancier) hook. Specifically, I see
> > the appearance of XeLaTeX under the Command menu after opening a .tex
> > file and this is the case with either code. Similarly, when I select
> > (in TeXing Options) PDF Mode, I still need to press XeLaTeX in Command
> > menu.
>
> The "fancy" version sets the default compiler command for the document
> when you load a tex file or switch to latex-mode. I think you'll notice
> the difference when you use C-c C-c to compile a document. With the
> "fancy" version it's either XeLaTeX or LaTeX, depending on whether there
> is \usepackage{fontspec} (or mathspec) within the first 3000 characters
> of the document.
>
> Or that's how it works in my system. I don't know Auctex very deeply and
> its different versions may behave differently.
Hi Teemu
Thanks for the tip. You're right, I noticed the Ctrl-c Ctrl-c
behaviour exactly as you described.
I'll stick with the fancy version because I can just use the keyboard
for faster compilation.
Best,
Tariq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to get xetex/xelatex option in the Emacs menu?
2010-04-23 19:11 ` Tariq
@ 2010-04-23 21:32 ` Ralf Angeli
2010-04-23 21:40 ` Tariq
0 siblings, 1 reply; 8+ messages in thread
From: Ralf Angeli @ 2010-04-23 21:32 UTC (permalink / raw)
To: help-gnu-emacs
* Tariq (2010-04-23) writes:
> 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.
How about upgrading AUCTeX and making use of `TeX-engine'?
--
Ralf
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to get xetex/xelatex option in the Emacs menu?
2010-04-23 21:32 ` Ralf Angeli
@ 2010-04-23 21:40 ` Tariq
0 siblings, 0 replies; 8+ messages in thread
From: Tariq @ 2010-04-23 21:40 UTC (permalink / raw)
To: help-gnu-emacs
On Apr 23, 5:32 pm, Ralf Angeli <dev.n...@caeruleus.net> wrote:
> * Tariq (2010-04-23) writes:
> > 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.
>
> How about upgrading AUCTeX and making use of `TeX-engine'?
>
> --
> Ralf
I installed Emacs 22 and AucTeX from the Ubuntu 9.10 repositories only
two days ago. That is the latest version they have. Since I have never
done these installations manually, I am not sure how to go about it
such that my existing system would not break.
If you can give some hints as to how to proceed, I would definitely
like to upgrade AucTeX and would certainly appreciate.
Regards,
Tariq
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-04-23 21:40 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-04-23 21:32 ` Ralf Angeli
2010-04-23 21:40 ` Tariq
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).