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

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

Re: Quick insert of characters into a column?


From: harven
Subject: Re: Quick insert of characters into a column?
Date: Wed, 24 Jun 2009 08:55:47 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin)

Chad <chad.jones@gmail.com> writes:

> Hi,
>
> I'm using emacs to edit a latex file to create a table with many rows,
> say 20.  I need to insert & to separate the columns, so I need a
> column of 20 ampersands.
>
> What is the quickest way to do this?  I'd like to highlight a region
> (column) and then tell emacs to insert the ampersand into that region,
> but I can't figure out how to do this.
>
> Thanks for your help!
>
> Chad

Instead of manually creating the table, I would suggest using templates
provided by emacs. 

M-x table-insert

you are then prompted for the number of columns, of rows, the width
of the cell and their height.

Fill the template if you want. When you're done, generate the latex source with

M-x table-generate-source

you are then prompted for the language (latex), the name of a buffer
where goes the result, and a title for the table. That's it.
If you didn't fill the template, you get something like this

% This LaTeX table template is generated by emacs 22.1.1
\begin{tabular}{|l|l|l|}
\hline
lala & ceci & tous \\
\hline
 & & \\
\hline
 & & \\
...
\hline
 & & \\
\hline
 & & \\
\hline
\end{tabular}

Have a look at the wiki for more details
http://www.emacswiki.org/emacs/TableMode


reply via email to

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