Effective D book?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Jun 16 04:58:20 PDT 2013


On 6/15/13 11:55 AM, H. S. Teoh wrote:
> I'm curious about how you manage to factor out / abstract away the
> niggling details of LaTeX, like the use of ".\ " after an abbreviation
> (to make it produce only an inter-word space, as opposed to the extra
> space at the end of a sentence),

ABBRDOT = .\$(SPACE)

> m-dash

MDASH = ---

> vs. n-dash

NDASH = --

>, etc., some of which
> are quite specific to LaTeX but are quite necessary if you're going for
> print-quality typesetting. And what about embedded \footnote's?

FOOTNOTE = \footnote{$0}

> Section
> references?

SECREF = \ref{sec:$0}

> Do you have macros for all of them?

Yah. All of the above would go into a latex.ddoc macros file. Then the 
html.ddoc file would contain things like

ABBRDOT = .$(SPACE)
MDASH = —
etc.

> Does it make it a bit
> cumbersome to type?

Most likely, but this is the price to pay for supporting multiple 
formats. Then, LaTeX wasn't exactly designed for ease of typing, so the 
marginal cumbersomeness shouldn't be high.

>> I do have to process the ddoc before giving it to the compiler in
>> order to generate the table of contents and index macros (since you
>> can't generate those with just macros), but since I'm using a D script
>> to do the build, that was actually pretty easy.
> [...]
>
> Isn't \tableofcontents enough to auto-generate the table of contents? Or
> are you talking about doing that for HTML output?

Yah, all outputs should have TOCs and such.


Andrei


More information about the Digitalmars-d mailing list