0

I am manipulating a document made in kaobook template. I was wondering if it is possible to locally or globally eliminate the side column (the column that allows for comments and stuff). I know that this template is made to have that but I wish to start another document with similar commands (based on the previous one) but where I need full page width for text.

1
  • Please see my update answer (in \chapter{Second Chapter}) to see how to apply locally wide or margin layouts. Commented Jul 24, 2021 at 20:18

1 Answer 1

3

Add to the preamble:

%%***************************************************** added
\renewcommand{\mainmatter}{%
    \oldmainmatter%
    \pagestyle{scrheadings}% Use a fancy style for the header and the footer
    \pagelayout{wide}% 
    \setchapterstyle{kao} % Choose the default chapter heading style
}

\renewcommand{\widelayout}{%
    \newgeometry{% to be adjusted if needed
        top=27.4\vscale,
        bottom=27.4\vscale,
        inner=28\hscale,
        outer=28\hscale,
        marginparsep=5mm,
        marginparwidth=20mm,
    }%
    \recalchead%
}   
%%*****************************************************

Using \usepackage{showframe} to show the margins

a

\documentclass[
    fontsize=11pt, % Base font size
    twoside=false, % Use different layouts for even and odd pages (in particular, if twoside=true, the margin column will be 
    secnumdepth=1, % How deep to number headings. Defaults to 1 (sections)
]{kaobook}

% Choose the language
\usepackage[english]{babel} % Load characters and hyphenation
\usepackage[english=british]{csquotes}  % English quotes

% Load packages for testing
\usepackage{blindtext}
\usepackage{showframe} % Uncomment to show boxes around the text area, margin, header and footer


%%***************************************************** added
\renewcommand{\mainmatter}{%
    \oldmainmatter%
    \pagestyle{scrheadings}% Use a fancy style for the header and the footer
    \pagelayout{wide}% 
    \setchapterstyle{kao} % Choose the default chapter heading style
}

\renewcommand{\widelayout}{%
    \newgeometry{% to be adjusted if needed
        top=27.4\vscale,
        bottom=27.4\vscale,
        inner=28\hscale,
        outer=28\hscale,
        marginparsep=5mm,
        marginparwidth=20mm,
    }%
    \recalchead%
}   
%%*****************************************************

\begin{document}
    
%----------------------------------------------------------------------------------------
%   BOOK INFORMATION
%----------------------------------------------------------------------------------------

\titlehead{Document Template}
\title[Template for the {\normalfont\texttt{kaobook}} Class]{Template for the {\normalfont\texttt{kaobook}} Class}
\author[JBG]{Johnny B. Goode}
\date{\today}
\publishers{An Awesome Publisher}

%----------------------------------------------------------------------------------------

\frontmatter % Denotes the start of the pre-document content, uses roman numerals

\makeatletter
\uppertitleback{\@titlehead} % Header

\lowertitleback{
    \textbf{Disclaimer} \\
    You can edit this page to suit your needs. For instance, here we have a no copyright statement, a colophon and some other information. This page is based on the corresponding page of Ken Arroyo Ohori's thesis, with minimal changes.
    
    \medskip
    
    \textbf{No copyright} \\
    \cczero\ This book is released into the public domain using the CC0 code. To the extent possible under law, I waive all copyright and related or neighbouring rights to this work.
    
    To view a copy of the CC0 code, visit: \\\url{http://creativecommons.org/publicdomain/zero/1.0/}
    
    \medskip
    
    \textbf{Colophon} \\
    This document was typeset with the help of \href{https://sourceforge.net/projects/koma-script/}{\KOMAScript} and \href{https://www.latex-project.org/}{\LaTeX} using the \href{https://github.com/fmarotta/kaobook/}{kaobook} class.
    
    \medskip
    
    \textbf{Publisher} \\
    First printed in May 2019 by \@publishers
}
\makeatother

\maketitle

\chapter*{Preface}

\blindtext

\tableofcontents % Output the table of contents

\mainmatter % Denotes the start of the main document content, resets page numbering and uses arabic numbers
\setchapterstyle{kao} % Choose the default chapter heading style

\chapter{First Chapter}

\blindtext

\addpart{Title of the Part}

\pagelayout{margin} % use large margins
\chapter{Second Chapter}
\blindtext
\pagelayout{wide} %  % Restore full width

\appendix % From here onwards, chapters are numbered with letters, as is the appendix convention

\addpart{Appendix}

\chapter{Some more blindtext}

\blindtext

\end{document}

The default now is wide layout. (\pagelayout{wide})

To go back to the large margins

use

\pagelayout{margin} % use large margins
\chapter{Second Chapter}
\blindtext
\pagelayout{wide} %  % Restore full width

f

2
  • That's great, do you know if I can do that locally for a given page or chapter?
    – Mauricio
    Commented Jul 24, 2021 at 19:47
  • @Mauricio You can go back and forth locally using \pagelayout{margin} for the original setup and later \pagelayout{wide} to go back to full width. See the updated answer. Commented Jul 24, 2021 at 20:16

You must log in to answer this question.

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