Live data from Hacker News

Using Web Technologies to Print a Book

richardmavis.info

41–50 of 69 posts

Re: Using Web Technologies to Print a Book

#41
post #35
post #32

I clearly missed something, but why are you not going markdown -> PDF directly? That's what we use extensively in our operations playbooks at work and it gives something that looks like I'd get in a book - even more so after I tweaked the templates a little.

Because the user in question does not know and is unwilling to learn how to design anything if it is not web technology. That is, you probably want to design PDF output. Some users prefer to do any design work whatsoever using web technology. Therefore, PDF needs to be generated from HTML.

If OP is used to working with HTML/CSS, it will probably save him a lot of time and energy to do basic formatting in HTML/CSS than to learn how to design a professional-looking PDF document. He's a programmer and novelist, not a designer.

In fact, he's not even aiming to design a professional-looking PDF document, just a throwaway printout for proofreaders who don't know how to parse Markdown.

Re: Using Web Technologies to Print a Book

#42

You are on linux. You want to typeset a book. Why not use (pdf)LaTeX?

I did that and i didn’t like latex. Especially error messages in case of wrong latex code was extremely unhelpful, pointing to code lines far away from the actual erroneous line. I might be too stupid... but that’s how it felt, and i imagine being able to use simple markdown much more useable.

Re: Using Web Technologies to Print a Book

#43

You are on linux. You want to typeset a book. Why not use (pdf)LaTeX?

Latex is really good if someone needs lots of math, references and so on. It's really par none when it comes to technical writing. But it's so clunky in some ways it's more of a precision tool for this particular task than a generic layout software. I'm saying this as person who's in his past lives written scientific material using LaTeX and done semi-professional graphic design and layout work as well.

Oh god, I in my time tried to tweak LaTeX so I could reach the same aesthetics as using InDesign. While doable (I'm sure) - it's not really worth an effort. LaTeX and it's ways of working are very specific to that one context. it's the Torx screwdriver for the torx screws of technical and scientific publishing. But lot of layout stuff needs a philips head, a nail and a hammer and so on. While a torx screwdriver surely can be used to pound nails, I would not suggest it as an efficient tool.

Don't feed the LaTeX fetish. Some people like to do everything with it, just like people like doing lots of odd things that bring particular aesthetic joy to them, that would be completely impractical or intolerable to others.

LaTeX in a non-technical or non-scientific context is an eccentric quirk. I love eccentric quirks and people who have them! I have many myself! But I would not push my quirks to other people in any setting.

Re: Using Web Technologies to Print a Book

#44

I thought Markdown supports line breaks with two trailing spaces at the end of the line. This gist[0] also mentions or \ at end of line also working. [0] https://gist.github.com/shaunlebron/746476e6e7a4d698b373

A good question from that gist thread: >Why does markdown do this? If I want two lines to run consecutively I won’t introduce a newline.

A bit of an educated guess but I believe the answer stems from markdown originally targeting terminals, which would line wrap but not word wrap. So you could get ugly output like this:

    hello, wor
    ld!
(albeit this is assuming the terminal is only 10 characters wide but I hope you get the point)

So it used to be common for developers and sysadmins to manually wrap to 80 characters (a habit I still regularly catch myself doing even now). Obviously with GUI readers and variable-width characters, you wouldn't want that 80 character manual wrap honoured.

Re: Using Web Technologies to Print a Book

#45
post #3

Glad the author shared his methods. If you're going to repeat this, I'd suggest you give it a try with the first 10 to 15 pages. Something like a small zine. Then use all the tools and make sure you get the output you're expecting. I've written several booklets that I sell on Amazon and my website. If you're interested in writing but not ready to commit to a full novel, try publishing a small zine or two. It's a lot…

Very off topic, but I couldn't find another easy way to get in touch with you. If you're up for it, I'd be super keen to swap notes on self-publishing. (Or to be more precise, I'm super keen to learn about your experiences with subscription self-publishing, and I'm hoping I can return the value in some way. I've been doing skill-building biz books & a bit of textbook stuff.) I'm rob@robfitz.com if it's relevant.

PS. sorry to everyone else for the off-topic!

Re: Using Web Technologies to Print a Book

#46
post #42

You are on linux. You want to typeset a book. Why not use (pdf)LaTeX?

I did that and i didn’t like latex. Especially error messages in case of wrong latex code was extremely unhelpful, pointing to code lines far away from the actual erroneous line. I might be too stupid... but that’s how it felt, and i imagine being able to use simple markdown much more useable.

Everyone always recommends latex, but I always end up spending more time googling cryptic errors that actually writing when using latex. I would not recommend it to a friend.

Re: Using Web Technologies to Print a Book

#48
post #44

Earlier quoted context omitted.

A good question from that gist thread: >Why does markdown do this? If I want two lines to run consecutively I won’t introduce a newline.

A bit of an educated guess but I believe the answer stems from markdown originally targeting terminals, which would line wrap but not word wrap. So you could get ugly output like this: hello, wor ld! (albeit this is assuming the terminal is only 10 characters wide but I hope you get the point) So it used to be common for developers and sysadmins to manually wrap to 80 characters (a habit I still regularly catch mysel…

Wrapping sentences into short functional parts (motivated by more or less arbitrary limits like 80 characters) helps having easily editable and readable text.

Re: Using Web Technologies to Print a Book

#49
post #48
post #44

Earlier quoted context omitted.

A bit of an educated guess but I believe the answer stems from markdown originally targeting terminals, which would line wrap but not word wrap. So you could get ugly output like this: hello, wor ld! (albeit this is assuming the terminal is only 10 characters wide but I hope you get the point) So it used to be common for developers and sysadmins to manually wrap to 80 characters (a habit I still regularly catch mysel…

Wrapping sentences into short functional parts (motivated by more or less arbitrary limits like 80 characters) helps having easily editable and readable text.

Apologies but I'm not sure I understand your point. Are you able to elaborate?

Re: Using Web Technologies to Print a Book

#50
post #32

I clearly missed something, but why are you not going markdown -> PDF directly? That's what we use extensively in our operations playbooks at work and it gives something that looks like I'd get in a book - even more so after I tweaked the templates a little.

I am not aware of any direct Markdown -> PDF converters. What do you have in mind?

pandoc makes use of Latex, which is extremely bulky and brings with it a lot of complexity and idiosyncrasies. I was not able to get anything as nice as a GitHub rendering out of that.

The only alternative I know is using web technologies (chrome headless) to produce a PDF, which is what the author does.

Post reply on HN