I installed a few packages (Screenplay and sffms) and was hoping that
"C-c C-e" would see the new begin {} end {} environments for the
\newenvironments written in the .cls file. C-c C-e fails to see the
environments, tedious typing.
How do I make C-c C-e find the new environments. I couldn't find
anything on the auctex site (didn't understand sect. 12.3 of the
manual) and faq's resulted in nil.
I do not know lisp.
Look at AUCTeX/style and learn from how other packages add their
environments to AUCTeX.
Leo
Thanks for your quick reply. I have looked at /AUCTeX/style,
the .el .elc files therein. I am having difficulty sifting through
the code. I do not understand the coding so I don't know what it is I
am looking at or looking for. I am reading through the book latex
companion, lots of example code but I havn't found what I need yet.
Thanks again.
> Thanks for your quick reply. I have looked at /AUCTeX/style,
> the .el .elc files therein. I am having difficulty sifting through
> the code. I do not understand the coding so I don't know what it is I
> am looking at or looking for. I am reading through the book latex
> companion, lots of example code but I havn't found what I need yet.
>
> Thanks again.
For example, something like this:
(TeX-add-style-hook
"xxcolor" ; <- name of your class
(lambda ()
(LaTeX-add-environments '("colormixin" "mixin spec"))))
Leo
Oh. So,create a .el file out of lisp (I don't know lisp so I have to
be a monkey at a typewriter and guess :P) I found a default auctex
setting, "array" resulting from C-c C-e, that, if I replace {array}
with {dialogue}, then after compiling i get the correct results in my
pdf. Now, I am looking for the lisp code that does that. At the
moment I know of no other way than looking through the .el files in
AUCTeX/style and searching for array.
I was going to ask you what (LaTeX-add-environments '("colormixin"
"mixin spec")))) was, but then thought, check yourself first. Google
took me back to the AUCTeX manual. I looked at the examples again,
(remember I have no idea of the syntax of lisp, sorry), and was
wondering, I wanted to get:
\begin{dialogue}[expression of character option]{character name}
la de data
\end{dialogue}
after Cc Ce and filling in emacs prompts
could that be accomplished by:
;; dialogue.el
(TeX-add-style-hook
"dialogue"
(lambda ()
(LaTeX-add-environments
'("dialogue" "characterxpression" "charactername"))))
Is Latex-add-environments the command to prompt the user to input
information? In this case, ("dialogue" "describe" "character"))))
which is the vector (sequence)??
Can't resist editorializing my $0.02. Without having used Auctex, I
suspect that it will always be vulnerable to unanticipated situations
that are troublesome without Lisp literacy. The OP may consider
temporarily transferring his Latex work to another editor (e.g.
TeXshop). He can learn Emacs + Lisp on the side and then come back to
Auctex.
Why? All that is needed is copying examples from the manual and changing
strings. Nothing can go wrong if you stick to the exact syntax in the
manual.
--
Change “LookInSig” to “tcalveu” to answer by mail.
Perhaps it's constructive to agree to disagree, with the OP now
exposed to both viewpoints.
Did you try section 11. instead? The command TeX-auto-generate will
extract much appropriate information from style and class files.
Hope this helps
Andrew
--
Andrew Swann sw...@imada.sdu.dk http://www.imada.sdu.dk/~swann
Department of Mathematics and Computer Science, Tel +45 6550 2354
and CP3-Origins, University of Southern Denmark, Dept +45 6550 2387
Campusvej 55, DK-5230 Odense M, Denmark Fax +45 6550 2325
Try the above, putting it in [] tells auctex that it is an optional
argument. You need to place the file in the subdirectory style/ in the
root of your project, or in a directory pointed to by
TeX-style-private, in my case, /Users/leo/.emacs.d/auctex/style. Then,
restart Emacs.
Emacs is rather powerful having more than 27000 editing functions. So
don't rush to try its advanced features. Actually for a long time I've
used auctex without creating any style file myself.
Best wishes,
Leo
Thank you everyone for all you insight and informed opinions. I have
been researching lisp and can see that it is going to be awhile before
I am even partially literate in my usage of it.
Leo, I placed the file you suggested in ~/.emacs.d/tex/auctex/style
and after entering M-x TeX-auto-generate, that I might add the
location "~/.emacs.d/tex/auctex/style" to my tex configuration with
the command TeX-style-private, emacs spit out an error:
> The local variables list in texbook1.bib
> contains values that may not be safe (*).
>
> Do you want to apply it? You can type
>
> y -- to apply the local variables list.
> n -- to ignore the local variables list.
> ! -- to apply the local variables list, and
> mark these values (*) as
> safe (in the future, they can be set
> automatically.)
I googled it but couldn't find anything pertinent, a few links from
2006 regarding auctex. Have you experienced anything like this?
Again, thank you for all the informed input. It is very helpful.
> Leo, I placed the file you suggested in ~/.emacs.d/tex/auctex/style
> and after entering M-x TeX-auto-generate, that I might add the
> location "~/.emacs.d/tex/auctex/style" to my tex configuration with
> the command TeX-style-private, emacs spit out an error:
>> The local variables list in texbook1.bib
> > contains values that may not be safe (*).
> >
> > Do you want to apply it? You can type
> >
> > y -- to apply the local variables list.
> > n -- to ignore the local variables list.
> > ! -- to apply the local variables list, and
> > mark these values (*) as
> > safe (in the future, they can be set
> > automatically.)
>
> I googled it but couldn't find anything pertinent, a few links from
> 2006 regarding auctex. Have you experienced anything like this?
>
> Again, thank you for all the informed input. It is very helpful.
Look at file texbook1.bib in the first line or the last few lines, you
may see something like:
;;;@ -*- .......; ......; -*-
or
%%% Local Variables:
%%% ......
%%% ......
%%% End:
where ...... is some lisp stuff.
Delete the offending one.
BTW, learning the basic of lisp is actually as easy as learning any
programming language, in particular, elisp is a much simplified lisp
compared to common lisp. So once you spend a few hours learning it,
that auctex stuff will become easy to do.
If you want to get on with your project for now, put it online or send
it to me by email, I will add the auctex support style for you.
For example, currently I have a project like this:
/Users/leo/MyProjects/thesis/
|-.git/
|-Chapters/
|-FrontBackmatter/
|-Images/
| |-chap4/
| |-cisco/
| +-obsolete/
|-TikZ/
| |-chap1/
| |-chap2/
| |-chap3/
| |-chap4/
| | |-ASE/
| | |-Gain-Current/
| | |-Gain-Spectrum/
| | |-NF/
| | +-SOP/
| |-chap5/
| |-chap6/
| +-style/
|-auto/
+-style/
The style subdirs are where I put auctex style files specific to this
project because I use a customized class file.
Best,
Leo
Great. Do you know how I can manage default values ? For instance my
multicol.el content is :
(TeX-add-style-hook
"multicol"
(lambda ()
(LaTeX-add-environments '("mul ticols" "Nbre de colonnes"))))
I would like the default value for "Nbre de colonnes" to be the last
value typed in...
--
JJR.
> (TeX-add-style-hook
> "multicol"
> (lambda ()
> (LaTeX-add-environments '("mul ticols" "Nbre de colonnes"))))
>
> I would like the default value for "Nbre de colonnes" to be the last
> value typed in...
Try:
(LaTeX-add-environments '("multicols" ("Nbre de colonnes" "initial input")))
Best,
Leo
This will provide a default input but not the last item in its input
history. You probably need to learn from other things in AUCTeX that
have similar feature and do it similarly.
Leo