News for hackers. Stuff that matters.
Re:Writing a book, still the same pain 15 years later by umvi on Tuesday June 18, 2019 @04:15PM (#20217903)
I myself write books in Markdown. Each chapter has a markdown file, the book is version controlled with Git, there is a "build script" that does a "build" (in this case it's a shell script that concatenates the markdown files and runs them through pandoc and calibre CLIs to generate eBooks and PDFs).

When I send to my editor I just tell her to modify the files as she sees fit. When I get them back I put the new files on a branch and create a PR so I can start discussions on changes, etc.

I think the process is pretty darn efficient but it's hard to sell it to non-techie writers/editors.

Re:Writing a book, still the same pain 15 years later by boazbarak on Tuesday June 18, 2019 @08:22PM (#20219790)
I am using the same setup though with a lot of customization of pandoc

https://github.com/boazbk/tcs

Re:Writing a book, still the same pain 15 years later by carapace on Tuesday June 18, 2019 @08:25PM (#20219813)
Oh cool! I'm getting reasonable results using Pandoc->LaTeX->PDF with mostly markdown and bits of raw LaTeX as the source.

I pass `-V documentclass:scrbook` to pandoc and then I can use e.g. '\frontmatter' and '\mainmatter' in the MD source.

As I say, I'm getting reasonable results, but it's one of those "I can't be the first person to do this" situations. Got any tips or links to share?

Re:Writing a book, still the same pain 15 years later by mikepurvis on Tuesday June 18, 2019 @05:00PM (#20218356)
I wanted to use a workflow like this years ago working with Apress. Possibly (hopefully) things are better now, but at least at the time, all their tooling expected Word docs as the input, and you had to use a very specific stylesheet (including goofy stuff like magic text strings to insert images).

There were also some manual transformation steps occurring on their end, because there was a cutover point where the Word doc was no longer accepted and you had to just quote page and line numbers to get further changes made.

Re:Writing a book, still the same pain 15 years later by munificent on Tuesday June 18, 2019 @05:46PM (#20218789)
> There were also some manual transformation steps occurring on their end, because there was a cutover point where the Word doc was no longer accepted

This was probably the point at which the text had been moved into InDesign for typesetting by the designer.

Re:Writing a book, still the same pain 15 years later by wyldfire on Tuesday June 18, 2019 @05:55PM (#20218849)
Are there publishers who are more accommodating of inputs like LaTeX/pandoc/markdown/etc? It'd be great to know that kind of thing when considering publishers.
Re:Writing a book, still the same pain 15 years later by bokumo on Tuesday June 18, 2019 @06:21PM (#20219047)
I think No Starch Press accepts LaTeX markup. There is a nostarch package on CTAN. https://ctan.org/pkg/nostarch?lang=en
Re:Writing a book, still the same pain 15 years later by geerlingguy on Tuesday June 18, 2019 @06:20PM (#20219041)
You should check out LeanPub. They support a variety of formats, and do some really nice things if you want to self-publish.
Re:Writing a book, still the same pain 15 years later by cosmodisk on Tuesday June 18, 2019 @07:05PM (#20219344)
The content of their books is often OK, however low-res images,pixelated tables and some random font and its size makes those books look funny..
Re:Writing a book, still the same pain 15 years later by ghaff on Tuesday June 18, 2019 @05:27PM (#20218620)
Word docs, Sharepoint. (Though I didn't have that experience with images.)
Re:Writing a book, still the same pain 15 years later by hypocrazybr on Tuesday June 18, 2019 @07:26PM (#20219479)
Would you mind sharing this script? I am moving all my notes to markdown and I would like to setup something like that
Re:Writing a book, still the same pain 15 years later by umvi on Wednesday June 19, 2019 @11:56AM (#20224456)
It's more of a haphazard set of custom scripts I'm afraid, they are pretty messy. I really should clean them up and host on GitHub or something. But, just to get you started, here's one of my scripts (a batch script I use to generate a kindle book on Windows):

    :: Convert Markdown to DOCX format, adding a pagebreak at every \newpage
    pandoc -f markdown -t docx --filter=pandoc-docx-pagebreakpy -o build.docx ^
        foreword.md ^
        preface.md ^
        acknowledgments.md ^
        part_a.md ^
        1.md ^
        2.md ^
        3.md
    
    
    :: File needs to be opened in Word, saved, and then closed to generate physical Table of Contents :/
    @echo off
    echo Please open build.docx in Word, save, and then close.
    pause
    
    :: Set e-book metadata
    ebook-meta build.docx --authors "First M. Last" --author-sort "Last, First M." --title "Book Title" --title-sort "Book Title"
    
    :: Convert DOCX to MOBI (Kindle)
    :: --share-not-sync Makes it so cover shows up in Kindle for PC but also breaks Kindle WhisperSync. Remove if you want WhisperSync.
    :: See https://manual.calibre-ebook.com/faq.html#the-covers-for-my-mobi-files-have-stopped-showing-up-in-kindle-for-pc-kindle-for-android-ipad-etc
    :: --cover "media/cover.jpg" --share-not-sync
    ebook-convert build.docx build.mobi
Re:Writing a book, still the same pain 15 years later by namarie on Tuesday June 18, 2019 @08:40PM (#20219890)
Seconding this, for the same reasons really.