Re: [AUCTeX-devel] How to indent the tex file properly?
Cody Chan writes: > So, how can I indent the tex file (just using **TAB** and **ENTER** > keys when editing it or indent the whole buffer using **TAB** or > indent command)? You can't do that. One reason that cannot be done is that nothing stops you to define your own \mysection{Foo bar baz} macro which just emits \section[Foo...]{Foo bar baz}, but how could AUCTeX know that for producing the right indentation. AUCTeX does indent in nested structures, e.g., when you put an itemize environment in an enumerate environment, that will be indented, or when you have nesting in terms of {...}. > I mean, every block (section, subsection, **EVERY** `\begin{}...\end{}` > pair no matter what is inside the {}) should be a part and should be in its > place related to its parent? Please note that this wouldn't be possible, or rather not produce the desired output, with some verbatim environments, e.g., with --8<---cut here---start->8--- \part{Foo} \chapter{Bar} \section{Baz} \subsection{Quux} \paragraph{Quexl} \subparagraph{Bla} \begin{verbatim} this stuff has 14 spaces in front even in the compiled output \end{verbatim} --8<---cut here---end--->8--- the verbatim text will also have 14 spaces in front of it in the compiled PDF output, because well, verbatim means put the stuff in there just as I've typed it. I guess you don't want that, and you'd need to write --8<---cut here---start->8--- \part{Foo} \chapter{Bar} \section{Baz} \subsection{Quux} \paragraph{Quexl} \subparagraph{Bla} \begin{verbatim} this stuff has 14 spaces in front even in the compiled output \end{verbatim} --8<---cut here---end--->8--- which pretty much defeats the purpose of the whole indentation ceremony. Bye, Tassilo ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
[AUCTeX-devel] How to indent the tex file properly?
When I'm editing a org-mode file, the structure of mine is like this(you may need configuration in init.el): ---snippet starts- * A section This is the content of the section #+BEGIN_SRC lang code here #+END_SRC ** A subsection This is the content of the subsection * Another section This is the content of another section ---snippet ends- But when when I'm editing a tex file using auctex, the structure of the tex file is this after I indented the whole buffer: ---snippet starts \documentclass{article} \begin{document} \section{A section} This is the content of the section. \begin{verbatim} some verbatim text \end{verbatim} \subsection{A subsection} This is the content of the subsection \section{Another section} This is the content of another section \end{document} ---snippet ends- It is not easy to view the whole structure, I know I can use **C-c =** to view the toc, but how can I make it like org-mode such as: ---snippet starts \documentclass{article} \begin{document} \section{A section} This is the content of the section. \begin{verbatim} some verbatim text \end{verbatim} \subsection{A subsection} This is the content of the subsection \section{Another section} This is the content of another section \end{document} ---snippet ends So, how can I indent the tex file (just using **TAB** and **ENTER** keys when editing it or indent the whole buffer using **TAB** or indent command)? I mean, every block (section, subsection, **EVERY** `\begin{}...\end{}` pair no matter what is inside the {}) should be a part and should be in its place related to its parent? And the indent-level should be configurable. How can do I do that? I googled a lot and found nothing useful. ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel