GeneralShowing "X most recent of Y total items" in a CV section

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
adam+neuro
Posts: 2
Joined: Fri May 11, 2012 4:20 pm

Showing "X most recent of Y total items" in a CV section

Post by adam+neuro »

I have been working on writing my CV in LaTeX, because it enables me to easily switch on and off sections using the ifthen package. In some contexts I want to provide a long form CV and in others provide a short form CV, but this way I keep one file that contains all my exploits. Right now I have a lot of conference abstracts (itemized), and I was wondering if it might be possible somehow to have the section title be something like "X most recent of Y total abstracts", where X is set by me as a variable, and Y is automatically determined by the number of items in the list? I think I have an idea of how to only display the number of items I want by using a custom counter and if statements, but I think the custom counter idea wouldn't work for calculating Y, since the total wouldn't be figured until well after the section title is generated. I am very grateful in advance for any ideas or suggestions that can be provided. Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Showing "X most recent of Y total items" in a CV section

Post by nlct »

You could use the databib package (part of the datatool bundle). For example:

Code: Select all

\documentclass{article}

\usepackage{databib}

\def\maxrefs{5}

\begin{document}
% loads acmtr.bib and creates a database called 'references'
\DTLloadbbl{references}{acmtr}
\nocite{*}
\DTLsort{Year=descending,Month=descending}{references}

\section*{\maxrefs\space most recent of \protect\DTLrowcount{references} total items}

\DTLbibliography[\value{DTLrowi}<\maxrefs\OR\value{DTLrowi}=\maxrefs]{references}

\end{document}
This requires:

Code: Select all

latex filename
bibtex filename
latex filename
Regards
Nicola Talbot
adam+neuro
Posts: 2
Joined: Fri May 11, 2012 4:20 pm

Re: Showing "X most recent of Y total items" in a CV section

Post by adam+neuro »

Thanks, that sounds promising. I'll give that a try.
Post Reply