0

I needed to reduce the size of the blank space before my title in Appendix part; I've read that, to do it, i needed titlespacing, and to use titlespacing, I had to use titleformat before.

Since I didn't want to change my title format, i just used the standard given here (in last page). This, however, wasn't really my standard: Instead of writing, for example:

3. My third Chapter

It writes:

Chapter 3
My third Chapter

This doesn't really annoy me I'm ok with both ways. However, it also changes the subsection format, deleting the numbers. I've tried writing titleformat for the section too, but it doesn't changes anything. Can someone help me with that?

Here is my code:

\documentclass{wissdoc}
\usepackage{titlesec}
\usepackage[english]{babel}

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\large\bfseries}{\thesubsection}{1em}{}

\begin{document}

\chapter{first Chapter}
let me introduce the chapter
\section{first section of chapter 1}
this is my text
\section{second section of chapter 1}
i have a lot of sections

\end{document}

what it gives me:

result

what i want:

what i want

I can get it by deleting the titlesec package and titleformat lines, but as i sadi i need those to use titlespacing later. So i either: 1) need a way to keep my correct format while using titlesec and titleformat or 2) need a way to reduce space between the top of the page and the title without using titlesec

Also, i have a wissdoc file for the documentclass. It's not made by me, it's given as something i have to use. In it, there is some newcommand for chapter and section who may or may not explain why i don't have the output i thought i should have:

\renewcommand{\chaptername}{}

\renewcommand{\section}{%
\@startsection{section}%
{1}% Gliederungsebene
{0mm}% Einzug
{1.5ex plus 1ex minus 1.2ex}% Vorabstand
{0.5ex plus 0.5ex minus 0.5ex}% Nachabstand
{\chapterheadfont\Large\bfseries}% Stil
}
\renewcommand{\subsection}{%
\@startsection{subsection}%
{2}%
{0mm}%
{1ex plus 1ex minus 1ex}%
{0.3ex plus 0.3ex minus 0.3ex}%
{\chapterheadfont\large\bfseries}%
} 

PS: sorry for the size of the images.

PS2: I'm on ubuntu and i use TexMaker with the quickBuild set as pdfLaTex+bib+pdfLaTex+view

EDIT: sorry, i'm unable to comment, i've asked to mere the accounts (thanks Phelype)

you can find this wissdoc class out here (which you probably does since you have it)

So, your answer seems to be what i want, but when i use it i don't have the same output as you: there's no numbers before my chapters and sections (just like my first image but without the "chapter" first word). However, they still appears correctly in the table of content. Plus, i can't write like you

\documentclass[english]{wissdoc}

because it says "package babel error: Unknown language english". So i've just writed :

\documentclass{wissdoc}
\usepackage[english]{babel}

Can it comes from a version problem? i'm using TexMaker version 4.4.1 since i'm on ubuntu 16.04

Also, when i write the titleformat line later (like, only in my Appendix file), the chapter format is then still good for all my document except the appendix (which is not so bad) but the section format doesn't have numbers (everywhere on my document, which makes no sense to me since the titleformat line is only in Appendix :'( . And everything still appears allright in the table of contents )

  • Welcme to TeX SX! This is probably due to your document class. Where can we get it? – Bernard Oct 2 '18 at 14:43
  • Yes, you can't comment nor edit because both accounts aren't related. You can ask the Stack Exchange staff to merge them together for you. – Phelype Oleinik Oct 2 '18 at 16:45
1

Is this what you want?

\documentclass[english]{wissdoc}
\usepackage{titlesec}

\titleformat{\chapter}[hang]
{\normalfont\huge\bfseries}{\thechapter.}{0.4em}{\Huge}

\begin{document}

\selectlanguage{english}
\chapter{first Chapter}
let me introduce the chapter
\section{first section of chapter 1}
this is my text
\section{second section of chapter 1}
i have a lot of sections

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.