Bibliography not rendering in R Studio - latex

I am very new to LaTex and R Markdown and I've been desperately searching for a solution and have not found anything helpful. I am writing a LaTex document under R Markdown file and my YAML header is the following;
---
linestretch: 2
output: pdf_document
header-includes:
- \setlength{\parindent}{3em}
- \setlength{\parskip}{0em}
bibliography: bibliography.bib
---
# References
however when I knit my file my bibliography is not rendering. Everything compiles nicely without error, but nothing is printed after the # References header. My bibliography.bib file is appropriately saved in the same file as where I have saved this LaTex document. I can't seem to figure this out.
Also if this helps by bibliography.bib file is as follows;
#Book{ref1,
title = {Survival Analysis: A Self-Learning Text},
publisher = {Springer},
year = {2005},
author = {David G. Kleinbaum, Mitchel Klein},
editor = {M. Gail, K. Krickeberg, J. Samet, A. Tsiatis, W. Wong},
edition = {2nd},
}
#Misc{ref2,
title = {pseudo: Pseudo - observations},
author = {{Maja Pohar Perme} and Mette Gerster},
year = {2012},
note = {R package version 1.1},
url = {https://CRAN.R-project.org/package=pseudo},
}
A solution to this problem will be very much appreciated!

Related

Repeat Title and Date R Markdown PDF

I am struggling what what is likely a trivial markdown matter. I am hoping to avoid YAML and additional header templates and such if I can. So my question is straightforward and I welcome your feedback. For an R Markdown knitted as a PDF, how can I repeat the title and date on each printed page?
Alternatively I am happy to use headers using the '#' syntax. But if I can use the title parameters that would be preferred.
The Header thus far:
---
title: "Dashboard"
date: '`r paste(Sys.Date(), " to ", Sys.Date()+14)`'
output:
pdf_document:
latex_engine: xelatex
mainfont: Calibri
geometry: margin=1cm
classoption: landscape
params:
set_title: !r test_title
header-includes:
- \usepackage{titling}
- \pretitle{\begin{flushleft}\huge}
- \posttitle{\end{flushleft}}
- \preauthor{\begin{flushleft}}
- \postauthor{\end{flushleft}}
- \predate{\begin{flushleft}\large}
- \postdate{\end{flushleft}}
---
From the rmarkdown cookbook:
When a Rmd document is compiled, all of its metadata in the YAML section
will be stored in the list object rmarkdown::metadata. You can use this object
in your R code. For example, rmarkdown::metadata$title gives you the title
of the document.

Where to download BibLaTEX

I'm trying to write my thesis using overleaf, but having trouble with the referencing. I've been told to use BibLaTEX but it doesn't seem to be formatting correctly see 1. From what I gather it's because I don't have the external software downloaded, but I'm confused as to what specifically I need and where to find it. I thought I downloaded this from CTAN, but all I found was a folder of .bib files and I'm not sure how that helps? 2 is the error message I recieve :/
Any advice would be much appreciated!
Here is my code, I try changing the style and the brackets in my doc change (but not the citation).
This is my new ref.bib
#book{williams_transmission_2008,
location = {New York},
edition = {2nd ed},
title = {Transmission electron microscopy: a textbook for materials science},
isbn = {978-0-387-76500-6},
shorttitle = {Transmission electron microscopy},
pagetotal = {4},
publisher = {Springer},
author = {Williams, David B. and Carter, C. Barry},
date = {2008},
keywords = {Materials, Microscopy, Transmission electron microscopy}
}
And this is my new test document, and the same image issue 3
\documentclass{report}
\usepackage[style=science, citestyle=numeric, sorting=ynt]{biblatex}
\addbibresource{ref} % the ref.bib file
\begin{document}
Hi there, Stackoverflowers \cite{williams_transmission_2008}
\printbibliography
\end{document}

Calligra font with RMarkdown

