0

I'm using Obsidian to write markdown text in order to export to PDF using pandoc PDFLateX. I'm using using tufte-book class and it's working perfect. The problem is that I'm trying to use kaobook class, but the citations that are automatically shown as sidenote in tufte are being shown as footnote in kaobook.

Is there a way to setup kaoobook to consider all citations as sidenotes automatically as tufte-book class do?

This is the outcome using tufte-book class: enter image description here

This is the outcome using kaobook class: enter image description here

This is the basic code using kaobook template:

% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
%
\documentclass[
  13pt,
  a4paper,
  justified]{kaobook}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{iftex}
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math}
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
  \setmainfont[]{KpRoman}
  \setsansfont[]{KpSans}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\pagestyle{headings}
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newlength{\cslentryspacingunit} % times entry-spacing
\setlength{\cslentryspacingunit}{\parskip}
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
 {% don't indent paragraphs
  \setlength{\parindent}{0pt}
  % turn on hanging indent if param 1 is 1
  \ifodd #1
  \let\oldpar\par
  \def\par{\hangindent=\cslhangindent\oldpar}
  \fi
  % set entry spacing
  \setlength{\parskip}{#2\cslentryspacingunit}
 }%
 {}
\usepackage{calc}
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
\ifLuaTeX
\usepackage[bidi=basic]{babel}
\else
\usepackage[bidi=default]{babel}
\fi
\babelprovide[main,import]{brazilian}
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
\ifLuaTeX
  \usepackage{selnolig}  % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same} % disable monospaced font for URLs
\hypersetup{
  pdfauthor={Christian M. De Britto},
  pdflang={pt-BR},
  colorlinks=true,
  linkcolor={Maroon},
  filecolor={Maroon},
  citecolor={blue},
  urlcolor={Blue},
  pdfcreator={LaTeX via pandoc}}

\author{Christian M. De Britto}
\date{}

\begin{document}

{
\hypersetup{linkcolor=}
\setcounter{tocdepth}{4}
\tableofcontents
}
\hypertarget{cidade-e-transformauxe7uxe3o}{%
\section{Cidade e transformação}\label{cidade-e-transformauxe7uxe3o}}

\hypertarget{afinal-de-contas-o-que-uxe9-a-cidade}{%
\subsection{Afinal de contas, o que é a
cidade?}\label{afinal-de-contas-o-que-uxe9-a-cidade}}

O Sociólogo alemão Georg Simmel (1858-1918) foi um dos primeiros autores
clássicos da sociologia a refletir sobre características da vida urbana.
Segundo ele, a vida urbana é marcada pela intensificação das
experiências. Em suas palavras:

\begin{quote}
O fundamento psicológico sobre o qual se eleva o tipo das
individualidades das grandes cidades é a \textbf{intensificação da vida
nervosa}, que brota da mudança acelerada e ininterrupta das impressões
interiores e exteriores.\footnote{Georg Simmel, \emph{As Grandes Cidades
  e a Vida Do Espírito} ({Covilhã}: {Universidade da Beira Interior},
  2009), 4.}
\end{quote}

\hypertarget{referuxeancias-bibliogruxe1ficas}{%
\subsection*{Referências
Bibliográficas}\label{referuxeancias-bibliogruxe1ficas}}
\addcontentsline{toc}{subsection}{Referências Bibliográficas}

\hypertarget{refs}{}
\begin{CSLReferences}{1}{1}
\leavevmode\vadjust pre{\hypertarget{ref-simmel}{}}%
Simmel, Georg. \emph{As Grandes Cidades e a Vida Do Espírito}.
{Covilhã}: {Universidade da Beira Interior}, 2009.

\end{CSLReferences}

\end{document}
5
  • 2
    You need to redefine the citation style / citation command in the document preamble. For a more decisive information you can convert the document to LaTeX and not directly to pdf, i.e., pandoc ... -s -t latex -o text.tex as a standalone document and then look how the citations are done there. That would be the command you need to adjust. You can also look for natbib / cite / biblatex inclusion the the header and check their options. It would help a lot if you would be able to provide a minimal example, short documents with which we can reproduce the issue. Commented Aug 24, 2022 at 14:40
  • 1
    Ok, thanks! As you can see, in the document the citation is actually typeset as a footnote (\footnote{Georg Simmel ...}) and then the full citation is added "manually" to the reference section. This is not the typical way it should work, though. Next point: this kind of referencing is surely done by the converter you are using. It's the tufte class, that shows any footnotes as side-notes, but you are giving LaTeX footnotes. The fix is somewhere before LaTeX. Commented Aug 24, 2022 at 15:01
  • 1
    Just an idea: check if the --natbib option of pandoc is on. Commented Aug 24, 2022 at 15:13
  • Hi @OlegLobachev I'm just using the --citeproc option, if I include --natbib the citations are gone. What am I doing wrong?
    – Britto
    Commented Aug 24, 2022 at 15:23
  • 1
    Well, as citeproc docs say, "This library generates citations and bibliography formatted according to a CSL style." This means that citeproc does all the formatting of the cites itself, so it generates the bibliography and probably also the footnotes. Without it, with natbib seems the better way for now (as long as LaTeX should be considered). Please check how the processing is done (try using latexmk, for example). You can post also the version, generated with --natbib here, it would help. Or you can post the full pandoc command and the orig. md file. Commented Aug 24, 2022 at 16:11

1 Answer 1

1

I don't know if this is the best solution. I inserted this command on my tex file and it's working now:

  • \usepackage{sidenotes}
  • \let\footnote=\sidenote
2
  • Tufte-LaTeX redefines the \footnote command so that it prints the text in the margin. kaobook doesn't do that: \footnote still makes a footnote; if you want to put something in the margin with kaobook, you should use either \sidenote or \marginnote or \sidecite. So adding \let\footnote=\sidenote to your tex file should be enough (the sidenotes package is already loaded by kaobook). Commented Sep 22, 2022 at 7:40
  • However, in kaobook and more generally in LaTeX there are more appropriate commands than \footnote or \sidenote to display citations. The recommended workflow is to create a bibTeX file with all your citations, and then in LaTeX use a package like biblatex or natbib; at that point you can just write \cite{key}, and LaTeX will take care of formatting the citation (i.e. you don't have to write the title, author, and year yourself). I don't know whether this practice works well with obsidian, though. Commented Sep 22, 2022 at 7:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .