简体   繁体   中英

Converting an org-mode table to LaTeX

IS there a way to 'texify' an ASCII table written with Emacs' orgtabl-mode. Creating tables in this mode is extremely simple.

Eg suppose I have this table

|------+-----+-----|
|    A |   B |   C |
|------+-----+-----|
| 2.34 | 2.7 | 8.9 |
| 3.67 | 4.5 | 8.9 |
|------+-----+-----|

If in EMACS, I could highlight this region and do soething like Mx texify or whatver to generate the latex code for that table that would save me a lot of pain.

Any non-emacs suggestion is also welcome.

You could use orgtbl-mode. In your latex buffer, do Mx orgtbl-mode , add

% BEGIN RECEIVE ORGTBL thenameofthetable
% END RECEIVE ORGTBL thenameofthetable

where you want the table to be.

add

#+ORGTBL: SEND thenameofthetable orgtbl-to-latex :splice nil :skip 0
|------+-----+-----|
|    A |   B |   C |
|------+-----+-----|
| 2.34 | 2.7 | 8.9 |
| 3.67 | 4.5 | 8.9 |
|------+-----+-----|

after the \\end{document}

and do Cc Cc on the org-mode table

The other solution is already given by Michael Hoffman: use org-mode export capability with Cc Ce l

Cc Ce l应该这样做。

In org-mode, put your cursor in the table, and Mx org-table-export exports the table in a file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM