Duplicate entries in bibliography and footnotes
Closed this issue · 6 comments
I am not sure what is causing this, but I updated to the latest mkdocs-bibtex and I am seeing duplicate entries of references. Have a look here:
lbsn.vgiscience.org mkdocs material docs
If the same citation is references several times, it will appear the same number of times duplicates in the bibliography.
Here's our mkdocs.yml:
site_name: LBSN Structure
site_url: https://lbsn.vgiscience.org/
site_author: Alexander Dunkel, Marc Löchner, Filip Krumpe
copyright: CC BY 4.0, 2022 Alexander Dunkel, Marc Löchner, Filip Krumpe, vgiscience.org and contributors
site_dir: site
plugins:
- search
- git-revision-date-localized
- minify:
minify_html: true
- bibtex:
bib_file: 'docs/references.bib'
csl_file: 'apa.csl'
theme:
name: 'material'
custom_dir: overrides/
palette:
primary: 'Light Blue' #43C3F5
accent: 'Orange' #F8A610
logo: 'img/logo-white.svg'
favicon: 'img/favicon.png'
features:
- navigation.instant
- navigation.expand
- navigation.top
...
markdown_extensions:
- markdown.extensions.codehilite:
guess_lang: false
- markdown_include.include:
base_path: docs
- admonition
- codehilite
- extra
- tables
- sane_lists
- pymdownx.superfences
- pymdownx.details
- pymdownx.tabbed:
alternate_style: true
- footnotes
Here is some more testing:
- also happens with default
csl_file
(parameter set to none) - mkdocs
1.2.3
and mkdocs-material8.2.5
(both latest), mkdocs-bibtex2.0.2
- also happens with the test files provided in this repository
- as you can see in the exmaple docs above, there are
:::
characters added beyond each bibliography ending. This is independent of the csl file uses. I don't know where these are coming from. - I have a feeling that this may be related to pandoc, or the way it is installed, or the version. Running
pandoc 2.17.1.1
locally, installed with conda, - in Debian Docker I observe the same behavior (same pandoc version, but installed with *.deb)
Super weird. I don't see anything wrong with your mkdocs.yml
file. I'll take a look at it this coming weekend. Any chance you could attach a snippet of the markdown that gets a duplicate citation and corresponding bibtex?
I know. Thanks for looking at this @shyamd
This is probably easiest: I've set the project to public.
- mkdocs.yml
- Example markdown file: metrics.md that gets processed to this result structure/metrics/ (with duplicates)
- the corresponding references.bib (it is only one file)
I know it is not your job to look through other people's repositories. I am happy to help wherever I can. I would not have asked in the first place if I hadn't tried already to solve this.
Here is the way to setup/test the repository (conda):
git clone https://gitlab.vgiscience.de/lbsn/lbsn.vgiscience.org.git
conda create -n mkdocs
conda activate mkdocs
conda install -c conda-forge mkdocs mkdocs-material-extensions mkdocs-material mkdocs-git-revision-date-plugin pandoc
pip install mkdocs-bibtex
pip install markdown-include
pip install mkdocs-git-revision-date-localized-plugin
pip install mkdocs-minify-plugin
pip install mkdocs-rtd-dropdown
mkdocs serve
Without conda (this is taken from the Docker setup, but modified for WSL/Linux):
PANDOC_VERSION=2.17.1.1
PANDOC_DOWNLOAD_URL=https://github.com/jgm/pandoc/releases/download/$PANDOC_VERSION/pandoc-$PANDOC_VERSION-1-amd64.deb
curl -fsSL "$PANDOC_DOWNLOAD_URL" -o pandoc.deb \
&& dpkg -i pandoc.deb \
&& rm pandoc.deb
# install mkdocs
apt-get install python3-venv
python3 -m venv mkdocs_env
source ./mkdocs_env/bin/activate
pip install --no-cache-dir mkdocs && \
pip install --no-cache-dir mkdocs-material && \
pip install --no-cache-dir mkdocs-material-extensions && \
pip install --no-cache-dir markdown-include && \
pip install --no-cache-dir pygments && \
pip install --no-cache-dir pymdown-extensions && \
pip install --no-cache-dir mkdocs-minify-plugin && \
pip install --no-cache-dir mkdocs-git-revision-date-localized-plugin && \
pip install --no-cache-dir mkdocs-bibtex
mkdocs serve
# remove venv
rm -rf mkdocs_env
Both setups result in the same issue.
Hi! I'm having the same issue. Any updates?
Awesome, thanks so much @shyamd ! Solved. Closed.