auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Create face for tabular-environment for font changing.


From: Ralf Angeli
Subject: Re: [AUCTeX] Create face for tabular-environment for font changing.
Date: Sat, 23 Aug 2008 11:46:49 +0200

* inu (2008-08-22) writes:

> Problem: The &-Symbols in tabular-environments cant be aligned properly by
> "\C-c\C-a"-Keystroke, when a proportional font is in use instead of
> monospaced.

On a vanilla setup with Emacs and AUCTeX `C-c C-a' is undefined, so I'm
not sure what function you mean here.  Probably `align-current'.

> Is it possible to create a face for the environment instead, which is
> delimited by "\begin{tabular}" and "\end{tabular}" like mathcode is
> delimited by two $-signs? And then to change the font of this environment to
> a monospaced font? Or instead a face which is delimited by for example two
> "%Mono".

You could do `M-x customize-variable <RET> LaTeX-verbatim-environments
<RET>' and add the tabular environment to the list.  Then this
environment will be treated and shown in AUCTeX as being verbatim-like.
This involves using a monospaced font for display.

Or you could use `font-lock-add-keywords' to use the `fixed-pitch' to
the contents of tabular environments:

(eval-after-load "latex"
  '(add-hook 'LaTeX-mode-hook
             (lambda ()
               (font-lock-add-keywords
                'latex-mode
                '(("\\\\begin{tabular}\\(\\(.\\|\n\\)+?\\)\\\\end{tabular}" 1
                   'fixed-pitch))))))

Besides, please don't send HTML mails.

-- 
Ralf




reply via email to

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