The question, as it stands, could be asking two different things. One: "Let's say I want to make all my sections into subsections and knock every other structure command down a level too" This could be done with a little regex-fu, for example, with sed. The idea would be to just find and replace all instances of each structure command with the next lowest. You'd have to start at the bottom and go up. So let's say the lowest structure command you have is \subsubsection
and you want to knock this down to \paragraph
. So run each of these lines in a terminal:
sed s/'\\subsubsection{'/'\\paragraph{'/ file.tex
sed s/'\\subsection{'/'\\subsubsection{'/ file.tex
and so on. This could obviously be improved loads by running them all with one script, and the like, but you get the idea.
The other thing this question might be asking is "I want to move a whole section of text around within a document AND change its level. This isn't as easy. emacs auctex mode has a command for marking a whole section: C-c *
and then you can cut it with C-w
as per usual. Automatically having the section change its section level is harder, but then it's not clear it would be useful. Sometimes you want a section to stay a section when you move it, and sometimes you want it to become a subsection. So it's best to do that by hand. With emacs reftex you can do this by moving to the section of interest in the reftex menu and using C-< or C-> to move up or down a level respectively.
\subsection
command.None
wants is to move\subsection{blah} hjkj \subsubsection{bloh} hjkh \subsubsection{blih}
to\section{blah} hjkj \subsection{bloh} hjkh \subsection{blih}
. I would do that with some regular expression substitution.org-mode
can do this. Maybe using it and only then exporting to LaTeX is a good idea?