I have a \VerbatimInput call to a test.dat file, as shown here:
\documentclass[12pt]{article}
\usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage{fancyvrb}
\usepackage{color,soul}
\usepackage[dvipsnames]{xcolor}
\begin{document}
\RecustomVerbatimCommand{\VerbatimInput}{VerbatimInput}%
{fontsize=\footnotesize,
%
frame=lines, % top and bottom rule only
framesep=2em, % separation between frame and text
rulecolor=\color{Gray},
%
label=\fbox{\color{Black}test.dat},
labelposition=topline,
%
commandchars=\|\(\), % escape character and argument delimiters for
% commands within the verbatim
commentchar=* % comment character
}
\VerbatimInput{./test.dat}
\end{document}
The test.dat file is the following:
#l.77:
TEST11
A3
(EL = 4) # this is compiled ok
mH/(C*K) # this is not compiled, giving that error
Due to the ( * ) symbols, the compilation gives this error:
Runaway definition?
-> mH/(C
! File ended within \read.
<read 1>
l.97 \VerbatimInput{./test.dat}
How could I compile this ?
commentchar=*– egreg Feb 02 '17 at 11:54\|\(\)means that()acts like{}and since*is the comment char, everything after it is ignored. So the((aka{) remains and the data is inconsistent as it is trying to look for the ending)which is not there. You should probably adjust this into something more suitable for your.datfile. – daleif Feb 02 '17 at 12:33commandchars=\|\(\)means that whenever the symbols|and()appear in the.datflie, do not include them in the final latex compilation. Is this true ? I don't really understand why you say that "\|\(\)means that()acts like{}" I would appreciate if you could expand this, thank you very much – DavidC. Feb 02 '17 at 12:44fancyvrbmanual about commandchars, especially the example with\textcolor{red}{Text}. Therecommandchars=\\\{\}meaning that\textcolor{red}{Text}is interpreted by LaTeX. If you remove thecommentchar=*(so it compiles) and add|emph(test)totest.datyou get italictestin the output. (1/2) – daleif Feb 02 '17 at 13:47(), because these now acts as if they were{}(aka the chars you specify arguments with). These always have to come in pairs. Butcommentchar=*says everything after*is ignored and this the scanner cannot find the end part to(inmH/(C*K)– daleif Feb 02 '17 at 13:47