7 Apr 2010 17:17

### font-latex-user-keyword-classes doesn't work

Hello!

I would like to have syntax highlighting for user defined LaTeX commands.
The auctex manual says, this could be done by setting the variable
font-latex-user-keyword-classes.

I've tried it (via M-x customize-variable), but unfortunately there
was no effect. After setting the variable this way, the corresponding
part of my .emacs file looked like:

(custom-set-variables
;; some other variables
'(font-latex-user-keyword-classes (quote (("testcommand" nil
(:family "font-latex-sectioning-0-face" :width extra-expanded :weight
extra-bold) noarg))))
)

What did I do wrong?

Is there another way to accomplish the required syntax highlighting for
user defined LaTeX  commands?

When adjusting the variable it was also not clear to me what "font
keywords" I could use.

My auctex version is 11.86.

Michael


8 Apr 2010 17:54

### Re: font-latex-user-keyword-classes doesn't work

* micheal S. (2010-04-07) writes:

> I would like to have syntax highlighting for user defined LaTeX commands.
> The auctex manual says, this could be done by setting the variable
> font-latex-user-keyword-classes.
>
> I've tried it (via M-x customize-variable), but unfortunately there
> was no effect.

Did you restart Emacs after that?

--

--
Ralf

8 Apr 2010 22:59

### Re: font-latex-user-keyword-classes doesn't work

On Thu, Apr 8, 2010 at 5:54 PM, Ralf Angeli <angeli <at> caeruleus.net> wrote:
> * micheal S. (2010-04-07) writes:
>
>> I would like to have syntax highlighting for user defined LaTeX commands.
>> The auctex manual says, this could be done by setting the variable
>> font-latex-user-keyword-classes.
>>
>> I've tried it (via M-x customize-variable), but unfortunately there
>> was no effect.
>
> Did you restart Emacs after that?

Yes I did. Restarting emacs didn't help.

11 Apr 2010 16:34

### Re: font-latex-user-keyword-classes doesn't work

* micheal S. (2010-04-08) writes:

> On Thu, Apr 8, 2010 at 5:54 PM, Ralf Angeli <angeli <at> caeruleus.net> wrote:
>> * micheal S. (2010-04-07) writes:
>>
>>> I would like to have syntax highlighting for user defined LaTeX commands.
>>> The auctex manual says, this could be done by setting the variable
>>> font-latex-user-keyword-classes.
>>>
>>> I've tried it (via M-x customize-variable), but unfortunately there
>>> was no effect.
>>
>> Did you restart Emacs after that?
>
> Yes I did. Restarting emacs didn't help.

Okay.  I checked your customization and saw that you did not provide any
keywords to be matched.  You only gave the name of the class.  So in
theory it should work once you add the keywords.  However, I found a bug
in the code dealing with face properties for LaTeX commands without
arguments, which prevents them from being fontified.  This is fixed in
CVS now.

If you really want to highlight a command without arguments, like \foo,
(in contrast to one with arguments, like \bar{baz}), then you can
specify an existing face instead of setting face properties in the
such a face but as the name of a font family which will not work.

--

--


13 Apr 2010 22:57

### Re: font-latex-user-keyword-classes doesn't work

Hi!

> Okay.  I checked your customization and saw that you did not provide any
> keywords to be matched.  You only gave the name of the class.  So in
> theory it should work once you add the keywords.  However, I found a bug
> in the code dealing with face properties for LaTeX commands without
> arguments, which prevents them from being fontified.  This is fixed in
> CVS now.
>

seems to work if I provide the keywords and specify face properties
like weight or foreground etc. that's great...

> If you really want to highlight a command without arguments, like \foo,
> (in contrast to one with arguments, like \bar{baz}), then you can
> specify an existing face instead of setting face properties in the
> customization interface.

I think I don't understand how to do this.

> such a face but as the name of a font family which will not work.
>
Can you give me a few examples of what I could put into the "Font-Family" field?

By the way: Is it possible to apply changes to the font latex user
keyword classes without restarting emacs? Why is it not enough to
execute eval-buffer on the .emacs file?



14 Apr 2010 15:54

