# Prevent line break caused by \part in article class

I'm trying to prevent the line break caused by the \part command. In a second step, I'd also like to get rid of the word 'Part' in the output. Hence, what I'd like to have is:

I ABC

But I'm stuck with:

Part I

ABC

So far, using\renewcommand{\partname}{} at least drops the word 'Part'. But I'm stuck with the rest. Any help is much appreciated!

MWE:

\documentclass[12pt]{article}
\begin{document}
\part{ABC}
\end{document}

• Can you not simply use \section ? – David Carlisle Oct 30 '18 at 16:32

You have to modify the \@part command. Using etoolbox to patch it:

\documentclass[12pt]{article}
\usepackage{etoolbox}
\usepackage{lipsum}% For dummy text
\makeatletter
\patchcmd\@part
{\Large\bfseries\partname\nobreakspace\thepart\par\nobreak}
{%
\huge % Same font size as the part title
\bfseries % Bold face
\thepart % Part number
\nobreakspace % Space
}
{}{\FAIL}
\makeatother
\begin{document}
\part{ABC}
\lipsum[1]
\end{document}


produces: