bookdown chapter heading not correct - latex

I am using the bookdown to write a book. I've defined the documentclass as book. Everything seems to be working correctly - the Table of Contents, List of Tables and List of Figures along with an Appendix, Bibliography and Index. However, in my index.Rmd file I lead off with a Preface section that is not numbered. So, this first "Preface chapter" is marked with a level-1 heading # Preface {-}. The Preface is listed correctly in the Table of Contents as an unnumbered Chapter. However, on the page following the "Preface chapter" the heading at the top of the page still says "List of Figures". So, somehow the chapter heading is being held over and repeated from the List of Figures and not being updated with the "Preface chapter" heading. This "List of Figures" heading stays the same until I get to the next chapter (technically the second chapter) which is numbered, then the rest of the page headings are correct for the rest of the book.
I'm a bit of a LaTeX newbie, so I'm sure there is some option or setting I'm missing. Do I need to add some special LaTeX command or Pandoc argument to make sure that the page headings are aligned with every chapter - both numbered and unnumbered?
Any suggestions are much appreciated. My relevant YAML settings and TEX commands are listed below.
_output.yml
bookdown::pdf_book:
includes:
in_header: preamble.tex
after_body: after_body.tex
latex_engine: xelatex
citation_package: natbib
keep_tex: yes
preamble.tex
\usepackage{booktabs}
\usepackage{makeidx}
\makeindex
\usepackage[nottoc]{tocbibind}
index.Rmd - relevant section of YAML
documentclass: book
bibliography: [manual.bib, packages.bib]
biblio-style: apalike
link-citations: yes
lot: true
lof: true

Since pandoc passes LaTeX commands through you could use
# Preface {-}
\markboth{Preface}{}
(c.f. https://tex.stackexchange.com/questions/89914/chapter-name-in-the-header-with-chapter)

Related

position of table of contens and searchable files with Quarto (PDF output)

is there a Quarto way to
place the table of contens (TOC) where I like it. Like for references (Bibliography Generation)
::: {#refs}
:::
(for LaTeX please see answer in comment from #shafee for further information)
toc: false
```{=latex}
\tableofcontents
```
create Copy-paste-able/searchable PDF files TeX FAQ
header-includes:
- \usepackage{mmap}
replace default title page, is there something like toc: false? https://en.wikibooks.org/wiki/LaTeX/Title_Creation
\begin{titlepage}
\end{titlepage}

Latex ClassicThesis - The numbering of the paragraphs does not appear

I need one more numbered level for my report. I used \paragraph{title} but it only appears without numbering.
In the config file, the paragraph is described as:
\titleformat{\paragraph}[runin]
{\normalfont\normalsize}{\theparagraph}{0pt}{\spacedlowsmallcaps}
I believe that the command \theparagraph is responsible for the numbering. Why doesn't it appear?
I searched the net for answers and tried the following commands (at once) before the beginning of the document:
\setcounter{secnumdepth}{\paragraphnumdepth}
Replace the previous command to get rid of run-in with:
\titleformat{\paragraph}
{\relax}{\textsc{\MakeTextLowercase{\theparagraph}}}{1em}{\normalsize\itshape}
\renewcommand{\theparagraph}{\thesubsection.\arabic{paragraph}}
I put the last two commands in \makeatletter and \makeatother.
The paragraph name appears like the section names now, but still no numbers. Any ideas? Here is a small example that works because I didn't include the classicthesis config files.
\documentclass{scrreprt}
\usepackage[utf8]{inputenc}
\setcounter{secnumdepth}{\paragraphnumdepth}
\begin{document}
\chapter{Chapitre}
\section{Introduction}
\subsection{Première sous-partie}
\subsubsection{Un cran en dessous}
\paragraph{Paragraphe with number: what I would like in my report}
Functional here because the problem clearly comes from the two classicthesis config files...
\end{document}
Thank you

How to remove number from toc title with pandoc+beamer

I am using pandoc to generate a beamer slideshow. I activated the generation of a TOC and specified a TOC headline. But there is an extra number added to this title as if the TOC would span several slides, but it does not.
My source file
---
toc: true
toc-title: the overview
...
# my section
and I compile with pandoc -t beamer -o x.pdf < x.md. The title of the TOC has this extra roman I which beamer normally adds if a slide is split into two (or more).
How can I get rid of this number?
Edit
In the end I put it in the yaml preamble of the pandoc file as raw latex code:
header-includes: |
```{=latex}
\setbeamertemplate{frametitle continuation}[from second]
% more stuff
```
You can disable the continuation count for frames that consist only of a single one by using this command:
\setbeamertemplate{frametitle continuation}[from second]
In the response from #samcarter_is_at_topanswers.xyz, I had to delimit the command with backticks and indicate as latex code:
`\setbeamertemplate{frametitle continuation}[from second]`{=latex}

Remove unwanted latex code from final document.

I made a file in rmarkdown to submit to a journal, but when I went to actually upload the file, they want raw latex. Okay, part of my YAML is.
output:
pdf_document:
keep_tex: true
header-includes:
- \usepackage{color}
- \usepackage{lineno}
- \linenumbers
The preview of the document looks great, except it starts out like this (just text not, in code format:
[]article lmodern amssymb,amsmath ifxetex,ifluatex fixltx2e =0 [T1]fontenc
[utf8]inputenc fontspec Ligatures=TeX,Scale=MatchLowercase upquote microtype
[protrusion]basicmath [margin=1in]geometry hyperref graphicx,grffile parskip
titling
color lineno
followed by everything I want. Where do I look to get rid of this?

How can I insert page number to rmarkdown beamer slides?

How can I show page numbers (preferably like 4/10, 5/10 etc.) on an rmarkdown beamer presentation?
In the front matter of the document, you can include a .tex file with extra commands as shown in RStudio's documentation here.
I created a new .tex file that I called "header_pagenrs.tex" which only includes the top 2 lines from #user4281727's answer:
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[page number]
Then I referenced this file at the top of my .Rmd file:
---
title: "Things and Stuff"
author: "Me"
output:
beamer_presentation:
includes:
in_header: header_pagenrs.tex
---
If this still gives you errors, you might also be missing some required TeX packages (a separate problem from RStudio and rmarkdown).
Here's another option that worked for me. Didn't need to add a .tex file to my folder. Just included the following (based on above code from #civilstat) at the top of my Markdown doc.
---
title: 'Your Title'
author: "Your Name"
date: "July 4, 1776"
output:
beamer_presentation(keep_tex = TRUE): default
header-includes:
- \setbeamertemplate{navigation symbols}{}
- \setbeamertemplate{footline}[page number]
---
If your beamer version is reasonable up to date (>= v3.48), you can adjust the format of the frame numbers while keeping the footline of your chosen beamer theme unchanged otherwise.
---
output:
beamer_presentation:
theme: "Berlin"
keep_tex: true
header-includes:
- \setbeamertemplate{page number in head/foot}[totalframenumber]
---
test
Try to put the lines below into the template
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[page number]
~/Library/R/3.1/library/rmarkdown/rmd/beamer/default.tex

Resources