The point here is that I don't know what I don't know. I'm an Emacs and AUCTeX user looking to improve my Emacs & AUCTeX use, especially regarding efficiency. I've been using the Emacs–AUCTeX combo for a while (4–5 years) and have a well-established routine at this point. I'm quite satisfied with this combo, but often wonder if I'm doing something in an inefficient way without even knowing it.

Thus I am I hoping to learn, for example, some ideas for things to add to my .emacs file or new shortcut keys (though I suspect I already know most of those). So if you have a tip you think I (and others) might benefit from, please share it.

7 Answers
7

Finding tips

It is hard to say what the best tips is for you. Especially if you do not give a more detailed description of your workflow. The best way to find this might be to read the manual from cover to cover. Also make sure to read the RefTeX manual since it is included in AUCTeX and you should use its commands for handling citations and cross-references. Other places to find tips is to peek at other peoples .emacs and go through emacs, auctex, reftex and the equivalent tags on StackOverflow and SuperUser.

Learning and configuring Emacs is a never-ending process as described in A simpleton's guide to (...)TeX workflow with emacs. Thus, you will learn more and more as you go. That you learn something new is not necessarily a sign of that you have been inefficient before that.

My tips

The following are some that tips I would like to share. They might be irrelevant for you and therefore the advice above might be the best.

Use folding to fold macros and environments and it will be easier to focus on the content of your document. To use folding you have to activate TeX-fold-mode. This can be done by either activating it temporarily, by M-x TeX-fold-mode, or permanently, by placing the following in your .emacs

Are there any drawbacks to folding? E.g. does it ever hide anything that might be better left unhidden?
–
Quinn CulverApr 17 '12 at 21:12

@QuinnCulver I have not encountered any obvious drawbacks in using it. As mentioned, folded items unfold as the cursor is placed on them. Also, I think the folded look is clear enough to show its meaning. Finally, it is easy to switch between folded and unfolded items for the whole buffer and parts of it, e.g. use C-c C-o b to unfold the whole buffer.
–
N.N.Apr 18 '12 at 6:08

Org-mode's radio tables are an easy, simple and fast way to create tables within Emacs/AUCTeX. They offer all of the calculation capabilities of the org-mode spreadsheets, which can be very convenient if need simple, auto-updating data.

The source org-table can be placed within a comment environment using the comment package, or after \end{document}. The radio table can be placed anywhere in the document by surrounding it with

% BEGIN RECEIVE ORGTBL table_name
% END RECEIVE ORGTBL table_name

The table will be automatically generated in LaTeX format within those two tags and will be updated every time the org-table is updated. Activating the orgtbl-mode (minor mode) will make it easier to edit the org-table within AUCTeX.

Radio Tables explanation

As requested, a brief explanation of what radio tables are and a link to where more info can be found:

Radio tables are a way of using Org-mode's tables in any mode within Emacs. The idea behind them is that one should be able to create a table in any mode (i.e. LaTeX-mode) while still using Org's syntax in a minor orgtbl-mode AND without generating errors with the major mode. This means that there will be a "source table" in Org syntax, a "target table" in the required syntax (i.e. LaTeX syntax) and a translator function to convert from one to the other and to place the table in the proper place. In a sense, the table is sent to its final place via the translator function, much like a radio signals are sent from the transmitter to the receptor.

In the case of radio tables, the "receptor" is defined by two lines that are comments in the major mode that we are working in. For LaTeX mode, those two lines take the form written above. Then, the source table is created elsewhere, with a special line atop of it, in the form of

#+ORGTBL: SEND table_name translation_function arguments....

Now, if the source table in Org syntax will definitely cause errors if placed as-is within the LaTeX document, so two ways to deal with this are to either send it past the \end{document} line, grouping all the source tables towards the end of the document and separating them from their target tables, or wrapping them in a comment environment, defined by the comment package, which would allow to keep the source tables close to the targets.

As for the translator function, Org-mode provides a very basic generic translator function that will give good enough tables. This translator function can be modified to fit the user's need.

This is incredible, seems we have a table calculation inside orgmode, which can produce LaTeX-Tables. For the record: the documentation is in the annex of the manual. I never read that.
–
Keks DoseApr 17 '12 at 16:07

This is a very sensible question! You know, there are many tricks to discover, which make live easier. My top 3 list:

M-q: Justify the current paragraph (or region if set), with respect to the fill-column variable [Couldn't do without, but it took me weeks to discover]

C-l: Recenter the cursor (one hit puts the current line in the center of the screen, next hit will put it on the top of the screen, next it at the bottom). [learned it in the tutorial; nice, don't want to write on the bottom of screen]

M-x LaTeX-fill-environment and M-x LaTeX-fill-buffer are very useful when editing other peoples code (generalisations of M-q, been using AUCTeX for years and did not know about it).

I love (C-u) C-c C-e and never understood why it hasn't been copied by others.

M-x reftex-change-label and the other refTeX global actions has also proved very handy.

I recently learned how to reconfigure refTeX such that it can provide environment dependent label prefixes, very handy when editing a document that did not use labels, and you would like to use fancyref.

I've also started writing my own macros in order to make editing easier. It is actually a lot of fun (frustrating at times, but fun)

One thing I'd like to have added to the LaTeX-fill-X macroes is that it should make sure all \\ (inclusing *, *[..] or [...]) stood on lines of their own, and the same thing for \begin/end{env} (+plus envs). That would make other peoples code a lot easier to read.

BTW: does anyone know of a set of paren matching macros where one can define what a matching pair of parens are? I'm currently using mic-paren.el, but it is not particularly good at getting matched sets of \{\} or \lbrace\rbrace

Addition:

I used the customize interface, M-x customize-variable RET reftex-label-alist, then say for proposition I have: proposition, P, prop:, \Fref{%s}, meaning that for only showing propositions when refering I type P, that the prefix will be prop: and that a reference will be of the form \Fref{...}. Remember to also edit reftex-insert-label-flags, there I have s, and sftTCEXLPiD

Note that you may want to avoid M-x LaTeX-fill-buffer since there are things common in LaTeX files that Emacs indent poorly, such as TikZ code. Have you got a link for how to configure RefTeX to use environment dependent label prefixes? Does tex.stackexchange.com/questions/15310/… cover the general idea? Finally, it might be better to post your question as a question rather than including it in the answer.
–
N.N.Apr 17 '12 at 11:09

I know about the LaTeX-fill-buffer problem, it also messes things up if there is a preamble in the file.
–
daleifApr 17 '12 at 15:45

1

Just found the answer to the LaTeX-fill-bufffer and tikz problem. Customize the LaTeX-indent-environment-list and add tikzpicture and scope, very handy
–
daleifJul 4 '12 at 9:31