all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Key binding? in Auctex (LaTex-mode)
@ 2011-08-23  3:17 spinner
  2011-08-23  5:38 ` Andreas Röhler
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: spinner @ 2011-08-23  3:17 UTC (permalink / raw)
  To: Help-gnu-emacs


I want to regularly insert the following code into documents that I write in
LaTex-mode via Auctex:

%%% Local Variables:
%%% mode: LaTeX
%%% TeX-master: t
%%% End: 

Since I need to do this regularly, I want to do this with something like key
binding. But I don't know if what I want to do is key binding (like C-c
C-f), a macro, or something else.
-- 
View this message in context: http://old.nabble.com/Key-binding--in-Auctex-%28LaTex-mode%29-tp32315986p32315986.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: Key binding? in Auctex (LaTex-mode)
  2011-08-23  3:17 Key binding? in Auctex (LaTex-mode) spinner
@ 2011-08-23  5:38 ` Andreas Röhler
  2011-08-23  6:19 ` Eric Abrahamsen
  2011-08-23  6:55 ` Morten Leander Petersen
  2 siblings, 0 replies; 10+ messages in thread
From: Andreas Röhler @ 2011-08-23  5:38 UTC (permalink / raw)
  To: help-gnu-emacs

Am 23.08.2011 05:17, schrieb spinner:
>
> I want to regularly insert the following code into documents that I write in
> LaTex-mode via Auctex:
>
> %%% Local Variables:
> %%% mode: LaTeX
> %%% TeX-master: t
> %%% End:
>
> Since I need to do this regularly, I want to do this with something like key
> binding. But I don't know if what I want to do is key binding (like C-c
> C-f), a macro, or something else.


auctex probably has provisions for inserting a standard header.
RTFM

Alternatively using some template like yasnippet would do it.

Also you may put the example below at some place where it gets loaded 
and bound it at some key afterwards:

(defun my-tex-inserts ()
   (interactive "*")
   (insert "%%% Local Variables:
%%% mode: LaTeX
%%% TeX-master: t
%%% End:
"))




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

* Re: Key binding? in Auctex (LaTex-mode)
  2011-08-23  3:17 Key binding? in Auctex (LaTex-mode) spinner
  2011-08-23  5:38 ` Andreas Röhler
@ 2011-08-23  6:19 ` Eric Abrahamsen
  2011-08-23 10:35   ` spinner
  2011-08-23  6:55 ` Morten Leander Petersen
  2 siblings, 1 reply; 10+ messages in thread
From: Eric Abrahamsen @ 2011-08-23  6:19 UTC (permalink / raw)
  To: help-gnu-emacs

On Tue, Aug 23 2011, spinner wrote:

> I want to regularly insert the following code into documents that I write in
> LaTex-mode via Auctex:
>
> %%% Local Variables:
> %%% mode: LaTeX
> %%% TeX-master: t
> %%% End: 
>
> Since I need to do this regularly, I want to do this with something like key
> binding. But I don't know if what I want to do is key binding (like C-c
> C-f), a macro, or something else.

Section 6 of the Autotyping manual shows how to automatically insert
template-like text in empty files based on major mode or file name.




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

* Re: Key binding? in Auctex (LaTex-mode)
  2011-08-23  3:17 Key binding? in Auctex (LaTex-mode) spinner
  2011-08-23  5:38 ` Andreas Röhler
  2011-08-23  6:19 ` Eric Abrahamsen
@ 2011-08-23  6:55 ` Morten Leander Petersen
  2011-08-23 10:35   ` spinner
  2 siblings, 1 reply; 10+ messages in thread
From: Morten Leander Petersen @ 2011-08-23  6:55 UTC (permalink / raw)
  To: help-gnu-emacs

spinner <michaelcrain@hotmail.com> writes:

> I want to regularly insert the following code into documents that I write in
> LaTex-mode via Auctex:
>
> %%% Local Variables:
> %%% mode: LaTeX
> %%% TeX-master: t
> %%% End: 
>
> Since I need to do this regularly, I want to do this with something like key
> binding. But I don't know if what I want to do is key binding (like C-c
> C-f), a macro, or something else.

C-c _

That should do the trick.
-- 
/Morten




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

* Re: Key binding? in Auctex (LaTex-mode)
  2011-08-23  6:55 ` Morten Leander Petersen
@ 2011-08-23 10:35   ` spinner
  2011-08-23 10:58     ` Morten Leander Petersen
  0 siblings, 1 reply; 10+ messages in thread
From: spinner @ 2011-08-23 10:35 UTC (permalink / raw)
  To: Help-gnu-emacs


> From: mortenlp2@gmail.com
>
> C-c _
>
> That should do the trick.

Morten:

Many thanks. I just looked over the documentation for this command and this
seems to be the built-in key binding to prompt me for the variables that I
want to insert in LaTex documents.

Question: The documentation says that I can specify a LaTex parent file as
"master" and this will automate the process when writing child files using
C-c _ to specify the parent-master file. But what if I am working on several
multi-file document projects. Will emacs/Auctex get confused if I have more
than one tex files set as "master"?
-- 
View this message in context: http://old.nabble.com/Key-binding--in-Auctex-%28LaTex-mode%29-tp32315986p32317809.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: Key binding? in Auctex (LaTex-mode)
  2011-08-23  6:19 ` Eric Abrahamsen
@ 2011-08-23 10:35   ` spinner
  0 siblings, 0 replies; 10+ messages in thread
From: spinner @ 2011-08-23 10:35 UTC (permalink / raw)
  To: Help-gnu-emacs


> From: eric@ericabrahamsen.net
 
> Section 6 of the Autotyping manual shows how to automatically insert
> template-like text in empty files based on major mode or file name.
>

Autotype is interesting and seems like it will do what I want. Many thanks.
-- 
View this message in context: http://old.nabble.com/Key-binding--in-Auctex-%28LaTex-mode%29-tp32315986p32317811.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: Key binding? in Auctex (LaTex-mode)
  2011-08-23 10:35   ` spinner
@ 2011-08-23 10:58     ` Morten Leander Petersen
  2011-08-23 11:54       ` spinner
  0 siblings, 1 reply; 10+ messages in thread
From: Morten Leander Petersen @ 2011-08-23 10:58 UTC (permalink / raw)
  To: help-gnu-emacs

spinner <michaelcrain@hotmail.com> writes:

>> From: mortenlp2@gmail.com
>>
>> C-c _
>>
>> That should do the trick.
>
> Morten:
>
> Many thanks. I just looked over the documentation for this command and this
> seems to be the built-in key binding to prompt me for the variables that I
> want to insert in LaTex documents.
>
> Question: The documentation says that I can specify a LaTex parent file as
> "master" and this will automate the process when writing child files using
> C-c _ to specify the parent-master file. But what if I am working on several
> multi-file document projects. Will emacs/Auctex get confused if I have more
> than one tex files set as "master"?
I'm not sure I understand the question, but as long as you specify a
particular master file in each of your child files you should be
alright.

Regards
-- 
/Morten




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

* Re: Key binding? in Auctex (LaTex-mode)
  2011-08-23 10:58     ` Morten Leander Petersen
@ 2011-08-23 11:54       ` spinner
  2011-08-23 12:41         ` Morten Leander Petersen
  0 siblings, 1 reply; 10+ messages in thread
From: spinner @ 2011-08-23 11:54 UTC (permalink / raw)
  To: Help-gnu-emacs



Morten Leander Petersen wrote:
> 
> I'm not sure I understand the question, but as long as you specify a
> particular master file in each of your child files you should be
> alright.
> 

Thanks for your message. I see the source of confusion. I must have
misunderstood the documentation:
http://www.gnu.org/software/auctex/manual/auctex/Multifile.html

I thought that if, first, I inserted the following code at the end of
my parent-master file and, secondly, I pressed C-c _ while in my child
file that Auctex would automatically find this master file without me
typing its path.

  %%% Local Variables:
  %%% TeX-master: "master"
  %%% End:


If I still must type the path to the master in each child, do you know if
there is a practical difference between these two Tex file settings:

  %%% TeX-master: t

  %%% TeX-master: "master"

If these settings are functionally the same, the following code from the
documentation
doesn't seem to be very useful (i.e., why bother with it):

  (setq-default TeX-master "master") ; All master files called "master"


Why call parent files "master" in --%%% TeX-master: "master"-- if I need
to specify the path in the child files? Am I missing something?


-- 
View this message in context: http://old.nabble.com/Key-binding--in-Auctex-%28LaTex-mode%29-tp32315986p32318241.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: Key binding? in Auctex (LaTex-mode)
  2011-08-23 11:54       ` spinner
@ 2011-08-23 12:41         ` Morten Leander Petersen
  2011-08-23 14:25           ` spinner
  0 siblings, 1 reply; 10+ messages in thread
