News for hackers. Stuff that matters.
Re:TeX Live 2017 released by kstenerud on Saturday June 03, 2017 @09:21PM (#14479433)
I've given up on tex. I'm typesetting a book right now, and getting the epub going was a piece of cake. Then I tried using LibreOffice for the print version and it was a nightmare to control via the API and buggy as hell. So I decided now would be a good time to try tex. After 2 solid days of yak shaving, I threw in the towel. It's too fragmented, the documentation is terrible (complete - all 600 pages worth, but terrible for discovery or learning). It's basically rabbit hole after rabbit hole, with most, if not all, tutorials directed towards typesetting your homework assignments.

All of the CSS/HTML based solutions cost thousands per license, so that's out.

I'm now on to SILE, which fixes a lot of problems with tex. I can only hope that it's advanced enough to properly typeset a novel.

Re:TeX Live 2017 released by radarsat1 on Saturday June 03, 2017 @09:26PM (#14479453)
I ask this as a totally naive person regarding novels and publishing, but who is fairly happy with writing papers in Latex: what is difficult about typesetting a novel? I ask because I would think that novels would be on the easier end of typesetting situations, but clearly your experience is different.. I just can't imagine what you are struggling with. I've "typeset" many novels by converting them from text formats to latex for the purpose of reading on my e-reader and haven't had many difficulties other than dealing with unsupported character encodings. Of course I can imagine that the professional situation is quite difficult, but I'm surprised it's so different. Care to share details of the trouble you had?
Re:TeX Live 2017 released by pmoriarty on Saturday June 03, 2017 @11:34PM (#14479765)
I've typeset novels, technical manuals, math, poetry, articles, chess diagrams, posters, presentations, my resume, and probably a bunch of other things in LaTeX. It wasn't a big deal, though it's definitely a rabbit hole in terms of the amount of tweaking that's required if you want everything just right, if you're doing something fancy, and if what you're doing doesn't quite fit any of the many pre-written templates. The great thing, though, is that once you've tweaked one document the way you like it, now you've got a template to use for documents of the same type, which should only require minor tweaking in the future.

There's definitely a learning curve to LaTeX, but not a huge one, as it's mostly just a markup language. If you want to get in to the programming side of it, or if you want to learn one of the larger LaTeX packages really well, that would take you more time, but not even then it shouldn't scare anyone, particularly if you've learned other high level programming languages before. Diving in to TeX itself could be a different story, but I can't comment since I've never bothered to learn it myself, and haven't had to for anything that I've done with LaTeX.

Re:TeX Live 2017 released by jacobolus on Sunday June 04, 2017 @02:53AM (#14480207)
Anyone who wants everything “just right” and is particular about what that means – and doesn’t have to make more than 2 documents in a particular template (or maybe even if they do) – should just start with InDesign, and save hours of trouble.

Where LaTeX shines is for cases where you don’t really care about the details of the layout, but just want someone else to handle it all in a somewhat sensible way when you hand them a basic manuscript, and not shit all over itself the way MS Word does on a regular basis.

LaTeX is great for generic college papers where you don’t have figures and don’t have time to worry about the layout. By contrast it’s a huge pain in the butt for something like magazines, coffee-table books, or posters.

(It’s also the best way to typeset mathematical formulas, of course.)

Re:TeX Live 2017 released by posterboy on Sunday June 04, 2017 @12:48PM (#14482328)
That doesn't answer the question. To me as a common reader, the typesetting of a novel requires in no particular order

- nice block text adjustment, line-breaks and hyphenation, line/paragraph,chapter spacing

- margins and padding, page numbers, and chapter headings

- font selection, supporting ligatures and kerning if you are fancy

I'm sure the devil is in the details, but how much detail can there be in basic running text? I'm fine reading novels rendered by basic html engines without css, even in monospaced font. The most important consideration for a text layout engine seems to be the font data format and corresponding font engine, which I don't know much about, because I don't really care.

Re:TeX Live 2017 released by xvilka on Sunday June 04, 2017 @08:34AM (#14481194)
Well, for doing fancy stuff including complex programming macroses LuaTeX suits much better these days.
Re:TeX Live 2017 released by kstenerud on Saturday June 03, 2017 @09:34PM (#14479479)
Getting otf fonts working, getting images working and properly positioned, getting alternating left-right headers to behave themselves, especially at a chapter start. Every new thing involved going back to ctan (I had high hopes for memoir) or searching online in the hopes that someone took the time to write down how they did it. Most of the time you'd just find "how to make your math formulas look pretty" or "how to typeset your thesis"

You'd think that typesetting a novel would be a gimme, but in the current ecosystem (tex or otherwise) it's a shambles.

Re:TeX Live 2017 released by stephen_g on Saturday June 03, 2017 @10:37PM (#14479625)
OTF is dead easy if you use XeTeX (specifically the xelatex command). The fancyhdr should give enough control over headers. Yeah, floating images can be annoying.

I use it mainly for technical documentation (product manuals, etc.), so I've never tried the memoir class. But what I find myself doing mostly these days is makinng my own classes, usually based on article because it seems to me to have the most 'neutral' defaults.

It's a very steep learning curve, but I've found it an extremely valuable technology to be able to use.

Asking questions on the TeX stack overflow is a pretty good way to get help also.

Re:TeX Live 2017 released by marvy on Sunday June 04, 2017 @12:42PM (#14482310)
I agree with the last point: asking questions on tex.stackexchange is a GREAT way to get help. Sometimes you run into an "impossible" problem and some wizard will show up and fix it in minutes.
Re:TeX Live 2017 released by dbrgn on Monday June 05, 2017 @07:27AM (#14486796)
XeTeX and the KOMA document classes really bring you a long way.
Re:TeX Live 2017 released by jkn on Sunday June 04, 2017 @04:21AM (#14480398)
I'm typesetting a series of novels with LaTeX and memoir and I share your pain. I didn't have much trouble with fonts (fontspec is pretty awesome compared to the old TeX way), but things like typesetting on a grid, that was difficult.

I'm now reading on ConTeXt and it seems to be a much more adequate TeX format. For one thing, it supports grid typesetting! LaTeX's philosophy is to separate style and content, leaving the style to "someone else". It seems that ConTeXt's philosophy is to separate style and content, but still make it easy for the user to choose the style. It's also more integrated: comprehensive core, few third-party packages, meaning less compatibility issues (but less choice too). I'll definitely try it for my next project.

Re:TeX Live 2017 released by radarsat1 on Sunday June 04, 2017 @02:40PM (#14482830)
> typesetting on a grid

what does this mean? I haven't seen that term before. I assume it's nothing to do with tables..

Re:TeX Live 2017 released by jkn on Sunday June 04, 2017 @04:16PM (#14483275)
The main idea is to have every line of text fall on an evenly spaced grid. Here's an example where the middle paragraph is not grid aligned: https://i.stack.imgur.com/XskJu.png

Generally you also want the baseline of titles to fall on the grid. Possibly also the formulas, figures etc.

LaTeX is pretty bad at this: by default it inserts stretchable vertical space between paragraphs, and around things like bullet lists, centered text and formulas.

Stretchable space is a good thing when you have a lot of elements beside simple paragraphs: it gives TeX flexibility to produce a nice page layout. For example the optimal spacing around equations might not be a multiple of the inter-line space. And you might still want to have the last line land precisely at the bottom of the page, so there must be a stretchable space somewhere. This flexibility also helps avoiding widows and orphans[1].

On the other hand I think non-grid-aligned text looks terrible for novels, especially when the page is thin and you can see through the paper the text on the other side (it's much less noticeable if the lines on both sides are perfectly aligned). Grid typesetting is also nice when you have multiple columns of text on the same page: it looks odd if the lines of one column are not aligned with those in the next column.

[1] https://en.wikipedia.org/wiki/Widows_and_orphans

Re:TeX Live 2017 released by posterboy on Sunday June 04, 2017 @12:53PM (#14482350)
I have round about never seen images in a novel, but every other novel mentioned on HN seems to have images.
Re:TeX Live 2017 released by radarsat1 on Saturday June 03, 2017 @11:05PM (#14479709)
Hm. Font stuff I'm not surprised, fonts can be tricky especially in Latex, you're definitely right. Bit surprised images were difficult. I guess I haven't had to deal much with margin and header issues. fancyhdr can certainly be confusing. Did you try "lyx"? I guess for what it does help with, it might not actually make any of these particular issues easier..

Of course, it's all about using a good template. Usually I find there are tons of resources out there, but it does often involve finding someone with the same problem and asking the right question.

Re:TeX Live 2017 released by chrisanthropic on Saturday June 03, 2017 @09:34PM (#14479475)
I wrote a free tool a bit ago that wraps Pandoc/LaTeX/Jekyll and takes Markdown inputs and exports epub, mobi, and print-ready PDFs (5x8 & 6x9 Pdfx-1a compliant), specifically for fiction.

You can check out the LaTeX template in the repo.

http://chrisanthropic.github.io/Open-Publisher-Documentation...

Re:TeX Live 2017 released by homarp on Sunday June 04, 2017 @12:37AM (#14479903)
you should add a LICENSE or LICENSE.txt file
Re:TeX Live 2017 released by chrisanthropic on Sunday June 04, 2017 @05:52PM (#14483757)
done, MIT license added.
Re:TeX Live 2017 released by svat on Saturday June 03, 2017 @11:35PM (#14479768)
What 600-page documentation are you referring to? The TeXbook by Knuth goes only up to page 483 (with the appendixes starting on page 304).

By the way, a really excellent book for (plain) TeX is A Beginner's Book of TeX by Seroul and Levy: it's truly for the beginner, yet at the end you'll be practically an expert, or at least know how to become one.

I've seen people get frustrated with LaTeX (not TeX), but that's because it was designed to make it difficult to do typesetting: instead the LaTeX philosophy is to specify only the document structure, and leave all the typesetting to a package that you hope someone has written.

Re:TeX Live 2017 released by Crontab on Sunday June 04, 2017 @12:17AM (#14479858)
Your comment is interesting to me. I've read about TeX and LaTeX from time to time and it was my impression that everyone used LaTeX because TeX itself was difficult to use. And I never questioned this because almost every article I could find only spoke about LaTeX.

Your comment is making me reevaluate what I thought I understood.

Re:TeX Live 2017 released by svat on Sunday June 04, 2017 @01:59AM (#14480085)
Yes, an overwhelming majority use LaTeX rather than TeX directly. (Well, among the tiny number of people who use TeX/LaTeX at all.) The reason, though, is not that TeX is difficult to use: it's that TeX is a system for typesetting, and most people don't need typesetting.

If you're writing a paper for publication in a journal, they probably have their own typesetting style. With LaTeX you can just specify your paper as a sequence of paragraphs, "sections", a title, an author, and so on, and, by including the journal's style file (assuming it's good), your paper will come out typeset in that journal's style. This philosophy is explained at https://www.latex-project.org/about/

This is great for certain (many) kinds of documents. The problem with this, though, is that the moment you want to change the appearance and get into typesetting yourself, you're fighting a system that was actively designed to prevent you from doing this.

An analogy may be a system like, say, WordPress: if what you have is a blog, then it would work for you, and you even get to choose one of several “themes” that others have written, and so on. The set of available plugins and customizations can even be impressively versatile (for example, I noticed that time.com runs on WordPress, and apparently so do a number of other non-blog sites: https://vip.wordpress.com/clients/). But ultimately, if you're trying to figure it out by yourself and have your own ideas about what your website should look like, a system like this will always be more frustrating than the alternative (of having full control).

TeX is not difficult to use, though in the beginning you'd have to specify manually things like the typesetting of the document title (put it in a bold font at 16pt, centered on a line...). LaTeX has features to automate many such common typesettings tasks, but it has its own flaws (some stemming from the fact that it's implemented using TeX macros, which weren't designed for such heavy “programming”).

Re:TeX Live 2017 released by xoroshiro on Sunday June 04, 2017 @07:38PM (#14484338)
I've never needed to use it much, but when I do, it's mostly copy paste, crappy hacks, or video 'tutorials' of LaTeX. Now I'm genuinely curious what vanilla TeX looks like. Any good learning resources?
Re:TeX Live 2017 released by svat on Monday June 05, 2017 @12:49AM (#14485311)
Sure: The book I mentioned earlier (A Beginner's Book of TeX by Seroul and Levy) is my favourite learning resource. You may able to find it in a library, or wherever you look for books. (There are other books available for free online, such as A Gentle Introduction to TeX (http://texdoc.net/texmf-dist/doc/plain/gentle/gentle.pdf) and TeX for the Impatient (http://mirrors.ctan.org/info/impatient/book.pdf).)

If all you have is a passing curiosity though, you may just want to look at some examples: Knuth has .tex sources of some of his papers on his website (https://cs.stanford.edu/~knuth/preprints.html); you can look at them and compare with the resulting PDF files (which you can generate with `pdftex`). For an already typeset example, look at JRM2680.tex (https://cs.stanford.edu/~knuth/papers/JRM2680.tex) and JRM2680.pdf (https://cs.stanford.edu/~knuth/papers/JRM2680.pdf).

Re:TeX Live 2017 released by TylerE on Sunday June 04, 2017 @12:41AM (#14479914)
TeX is basically a much lower level formatting system.

You don't say "make a heading", you say "make this text in 14pt font, bold, with this much extra vertical space.

Re:TeX Live 2017 released by posterboy on Sunday June 04, 2017 @12:57PM (#14482365)
No, if you did that instead of defining a macro, it would be your own fault.
Re:TeX Live 2017 released by taeric on Sunday June 04, 2017 @12:29AM (#14479881)
People use LaTeX because it already does a lot of what people want to do. More, it was also one of the first standard ways of packaging extensions for TeX. (I may be wrong on that point...)

Folks are also highly scared off of TeX due to some of its aesthetic nature. Specifically, it looks rather different than most modern languages.

That said, I think most of that fear is unfounded and I regret that I let it keep me from learning this while in college.

Re:TeX Live 2017 released by petters on Sunday June 04, 2017 @01:49AM (#14480065)
Two days? I wrote my thesis in Tex and i probably spent two weeks! But the end result was typographically great! When you're in academia, you can afford to spend that time. These days, it's all Google Docs for me.

I've had complete strangers email me with Tex questions just from encountering my thesis.

The community on Stack Exchange was very helpful for me.

Re:TeX Live 2017 released by whyenot on Saturday June 03, 2017 @10:17PM (#14479571)
I found the memoir class frustrating to use when I was writing a technical manuscript (a botanical flora). It's great if you are willing to accept the defaults, but if you want to change things, the documentation is actually pretty spare. You can waste hours or even days tweaking and rebuilding your document to have it formatted the way you would like -- tasks that could be done in a lot less time in graphical page layout software like InDesign. I ended up composing my work in Word and then importing it into InDesign. That was a lot more satisfying than using latex for me, for writing that is not math heavy.
Re:TeX Live 2017 released by Kootle on Saturday June 03, 2017 @09:34PM (#14479478)
Have you seen the KOMA-script or memoir latex classes? They are very suited for typesetting books and have great documentation.
Re:TeX Live 2017 released by lottin on Sunday June 04, 2017 @04:06AM (#14480371)
It doesn't help either that all the basic references are in the form of books. Finding the relevant bits of information can take a long time. Besides documentation, another of TeX's weaknesses is its lack of debugging capabilities, which makes it really hard to figure out what goes on behind the scenes.
Re:TeX Live 2017 released by xname2 on Saturday June 03, 2017 @09:28PM (#14479459)
You can try bookdown.