I'm trying to adapt an unofficial University of South Florida Latex document class and template file which are available from http://shell.cas.usf.edu/~saito/grad/ into an Rmarkdown template similar to the thesisdown and huskydown packages. After playing with that for a while I was able to get a package that has a custom template (https://github.com/ailich/bulldown) and can be installed with remotes::install_github("ailich/bulldown")
. The document will knit, but if I add any headers to the child documents (e.g. # Chapter 1) I get the error "! Undefined control sequence. l.49 \hypertarget". I've included a text file which lists the steps I took to create this R package/template and the edits I had to make to various files. Does anyone know how to fix this issue or why it would occur? I'm not very familiar with Latex so I've had trouble debugging this. I've included an example of the converted .tex document that comes out after clicking "knit" below.
\documentclass[boldheadings,thrmdefs,bbm,ams]{USFDissertation}
%% Set basic information about the disseration
\title{My Dissertation Title}
\author{My Name}
\degree{Doctorate of Philosopy}
\department{Marine Resource Assessment}
\college{College of Marine Science}
\university{}
\majorprofessor{your advisor}{Ph.D.}
\committeemember{committee member 1}{Ph.D.}
\committeemember{committee member 2}{Ph.D.}
\committeemember{committee member 3}{Ph.D}
\committeemember{committee member 4}{Ph.D}
\keywords{keyword1}{keyword2}{keyword3}{keyword4}{keyword5}
\approvaldate{August 5, 2023}
\copyrightdate{2023}
%% Begin the document itself
\begin{document}
%% Make a title page
\maketitle
%% Maybe dedicate it to someone
\begin{dedication}
``My dedication''
\end{dedication}
%% Acknowlege your intellectual debts
\begin{acknowledgment}
``My acknowledgments''
\end{acknowledgment}
%% Insert a table of contents
\tableofcontents
%% Insert a table of tables -- comes before figures in the format.
\listoftables
%% Insert a table of figures
\listoffigures
%% Include an abstract
\begin{abstract}
``Here is my abstract''
\end{abstract}
%% begin the body of the dissertation
\dissertation
\hypertarget{title-of-my-first-chapter}{%
\chapter{Title of my first chapter}\label{title-of-my-first-chapter}}
The first thing
The second thing
The third thing
%% End of dissertation
\end{document}
This can be accomplished with "-r", "markdown-auto_identifiers"
It can be specified in the YAML with
output:
bulldown::thesis_pdf:
pandoc_args: [
"-r", "markdown-auto_identifiers"
]
or in a function like bookdown::pdf_book
using the pandoc_args
argument
pandoc_args = c(pandoc_args, "--top-level-division=chapter", "-r","markdown-auto_identifiers")