Effective D book?
Jonathan M Davis
jmdavisProg at gmx.com
Sat Jun 15 12:08:10 PDT 2013
On Saturday, June 15, 2013 08:55:11 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), m-dash vs. n-dash, 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? Section
> references? Do you have macros for all of them? Does it make it a bit
> cumbersome to type?
I'm early enough in the process that I haven't done much with those yet, and
I'm likely to have to go back and fix that sort of thing up later (especially
since about all I've done with LaTeX previously is write papers for college,
and I didn't necessarily have to get everything as nice and exact as you would
for a published book, so I'd likely be screwing some of that up even if I were
writing directly in LaTeX). I expect to be using macros for them, but since
you have to mark them up when writing in LaTeX anyway, it's not like I lose
much using ddoc instead. It's just that the syntax changed. But it may be that
if some of those can be automated, I'll end up doing something in the build
script to manipulate the text to add that markup for me rather than using
macros directly. I'll worry about that level of typesetting later. I wouldn't
be worrying about that now even if I were writing directly in LaTeX.
And ddoc macros will easily allow me to add it all later. It's just that the
ddoc files for stuff like html and epub will ignore them. I don't really need to
create something which is completely target-agnostic. I just need to create
something that easily converts to all of the target formats that I need. And
ddoc will do that just fine.
> > 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?
LaTeX will autogenerate the table of contents and the index, but html won't
(and I don't think that something like epub will either, but I haven't gotten
around to generating that yet). So, I have to generate the whole thing as
macros, which the latex.ddoc file mostly gets rid of, and the html.ddoc file
replaces with the appopriate text and links.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list