On Aug 25, 2011, at 5:57 PM, Damien Cassou wrote:
Hi,
I've just created a function that align the '&' in a Latex table. This makes them much easier to read and change.
(defun LaTeX-align-table ()
(interactive)
(save-excursion
(LaTeX-mark-environment)
(align-regexp (region-beginning) (region-end) "\\(\\s-*\\)&" 1 1 t)))
Calling this function within the following environment:
address@hidden@{}}
\toprule
& Foo & Something different & Bar \\
\midrule
Yeah & 69 & 60 & 402 \\
Another yeah & 742 & 848 (x 3.2) & 3820 \\
\bottomrule
\end{tabular}
Results in the following:
address@hidden@{}}
\toprule
& Foo & Something different & Bar \\
\midrule
Yeah & 69 & 60 & 402 \\
Another yeah & 742 & 848 (x 3.2) & 3820 \\
\bottomrule
\end{tabular}
What do you think?
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
_______________________________________________
auctex-devel mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/auctex-devel