0

Is there any easy way to do the same thing that this code does:

% arara: pdflatex

\documentclass[a4paper,12pt]{report}
\usepackage[inner=0.75in,outer=0.65in,top=0.75in,bottom=0.75in]{geometry}
\usepackage{blindtext}
\usepackage{titlesec}

\makeatletter
    \def\@makechapterhead#1{%
    \vspace*{5\p@}
    {%
    \parindent \z@ \raggedleft \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
            %\huge\bfseries \@chapapp\space \thechapter
            \Large\bfseries \thechapter.\space%
            %\par\nobreak
            %\vskip 20\p@
        \fi
    \fi
    \interlinepenalty\@M
    \Large \bfseries #1\par\nobreak
    \vskip 5\p@
    }}
\makeatother

\begin{document}
\chapter{Some Text}
    \begin{itemize}
        \item[1.1] \blindtext
        \item[1.2] \blindtext
    \end{itemize}

\section{Some More Text...}
    \begin{itemize}
        \item[1.3] \blindtext
        \item[1.4] \blindtext
    \end{itemize}

\subsection{Some More Text...}
    \begin{itemize}
        \item[1.5] \blindtext
    \end{itemize}
\end{document}

Please provide some information regarding how to increase the horizontal spacing between the item number and the ..

The indentation for each paragraph is also significant. Should this be done manually?

The requirement of this post can be summarized as:

  • Paragraph numbering in an ascending order without the effect of sections, etc.

  • Indentation of the paragraph should be the same

  • If this can only be done manually as shown, please propose a way to increase the horizontal distance between the paragraph number and the text.

3
  • Do you just want an easier way to number paragraphs? Is it only specific paragraphs that require numbering, or all of them? See, for example, Numbering paragraphs or even Numbering of subsections and paragraphs.
    – Werner
    Commented Aug 28, 2013 at 6:15
  • A minimal working example would be nice. Commented Aug 28, 2013 at 6:17
  • All the paragraph are to be numbered, all the paragraphs of a chapter are to be numbered in an ascending order. Chapter 1 1st para will be 1.1, 2nd 1.2 so on and 2nd chapter should be 2.1, 2.2 and so on.. The indentation is also significant
    – blooooomer
    Commented Aug 28, 2013 at 6:22

1 Answer 1

2

To increase the separation between the number and the text, change \labelsep to the length you prefer.

It is assumed that the numbered paragraph ends with a blank line.

\documentclass[a4paper,12pt]{report}
\usepackage{blindtext}

\newcounter{mypar}[chapter]
\renewcommand{\themypar}{\thechapter.\arabic{mypar}}
\newcommand{\mypar}{%
  \par\addvspace{\topsep}% ensure we're in vertical mode
  \begingroup
  \setlength{\parindent}{0pt}
  \refstepcounter{mypar}%
  \def\par{\endgraf\endgroup}%
  \everypar=\expandafter{\the\everypar\makebox[0pt][r]{\themypar\hspace{\labelsep}}\everypar{}}%
  \leftskip=\labelwidth
}

\begin{document}

\chapter{Some Text}

\mypar \blindtext

\mypar \blindtext

\section{Some More Text...}

\mypar \blindtext

\mypar \blindtext

\subsection{Some More Text...}

\mypar \blindtext

\end{document}

enter image description here

You must log in to answer this question.

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