I'm using an automated way to generate a research diary / logbook. (Credit: Using LaTeX to keep a diary) However I'm having trouble getting references to work properly.
I get weird results with this (i.e., the bibliography currently appears in on the page before, at the top of the current entry and right at the end), but I'm clueless how to control this setup.
Ideally, I'd like to have the relevant citations at the end of each entry file (but I'm open to wiser suggestions, e.g. placing them in the sides).
For context, this is meant to be my PhD log book, so through the months/years I'd have many citations. Therefore instead of having one giant bibliography section (as in a thesis), it seems to be preferable to have the relevant entries at the end of each day.
Any help would be appreciated.
\documentclass[nobib]{tufte-book}
\usepackage{xifthen}
\usepackage{amsmath, amssymb}
\usepackage{hyperref, listings, makecell, pdflscape, placeins}
\usepackage{scrextend} %To manually add margins
\usepackage{enumitem} %Costomize enumerate/itemize spacing
\newenvironment{loggentry}[2]% date, heading
{\noindent\textbf{#2}\marginnote{#1}\par}{\vspace{0.5cm}}
\def\?#1{}
\pgfmathtruncatemacro{\StartYear}{2008}
\pgfmathtruncatemacro{\EndYear}{2030}
\newcommand{\writetitle}{0}
\newcommand{\mytitle}[1]
{ \ifthenelse{\writetitle=1}{#1}{}
}
\newread\mysource
\title{Journal}
\author{Name}
\date{Some day}
\begin{document}
\maketitle
\title{Journal}
\cleardoublepage
\foreach \Year in {\StartYear,...,\EndYear}
{ \foreach \Month in {Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}
{ \foreach \Day in {1,...,31}
{ \IfFileExists{\Year/\Month/\Day}
{ \openin\mysource=\Year/\Month/\Day.tex
\read\mysource to \firstline
\closein\mysource
\xdef\writetitle{1}
\begin{loggentry}{\fbox{\Large{\Year - \Month - \Day}}}{\firstline}
\xdef\writetitle{0}
\input{\Year/\Month/\Day}
\end{loggentry}
}
{ % files does not exist, so nothing to do
}
}
}
}
\end{document}
This would be my entry file:
\mytitle{A daily title}
\begin{enumerate}
\item something \cite{Rodi.etal2013}
\item something2 \footnotemark{}\footnotetext{if vector}
\end{enumerate}
\bibliographystyle{unsrt}
\bibliography{../references.bib}
And finally, my .bib entry file:
@book{Rodi.etal2013,
address = {{Boca Raton}},
series = {{{IAHR}} Monographs},
title = {Large-{{Eddy Simulation}} in Hydraulics},
isbn = {978-1-138-00024-7},
language = {en},
publisher = {{CRC Press}},
author = {Rodi, Wolfgang and Constantinescu, George and Stroesser, Thorsten},
year = {2013},
note = {OCLC: 951332989}
}
My system is: Ubuntu 16.04 with TexLive, compilation done with PdfLaTeX. I use Zotero to manage my references.