General ⇒ Showing "X most recent of Y total items" in a CV section
-
- Posts: 2
- Joined: Fri May 11, 2012 4:20 pm
Showing "X most recent of Y total items" in a CV section
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!
NEW: TikZ book now 40% off at Amazon.com for a short time.

Showing "X most recent of Y total items" in a CV section
You could use the databib package (part of the datatool bundle). For example:
This requires:
Regards
Nicola Talbot
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}
Code: Select all
latex filename
bibtex filename
latex filename
Nicola Talbot
LaTeX Resources: http://www.dickimaw-books.com/latexresources.html
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
-
- Posts: 2
- Joined: Fri May 11, 2012 4:20 pm
Re: Showing "X most recent of Y total items" in a CV section
Thanks, that sounds promising. I'll give that a try.