in 2008 I wrote a document and now I want to change it, but I have a problem with the package datatool. I'm loading a database and look for the row name "Rezeptname", then I use the second cell content as subsection name. I do this twice, first time in normal text, second time I use suetterlin (old german handwritten type). The first time it doesn't work (see also missing bookmark) but the second time there is no problem. If I remove subsection{} (line 28 instead of 29) it works, but looks a little bit different (new line at second part). Texniccenter shows me no error or warning in this example, so I don't know where to search for the error.
I'm not sure if datatool is the reason because I changed from Windows XP to Windows 10 and another computer, but in 2008 it worked.
Thanks for your help to find and eliminate the error.
The .zip contains the example and the csv-file.
Here to read directly:
csv-file:
Code: Select all
1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30
Rezeptname;Hirsesuppe
Kategorie;Suppe
Zutaten;\unit[100]{g} Hirse;\unit[20--40]{g} Fett;\unit[1\nicefrac{1}{2}]{l} Flüssigkeit;Salz
Zubereitung;Die Hirse im Fett anrösten, mit der Flüssigkeit ablöschen. Kochzeit: \unit[30]{Min.}
Zubereitungszeit;\unit[40]{min}
Code: Select all
\documentclass{scrbook}
\newfont{\suet}{suet14}
\newfont{\schwell}{schwell}
\newfont{\schwellv}{schwell scaled \magstep5}
\newfont{\suetv}{suet14 scaled \magstep5}
\DeclareTextFontCommand{\textsuet}{\suet}
\DeclareTextFontCommand{\textschwell}{\schwell}
\DeclareTextFontCommand{\textschwellv}{\schwellv}
\DeclareTextFontCommand{\textsuetv}{\suetv}
\usepackage[T1]{fontenc}% europäischer Zeichensatz
\usepackage[latin9]{inputenc}% Zeichenkodierung
\usepackage[german,ngerman]{babel}% neue deutsche Rechtschreibung, wichtig für Umlaute und Trennungsregeln
\usepackage{datatool}
\usepackage{units}
\usepackage[pdftex]{hyperref} % letztes Paket
\hypersetup{%
bookmarksopen,%
}
\DTLsetseparator{;}
% Zähler starten
\newcounter{dbCounter}
%\newcommand{\writeSectionName}[1]{\DTLforeach[\DTLisieq{\ersteSpalte}{#1}]{aktRezeptDB\arabic{dbCounter}}{\ersteSpalte=1,\zweiteSpalte=2}{\zweiteSpalte}}
\newcommand{\writeSectionName}[1]{\DTLforeach[\DTLisieq{\ersteSpalte}{#1}]{aktRezeptDB\arabic{dbCounter}}{\ersteSpalte=1,\zweiteSpalte=2}{\subsection{\zweiteSpalte}}}
\newcommand{\inhalt}{%
\chapter{Vorspeisen}
\addsec{Suppen}
% lies Datenbank des Rezeptes
\DTLloaddb{aktRezeptDB\arabic{dbCounter}}{hirsesuppe.data}% jeder DBName nur einmal
\writeSectionName{Rezeptname}
\stepcounter{dbCounter}% Zähler erhöhen, um fortlaufende DBNamen erstellen zu können
}
\begin{document}
\selectlanguage{german} % alte deutsche Rechtschreibung für Sütterlin
\setkomafont{chapter}{\suetv}
\textsuet{
\cleardoublepage
\phantomsection
\addpart{Die Abschrift in Sütterlin}
\inhalt
}
\selectlanguage{ngerman} % neue deutsche Rechtschreibung für heutige Schrift
\setkomafont{chapter}{\textnormal}
\textnormal{
\cleardoublepage
\phantomsection
\addpart{Die Abschrift in lateinischer Schrift}
\inhalt
}
\end{document}