Hi all,
When I build the pdf_book (documentclass: krantz),
---
title: "title"
author: "KIM"
date: "`r Sys.Date()`"
knit: "bookdown::render_book"
documentclass: krantz
site: bookdown::bookdown_site
fontsize: 12pt
monofont: "Source Code Pro"
monofontoptions: "Scale=0.7"
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
description: "DrPH Multivariable Analysis."
---
The output (the table of contents and the chapter) starts with 0.1 instead of 1.0 (see image below).
But when I use documentclass::book (see below), bookdown::pdf_book renders the numbering of chapters correctly (FYI, in all the Rmd files I used the single # as the heading for chapter).
---
title: "title"
author: |
| Kamarul Imran
| Assc Prof (Epidemiology and Statistics)
date: "`r Sys.Date()`"
knit: "bookdown::render_book"
documentclass: book
site: bookdown::bookdown_site
fontsize: 12pt
monofont: "Source Code Pro"
monofontoptions: "Scale=0.7"
lot: yes
lof: yes
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
description: "DrPH Multivariable Analysis."
---
The latex preamble (which was taken almost entirely from bookdown: Authoring Books and Technical Documents with R Markdown preamble latext) is written as below;
\usepackage{booktabs}
\usepackage{longtable}
\usepackage[bf,singlelinecheck=off]{caption}
\usepackage{framed,color}
\definecolor{shadecolor}{RGB}{248,248,248}
\renewcommand{\textfraction}{0.05}
\renewcommand{\topfraction}{0.8}
\renewcommand{\bottomfraction}{0.8}
\renewcommand{\floatpagefraction}{0.75}
\renewenvironment{quote}{\begin{VF}}{\end{VF}}
\let\oldhref\href
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
\ifxetex
\usepackage{letltxmacro}
\setlength{\XeTeXLinkMargin}{1pt}
\LetLtxMacro\SavedIncludeGraphics\includegraphics
\def\includegraphics#1#{% #1 catches optional stuff (star/opt. arg.)
\IncludeGraphicsAux{#1}%
}%
\newcommand*{\IncludeGraphicsAux}[2]{%
\XeTeXLinkBox{%
\SavedIncludeGraphics#1{#2}%
}%
}%
\fi
\makeatletter
\newenvironment{kframe}{%
\medskip{}
\setlength{\fboxsep}{.8em}
\def\at@end@of@kframe{}%
\ifinner\ifhmode%
\def\at@end@of@kframe{\end{minipage}}%
\begin{minipage}{\columnwidth}%
\fi\fi%
\def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
\colorbox{shadecolor}{##1}\hskip-\fboxsep
% There is no \\@totalrightmargin, so:
\hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
\MakeFramed {\advance\hsize-\width
\@totalleftmargin\z@ \linewidth\hsize
\@setminipage}}%
{\par\unskip\endMakeFramed%
\at@end@of@kframe}
\makeatother
\makeatletter
\@ifundefined{Shaded}{
}{\renewenvironment{Shaded}{\begin{kframe}}{\end{kframe}}}
\makeatother
\newenvironment{rmdblock}[1]
{
\begin{itemize}
\renewcommand{\labelitemi}{
\raisebox{-.7\height}[0pt][0pt]{
{\setkeys{Gin}{width=3em,keepaspectratio}\includegraphics{images/#1}}
}
}
\setlength{\fboxsep}{1em}
\begin{kframe}
\item
}
{
\end{kframe}
\end{itemize}
}
\newenvironment{rmdnote}
{\begin{rmdblock}{note}}
{\end{rmdblock}}
\newenvironment{rmdcaution}
{\begin{rmdblock}{caution}}
{\end{rmdblock}}
\newenvironment{rmdimportant}
{\begin{rmdblock}{important}}
{\end{rmdblock}}
\newenvironment{rmdtip}
{\begin{rmdblock}{tip}}
{\end{rmdblock}}
\newenvironment{rmdwarning}
{\begin{rmdblock}{warning}}
{\end{rmdblock}}
\usepackage{makeidx}
\makeindex
\urlstyle{tt}
\usepackage{amsthm}
\makeatletter
\def\thm@space@setup{%
\thm@preskip=8pt plus 2pt minus 4pt
\thm@postskip=\thm@preskip
}
\makeatother
\frontmatter
What have I done wrong? Really appreciate your time in attending this problem. Thank you.
KIM