GeneralDatatool: different behaviour in new version

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
schwarz
Posts: 4
Joined: Mon Oct 24, 2016 3:49 pm

Datatool: different behaviour in new version

Post by schwarz »

Hallo,

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}
example:

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}
Attachments
DatatoolTest.zip
minimum example
(1.19 KiB) Downloaded 128 times
Last edited by Stefan Kottwitz on Mon Oct 24, 2016 4:28 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Datatool: different behaviour in new version

Post by rais »

Hi,
your problem is not related to datatool, rather to your font switching.
Actually, you'd face the same problem using the fundus-sueterlin (suetterl) package. Here's a fix suggested by u_fischer:

Code: Select all

\documentclass{scrbook}
\usepackage{suetterl}
\DeclareFontShape{T1}{suetterl}{m}{n}{<->s*[0.8]suet14}{\fontdimen5\font=0.5\fontdimen6\font}
% see http://www.mrunix.de/forums/showthread.php?73448-Schriftart-f%FCr-das-ganze-Dokument
\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{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}{\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{disposition}{\suetterlin}
\suetterlin
\cleardoublepage
\phantomsection
\addpart{Die Abschrift in Sütterlin}
\inhalt
}
\cleardoublepage
\phantomsection
\addpart{Die Abschrift in lateinischer Schrift}
\inhalt

\end{document}
BTW: So far, I don't see a reason for your usage of different data bases...nor for loading the same data base over and over, again.

KR
Rainer
schwarz
Posts: 4
Joined: Mon Oct 24, 2016 3:49 pm

Re: Datatool: different behaviour in new version

Post by schwarz »

Hallo Rainer,

now it works, thank you very much. So it was a change in another package (or more) over the years which now shows the error (in 2008 it didn't happen).
I have some other questions about the layout, but I'll use a new thread for that.

Thanks for the very fast help, this is what I like at the LaTeX community.

Regards,
schwarz
Post Reply