When displaying a datatool-database with \DTLdisplaylongdb
- how to obtain a horizontal rule atop of the table-heads?
Whatever I try yields error-messages about ! Misplaced \noalign.
(Besides this I'd like to know the reason for the Underfull \vbox (badness 10000)
-message.
\documentclass{article}
\usepackage{datatool,longtable}
%===============================================================
\DTLnewdb{MyDataBase}%
\DTLaddcolumn{MyDataBase}{columnA}%
\DTLsetheader{MyDataBase}{columnA}{First Column}%
\DTLaddcolumn{MyDataBase}{columnB}%
\DTLsetheader{MyDataBase}{columnB}{Second Column}%
%---------------------------------------------------------------
\DTLnewrow{MyDataBase}
\DTLnewdbentry{MyDataBase}{columnA}{Row 1 Col A}
\DTLnewdbentry{MyDataBase}{columnB}{Row 1 Col B}
%---------------------------------------------------------------
\DTLnewrow{MyDataBase}
\DTLnewdbentry{MyDataBase}{columnA}{Row 2 Col A}
\DTLnewdbentry{MyDataBase}{columnB}{Row 2 Col B}
%===============================================================
\begin{document}
\begingroup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This doesn't work out but yields ! Misplaced \noalign.
%\renewcommand{\dtldisplaystarttab}{\hline}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\dtldisplayafterhead{\hline}%
\renewcommand\dtldisplaystartrow{\hline}%
\renewcommand{\dtldisplayendtab}{\tabularnewline\hline}%
\renewcommand{\dtlbeforecols}{|}%
\renewcommand{\dtlaftercols}{|}%
\renewcommand{\dtlbetweencols}{|}%
\renewcommand\dtlheaderformat[1]{\textbf{#1}\hfil\null}%
\DTLdisplaylongdb{MyDataBase}
\endgroup
\end{document}
Comsole output:
pdflatex-dev test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex-dev)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2021-05-01> pre-release-1 (develop 2021-2-27 branch)
L3 programming layer <2021-02-18>
(/usr/local/texlive/2020/texmf-dist/tex/latex-dev/base/article.cls
Document Class: article 2020/11/23 v1.4m Standard LaTeX document class
(/usr/local/texlive/2020/texmf-dist/tex/latex-dev/base/size10.clo))
(/usr/local/texlive/2020/texmf-dist/tex/latex/datatool/datatool.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2020/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/local/texlive/2020/texmf-dist/tex/generic/xkeyval/keyval.tex))))
(/usr/local/texlive/2020/texmf-dist/tex/latex-dev/base/ifthen.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/xfor/xfor.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/substr/substr.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/datatool/datatool-base.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex-dev/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2020/texmf-dist/tex/latex-dev/amsmath/amstext.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex-dev/amsmath/amsgen.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex-dev/amsmath/amsbsy.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex-dev/amsmath/amsopn.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/datatool/datatool-fp.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp.sty
`Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/defpattern.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-basic.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-addons.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-snap.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-exp.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-trigo.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-pas.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-random.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-eqn.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-upn.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fp/fp-eval.sty)))))
(/usr/local/texlive/2020/texmf-dist/tex/latex-dev/tools/longtable.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(./test.aux)
Underfull \vbox (badness 10000) detected at line 45
[1{/usr/local/texlive/2020/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux) )
(see the transcript file for additional information)</usr/local/texlive/2020/te
xmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/local/texlive/2020/tex
mf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on test.pdf (1 page, 22819 bytes).
Transcript written on test.log.
\dtldisplaystarttab \@dtl@resetdoamp
but with longtable the order is exchanged\@dtl@resetdoamp\dtldisplaystarttab
and the first command starts the column.