I have a file composed by many sections: I'm not sure of this choice, and maybe in the future I want to switch to chapters (or to subsections, for example).

My solution is the following command:


And I use \mychapter{Title} instead of \section{Title}. In this way I can simply edit the command to switch from sections to whatever I want.

Is this a valid solution?

  • 1
    You are inserting spurious spaces -- they could matter, also you won't be able to use the optional arguments. Feb 26, 2016 at 11:18
  • 1
    As far as I understand your problem, you just need to replace \chapter with section and so on. This is the most correct and simple to do with editor capability "replace". You only need to start replacing at the lowest level of your document divisions.
    – Zarko
    Feb 26, 2016 at 11:37

4 Answers 4


If you really want to do this:

\global\let\subsubparagraph\orisubparagraph % for symmetry

I would find this rather confusing if I went back to a document after a while, or was asked to review a document for someone else. You could use something like \newcommand{\MyLevelOneDiv}[1]{\section{#1}}, but I would take a different approach.

In any decent text editor you can do this with a simple find/replace with regular expressions. By searching for \\section\{([^}]*)\} and replacing with \\subsection{$1} you can easily demote all sections to subsections. This simple version doesn't work for optionl short titles, or if you have macros with } inside the title.

A version that would work for (sub)section names such as \section[short title]{A rather \emph{long} title} is to replace \\section(\[[^\]]*\])?(\{.*\})\s*$ with \\subsection$1\$2 (although this assumes that you have nothing other than whitespace after the closing } -- no good if you want a comment there.

The exact syntax may need tweaking depending on your regex engine, especially in terms of exactly which brakcets need escaping with a \ in the search, and how to refer to the captured groups in the replacement. My versions are tested under jEdit.

Many TeX-specific editors don't offer this feature, which is why I don't use them, preferring a general programming text editor.


You could use the memoir class which encompasses the book, report and article classes. Set up your document as though it was a book or report (i.e. use \chapter as the main document division). Then if you specify


it will be set like a book or report, but if you specify


it will be set like an article with chapters set as section, sections set as subsections, etc.


It should do the job, but you should take care of subsections, subsubsections, ... as well.


This way you can adjust your whole structure in a single place.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .