I'm working with an automated system that injects some code that redefines the paragraph command:

% Redefines (sub)paragraphs to behave more like sections

I'm stuck with this change.

This causes issues with some LaTeX packages that I use below these lines.

Is there a simple way to un-do this action? Maybe

  • \let\paragraph\oldparagraph and \let\subparagraph\oldsubparagraph... But you shoud check if \oldparagraph and \oldsubparagraph are already defined like in the code above: \ifx\oldparagraph\undefined\else\let\paragraph\oldparagraph\fi and the same for \subparagraph – koleygr Feb 18 at 16:53

Doing \renewcommand{\paragraph}{\oldparagraph} will do if \paragraph is defined to begin with.

Better is


In case \oldparagraph is not defined, then your class doesn't allow \paragraph to begin with and you will get an error just like you'd get without the injected code.

By the way, that code is wrong and it should have


otherwise input such as


will not have “Something” on a new line (but on the same line with a spurious space in addition) which is almost certainly what the redefinition is aiming to attain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.