unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Quick insert of characters into a column?
@ 2009-06-23 23:38 Chad
  2009-06-24  3:10 ` Joost Kremers
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chad @ 2009-06-23 23:38 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Quick insert of characters into a column?
  2009-06-23 23:38 Quick insert of characters into a column? Chad
@ 2009-06-24  3:10 ` Joost Kremers
  2009-06-24  6:55 ` harven
  2009-06-30 17:57 ` Ken Goldman
  2 siblings, 0 replies; 5+ messages in thread
From: Joost Kremers @ 2009-06-24  3:10 UTC (permalink / raw)
  To: help-gnu-emacs

Chad wrote:
> 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.

M-x string-insert-rectangle


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Quick insert of characters into a column?
  2009-06-23 23:38 Quick insert of characters into a column? Chad
  2009-06-24  3:10 ` Joost Kremers
@ 2009-06-24  6:55 ` harven
  2009-06-24 16:46   ` Chad
  2009-06-30 17:57 ` Ken Goldman
  2 siblings, 1 reply; 5+ messages in thread
From: harven @ 2009-06-24  6:55 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Quick insert of characters into a column?
  2009-06-24  6:55 ` harven
@ 2009-06-24 16:46   ` Chad
  0 siblings, 0 replies; 5+ messages in thread
From: Chad @ 2009-06-24 16:46 UTC (permalink / raw)
  To: help-gnu-emacs


These are both excellent suggestions, just what I needed.  Thanks very
much!
-- Chad


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Quick insert of characters into a column?
  2009-06-23 23:38 Quick insert of characters into a column? Chad
  2009-06-24  3:10 ` Joost Kremers
  2009-06-24  6:55 ` harven
@ 2009-06-30 17:57 ` Ken Goldman
  2 siblings, 0 replies; 5+ messages in thread
From: Ken Goldman @ 2009-06-30 17:57 UTC (permalink / raw)
  To: help-gnu-emacs

Search the docs for 'rectangle'

Specifically

C-x r t runs the command string-rectangle
    which is an interactive compiled Lisp function in `rect'.
(string-rectangle START END STRING)

Replace rectangle contents with STRING on each line.
The length of STRING need not be the same as the rectangle width.

Chad wrote:
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-30 17:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-23 23:38 Quick insert of characters into a column? Chad
2009-06-24  3:10 ` Joost Kremers
2009-06-24  6:55 ` harven
2009-06-24 16:46   ` Chad
2009-06-30 17:57 ` Ken Goldman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).