Commit
you have to put at least svmono.cls and spbasic.bst under the root directory
- Loading branch information
There are no files selected for viewing
10 comments
on commit 23ba576
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Platform: Windows 10 Pro
Pandoc Version: 1.17.2
MikTeX Version: 2.9
I can't run this example successfuly. I've downloaded the svmono.cls and spbasic.bst under the root directory but still I'm having problems.
When running
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS bookdown-demo-changed.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output bookdown-demo-changed.pdf --template "C:\Users\Altran\Documents\R\win-library\3.3\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --bibliography book.bib --bibliography packages.bib --filter pandoc-citeproc
I get the following error:
! LaTeX Error: Command \subtitle already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.116 }
pandoc.exe: Error producing PDF
Error: pandoc document conversion failed with error 43
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS bookdown-demo-changed.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output bookdown-demo-changed.pdf --template "C:\Users\Altran\Documents\R\win-library\3.3\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --bibliography book.bib --bibliography packages.bib --filter pandoc-citeproc' had status 43
In order to understand the error a little bit better, I've deleted the following lines from the default-1.17.0.2.tex:
\newcommand{\subtitle}[1]{
\posttitle{
\begin{center}\large#1\end{center}
}
}
And I don't have an error anymore. But the output is not like the one that you shared
What am I doing wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you also make the changes in _output.yml
like what I did above? template: null
is important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
Another thing that I forget to tell is that I am not running with the "Build -> Build All", I am trying to do this by run
rmarkdown::render_site(input = ".", output_format = "pdf_document")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is supposed to work with bookdown::pdf_book
, or the Build Book
button. I'm not really sure if rmarkdown::render_site
or pdf_document
works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted @yihui ! Thank you very much for the feedback!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi again,
This used to work for me, but something got updated (have recently installed Hugo, along with an update of many other R packages, perhaps it tinkered with some other files)... and it doesn't work anymore.
With a fresh default bookdown_demo directory where I added svmono.cls, svind.ist and spbasic.bst files, when building from RStudio I get this error:
output file: bookdown-demo.knit.md
! LaTeX Error: Command \proof already defined.
Or name \end... illegal, see p.192 of the manual.
Error: Failed to compile bookdown-demo.tex. See bookdown-demo.log for more info.
Execution halted
Exited with status 1.
I also tried from the command line, with:
bookdown::render_book("index.Rmd", bookdown::pdf_book(keep_tex = TRUE))
and here I get a different, but similar error:
! LaTeX Error: Command \subtitle already defined.
Or name \end... illegal, see p.192 of the manual.
Error: Failed to compile bookdown-demo.tex. See bookdown-demo.log for more info.
And this is the same error which is mentioned in the bookdown-demo.log file. I'd be grateful for any additional hint, thanks very much in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also get a LaTeX error:
Latexmk, John Collins, 1 January 2015. Version 4.41
! LaTeX Error: Command \subtitle already defined.
Or name \end... illegal, see p.192 of the manual.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the solution is to define a custom Pandoc LaTeX template (and don't define the \subtitle
command): https://bookdown.org/yihui/bookdown/templates.html but I don't have time for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Yihui, thank you for the above guidance.
I tried following the book guide to compile my thesis with my university's LaTeX template, but I get the error
! LaTeX Error: Missing \begin{document}.
This is what I have in my Index YAML
title: "The Asian Tigers miracle; the role of Public Expenditure: Lessons for Africa"
subtitle:
- "By"
- "Blaise Boya Kuubetertii Saanuo"
- "(BSc. Economics & Business Administration, Management)"
author: - "A thesis submitted to the Department of Accounting and Finance, Kwame Nkrumah University of Science and Technology, Kumasi in partial fulfilment of the requirements for the award degree of"
- "MASTER OF PHILOSOPHY IN BUSINESS ADMINISTRATION"
- "[FINANCE]"
date: "June, 2020"
output:
bookdown::gitbook:
css: style.css
split_by: chapter
config:
toc:
collapse: section
before: |
- My MPhil Thesis Report
- Blaise Boya Kuubetertii Saanuo
- Proudly published with bookdown
after: |
toolbar:
position: fixed
search: yes
download: no
edit: no
fontsettings:
theme: white
family: sans
size: 2
sharing:
facebook: yes
twitter: yes
github: yes
all: false
bookdown::pdf_book:
includes:
in_header: preamble.tex
template: null
keep_tex: yes
latex_engine: xelatex
citation_package: none
pandoc_args: --top-level-division=chapter
mainfont: "Times New Roman"
fontsize: 12pt
papersize: a4
linestretch: 1.5
toc: true
toc-depth: 3
lof: True
lot: True
site: bookdown::bookdown_site
documentclass: book
classoption: knustthesis.tex
bibliography: ["book.bib", "packages.bib"]
csl: harvard-educational-review.csl
link-citations: yes
geometry: "left=4cm, right=2.5cm, top=2.5cm, bottom=2.5cm"
The connect of my University Template is below
\documentclass[a4paper,12pt, oneside]{book}
\usepackage{knustthesis}
\begin{document}
\include{titlepage}
\frontmatter
%\pagenumbering{roman}
\include{A1-declaration}
\include{A2-dedication}
\include{A3-acknowledgement}
\include{A4-abstract}
\addcontentsline{toc}{chapter}{Declaration}
\addcontentsline{toc}{chapter}{Dedication}
\addcontentsline{toc}{chapter}{Acknowledgement}
\addcontentsline{toc}{chapter}{Abstract}
\tableofcontents
\newpage
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}
\newpage
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}
\mainmatter
\include{01-intro}
\include{02-literature}
\include{03-method}
\include{04-application}
\include{05-summary}
%\include{ref}
\backmatter
\bibliographystyle{harvard-educational-review}
\bibliography{reference}
\addcontentsline{toc}{chapter}{References}
\include{07-appendices}
\end{document}
I did a bit of editing to suit my work
and the content of the .sty file is below
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=4.00cm, right=2.50cm, top=2.50cm, bottom=2.50cm]{geometry}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}[section]
\newtheorem{theorem}{Theorem}[section]
\usepackage{enumerate}
\usepackage{tabularx}
\usepackage{placeins}
\setlength{\parindent}{1.5cm}
\pagestyle{plain}
\usepackage{tocloft}
\usepackage{setspace, latexsym}
\doublespacing
\usepackage[round]{natbib}
%\bibpunct{(}{)}{;}{a}{,}{,}
\renewcommand{\chaptername}{CHAPTER}{\Large}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\bfseries\centering\Numberstring{section}}{\chaptertitlename\ \thechapter}{20pt}{\Large}
\titlespacing*{\chapter}{0pt}{0pt}{0em}
\renewcommand{\baselinestretch}{1}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\bibname}{REFERENCES}
what can I do to be able to compile my thesis using bookdown with my University LaTeX template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why people keep asking LaTeX questions on this irrelevant commit on Github. This is not the right place for asking questions, and I'll ignore future questions here. Please read the guide https://yihui.org/issue/ and ask questions in other appropriate places. Thanks!
@boyasaanuo Please try remotes::install_github('rstudio/rmarkdown')
.
2019-11-03: this is now
pandoc_args: --top-level-division=chapter