5

I have uploaded a picture. I wrote

\part{Functions from $\mathbb{R}^{n}$ to $\mathbb{R}^{m}$}

and it printed what you see in the picture. However I just want it to be seen as

I Functions from....

instead of writing Part I and skipping a line and then writing what I wrote. How can I modify that?

enter image description here

Ruben
  • 13,448

2 Answers2

3

My advice, from the point of ease-of-use (and also because that's the only thing visible in your post) is to use \section instead of \part with the following added to your preamble:

\renewcommand{\thesection}{\Roman{section}}

Here is a minimal example highlighting this output:

enter image description here

\documentclass{article}
\usepackage{amssymb,lipsum}
\renewcommand{\thesection}{\Roman{section}}

\begin{document}
\section{Functions from $\mathbb{R}^{n}$ to $\mathbb{R}^{m}$}
\lipsum
\end{document}

If you must use \part, here's a modification (patch, via etoolbox) to the \part-related macro that sets it the way you want:

enter image description here

\documentclass{article}
\usepackage{amssymb,etoolbox,lipsum}
\renewcommand{\thesection}{\Roman{section}}
\makeatletter
\patchcmd{\@part}% <cmd>
  {\Large\bfseries\partname\nobreakspace\thepart\par\nobreak}% <search>
  {\huge\bfseries\thepart\quad}% <replace>
  {}{}% <success><failure>
\makeatother

\begin{document}
\part{Functions from $\mathbb{R}^{n}$ to $\mathbb{R}^{m}$}
\lipsum
\end{document}
Werner
  • 603,163
  • Hey, firstly thanks for replying. Secondly, I have tried what you have suggested, but I found it to be a bit problematic. When I use this code, whenever I use, \subsection or \subsubsection, then It prints the first number of the subsection (or the subsubsection) in roman and after the dot it prints regular numbers. For example If I do my first section and then my subsection: \section{First Section} \subsection{First subsection} it's printing I First section I.1 Subsection. So I think trying to modify \part instead of \section would be a better idea. But I am new at this,maybethereisanotherway – Charles Carmichael Sep 10 '15 at 18:41
  • @CharlesCarmichael: I've added a patch for the appropriate macro to keep your usage of \part. – Werner Sep 10 '15 at 18:48
3

Here is a solution that doesn't require changes to the sectional markup.

\documentclass{article}
\usepackage{lipsum}
\usepackage{amssymb}
\usepackage{etoolbox}

\makeatletter
\renewcommand\partname{\let\wild@card= }
\patchcmd\@part{\par\nobreak}{~\relax}{}{}
\patchcmd\@part{\Large}{\huge}{}{}
\makeatother

\begin{document}
\part{Functions from $\mathbb{R}^{n}$ to $\mathbb{R}^{m}$}
\lipsum
\end{document}

output

If you want to have more space in between the part number and the title you can change the second line of the patch to

\patchcmd\@part{\par\nobreak}{\hskip 1em}{}{}

with the desired amount of space. With '1em', as above, it looks like

output_spaced

Ruben
  • 13,448