### Re: font-latex-user-keyword-classes doesn't work

* micheal S. (2010-04-13) writes:

>> If you really want to highlight a command without arguments, like \foo,
>> (in contrast to one with arguments, like \bar{baz}), then you can
>> specify an existing face instead of setting face properties in the
>> customization interface.
>
> I think I don't understand how to do this.

In the customization buffer of font-latex-user-keyword-classes' you can
find a button labeled "Value Menu" in front of the "Face attributes"
section of a keyword class.  If you left-click on that and select "Face
name", a text field will be displayed where you can type in the name of
a face.

>> such a face but as the name of a font family which will not work.
>>
> Can you give me a few examples of what I could put into the "Font-Family" field?

It will likely accept some or all of the formats described in
(info "(emacs)Font X").  I haven't tried this, though.

> By the way: Is it possible to apply changes to the font latex user
> keyword classes without restarting emacs? Why is it not enough to
> execute eval-buffer on the .emacs file?

From the description of the variable:

,----[ C-h v font-latex-user-keyword-classes <RET> ]


15 Apr 2010 21:34

### RefTeX: finding .bib files in local texmf tree

Howdy,

I have set up a local texmf tree[1] for a specific project, but after
trying to set up RefTeX to find the texmf/bibtex/bib directory[2], I still
get "No valid bibliography found."  Is there anything else I can try?
I'd rather not globally alter TEXINPUTS and BIBINPUTS --- the best thing
would be to set these locations as file-local variables for the .tex
files in the project.

Thanks,

Joel

Footnotes:
[1]  http://en.wikibooks.org/wiki/LaTeX/Collaborative_Writing_of_LaTeX_Documents#Hosting_LaTeX_files_in_Subversion

[2]  info: (reftex) Finding Files

--

--
Servedio Lab
University of North Carolina at Chapel Hill

FSF Member #8164

_______________________________________________
auctex mailing list
auctex <at> gnu.org


16 Apr 2010 11:58

### LaTeX/Auctex on Fedora 12


Hello

I have just done a series of (long overdue) updates to Fedora (from 9 to 12,
each done in turn) I now find that the updates have left my Fedora 9 tetex
intact but the updates to the libraries mean that latex does not run until I
get the old libraries back. I have not updated Auctex since I am a bit
concerned that something will break in the middle of two large projects. The
Fedora 12 DVD does not seem to have any LaTeX/AucTeX rpms which strikes me as
very odd - any experience out there?

Regards,

Dave

Dr. David B Cook

16 Apr 2010 17:19

### Font locking -- highlighting only the second of two pairs of brackets

Dear all,

did you ever try to write documents with two columns, German (or whatever
language) text in the left and a translation in the right hand column? LaTeX
may produce a nice PDF, but in your editor you get confused easily.which text
belongs to which column.

For the two parallel running columns I employ the »parcolumns«-package and
define a macro called »\PC«  followed by two mandatory arguments. The first
one takes the German text, the second one the English text.

What I'd like to do is to highlight the second argument, but not the first
one. Often I'm writing a text completely in German and translate it later or
ask somebody to translate. I would be helpfull to have the English text (or
the yet empty brackets) highlighted.

Here is a small example:

%%%%%%%%%%%%%%%%
\documentclass[pagesize,english,ngerman]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel,parcolumns}

\newcommand\PC[2]{\parcolumns[distance=2em]{2}
\colchunk[1]{\selectlanguage{ngerman}#1}%
\colchunk[2]{\selectlanguage{english}#2}%
\colplacechunks
\vspace{0.3\baselineskip}%
}


17 Apr 2010 11:42

### Re: RefTeX: finding .bib files in local texmf tree

* Joel J. Adamson (2010-04-15) writes:

> I have set up a local texmf tree[1] for a specific project, but after
> trying to set up RefTeX to find the texmf/bibtex/bib directory[2], I still
> get "No valid bibliography found."  Is there anything else I can try?

Can you provide a concise recipe to reproduce the problem?  Especially
the settings you tried according to the info page you cited would be
interesting.

--

--
Ralf
`

Gmane