help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Run shell command from latex?


From: Joel J. Adamson
Subject: Re: Run shell command from latex?
Date: Thu, 10 Apr 2008 09:53:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

David Hansen <david.hansen@gmx.net> writes:

> On Wed, 09 Apr 2008 22:39:03 +0200 saneman wrote:
>
>> I know but I don't want to type 'make' each time. Instead I would like
>> to define a short key in my .emacs file that executes the script.
>>
>> Something like:
>>
>> (global-set-key "\C-r" 'myscript)
>
> (defun do-myscript ()
>   (interactive)
>   (shell-command "myscript"))
>
> (global-set-key (kbd "C-r") #'do-myscript)
>
> Anyway, compile mode is far more convenient if it understands your error
> messages.  You could e.g. (global-set-key (kbd "C-c c") #'compile) if
> you don't like to type M-x compile every time.
>
> But in case of latex files it's probably a better idea to look how to
> manipulate the external programs used by auctex (don't know if
> compile-mode understands latexs error messages).

Yes, AUCTeX will take you straight to the first error in your text.  You
use "C-cC-c" to compile LaTeX.

As for not wanting to type "make" every time, (1) you don't: the default
compile-command comes up in the minibuffer and you hit RET; and (2) get
real: yes you can skip that extra keystroke but do you want to deal with
the crap you're going to get from skipping it?  What happens if you
change your mind about which command to run?  The designers of AUCTeX
have already done the hard work for you.

I suggest that you reorganize your project (using LaTeX commands, or
appropriate Makefile structure) and learn to use AUCTeX and "M-x
compile."

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109
Public key: http://pgp.mit.edu

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]