When I use the package tabularx
in a tex file, if I insert table
environment, the inner environment will be given as tabularx
instead of tabular
when the package tabularx
is not used.
Normally this would not be a problem for me because I do not deliberately use the package tabularx
. However, when I use \documentclasss{memoir}
, the package tabularx
is automatically used.
I found the variable LaTeX-default-tabular-environment
and want to reset its value back to tabular
(now I'm not sure it's the correct variable for me to reset),
(eval-after-load 'latex
(setq LaTeX-default-tabular-environment "tabular"))
but it does not work, and when I query the value for LaTeX-default-tabular-environment
using C-h v
, I get the following,
LaTeX-default-tabular-environment is a variable defined in `latex.el'. Its value is "tabularx"
Local in buffer test-tabularx.tex; global value is "tabular"
Automatically becomes buffer-local when set.
Now I am utterly confused. I also tried add some style hook, but it seems to me that I need to alter or update some hook instead just adding it. Could someone help me please? Thanks a lot!
After I put the code by Arash Esbati in my .emacs
file, I noticed the following: even if I do not mention memoir
in the tex file, for example
\documentclass{article}
\usepackage{tabularx}
\begin{document}
(cursor here)
\end{document}
if I then type C-c C-e table
RET(a bunch of them), then I would get tabular
inside table
instead of tabularx
inside table
. Of course, I later realized that I had another tex file with \documentclass{memoir}
loaded in emacs. If I kill that buffer and reboot emacs, everything will be as expected.