2

I'm usign titlesec to personalize name of the sections. This is my code:

\newcommand{\hsp}{\hspace{20pt}} 
\titleformat{\chapter}[hang]{\huge\bfseries\scshape\itshape}
{\thechapter\hsp}{0pt}{\huge\bfseries\scshape}

I want to put the chapter number at the right, write it using itshape, and make it bigger than now.

Like this: enter image description here

Full compatible code:

\documentclass[11pt,a4paper,twoside,openright,titlepage]{book}
\usepackage[suftesi]{frontespizio}
\usepackage{lipsum}

\newcommand{\hsp}{\hspace{20pt}} 
    \titleformat{\chapter}[hang]{\huge\bfseries\scshape\itshape}
    {\thechapter\hsp}{0pt}{\huge\bfseries\scshape}

\begin{document}
\chapter{Hello}
\lipsum[1]
\end{document}
3
  • 1
    Welcome to TeX SX! Could you post a short full compilable code?
    – Bernard
    Oct 7, 2017 at 10:19
  • Do you mean that the number is at a fixed distance from the title?
    – egreg
    Oct 7, 2017 at 18:00
  • @egreg I want the chapter title at the left and the chapter number at the right. Using the following I obtain what I want: \newcommand{\hsp}{\hspace{-200pt}} \titleformat{\chapter}[block]{\huge\bfseries\scshape} {\makebox[0pt]{\makebox[\textwidth][r]{\scalebox{2}{\itshape\thechapter}\hsp}}}{0pt}{}. Maybe you know "Scrivere la tesi di laurea in LaTeX" by Agostino de Marco, well, I want to copy him.
    – zar
    Oct 8, 2017 at 8:55

2 Answers 2

3

Play with this (not that I like the result at all).

\documentclass[11pt,a4paper,twoside,openright,titlepage]{book}
\usepackage{titlesec}
\usepackage{lmodern}

\usepackage{lipsum}

\titleformat{\chapter}[display]
  {\Large\scshape}
  {}
  {0pt}
  {\numberatright}
\titleformat{name=\chapter,numberless}[display]
  {\Large\scshape}
  {}
  {0pt}
  {\zarchaptertitle}

\newcommand{\zarchaptertitle}[1]{%
  \parbox[t]{0.8\textwidth}{#1}
}
\newcommand{\numberatright}[1]{%
  \zarchaptertitle{#1}\hfill
  \makebox[0pt][r]{\fontsize{48}{0}\itshape\thechapter}%
}


\begin{document}

\frontmatter
\tableofcontents

\mainmatter

\chapter{Hello}
\lipsum[1]

\end{document}

enter image description here

4
  • Yes, I've read that you don't like FncyChap's chapter style et similia. Honestly, like you, I don't like it, but this specific result it's not so bad to me. I just want to avoid the word "Chapter". Question: the reason you don't like it is just your taste or there is some typography theory reason behind this.
    – zar
    Oct 8, 2017 at 9:09
  • @zar This is much better than fncychap styles! ;-). However, it requires thinking about all the other styles: for instance, boldface for section titles is out of the question and you also have to modify the appearance of the table of contents.
    – egreg
    Oct 8, 2017 at 9:11
  • Yes, I've done it using: \renewcommand\cftchapfont{\large\scshape\bfseries}. For section and subsection I've write this: \titleformat*{\section}{\Large\scshape\bfseries} \titleformat*{\subsubsection}{\large\bfseries\scshape}
    – zar
    Oct 8, 2017 at 9:15
  • @zar There is no boldface small caps font in Computer Modern or Latin Modern.
    – egreg
    Oct 8, 2017 at 9:40
2

This should do the trick:

\documentclass[11pt,a4paper,twoside,openright,titlepage]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[suftesi]{frontespizio}
\usepackage[showframe]{geometry}
\usepackage{titlesec}
\usepackage{lipsum}

\newcommand{\hsp}{\hspace{20pt}}
    \titleformat{\chapter}[block]{\huge\bfseries\scshape\filcenter}
    {\makebox[0pt]{\makebox[\textwidth][r]{\scalebox{2}{\itshape\thechapter}\hsp}}}{0pt}{}

\begin{document}

\chapter{Hello}

\lipsum[1]

\end{document} 

enter image description here

5
  • Everything is too far to the right. Also, the name of the chapter is in italic and I want just the chapter number in italic.
    – zar
    Oct 7, 2017 at 10:28
  • For the ‘italic’ problem, it's easy to solve (updated answer). For the rest, I couldn't test, as you didn't post a full code, beginning at \documentclass and ending with \end{document}.
    – Bernard
    Oct 7, 2017 at 10:33
  • Now I did. I've tried your new answer but it's set the chapter number normal and the chapter name in italic
    – zar
    Oct 7, 2017 at 10:58
  • @Zar: I've updated the code. Is it like you want, per chance?
    – Bernard
    Oct 7, 2017 at 12:12
  • Bernard: Using this I obtain the result that I desire: \newcommand{\hsp}{\hspace{-200pt}} \titleformat{\chapter}[block]{\huge\bfseries\scshape} {\makebox[0pt]{\makebox[\textwidth][r]{\scalebox{2}{\itshape\thechapter}\hsp}}}{0pt}{}
    – zar
    Oct 8, 2017 at 8:52

You must log in to answer this question.

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