Discussion:
Weird formatting after TeX-insert-environment
Frank Küster
2005-02-07 17:16:56 UTC
Permalink
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.

I wanted to convert a tabular environment into a floating
table. Therefore I marked the complete environment as the region,
pressed C-c C-e, and selected table. I filled in a caption and
answered y to "center?", but didn't give any answers for the tabular
questions that followed. This is how it looked like before:


*************************************
\begin{tabular}{lrlcp{2.5cm}}
Typ & Amplituden & $\tau_i / \nanosecond{}$ & $\chi^2$ & \\\hline
1exp & & 4.7 & 58 & schlecht \\
2exp & -45\,150 & 2.036 & \\
& 72\,434 & 3.89 & 5.0 & visuell gut, außer ganz zu Beginn \\
3exp & & & 5.0 & teilt den Anstieg in zwei fast gleich schnelle Phasen \\\hline
2exp, shift fix & -64\,642 & 2.59 & \\
& 96\,234 & 3.706 & 15 &
deutliche Abweichungen der Residuen \\
\end{tabular}

Lässt man den Bereich am Anfang weg, wo der Akzeptor etwa $10^1$
counts, die IRF nichts hat, dann ergibt sich ein minimal anderer Fit.
*************************************

And this is the appearance afterwards:

*************************************
\begin{table}
\begin{tabular}{lrlcp{2.5cm}}
Typ & Amplituden & $\tau_i / \nanosecond{}$ & $\chi^2$ & \\\hline
1exp & & 4.7 & 58 & schlecht \\
2exp & -45\,150 & 2.036 & \\
& 72\,434 & 3.89 & 5.0 & visuell gut, außer ganz zu Beginn \\
3exp & & & 5.0 & teilt den Anstieg in zwei fast gleich schnelle Phasen \\\hline
2exp, shift fix & -64\,642 & 2.59 & \\
& 96\,234 & 3.706 & 15 &
deutliche Abweichungen der Residuen \\
\end{tabular}\centering
\begin{tabular}{}

\caption{Fitparameter für den Akzeptor-Decay in \proxx}
\label{tab:pro20-acc-fit}
\end{tabular}
\end{table}
Lässt man den Bereich am Anfang weg, wo der Akzeptor etwa $10^1$
counts, die IRF nichts hat, dann ergibt sich ein minimal anderer Fit.
*************************************


Finally, this is what I expected:

*************************************
\begin{table}
\centering
\begin{tabular}{lrlcp{2.5cm}}
Typ & Amplituden & $\tau_i / \nanosecond{}$ & $\chi^2$ & \\\hline
1exp & & 4.7 & 58 & schlecht \\
2exp & -45\,150 & 2.036 & \\
& 72\,434 & 3.89 & 5.0 & visuell gut, außer ganz zu Beginn \\
3exp & & & 5.0 & teilt den Anstieg in zwei fast gleich schnelle Phasen \\\hline
2exp, shift fix & -64\,642 & 2.59 & \\
& 96\,234 & 3.706 & 15 &
deutliche Abweichungen der Residuen \\
\end{tabular}
\caption{Fitparameter für den Akzeptor-Decay in \proxx}
\label{tab:pro20-acc-fit}
\end{table}
*************************************

Regards, Frank

Emacs : GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2003-11-15 on alhambra, modified by Debian
Package: AUCTeX 11.55

current state:
==============
(setq
window-system 'x
LaTeX-version "2e"
TeX-style-path '("style/" "auto/" "/home/frank/texmf/tex/latex/style/" "/home/frank/texmf/tex/latex/auto/"
"/usr/share/emacs21/site-lisp/auctex/style/" "/var/lib/auctex/emacs21/" "/home/frank/.auctex-styles/"
"/home/frank/.auctex-styles/")
TeX-auto-save t
TeX-parse-self t
TeX-master "Laborbuch"
)
Ralf Angeli
2005-02-08 10:43:09 UTC
Permalink
Post by Frank Küster
I wanted to convert a tabular environment into a floating
table. Therefore I marked the complete environment as the region,
pressed C-c C-e, and selected table. I filled in a caption and
answered y to "center?", but didn't give any answers for the tabular
[...]
Post by Frank Küster
*************************************
\begin{table}
\centering
\begin{tabular}{lrlcp{2.5cm}}
[tabular contents]
Post by Frank Küster
\end{tabular}
\caption{Fitparameter für den Akzeptor-Decay in \proxx}
\label{tab:pro20-acc-fit}
\end{table}
That's not easy to achieve. I attached a patch which at least
recognizes an active region and moves point to the correct positions.
But there still is a problem. The table environment is listed in
`LaTeX-indent-environment-list' and won't be filled or indented during
the insertion of an environment. You can check this by marking the
tabular environment and typing `M-: (LaTeX-insert-environment "table")
RET'. The result is an incorrect indentation. Currently I don't have
time to investigate this further. If anybody is interested, feel free
to have a look at it.
--
Ralf
Loading...