auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Some hints for editing tables


From: Mosè Giordano
Subject: Re: [AUCTeX] Some hints for editing tables
Date: Mon, 16 Nov 2015 23:44:25 +0100

Hi Joost,

2015-11-16 23:21 GMT+01:00 Joost Kremers <address@hidden>:
>>
>> Op 15 nov. 2015 om 18:55 heeft Mosè Giordano <address@hidden> het volgende 
>> geschreven:
>>
>> Dear all,
>>
>> as you all know, editing tables in LaTeX can be quite tedious.
>> Luckily in AUCTeX we got a couple of nice features, auto insertion of
>> the appropriate &s and a good indentation function in tabular-like
>> environments, but there is still much room for improvements.[1]
> [...]
>
>> Note
>> [1]  Suggestions welcome.
>
> Well, IMHO this is one area where Emacs shines, but you need a bit more than 
> just AUCTeX. Using orgmode and preview-latex, there is a solution that is 
> better than anything I've ever seen. This is what I do:
>
> - include in the preamble of my documents the following snippet:
>
> ```
> \usepackage{comment}
> \specialcomment{orgtbl}{}{}
> \excludecomment{orgtbl}
> ```
>
> - customise `orgtbl-radio-table-templates`, so that the LaTeX table is inside 
> an orgtbl environment.
>
> - customise `LaTeX-comment-env-list` and `LaTeX-verbatim-environments` to 
> include `orgtbl`.
>
> - customise `TeX-fold-env-list` to fold the orgtbl environment to "[orgtbl]". 
> (Actually, there's no need to set up a special comment environment. I do it 
> so I can easily distinguish between folded comments and folded org tables.)
>
> - activate `orgtbl-mode` in my LaTeX buffer.
>
> - issue the command `M-x orgtbl-insert-radio-table` where I want my table to 
> be. This inserts an org-mode table template inside an orgtbl environment, 
> plus a receiving location for the LaTeX table right above it.
>
> - edit my table with the full orgmode table editor right inside my LaTeX 
> buffer.
>
> - press C-c C-c when I'm done with the table. This converts the table to 
> LaTeX format and puts the result in the LaTeX buffer at the specified 
> location.
>
> - press C-c C-o C-b to fold the orgtbl environment.
>
> - move the cursor to the LaTeX table and press C-c C-p C-p to preview the 
> table.
>
> The results? This:
>
>
>
>
> allows me to edit the table comfortably (moving from cell to cell with TAB, 
> automatic realignment of columns, quick insertion/deletion of rows and 
> columns with C-M-<cursor_key>, etc.) and eventually turns into this:
>
>
>
>
> (Yes, in case you noticed, I do indeed use a proportional font in my LaTeX 
> buffers.)
>
> I think that calls for a big Woohoo! and a big Hail Ye! to all the Emacs 
> priests who help make this possible (which IMO includes the AUCTeX team). Oh, 
> and stop staring at the people quietly slipping out the back door. They're 
> just vi users sneeking to their computers to see whether evil-mode works with 
> AUCTeX.
>
> Ok, I'm going a bit overboard there, but I really think the whole thing is 
> truly amazing and it deserves a mention in a thread entitled "Some hints for 
> editing tables". Even if it's not entirely what you were after when you said 
> suggestions were welcome...

Thank you!  Indeed I was discussing features entirely AUCTeX-related
(being this the AUCTeX mailing list ;-), but your experience with
other Emacs tools that can be used for LaTeX documents is relevant.

I like org, and I used it in the past (nowadays much less), and its
table features are really impressive.  In particular I love the
possibility to turn Emacs into a full fledged spreadsheet combining
org and calc.  Nevertheless, I don't like very much the final LaTeX
output of org tables (I don't know if it changed lately, but looking
to your screenshot it doesn't seem to be so), for example the vertical
bars are questionable, but of course in Emacs you can customize every
detail and the content of of the table is more important of its aspect
that can be easily adjusted.

I must admit that when I was thinking to possible improvements to
management of tables inside AUCTeX I was really thinking about org:
moving across cells with TAB and inserting and deleting columns with a
single key binding are really handy features!  But I'm not sure it's
worth having those features in AUCTeX, it could be a useless
duplication of efforts if many users take advantage of org anyway.

Bye,
Mosè



reply via email to

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