I self-published a paperback and eBook using LaTeX and Pandoc
theroadchoseme.com
theroadchoseme.com
On the technical side, it wasn't so straightforward to me to get a good result. In my case, I had to iterate a few times and order a new copy with adjustments to margins, etc. until it looked right.
One issue I didn't manage to solve back then was that the inner margin needs to slightly increase towards the end of the book. That's because the binding is eating up visual space since you can't open the book flat without destroying it. Professional publishing tools do this automatically, but Latex doesn't have an option for it. At least that's how I remember the issue. But maybe things have changed?
My memory is a bit fuzzy about the details, maybe it was about the inner margins of left-hand side and right-hand side changing. Maybe someone else recognises what I mean? :)
Since Latex is very powerful, I'm sure there is a way to code that behaviour in. But I had spent too many hours already on that project and I was happy with the result anyway, so I stopped investigating.
\documentclass[twoside,a4paper,11pt]{article}
Setting it to `oneside` will prevent the inner margins from swapping.I'm curious about the choice of LaTeX. According to the article, it was about controlling the layout. I did something similar [0] a few years ago, but my "stack" was Markdown + Pandoc; converting Markdown directly to an epub with Pandoc was more than enough, but for the paperback version I converted the Pandoc to a LibreOffice document with a custom template; this let me do all the fine-tuning for the styles, paragraph flow, etc.
I wonder if you tried this and decided LaTeX was better, or if you went for LaTeX due to your previous familiarity with it. I have the feeling that for my novel it would have been overkill; did you get most of the value by having precise control of the layout of the images?
(btw, the "Power Move One – Conditionals" anchor seems to be broken)
Don't know about the author, but having written a few lecture notes to be converted to pdf and html, I have found that writing the source document in LaTeX is much more convenient than markdown, especially for math-heavy text. The LaTeX->pdf conversion is natural, and then you can convert easily to html+mathjax using a simple script.
Have had many unsolicited comments from those who have handled/thumbed through it about the high quality of the book (look/layout/feel) - most are surprised that it was not done by a 'big' publishing house. Frankly, my own opinion is that the quality is at least equal, probalby higher, than what is being churned out today by big names today. Part of that is the format/layout as a result of using LaTex, the rest is the physical material characteristics from using an excellent printer. None of that speaks to the actual content, of course :)
I did eventually make a kindle version, unfortunately I do not recall the tool chain used.
Highly recommend Lightning Source (Ingram) for your printing/distribution needs if you are serious about your publication.
The point of OP is that you keep one type of file. Also doing mass edits or source control with office must be a nightmare.
I can’t even imagine how hard it must be to get details right as well. As horrible as latex is, it still gives you much more control.
Eh? With all the great tools and self-publishing options available these days, publishing a book is not a fantastic achievement. In fact, anyone can do it. Writing a book is no achievement either, especially if it is not of great quality. It simply takes a bit of time.
One of the major advantages of LaTeX is that it will fill lines automatically, hyphenating where necessary.
Another important part of type design is flowing paragraphs so that the final line contains enough type. One does not want a paragraph to end with a single “me” by itself on the final line, and ideally you want a substantial amount of type there.
Are these parameterised in LaTeX? Did you turn hyphenation off?
These are known as widows and orphans.
> Cobbler's boy and whore's child (in German Schusterjunge und Hurenkind) [1]
I never forgot these two terms.
What you ideally want is every page with the same number of lines, all the lines having the same offsets (grid), each line filled with the same amount of type when you squint, last lines being not too empty and not too full, and no lone first or last lines. Now, when you do your galley proofs and then just cut the paper every n-th line, chances are there will be some orphans and some widows. It follows from geometrical consideration that one of the mentioned constraints then has to be loosened or given up in order to not have orphaned first and last lines. People nowadays scream when you suggest to just leave it that way but really, you have to have some lines with narrower or wider word spacing, or some pages with more or fewer lines, or some paragraphs with a less-than-ideal choice of hyphenation in order to stretch or squeeze the content so it fits in.
As an example, maybe you have just the letters 'me.' on a paragraph last line, which is bad by itself, and that word appears first thing on a new page. That's double bad and easy to fix, maybe just typeset one of the lines above that a little tighter to make the 'me.' find space on the preceding line. Problem fixed, but the price for that is now your last-of-paragraph line is overly full and it is also the last line on the page, which is... double bad, again, like what you started out with. In this case, maybe increasing spacing in the entire paragraph works out better, giving you an orphaned line all by itself on a new page, but at least it contains another word or two.
But that still doesn't invalidate the fact that it is a sign of poor quality.
The offensive naming is a historical thing. I wouldn't call them that today, but can accept the fact that in times not so long gone by this was quite normal. It is like slave/master in IT terms. A historical technical term that should be replaced nowadays.
Also this tends to be sort of overkill for what most people want so - as with most tech - gotta evaluate if it's worth the time and effort.
This is for straight narratives or non-fiction books. Things with more complex layouts will require more work.
Most of the work in making a book is not in the typesetting.
>No comments about my sed magic please
The commands are fine. Had a doubt if you are using GNU sed or some other flavor since you mention MacOS a few paras earlier. If you are not using GNU implementation, `-i -e` will likely create backup files with `-e` as extension. See [0] for details.
For the Perl command, `-0` option will use ASCII NUL as the record separator. To slurp entire file, pass a value 400 or greater, `-0777` is idiomatically used. If your input doesn't have NUL characters, which is likely the case here, this distinction doesn't play a role.
[0] https://stackoverflow.com/questions/5694228/sed-in-place-fla...
I've done a similar thing wrote about it here: https://pascalprecht.github.io/posts/writing-an-ebook
Instead of using Latex, I went with markdown as the source to generate PDFs, Mobi and Epub from that.
Thanks for sharing your experience!
I guess the trick is to write about something you have a special "qualification" to write so that you are not just writing something that will only sell 100 copies after taking a year of your life!
Being James Patterson would probably be great but it takes time to get the success that then pays for you to sit and churn stuff out at the rate he does! I need to go back to work now...
Congratulations on doing what lots of folks only dream about!
I have been struggling with this and finally got my class to produce possibly PDF/X-4 compatible printable file and PDF/A-2b compatible PDF file for archival purposes.
Maybe the next step is adding epub generation from the same LaTeX source.
I follow your IG and your trip looked like a lot of fun. I dream of the day when my boys will be off at college and I can do something similar. For now, two-week dirt trips every year.
Chris (@desertdefender on the Gram)
Nice to see Chris here too, I wonder how many of us are at the intersection of geekery and overlandery?
LaTeX on the other hand (or more specifically, TeX) is a set of macros that will generate formatting for you. Usually, the output is a DVI file, but can also be a PostScript or PDF file.
LaTeX is all plain text. It only handles document processing, turning the LaTeX document into an outputted formatted document.
Edit: You can still include images etc. Pandoc allows you to convert between LaTeX and many other formats. What you can do with LaTeX is almost limited only by your imagination: https://www.latex-project.org/publications/2020-egreg-TUB-tb...
When I used LaTex for my (sociology of computing) PhD it made it look I'd put far more effort into the document formatting than I actually had.
Seems hard to replicate this approach in word in my experience without good discipline
Use some custom formatting in a paragraph when I should be using a preset default etc
Depends on what you're trying to do. To publish an article or book - no it's not very complicated. There's a vast package ecosystem and knowing where to turn can be daunting, but there is great community documentation out there such as by Overleaf[1] and the community on stack exchange is lively and lovely.
Building your own functionality can be complicated, however partly this comes down to LaTeX being a very different programming paradigm to the conventional C-like languages.
> the ecosystem has badly aged
Care to substantiate?
> you need makefile and docker if you want to do it right, and nobody uses docker
Simply untrue. If you have a setup that warrants more than a conventional setup there are native-LaTeX build tools like arara which are simple to use.[2]
[1] https://www.overleaf.com/learn/latex/Main_Page [2] https://gitlab.com/jm4rc05/arara
And the ecosystem actually is quite good these days. You always had pretty good editor support in the "nerdy" ones, but these days there are also friendlier frontends like Lyx, Texpad, Texstudio or the collaborative web-based Overleaf.
The backend isn't that bad, either. The days of specialized output and font formats are gone, using any system TTF/OTF and producing PDF is easy enough with pdfTeX, luaTeX adds lua-based scripting to that and ConTeXt does all that plus better access to layout primitives and typographical features. And I'm sure the Rust Rewrite Liberation Front is active in TeX, too.
The worst thing in the TeX world, ironically, is documentation. There's a lot of stuff out there that didn't keep up with all the new features and possibilities.
As if any typeface could possibly be superior to Computer Modern Serif.
I wouldn’t say the ecosystem is good. Every time you want to add a new extension you’ll be in a world of pain. I prefer customizing emacs at this point.
what? Just make and the texlive setup.
I you want something bullshit-free, install texlive on slackware, it brings the full setup.
Everything is a pain to do, and I just described the happy path. If you try to do something a little tricky you easily run into incompatible packages wreaking with each other. Word has its shortcomings for sure, but for writing a short paper it’s a magnitude or two more easier and faster (except when a coworker uploaded it in Google Docs with deleted the styles...)
No. Just use unicode.
Also search for errors about missing glyphs in your font.
It supports it fine.
I started learning few weeks ago and now working on two additional documents because I start to understand of how to use it and it become quicker from there. But again every person have a different approach with learning LaTeX.
https://www.thebookdesigner.com/2018/05/selling-out-going-wi...
I'm afraid to read your books because your bravery may inspire me to road trip to Africa.