fmarotta / kaobook

A LaTeX class for books, reports or theses based on https://github.com/kenohori/thesis and https://github.com/Tufte-LaTeX/tufte-latex.

Home Page:https://github.com/fmarotta/kaobook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sidecite horizontal alignment

RemDelaporteMathurin opened this issue · comments

Description

Hi @fmarotta

I'm encountering this issue with sidecite where long citations get misaligned (see below).
Is this a bug or am I doing something wrong?

Thanks!

Minimal Working Example

\documentclass{kaobook}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{kaobiblio}
\usepackage{kaotheorems}
\usepackage{kaorefs}

\addbibresource{mybib.bib} % Bibliography file


\RenewDocumentCommand{\formatmargincitation}{m}{
	\parencite{#1} \citeauthor*{#1} (\citeyear{#1})\\
}

\begin{document}


\title{Bug Report}
\author{Author}
\date{\today}

\frontmatter
\maketitle
\mainmatter
\setchapterstyle{kao}

\chapter{First Chapter}
\blindtext
\sidecite{short}
\sidecite{long}

\end{document}

mybib.bib

@article{short,
	title = {Title1},
	journal = {Journal of Nuclear Materials},
	author = {Shortname},
	year = {2015},
}

@article{long,
	title = {Title2},
	journal = {Journal of Nuclear Materials},
	author = {VEEEERYLONGAUTHORNAME},
	year = {2015},
}

Expected behavior:
Alignment of the two citations

Actual behavior:
image

@fmarotta maybe there's a flag in sidecite that forces the alignment to the left?

@RemDelaporteMathurin Hi, does this fix the issue?

\RenewDocumentCommand{\formatmargincitation}{m}{% <- This comment avoids inserting a space.
	\parencite{#1} \citeauthor*{#1} (\citeyear{#1})%
}

Hi @pi8027 it does fix it! and it's well aligned now.
image
However there still is some were spacing in the name... any idea?

@RemDelaporteMathurin If you just want to put a space of the same width after every [n], I would suggest:

\RenewDocumentCommand{\formatmargincitation}{m}{%
	\parencite{#1}\;\citeauthor*{#1} (\citeyear{#1})%
}

Here, \; has a fixed width of 5 mu. You may also replace it with \hspace.

@pi8027 Thanks! it fixed the space after [n]
image
is there a way to deactivate the text justification? Like on this screenshot the space between "Hammon" and "et" is really big!

Or maybe simply remove "et al"?

Hi, perhaps this?

\RenewDocumentCommand{\formatmargincitation}{m}{%
	{\RaggedRight\parencite{#1}\;\citeauthor*{#1} (\citeyear{#1})}%
}