I'd like to create the following table using datatool
:
\documentclass{article}
\begin{document}
\begin{tabular}{ *{3}{r} }
\bfseries FieldA & \bfseries FieldB & \bfseries FieldC \\
First & Second & Third \\
\textit{First} & \textbf{Second} & \textsl{Third} \\
First\&A & Second\_B & Third
\end{tabular}
\end{document}
In this example the second row contains a bunch of formatting commands (\textbf
, \textit
, \textsl
, ...) that I'd like to keep, while the third row contains some active characters I'd like to print as-is (that is, &
> \&
, _
> \_
, ...).
I thought I could use datatool
's \DTLloadrawdb
to get around the active character mapping, but this doesn't work with the formatting commands as illustrated in the following example:
\documentclass{article}
\usepackage{datatool,filecontents}
\begin{filecontents*}{data.csv}
FieldA, FieldB, FieldC
First, Second, Third
\textit{First}, \textbf{Second}, \textsl{Third}
First&A, Second_B, Third
\end{filecontents*}
\DTLloadrawdb{data}{data.csv}% ... booooom!
\begin{document}
\DTLdisplaydb{data}
\end{document}
How can I leave some commands within a database untouched (like the formatting commands \textbf
, \textit
, ... and their arguments), while still retaining the \DTLrawmap
feature for certain active characters (like &
, _
, ...)?