all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* simple tex shell command
@ 2008-06-10 12:40 benjamin.friedrich
  2008-06-11  0:00 ` Xah
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: benjamin.friedrich @ 2008-06-10 12:40 UTC (permalink / raw)
  To: help-gnu-emacs

Dear all,

I am a lisp newbie;
I want to define a short-cut in my .emacs which automatically runs
latex on my thesis,
i.e. something like this

(defun tex-thesis () "latex my thesis" "latex \\nonstopmode\input -src
E:/thesis/thesis.tex")
(global-set-key [f4] 'tex-thesis)

How should this read as correct lisp code?

Thanks,
Ben

P.S.
I tried
(setq tex-main-file "E:/ben/thesis/thesis.tex")
but then c-c c-f 'latex-file will always latex the thesis, even if I
happen
to work on a tex-file that does not belong to the thesis.


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

* Re: simple tex shell command
  2008-06-10 12:40 simple tex shell command benjamin.friedrich
@ 2008-06-11  0:00 ` Xah
  2008-06-11  9:02 ` Peter Dyballa
  2008-06-11 13:42 ` Joel J. Adamson
  2 siblings, 0 replies; 4+ messages in thread
From: Xah @ 2008-06-11  0:00 UTC (permalink / raw)
  To: help-gnu-emacs

To run a shell command in elisp, you need, e.g.

(shell-command command &optional output-buffer error-buffer)
or
(setq sh-output
          (shell-command-to-string (concat cmd-name " " img-file-
path)))

for a full code example, see the xGetDimention in

Elisp Lesson: Writing image-linkify Function
http://xahlee.org/emacs/elisp_image_tag.html

  Xah
∑ http://xahlee.org/

☄

On Jun 10, 5:40 am, "benjamin.friedrich"
<benjamin.friedr...@gmail.com> wrote:
> Dear all,
>
> I am a lisp newbie;
> I want to define a short-cut in my .emacs which automatically runs
> latex on my thesis,
> i.e. something like this
>
> (defun tex-thesis () "latex my thesis" "latex \\nonstopmode\input -src
> E:/thesis/thesis.tex")
> (global-set-key [f4] 'tex-thesis)
>
> How should this read as correct lisp code?
>
> Thanks,
> Ben
>
> P.S.
> I tried
> (setq tex-main-file "E:/ben/thesis/thesis.tex")
> but then c-c c-f 'latex-file will always latex the thesis, even if I
> happen
> to work on a tex-file that does not belong to the thesis.



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

* Re: simple tex shell command
  2008-06-10 12:40 simple tex shell command benjamin.friedrich
  2008-06-11  0:00 ` Xah
@ 2008-06-11  9:02 ` Peter Dyballa
  2008-06-11 13:42 ` Joel J. Adamson
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2008-06-11  9:02 UTC (permalink / raw)
  To: benjamin.friedrich; +Cc: help-gnu-emacs


Am 10.06.2008 um 14:40 schrieb benjamin.friedrich:

> I want to define a short-cut in my .emacs which automatically runs
> latex on my thesis,

AUCTeX offers C-c C-c.

--
Mit friedvollen Grüßen

   Pete

With Capitalism man exploits man. With communism it's the exact  
opposite.






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

* Re: simple tex shell command
  2008-06-10 12:40 simple tex shell command benjamin.friedrich
  2008-06-11  0:00 ` Xah
  2008-06-11  9:02 ` Peter Dyballa
@ 2008-06-11 13:42 ` Joel J. Adamson
  2 siblings, 0 replies; 4+ messages in thread
From: Joel J. Adamson @ 2008-06-11 13:42 UTC (permalink / raw)
  To: benjamin.friedrich; +Cc: help-gnu-emacs

"benjamin.friedrich" <benjamin.friedrich@gmail.com> writes:

> Dear all,
>
> I am a lisp newbie;
> I want to define a short-cut in my .emacs which automatically runs
> latex on my thesis,
> i.e. something like this
>
> (defun tex-thesis () "latex my thesis" "latex \\nonstopmode\input -src
> E:/thesis/thesis.tex")
> (global-set-key [f4] 'tex-thesis)
>
> How should this read as correct lisp code?
>
> Thanks,
> Ben

You could instead use AUCTeX, the Emacs mode for LaTeX (and other TeX)
editing.  No need to re-invent the wheel, or AUCTeX ;)  Then when you
are editing LaTeX, all you do is "C-cC-c" and you're good to go.

Joel

-- 
Joel J. Adamson
(303) 880-3109
Public key: http://pgp.mit.edu
Homepage: http://www.unc.edu/~adamsonj
Please read http://www.unc.edu/~adamsonj/roe.html




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

end of thread, other threads:[~2008-06-11 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10 12:40 simple tex shell command benjamin.friedrich
2008-06-11  0:00 ` Xah
2008-06-11  9:02 ` Peter Dyballa
2008-06-11 13:42 ` Joel J. Adamson

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.