DtoTex [ -b field-list ] [ -n field-list ] [ -r macro-name ] [ input-file.. ]
DtoTex converts D-records in the input-files into TeX source file. Each field becomes
\fieldnamevalue
line. If the field is in -b field-list, the value is enclosed with {} as:
\fieldname{value}
At each end of D-record, DtoTex output a null line (a line with length zero). But, when -r macro-name option is given, end of a D-record is converted to the given macro. You have to give valid TeX macro name in the -r option.
TeX special characters in the value part are converted on the output, to be printed as the original character. They are:
\ | $\backslash$ |
$ | \$ |
& | \& |
# | \# |
^ | \char94 |
~ | \char126 |
% | \% |
< | $<$ |
> | $>$ |
| | $|$ |
{ | $\{$ |
} | $\}$ |
These conversions are not in effect in the fields listed in the -n option.
DtoTex is used to get quality printing of your D-files. As field names become TeX macro names, you are responsible to feed proper TeX macro definitions for them.
Assuming file "ex1.d" has three fields "aa", "bb" and "cc" in this order. Field "aa" and "bb" have short text value, the field "cc" has long text.
Contents of macro file "ex1.tex" is as follows:
\documentstyle{article}
\def\aa#1{#1 &}
\def\bb#1{#1 &}
\def\cc#1{\vtop{\hsize 64pt #1}\\}
\begin{document}
\begin{tabular}{lrl}
\input tmp.tex
\end{tabular}
\end{document}
Then, next commands produce a formatted table output (ex1.dvi file to be output by proper command).
DtoTex -b aa,bb,cc ex1.d > tmp.tex
latex ex1.tex
Assuming file "ex2.d" has three fields "aa", "bb" and "cc" in this order. All fields are short text data.
Contents of macro file "ex2.tex" is as follows:
\def\aa{}
\def\bb{&}
\def\cc{&}
\def\endofrecord{\cr}
\halign{#\hfil&#\hfil&#\hfil\cr
\input tmp.tex
}
\bye
Then, next commands produce a formatted table output (ex2.dvi file to be output by proper command).
DtoTex -r endofrecord ex2.d > tmp.tex tex ex2.tex
See the manual of D_msg.
MIYAZAWA Akira