Showing posts with label biblatex. Show all posts
Showing posts with label biblatex. Show all posts

Sunday, November 06, 2022

Making an Index of Plant Names

I'm translating a Sanskrit text full of plant names.  In a previous project of this type, I created a simple bilingual index, Sanskrit-English and English-Sanskrit.  I did not include Latin binomials and, most regrettable, I didn't include any of the source-referencing and thought that went into my translation choices.  I had compiled all this material, but I didn't share it with the public.  With the current project, I want to use a database to collect the information about each plant cumulatively and in a single place, and I want to have a straightforward way of presenting this complex data in the book.

TLDR: as I write, I just use the Sanskrit name of the plant, and the Glossaries- Extra package replaces it with the English translation from my bib file and also constructs the alphabetical glossary entries at the back of the book.  E.g., I write "take the \gls{dhava} plant" and I automatically get "take the axelwood plant" and an index entry at the back of the book giving the Latin name etc.

Monday, July 24, 2017

Biblatex, citations and bibliography sorting

"I want to sort in-text citations by year, but bibliography by name."  So begins one of the questions at a Stackexchange.  That's just what I want too.

I want to put multiple references in a \cite{} command without caring about their sequence, and have them automatically print in year-order.  Then, I want my bibliography to be ordinary, i.e., printed in author-date order.

The discussion at the above site is tricky, but the answer by moewe works. 

NB: update in 2024. After biblatex ver. 3.18, the way to do this changed.  The old, pre 3.18, method is appended below.  But since 2022, 

Current, post-2022 method

\documentclass{article}
\usepackage[backend=biber,
  style=authoryear-comp,
  % sortcites=true, % not needed here because it is implied by style=authoryear-comp,
]{biblatex}
\AtBeginRefsection{\GenRefcontextData{sorting=ynt}}
\AtEveryCite{\localrefcontext[sorting=ynt]}
\addbibresource{mybibliography.bib} 

\begin{document}
  Lorem \autocite{key2000, key1900}

  ipsum \autocite{key1900, key2000}

  \printbibliography
\end{document}


There is another post by moewe that rewrites the \cites command so that also obeys sortcites (which it doesn't by default).


Old, pre-2022 method, for historical interest

In a nutshell here's what you actually do:

\begin{document}
\usepackage[sorting=ynt,sortcites=true]{biblatex}
\addbibresource{mybibliography.bib}
\AtBeginDocument{\assignrefcontextentries[]{*}}
\begin{document}
Hello world!\footcites{ref1,ref3,ref0,ref4}
\newrefcontext[sorting=nyt]
\printbibliography

\end{document}
This will print your footnoted citations in ascending order of year, and your bibliography in ascending order of author.