1. 38

  2. 5

    Some of these things are orthogonal. I’ve published four books with Pearson and I provided them with camera-ready PDFs generated with LaTeX for all of them. It took about a day of tweaking to get a LaTeX template that matched their style, but LaTeX already has lots of useful things such as a package to produce big pages with crop marks for professional printing. The most useful thing I got from them was a professional copyeditor (although copyeditors are incredibly badly paid and so that wasn’t a huge amount of the total cost of publishing).

    For the later books, after seeing what a mess they made of LaTeX to HTML conversion and being unhappy with all of the LaTeX to HTML tools, I moved to writing 100% semantic markup, with TeX syntax and completely splitting the print and ePub production pipelines. I wrote a tool that parsed my semantic markup and generated semantic HTML from it. All of my code examples were pulled in from source files. This gave me two big advantages:

    • I guaranteed that they worked, because they were in files that had to build and run.
    • The syntax highlighter had the full context, even if the reader didn’t.

    In the ePub versions of my Objective-C Phrasebook, for example, I run the source files through libclang and then emit the token stream into the HTML with <span> tags around each token with the token type pulled from the AST, so functions, classes, built-in types, macros, and so on all get different classes. I can then style these however I want in the CSS.

    Similarly, all of the macros that I use are defined in the class file for my LaTeX document. I tried to avoid things like \textit in favour of semantic notation such as \keyword (which then meant it was trivial to build a lot of the index: \keyword{whatever} rendered as whatever but also added an index entry. In the HTML version, that linked directly back to the place the keyword was used.

    1. 1

      I’ve seen plenty of (technical) authors create their own workflows for putting manuscripts together. Did you try to find an already-created solution beforehand? Maybe it’s not just very difficult to create one from scratch.

      1. 2

        I fell into my workflow by starting with LaTeX and some minimal tweaks, gradually moving towards more semantic markup, and then wanting HTML. If I were starting from scratch, I’d be tempted to go with Sile, because it is design to take semantic markup as input and give a fine-grained control over layout. For example, my publisher had a requirement that figures must appear after the first reference to that figure and that’s impossible to do in LaTeX because TeX uses a greedy algorithm for page layout. Sile is designed to support it.

    2. 4

      If you go this route also consider using a language linter such as languagetool, proselint or writegood all of which have plugins for various editors.

      1. 2

        All of them (except the LanguageTool at some degree) are focused on English writers only.

        Here I should probably write a looooong comment and dive into the elaboration that we still can’t get most things done with a computers automagically which many can proof by writing any sort of liner/analyzer (except the regular spelling dict) to check documents written in, for example, Polish language. (you can insert here any verbose language with flexible grammar rules).

        But in the end I’ll left that to you, since I know there are some people related to linguistics here.

        1. 1

          I know that most writing tools are heavily English biased, but the README on writegood linked to an example German extension (the appropriately named schreib-gut).

          I know that some languages are less tractable when it come to computational language analysis (eg Finnish is apparently impossible to have an autocomplete for), and it seems like the classes of problems might not match English’s (eg some idioms can’t be confusing due to declination), but I suspect it’s a matter of people sitting down and making such tools.

        2. 1

          Thanks. I’ve been suggested to use grammarly, but I prefer a s/w that can be used offline. I’ll check these out.

          1. 1

            write-good is quite an ironic name since it should be write-well for it to be grammatically correct.

            1. 5

              I think that’s the joke.♥

              1. 2

                That would.. Make a lot of sense. ♥

              2. 2

                Maybe it’s influenced by Ingsoc’s Newspeak.