News for hackers. Stuff that matters.
Re:Learnlatex.org: A place to learn LaTeX online by leephillips on Wednesday March 17, 2021 @08:29PM (#26498507)
“typesetting is handled in such a way that the kerning around things like hyphens is broken”

Can you give more details about this? I’ve never heard this complaint before, nor noticed this myself.

Also, I’m not sure I understand what you are saying about “LaTeX editors”; I use Vim, and it works quite well.

Re:Learnlatex.org: A place to learn LaTeX online by spekcular on Wednesday March 17, 2021 @10:00PM (#26499019)
The issue that immediately came to mind was that if you change the kerning settings, then you can't input em dashes as --- anymore. See, for example, this Tex.SE question: https://tex.stackexchange.com/questions/315822/unwanted-kern....

But after a while I remembered the more fundamental point that bothered me:

> one might add that it's not just microtype that doesn't offer optical kerning -- it's structural limitations in TeX's typesetting that prevent it. To TeX, each glyph is contained inside a (I guess: black) box. TeX knows the outer dimensions of those boxes, but has no clue (and doesn't care) about what the glyph looks like that's inside it.

https://tex.stackexchange.com/questions/139926/optical-kerni...

And this led to bad spacing for hyphens, which led to me experimenting with manual kerning, which led to the issue that I recalled first.

Also, I am not really convinced of the merits of Vim for LaTeX. Most of my time writing is spent revising, which requires a lot of "random access edits," and I'm at least twice as fast at jumping to arbitrary locations on screen using a mouse as I am with vim (even with the usual tricks).

(I tend to think of vim as something that was purpose-built for programming in C and with usefulness inversely proportional to how far a given task is from that purpose. While I realize that's not entirely accurate, I've found it a good heuristic. Programming: vim works decently for me. General purpose writing: not so much.)

Further, the ability to control-click .pdfs and skip to the corresponding place in the .tex file, and vice versa, is an amazing convenience. I understand that there are technically ways to do this in vim, but then at that point I'm using the mouse a ton anyway and I don't really see the point of vim (which is usually proposed to be "hands don't go off keyboard = write faster" in my experience).

So, yes, I could survive if forced to use vim. I just wouldn't like it.

Given this, and given I feel I'm much more willing to experiment with these things than the average person writing papers in the physical sciences. I can't even imagine how the conversation would go if I tried to tell my 72-year-old advisor that TeXShop's not going to work anymore because he updated his computer and it's time to get friendly with the command line. These people want to do science, they don't want to learn vim shortcuts.

Re:Learnlatex.org: A place to learn LaTeX online by drfuchs on Wednesday March 17, 2021 @11:16PM (#26499395)
TeX finds out about character widths and kerning pairs and ligature replacements from outside of TeX itself. TeX is perfectly happy to ligature together "--" into an en-dash, and "---" into an em-dash, and to then kern either one of them with whatever characters you like, if instructed to do so by these externally-supplied per-font instructions. So, it seems like you're being troubled by the externally-provided font info rather than any limitation of TeX per se.

Boring details: TeX, as it comes from Knuth, reads TFM ("TeX Font Metric") files to supply this per-font information. Knuth's Computer Modern fonts do not contain any kerning pairs that contain dash characters, which one may be pleased or displeased about. Various enhanced-TeXs get font info from the OS or perhaps directly from, say, OpenType font files. If the ligature and kern info isn't passed into TeX from there properly, or doesn't exist in the font itself, then of course you won't get the results you're looking for.

Re:Learnlatex.org: A place to learn LaTeX online by spekcular on Wednesday March 17, 2021 @11:37PM (#26499486)
Yes, but there's no way to get optical kerning, right?
Re:Learnlatex.org: A place to learn LaTeX online by drfuchs on Thursday March 18, 2021 @01:06AM (#26499832)
Arguably, there is no algorithmic way to compute high-quality kerning based on character shapes (just as there's no way to determine, say, character width just from an outline). If there were, then Apple would build it into MacOS and iOS, and Microsoft would build it into Windows, and Google would build it into Android, and then all applications from TextEdit to Word, Safari to Chrome, and troff to TeX would automatically get told about these synthetic kerning pairs, and use them by default.

That said, Adobe does have a proprietary optical kerning scheme that they use in their applications. But it's turned off by default (hint, hint), and their documentation is a bit defensive about it: "Optical kerning adjusts the spacing between adjacent characters based on their shapes, and is optimized for use with Roman glyphs. Some fonts include robust kern-pair specifications. However, when a font includes only minimal built-in kerning or none at all, or if you use two different typefaces or sizes in one or more words on a line, you may want to use the optical kerning option for the Roman text in your document." Loosely translated: Fonts from real type foundries have kerning pairs carefully created by their designers; if you have slap-dash one where they didn't bother, we'll do the best we can if you want. YMMV.

Re:Learnlatex.org: A place to learn LaTeX online by leephillips on Wednesday March 17, 2021 @11:56PM (#26499553)
I think this information would be built in to any high-quality font. As drfuchs tried to explain, TeX has no information about letterforms; that’s not its job.
Re:Learnlatex.org: A place to learn LaTeX online by cycomanic on Thursday March 18, 2021 @04:50AM (#26500707)
> Also, I am not really convinced of the merits of Vim for LaTeX. Most of my time writing is spent revising, which requires a lot of "random access edits," and I'm at least twice as fast at jumping to arbitrary locations on screen using a mouse as I am with vim (even with the usual tricks).

> (I tend to think of vim as something that was purpose-built for programming in C and with usefulness inversely proportional to how far a given task is from that purpose. While I realize that's not entirely accurate, I've found it a good heuristic. Programming: vim works decently for me. General purpose writing: not so much.)

I don't want to comment on the kerning stuff (I don't really know much about it). However, I found your comment about the merits of vim when revising interesting. Like you, I spend most of my time writing revising/correcting (often other peoples work), however my take on vim is just the other way around.

If I write a large text myself, it doesn't really matter what editor I use, it's when I revise/correct things that I love using vim. While you might be correct that you would be quicker to move to the appropriate spot using a mouse, I pretty much guarantee that all the gain is gone when you have to switch back to the keyboard to do your change. That's why I love vim for these kind of tasks, the moving and changing of specific text is such a seemless experience without even having to change the hand position on the keyboard. My productivity absolutely plummets every time I have to use word or some other editor for these sort of tasks.

Re:Learnlatex.org: A place to learn LaTeX online by spekcular on Thursday March 18, 2021 @08:48AM (#26502108)
> While you might be correct that you would be quicker to move to the appropriate spot using a mouse, I pretty much guarantee that all the gain is gone when you have to switch back to the keyboard to do your change.

I see! What I didn't say is that I'm working on a laptop, so the trackpad to keyboard distance is negligible – it's essentially just another big key. All I have to do is pivot my hand.