我可以删除kaobook模板中的侧栏吗?

我可以删除kaobook模板中的侧栏吗?

我正在处理一份kaobook 模板。我想知道是否可以局部或全局地消除侧栏(允许注释和其他内容的栏)。我知道此模板有此功能,但我希望使用类似命令(基于前一个命令)启动另一个文档,但我需要全页宽度来显示文本。

答案1

添加到序言中:

%%***************************************************** 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%
}   
%%*****************************************************

用于 \usepackage{showframe} 显示边距

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}

现在默认的是宽布局。(\pagelayout{wide}

回到大利润

使用

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

F

相关内容