From: Morten Leander Petersen @ 2011-08-23 12:41 UTC (permalink / raw)
  To: help-gnu-emacs

spinner <michaelcrain@hotmail.com> writes:

> Morten Leander Petersen wrote:
>> 
>> I'm not sure I understand the question, but as long as you specify a
>> particular master file in each of your child files you should be
>> alright.
>> 
>
> Thanks for your message. I see the source of confusion. I must have
> misunderstood the documentation:
> http://www.gnu.org/software/auctex/manual/auctex/Multifile.html
>
> I thought that if, first, I inserted the following code at the end of
> my parent-master file and, secondly, I pressed C-c _ while in my child
> file that Auctex would automatically find this master file without me
> typing its path.
>
>   %%% Local Variables:
>   %%% TeX-master: "master"
>   %%% End:
>
>
> If I still must type the path to the master in each child, do you know if
> there is a practical difference between these two Tex file settings:
>
>   %%% TeX-master: t
>
>   %%% TeX-master: "master"
>
> If these settings are functionally the same, the following code from the
> documentation
> doesn't seem to be very useful (i.e., why bother with it):
>
>   (setq-default TeX-master "master") ; All master files called "master"
>
>
> Why call parent files "master" in --%%% TeX-master: "master"-- if I need
> to specify the path in the child files? Am I missing something?

Imagine the following scenario. Say you have 3 files,

something.tex
b.tex
c.tex

Where something.tex is your main file, i.e. you have statements like

\include{b.tex}
\include{c.tex}

inside something.tex. Now say you are working on b.tex and you want to
compile your code. What you really want is to compile something.tex
since this is your main file. So by inserting

%%% Local Variables:
%%% TeX-master: "something"
%%% End:

into b.tex, you tell the system to compile something.tex, even though
you are currently working on b.tex. Insert the same 3 lines into c.tex
(using C-c _) and you can now compile your code no matter what file you
are currently working on.

With regards to

%%% TeX-master: t

versus

%%% TeX-master: "master"

the first line says that when you hit "compile" (C-c C-c) then it should
compile the current file whereas the second one says that it should
compile the file named "master.tex".

Hope this clarifies things a little bit :)

Regards
-- 
/Morten




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

* Re: Key binding? in Auctex (LaTex-mode)
  2011-08-23 12:41         ` Morten Leander Petersen
@ 2011-08-23 14:25           ` spinner
  0 siblings, 0 replies; 10+ messages in thread
From: spinner @ 2011-08-23 14:25 UTC (permalink / raw)
  To: Help-gnu-emacs


This makes sense now. Many thanks for explaining things.


Morten Leander Petersen wrote:
> 
> 
> Imagine the following scenario. Say you have 3 files,
> 
> something.tex
> b.tex
> c.tex
> 
> Where something.tex is your main file, i.e. you have statements like
> 
> \include{b.tex}
> \include{c.tex}
> 
> inside something.tex. Now say you are working on b.tex and you want to
> compile your code. What you really want is to compile something.tex
> since this is your main file. So by inserting
> 
> %%% Local Variables:
> %%% TeX-master: "something"
> %%% End:
> 
> into b.tex, you tell the system to compile something.tex, even though
> you are currently working on b.tex. Insert the same 3 lines into c.tex
> (using C-c _) and you can now compile your code no matter what file you
> are currently working on.
> 
> With regards to
> 
> %%% TeX-master: t
> 
> versus
> 
> %%% TeX-master: "master"
> 
> the first line says that when you hit "compile" (C-c C-c) then it should
> compile the current file whereas the second one says that it should
> compile the file named "master.tex".
> 
> Hope this clarifies things a little bit :)
> 
> Regards
> -- 
> /Morten
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Key-binding--in-Auctex-%28LaTex-mode%29-tp32315986p32319365.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

end of thread, other threads:[~2011-08-23 14:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-23  3:17 Key binding? in Auctex (LaTex-mode) spinner
2011-08-23  5:38 ` Andreas Röhler
2011-08-23  6:19 ` Eric Abrahamsen
2011-08-23 10:35   ` spinner
2011-08-23  6:55 ` Morten Leander Petersen
2011-08-23 10:35   ` spinner
2011-08-23 10:58     ` Morten Leander Petersen
2011-08-23 11:54       ` spinner
2011-08-23 12:41         ` Morten Leander Petersen
2011-08-23 14:25           ` spinner

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.