This is my Rmarkdown code:
---
title: "My Title"
header-includes:
- \usepackage{calligra}
- \usepackage[T1]{fontenc}
output:
pdf_document:
latex_engine: xelatex
---
# Section 1
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
I was studying the best way to change fonts in Rmarkdown. In texlive the installed calligra package appears and calligra-type1 also.
When I run the script with the calligra package it generates the pdf but the font does not match the calligra font.
And when I run the script for calligra-type1 the pdf is not even generated.
Any help, guys?
The calligra.sty does not set-up the Calligra as default font, but you can do so by adding
\renewcommand{\rmdefault}{calligra}
to header-includes.
BTW, there is no need to call fontenc.sty, since calligra.sty does so already. In addition, using xelatex is not necessary here.

Compiler errors when using BibTeX

I have tried to compile some work in LaTeX, using the command pdflatex seminararbeit first, which compiled well.
After that, I tried bibtex seminararbeit, which resulted in this:
I found no \citation commands---while reading file seminararbeit.aux
I found no \bibdata command---while reading file seminararbeit.aux
I found no \bibstyle command---while reading file seminararbeit.aux
My seminararbeit.tex file looks like this:
\documentclass[final,bibliography=totocnumbered]{include/sikseminar}
\usepackage[utf8]{inputenc}
\usepackage{todonotes}
\usepackage{hyperref}
\hypersetup{colorlinks = true,linkcolor = black,citecolor = black,urlcolor = black,filecolor = black}
\graphicspath{{./figures/}}
\clubpenalty=10000
\widowpenalty=10000
\overfullrule=1mm
\begin{document}
\newpage
\citation{ kopka00latex1}
\printbibliography
\end{document}
While seminararbeit.bib looks like this:
#book{ kopka00latex1,
author = "Helmut Kopka",
title = "{LATEX, Band 1 -- Einf{\"u}hrung}",
publisher = "Addison-Wesley",
address = "München",
year = {2000},
edition = {3., überarbeitete Auflage},
isbn = {3-8273-1557-3}
}
The problem is, that I need to use the packages I included, I guess that's the root of the problem.
Do you guys have any ideas?
Don't use \citation. Instead use \cite.

Latex and multibib

I want to split my bibliography into two parts, and found the multibib package which seems to be perfect for this.
But: somehow it doesn't work, not even the simple example works:
\documentclass{article}
\usepackage{multibib}
\newcites{ltex}{\TeX\ and \LaTeX\ References}
\begin{document}
References to the \TeX book \citeltex{Knuth:1991} and to Lamport’s \LaTeX\ book, which appears only in the references\nociteltex{Lamport:1994}. Finally a cite to a Postscript tutorial \cite{Adobe:1985}.
\bibliographystyleltex{alpha}
\bibliographyltex{lit}
\renewcommand{\refname}{Postscript References}
\bibliographystyle{plain}
\bibliography{lit}
\end{document}
With the bib file looking like that
#book{Knuth:1991, author = {Knuth, Donald E.}, title = {The TEC book}, publisher = {Addison-Wesley, Reading, Massachusetts}, year = {1991}}
#book{Lamport:1994, author = {Lamport, Leslie}, title = {LATEX: A Document Preparation System}, publisher = {Addison-Wesley, Reading, Massachusetts, 2 edition}, year = {1994} }
#book{Adobe:1985, author = {Adobe System Incorporated}, title = {Postscript Language Tutorial and Cookbook}, publisher = {Addison-Wesley, Reading, Massachusetts}, year = {1985}}
As expected, two aux files are created (one for each part), but the created pdf file only contains the references for the "normal", not for the created bib.
Any ideas? Thanks!
Ok, I found it out by myself:
I'm using Texniccenter and tought all the compiling is done automatically, but an additional bibtex call is needed for the ltex.aux file, so you need to run
bibtex ltex.aux
manually on the command line, then it works.
Perhaps someone knows a way to do that call from Texniccenter?
Open the ltex.aux file in Texnic Center (through File then Open...).
Once it is open and it is the selected tab in Texnic Center, go to Build, Current File... and click Bibtex. The key here is to choose the Bibtex command in the Current File option.
This performs the same as bibtex ltex.aux in Texnic Center

Resources