dlangspec.pdf?

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Jan 6 07:19:22 PST 2013


On Sun, Jan 06, 2013 at 10:44:27AM +0100, Philippe Sigaud wrote:
> > Philippe, please share with me as soon as you have anything significant
> > done in terms of LaTeX production so we don't overlap work.
> >
> >
> Nothing significant yet, that's my first dib into macro.
> I use these, but have a problem for code highlighting: DMD inserts macros
> to colour the code, these don't play well with my usual solutions (package
> pygmentize or package listings). The same for \verbatim{} instruction.
> Here, I just used a simple \texttt{} instruction, but in this case curly
> braces are lost :(

LaTeX has its own syntactic conventions. Curly braces must be escaped
with backslash, and certain operators (^ in particular, which also
affects ^^) will cause syntax errors, because they are metacharacters
with a different meaning. All of them need to be properly escaped.

You may be able to use \begin{verbatim} and \end{verbatim} (which
doesn't suffer from the trailing brace problem) but you can't use it for
inline spans of text.

Unless, of course, you drop into low-level TeX hacking to redefine
metacharacters so that characters used in D code never collide with
them. (It's possible, but not recommended because nobody will be able to
read the code and understand what it does! Plus, you'll have to restore
LaTeX's original definitions every time you end a block of code so that
LaTeX macros will still work -- otherwise you'll get very colorful
malfunctions.)


T

-- 
Talk is cheap. Whining is actually free. -- Lars Wirzenius


More information about the Digitalmars-d mailing list