1

I'm writing an user manual for an application I made, and I'm using the book documentclass. I was able to eliminate the word "Chapter" from both the begining of the chapter and the table of contents, so it only shows the number and the chapter name. BUT I don't know how to remove it from the page header as well. A MWE (maybe not so minimal...) is as follows:

% !TeX encoding = UTF-8
\documentclass[letterpaper,12pt,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[spanish]{layout}
\usepackage{graphics,graphicx}
\usepackage[bottom=2.5cm,top=3cm,left=1.8cm,right=1.8cm,footnotesep=0.5cm]{geometry} % ,showframe
\usepackage[flushmargin]{footmisc}

\makeatletter
\def\@makechapterhead#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright \normalfont
        \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
        %\huge\bfseries \@chapapp\space \thechapter
        \Huge\bfseries \thechapter.\space%
        %\par\nobreak
        %\vskip 20\p@
        \fi
        \fi
        \interlinepenalty\@M
        \Huge \bfseries #1\par\nobreak
        \vskip 40\p@
    }
}
\def\@makeschapterhead#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright \normalfont
        \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
        %\huge\bfseries \@chapapp\space \thechapter
        \Huge\bfseries \thechapter.\space%
        %\par\nobreak
        %\vskip 20\p@
        \fi
        \fi
        \interlinepenalty\@M
        \Huge \bfseries #1\par\nobreak
        \vskip 40\p@
    }
}
\makeatother
\addtolength{\footnotesep}{2.5mm}
\renewcommand{\thefootnote}{\textbf{\arabic{footnote}}}

\begin{document}

\begin{titlepage}
    \centering
    %\includegraphics[width=6cm]{pics/logo.png}
    \par\vspace{1cm}
    {\scshape\LARGE Company's shortname\par}
    \par\vspace{1cm}
    {\scshape\LARGE Manual de Usuario \par}
    \par\vspace{1cm}
    {\scshape\Large Company's name \par}
    \vfill
    {\scshape My name ;) \par}
    \today \par
\end{titlepage}

\frontmatter
\tableofcontents

%\include{./TeX_files/intro}
\mainmatter
%\include{./TeX_files/primeros_pasos}
%\include{./TeX_files/cap_actas}
%\include{./TeX_files/cap_fotos}
\chapter{This is a chapter}
Some filler text here... \footnote{This is the footnote.}

\backmatter
% bibliography, glossary and index would go here.

\end{document}

The result of this would be as in the images below:

Table of Contents Begining of Chapter Problem I'm facing

Thanks in advance! ;)

2

You need to modify also \chaptermark:

\documentclass[letterpaper,12pt,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}

\usepackage[
  bottom=2.5cm,
  top=3cm,
  left=1.8cm,
  right=1.8cm,
  footnotesep=0.5cm,
%  showframe,
]{geometry}

\usepackage[flushmargin]{footmisc}
\usepackage{graphicx}

\usepackage{lipsum} % just for the test

\makeatletter
\def\@makechapterhead#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright \normalfont
        \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
        %\huge\bfseries \@chapapp\space \thechapter
        \Huge\bfseries \thechapter.\space%
        %\par\nobreak
        %\vskip 20\p@
        \fi
        \fi
        \interlinepenalty\@M
        \Huge \bfseries #1\par\nobreak
        \vskip 40\p@
    }
}
\def\@makeschapterhead#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright \normalfont
        \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
        %\huge\bfseries \@chapapp\space \thechapter
        \Huge\bfseries \thechapter.\space%
        %\par\nobreak
        %\vskip 20\p@
        \fi
        \fi
        \interlinepenalty\@M
        \Huge \bfseries #1\par\nobreak
        \vskip 40\p@
    }
}
\renewcommand{\chaptermark}[1]{%
  \markright{%
    \MakeUppercase{%
      \ifnum\c@secnumdepth>\m@ne
        \if@mainmatter
          %\@chapapp \ %
          \thechapter. \ %
        \fi
      \fi
      #1%
    }%
  }%
}
\makeatother
\addtolength{\footnotesep}{2.5mm}
\renewcommand{\thefootnote}{\textbf{\arabic{footnote}}}

\begin{document}

\begin{titlepage}
    \centering
    %\includegraphics[width=6cm]{pics/logo.png}
    \par\vspace{1cm}
    {\scshape\LARGE Company's shortname\par}
    \par\vspace{1cm}
    {\scshape\LARGE Manual de Usuario \par}
    \par\vspace{1cm}
    {\scshape\Large Company's name \par}
    \vfill
    {\scshape My name ;) \par}
    \today \par
\end{titlepage}

\frontmatter
\tableofcontents

\mainmatter

\chapter{This is a chapter}
Some filler text here... \footnote{This is the footnote.}

\lipsum[1-15]

\backmatter
% bibliography, glossary and index would go here.

\end{document}

I have left the part where \@chapapp is inserted by the default command.

enter image description here

0

You could simply use the following in the preamble:

\makeatletter
\newlength\mywidth
\settowidth{\mywidth}{\ }
\def\@chapapp{\hspace*{-\mywidth}}
\makeatother

Now your MWE can be updated as:

\documentclass[letterpaper,12pt,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[spanish]{layout}
\usepackage{graphics,graphicx}
\usepackage[bottom=2.5cm,top=3cm,left=1.8cm,right=1.8cm,footnotesep=0.5cm]{geometry} % ,showframe
\usepackage[flushmargin]{footmisc}
\usepackage{blindtext}

\makeatletter
\newlength\mywidth
\settowidth{\mywidth}{\ }
\def\@chapapp{\hspace*{-\mywidth}}
\makeatother
\addtolength{\footnotesep}{2.5mm}
\renewcommand{\thefootnote}{\textbf{\arabic{footnote}}}

\begin{document}

\begin{titlepage}
    \centering
    %\includegraphics[width=6cm]{pics/logo.png}
    \par\vspace{1cm}
    {\scshape\LARGE Company's shortname\par}
    \par\vspace{1cm}
    {\scshape\LARGE Manual de Usuario \par}
    \par\vspace{1cm}
    {\scshape\Large Company's name \par}
    \vfill
    {\scshape My name ;) \par}
    \today \par
\end{titlepage}

\frontmatter
\tableofcontents

%\include{./TeX_files/intro}
\mainmatter
%\include{./TeX_files/primeros_pasos}
%\include{./TeX_files/cap_actas}
%\include{./TeX_files/cap_fotos}
\chapter{This is a chapter}
Some filler text here... \footnote{This is the footnote.}

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext


\backmatter
% bibliography, glossary and index would go here.

\end{document}

Note: I have added \blindtext command from blindtext package to get some dummy text. You can also use the definitions that were used in your MWE if Chapter number and chapter title to print in two lines.

Output:

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.