# memoir: change paragraph title from “10. Excercise” to “Exercise 10”

I use

\setparaheadstyle{\normalsize\itshape}


I'd like to move the number to the right and dispense with the period. I'd also like to align the whole title to the right (to flush it right?). Is there a way to do it?

MWE as requested:

\documentclass[11pt,a4paper,oneside]{memoir}

\pagestyle{plain}

\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{polyglossia}

\setmainfont[Mapping=tex-text]{Liberation Serif}
\setsansfont[Mapping=tex-text]{Liberation Sans}
\setmonofont[Mapping=tex-text]{Liberation Mono}

%% Ensure sequential numbering of subsubsections.
\setsecnumdepth{paragraph}
\counterwithout{paragraph}{subsubsection}
\counterwithout{subsubsection}{subsection}
\renewcommand{\thechapter}{\arabic{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\Roman{subsection}}
\renewcommand{\thesubsubsection}{\S\arabic{subsubsection}}

\setcounter{tocdepth}{3} % Must not precede the above

\begin{document}

\chapter{Alfa}
\section{Bravo}
\subsection{Charlie}
\paragraph{Exercise}
\paragraph{Exercise}

\end{document}

• Please add a complete MWE (beginning at \documentclass and ending at \end{document}) so we can help you better. – Skillmon Mar 21 '17 at 14:25
• (1) full minimal example, please (2) paragraphs are usually not numbered, so as per (1) we need more information on what yo are doing. (3) why don't you use theorem like constructions instead? I think that is the most common method for making excercises and 'Name number' is the default setting. Theorem like structures does not need to be italic, can easily be changed if you are using say amsthm. – daleif Mar 21 '17 at 14:25
• MWE added. The document division is very peculiar, not of my choice, an is not to be negotiated. The subsubsections and paragraphs are numbered sequentially throughout the document, regardless of section an subsection numbering. As soon as I redesign the paragraph title, everything will be to my satisfaction. – Alexey Orlov Mar 21 '17 at 16:32
• Isn't it easier to define a command \Exercise which fits your need. So you don't need to change the default setting of \paragraph – Marco Daniel Mar 21 '17 at 22:03
• An interesting idea. I'm not even aware of how much it takes to implement a good division command, but do I really need one? Just print and increment a counter? But... What about my pages? I don't really want a title on one page and the body of the exercise on another. – Alexey Orlov Mar 22 '17 at 3:07

To @Alexey Orlov and future readers, I propose a solution based only on memoir. This is a minimal working example, that does what you want:

\documentclass{memoir}
\setsecnumdepth{paragraph}
\renewcommand{\theparagraph}{Question \arabic{paragraph}}% This does the trick
\pagestyle{plain}
%\headstyles{default}% This is the modified style.
\begin{document}
\paragraph{} Text for the first exercise.% Observe '{}'
\end{document}


This is my MWE, new and improved. The solution based on titlesec is quite satisfactory.

\documentclass[11pt,a4paper,oneside]{memoir}

\pagestyle{plain}

\usepackage[explicit]{titlesec}

\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{polyglossia}

\setmainfont[Mapping=tex-text]{Liberation Serif}
\setsansfont[Mapping=tex-text]{Liberation Sans}
\setmonofont[Mapping=tex-text]{Liberation Mono}

%% Ensure sequential numbering of subsubsections and paragraphs.
\setsecnumdepth{paragraph}
\counterwithout{paragraph}{subsubsection}
\counterwithout{subsubsection}{subsection}
\renewcommand{\thechapter}{\arabic{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\Roman{subsection}}
\renewcommand{\thesubsubsection}{\S\arabic{subsubsection}}
\setcounter{tocdepth}{3} % Must not precede the above

\titleformat{\paragraph}[hang]
{\raggedleft\normalfont\small\itshape\bfseries}{}{0pt}{#1 \arabic{paragraph}}

\begin{document}

\chapter{Alfa}
\section{Bravo}
\subsection{Charlie}
\paragraph{Exercise}
\paragraph{Exercise}

\end{document}