Page LayoutEnabling automatic Numbering for Paragraphs

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Enabling automatic Numbering for Paragraphs

Post by AleCes »

My apologies for trying to show how it could be done consistently with consecutive heading levels. Won't happen again.
Oops... sorry I didn't mean to upset you. My apologies. Your stance is indeed reasonable. So, let's go your way. That is, show me how it could be done consistently with consecutive heading levels.

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Enabling automatic Numbering for Paragraphs

Post by localghost »

Oh, I almost forgot this here. The below example should do the formatting for consecutive heading levels as you asked for. If not, we certainly can do modifications in order to get a proper solution.

Code: Select all

\documentclass[11pt]{book}
\usepackage[T1]{fontenc}
\usepackage{titlesec}
\usepackage{lipsum}

\setcounter{secnumdepth}{4}
\renewcommand*{\thesection}{\arabic{section}}
\renewcommand*{\thesubsubsection}{\alph{subsubsection}}
\titleformat{\subsection}[runin]{\normalfont\bfseries}{\thesubsection}{0.5em}{}[.\quad]
\titleformat{\subsubsection}[runin]{\normalfont\bfseries}{\thesubsubsection)}{0.5em}{}[.\qquad]

\begin{document}
  \chapter{Foo}
    \section{Bar}
      \lipsum[1]

      \subsection{Baz}
        \lipsum[2]

        \subsubsection{Fu}
          \lipsum[3]
\end{document}
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Enabling automatic Numbering for Paragraphs

Post by AleCes »

Hi. Thanks for your help. The code you devised works, but somewhat it collides with my prologue:

Code: Select all

\documentclass[a4paper, 12pt, openany, draft]{book}
\usepackage{a4wide}
\usepackage{fontspec}
\usepackage{paralist}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Tinos}
\usepackage{polyglossia}
\setmainlanguage{french}
\setotherlanguages{dutch, english, german, latin, italian, spanish}
\setotherlanguage[variant=ancient]{greek}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{bookmark}
\setcounter{tocdepth}{1}
\raggedbottom
\usepackage{soul}
\newfontfamily\greekfont[Script=Greek]{Tinos}
\newcommand{\og}{\guillemotleft}
\newcommand{\fg}{\guillemotright}
\usepackage{enumitem}
\setenumerate{nolistsep}
\setitemize{nolistsep, label=$-$}
\usepackage{footmisc}
%\setcounter{secnumdepth}{4}


\makeatletter
	\long \def \@makefntext #1%
		{%
			\noindent 
			\makebox [25pt][r]{\@thefnmark.\,}#1%
      	}
\makeatother

\renewcommand*\thesection{\arabic{section}}
\usepackage{fancyhdr}


\renewcommand{\sectionmark}[1]{\markright{#1}}


\usepackage[T1]{fontenc}
\usepackage{titlesec}
\setcounter{secnumdepth}{4}
\renewcommand*{\thesection}{\arabic{section}}
\renewcommand*{\thesubsubsection}{\alph{subsubsection}}
\titleformat{\subsection}[runin]{\normalfont\bfseries}{\thesubsection}{0.5em}{}[.\quad]
\titleformat{\subsubsection}[runin]{\normalfont\bfseries}{\thesubsubsection)}{0.5em}{}[.\qquad]
I get the following error message:
! LaTeX Error: Command \nobreakspace unavailable in encoding T1.
Could you please identify what's wrong with my prologue?
Thank you very much
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Enabling automatic Numbering for Paragraphs

Post by localghost »

How should I know that you compile with XeLaTeX? You never provided a minimal example in this thread. In that case you have to drop the inputenc package.

Finally a well meaning advice. The a4wide package is obsolete and should not be used any more [1]. It is to be replaced by the geometry package with equivalent settings.

[1] View topic: Obsolete Packages and Document Classes — Avoid Usage!
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Enabling automatic Numbering for Paragraphs

Post by AleCes »

localghost wrote:How should I know that you compile with XeLaTeX? You never provided a minimal example in this thread. In that case you have to drop the inputenc package.

Finally a well meaning hint. The a4wide package is obsolete and should not be used any more [1]. It is to be replaced by the geometry package with equivalent settings.

[1] View topic: Obsolete Packages and Document Classes — Avoid Usage!
I'm sorry, I didn't realize XeLaTeX could affect this matter. But, I don't see any inputenc package in my prologue. :?:

About the geometry package, I knew it existed but its settings seemed to me too complicated. So I settled for the a4wide package which provided me for everything I was looking for without any need for me to be bothered with messy set ups. I'm lazy. :mrgreen:
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Enabling automatic Numbering for Paragraphs

Post by localghost »

AleCes wrote:[…] But, I don't see any inputenc package in my prologue. […]

Argh! I meant the fontenc package. Sorry for the confusion. Me culpa.
AleCes wrote:[…] About the geometry package, I knew it existed but its settings seemed to me too complicated. So I settled for the a4wide package which provided me for everything I was looking for without any need for me to be bothered with messy set ups. […]
I can't comprehend your concerns. The geometry package allows an easy setup for page layouts by determining explicitly well known parameters (margins, text body, …). I think you should take a look at its manual. But that's another story.

With some information about demands regarding your type area I could propose a layout by this package. Since I can't be sure that it would be satisfactory for you, I won't do so without this data. So I only recommend to use it for future projects.
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Re: Enabling automatic Numbering for Paragraphs

Post by AleCes »

You mean fontspec? I can see no fontenc package either.
As for the geometry package, how do I can I get an a4wide-like output? I'm OK with the a4wide layout, I don't want too much space above, beneath, left and right.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Enabling automatic Numbering for Paragraphs

Post by localghost »

AleCes wrote:You mean fontspec? I can see no fontenc package either. […]
In your preamble as provided above there is clearly the fontenc package. Exactly between fancyhdr and titlesec. Presumably you picked it up from my example code.
AleCes wrote:[…] As for the geometry package, how do I can I get an a4wide-like output? I'm OK with the a4wide layout, I don't want too much space above, beneath, left and right.
You can start with a very simple setup.

Code: Select all

\usepackage[
  includeheadfoot,
  margin=2cm
]{geometry}
For customization of other possible parameters please refer to the (not so complicated) user guide. But of course you are free to ask here.
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Enabling automatic Numbering for Paragraphs

Post by AleCes »

OK, localghost, things now work very well. But I'd like to remove those annoying points after subsection & subsubsection headings.
I guess I should tamper with those

Code: Select all

[.\qquad]
?
As far as the geometry package is concerned I'll try soon your settings and let you know if I'm contented with them.
Thank you for all you've been doing for me.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Enabling automatic Numbering for Paragraphs

Post by localghost »

AleCes wrote:[…] But I'd like to remove those annoying points after subsection & subsubsection headings.
I guess I should tamper with those

Code: Select all

[.\qquad]
?
[…]
If you don't like those periods, just remove them. They have been only a suggestion to show the end of the headings.
Post Reply