help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Tab-key not working in auctex?


From: Johs
Subject: Re: Tab-key not working in auctex?
Date: Fri, 10 Nov 2006 18:21:08 +0100
User-agent: KNode/0.10.4

Malte Spiess wrote:

> Johs <address@hidden> writes:
> 
>> Malte Spiess wrote:
>>
>>> "Johs" <address@hidden> writes:
>>> 
>>>> I have installed auctex for emacs in Ubuntu. But when I press the
>>>> Tab-key nothing happens.
>>>> I know that multiple whitespaces are treated as one in latex but in
>>>> my .tex file it is sometimes nice to use Tab-key indentation to make
>>>> the text easier to read (when writing pseudocode).
>>>  Do you mean that never anything happens when you press TAB or just in
>>> certain situations nothing happens?
>>> 
>>>> How do I make my Tab-key respond i auctex?
>>>  What does it say when you hit "C-h k TAB"? (Display documentation of
>>> the function invoked by TAB.)
>>
>> It says:
>>
>> TAB runs the command indent-for-tab-command
>>    which is an interactive compiled Lisp function in `indent'.
>> (indent-for-tab-command &optional PREFIX-ARG)
>> [...]
>>
>> but nothing happens when I press the Tab-key. Maybe Tab-key is not meant
>> to work in auctex.
> 
> Don't worry, it works fine here! Found this for you in the AucTeX info
> page:
> ,----
> |    Indentation is done by LaTeX environments and by TeX groups, that is
> | the body of an environment is indented by the value of
> | `LaTeX-indent-level' (default 2).  Also, items of an `itemize-like'
> | environment are indented by the value of `LaTeX-item-indent', default
> | -2.  If more environments are nested, they are indented `accumulated'
> | just like most programming languages usually are seen indented in
> | nested constructs.
> `----
> 
> Basically it says you should customize the variables
> `LaTeX-indent-level' and `LaTeX-item-indent'.
> (e.g. via M-x customize-variable)


'LaTex-indent-level' is already set to 2 and `LaTeX-item-indent' is set
to -2. So that is not the problem.

Tab-key works fine when I edit .txt files but seems to be dead when I
edit .tex files. This is the auctex section of my .emacs file:

;;;;;;;;;;;;;;;  BEGIN AUCTEX ;;;;;;;;;;;;;;;;;;;;;;

(require 'tex-site)

;; Enable auto-fill
(add-hook 'TeX-mode-hook 'turn-on-auto-fill)


(add-hook 'TeX-mode-hook
          (lambda ()
            (TeX-source-specials-mode 1)
            (add-to-list 'TeX-output-view-style
                         '("^pdf$" "." "kpdf %o"))
            (add-to-list 'TeX-output-view-style
                         '("^dvi$" "." "kdvi %o"))))
;;;;;;;;;;;;;;  END AUCTEX ;;;;;;;;;;;;;;;;;;;;;;;;;




There is nothing below the above line in the .emacs file. I have also tried
to add this the "(add-hook 'Tex-mode-hook ....)))" section:

(add-hook 'TeX-mode-hook
          (lambda ()
            (TeX-source-specials-mode 1)
            (local-set-key "\C-l" 'th-complete-or-indent t)
            (local-set-key "\t" 'LaTex-indent-line t)
            (add-to-list 'TeX-output-view-style
                         '("^pdf$" "." "kpdf %o"))
            (add-to-list 'TeX-output-view-style
                         '("^dvi$" "." "kdvi %o"))))


But that does nothing either.

What happens when you press the Tab-key in auctex?




reply via email to

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