About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Latest news 2024-07-03: Ebook sale (1st – 31st July 2024): short story cybercrime fiction Unsocial Media free; short story cybercrime fiction Smile for the Camera free; short story noir crime fiction I’ve Heard the Mermaid Sing free; crime fiction novel The Private Enemy US$1.99; illustrated children’s story The Foolish Hedgehog US$0.99.

Exercise 4: Internal Lists (Solution)

This is a solution to Exercise 4. You need the sample file booklist.csv. Alternatively, if you want to use data from the samples SQL database, remember to use datatooltk to import the data to a .dbtex file and load it using \DTLloaddbtex as described in Loading Data From a .dbtex File.

\documentclass[captions=tableabove]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{datatool}

% Load data from booklist.csv:
\DTLloaddb{books}{booklist.csv}

\begin{document}

\newcommand*{\titlelist}{}

\DTLforeach*{books}{\Title=title}%
{%
  \xifinlist{\Title}{\titlelist}{}{\listeadd{\titlelist}{\Title}}%
}

\renewcommand{\do}[1]{#1\par}
\dolistloop{\titlelist}

\end{document}

Download etoolboxlist.tex or etoolboxlist.pdf.

© 2015 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs