Discussion:
Changing LaTeX files extension
santi
2005-01-21 17:26:44 UTC
Permalink
Hello,

I want to give may LaTeX files the extension .latex instead of the actual .tex,
I want to caracterize my Plain TeX files.

In my .emacs file I inserted

(setq auto-mode-alist
(cons '("\\.latex$" . tex-mode)
auto-mode-alist))

but when I try to compile such a file, I have the following error

=====================================================================================================
Running `LaTeX' on `Etude_001.latex' with ``latex --src-specials
\nonstopmode\input{test.latex.tex}''
This is TeX, Version 3.14159 (MiKTeX 2.2)
LaTeX2e <2001/06/01>
Babel <v3.7h> and hyphenation patterns for english, french, german, ngerman, du
mylang, nohyphenation, loaded.


! LaTeX Error: File `test.latex.tex' not found.
=====================================================================================================


the extension .tex is added to the name of the file and of course the file
doesn't exist,
and I don't to prevent AUCTeX to add this extension.

My test.latex file :

=================================================================
\documentclass[leqno,a4paper]{article}
\usepackage[frenchb]{babel}

\begin{document}

Hello !

\end{document}


%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
==================================================================

Does somebody know how to solve this ?

Thanks
Santi MAURO
Ralf Angeli
2005-01-21 17:49:13 UTC
Permalink
Post by santi
I want to give may LaTeX files the extension .latex instead of the
actual .tex, I want to caracterize my Plain TeX files.
In my .emacs file I inserted
(setq auto-mode-alist
(cons '("\\.latex$" . tex-mode)
auto-mode-alist))
but when I try to compile such a file, I have the following error
[...]
Post by santi
the extension .tex is added to the name of the file and of course
the file doesn't exist, and I don't to prevent AUCTeX to add this
extension.
Compilation should work if you add "latex" to `TeX-file-extensions'.
But briefly testing this I already saw problems with parts of AUCTeX
which rely on the value of `TeX-default-extension', e.g. the master
file mechanisms. You could probably make it buffer-local and change
its value via `LaTeX-mode-hook' but I haven't tested this.
--
Ralf
Loading...