693
submitted 4 months ago* (last edited 4 months ago) by renzev@lemmy.world to c/linuxmemes@lemmy.world

Context: LaTeX is a typesetting system. When compiling a document, a lot of really in-depth debugging information is printed, which can be borderline incomprehensible to anyone but LaTeX experts. It can also be a visual hindrance when looking for important information like errors.

you are viewing a single comment's thread
view the rest of the comments
[-] pmk@lemmy.sdf.org 65 points 4 months ago* (last edited 4 months ago)

The reason is that you're reading TeX, not LaTeX. The latter has abstracted away the fundamental building blocks so few people know how an hbox is set anymore. So, an hbox is a box where the content is in horizontal mode. Between the things is glue. Glue can stretch and shrink. Depending on how you have set your tolerance and penalties, there's a maximum percentage of stretch allowed. If the glue stretches more, it becomes bad, this is called badness and can effectively be up to 10000 bad. So why not just put more things into the box? Well, (La)TeX probably tried to do that, but came up with worse badness. TeX always chooses the least bad option on a paragraph level. In practice, the usual suspect is often that you have something else that can't fit the last part of a line, like a really long word. If you can look at it and manually hyphenate it, things might be better.

[-] eager_eagle@lemmy.world 26 points 4 months ago
[-] Treczoks@lemmy.world 8 points 4 months ago

Most probably a narrow column with a word near the end that TeX had problems hyphenating.

A line of text is basically a hbox. The words in this line are fixed in their lenght, so TeX distributes the space between them as evenly as possible to fill this hbox. It has a certain range for the length of a space, and tries to move words or parts of words with hyphenation around to stay in the OK range for the space width. If it can't, it complains about under- or overfull hboxes.

[-] borari@lemmy.dbzer0.com 1 points 4 months ago

I ran into this issue when using code blocks in LaTeX that contained a bash command like ‘echo aBcdEF32… > /var/www/index.php’, where aBcdEF32… was the base64 encoded string of a web shell. I wound up having to set the line break behavior to split on some random letters/numbers to get everything to wrap appropriately, although that was probably some hacky heretical solution.

[-] Treczoks@lemmy.world 4 points 4 months ago

You could have used a thin space every four or eight hex digits, showing that it is not really a space but making it easier to read.

But you cannot blame TeX for not being able to break such a construct.

[-] borari@lemmy.dbzer0.com 2 points 4 months ago

Oh I don’t blame it at all, I totally realize I threw a weird edge case at it! If it sounded like I was slagging TeX I didn’t mean it that way at all.

[-] indianboy42@lemmy.world 5 points 4 months ago

Ironically the tom7 video about it using an AI to rewrite text to look prettier was the first time I learnt what badness and text layout in TeX actually meant.

https://youtu.be/Y65FRxE7uMc

[-] renzev@lemmy.world 2 points 4 months ago

Thank you for this writeup, very informative. I get a lot of these "badness 10000" messages when working with things that have "complex" layouts, for example a resume/CV template. Given that TeX was originally made for research papers/articles, it makes sense that weirdness would arise when it's used for more layout-heavy stuff!

[-] pmk@lemmy.sdf.org 5 points 4 months ago

Badness 10000 usually indicates that something is very wrong. Usually overfull hboxes. If the text is spaced out to the point where it immediately looks bad, that could still be like badness 5000. What I have seen mostly is macros not playing well with other macros, and in LaTeX there's a lot of macros under the hood, so it's very hard to troubleshoot.

this post was submitted on 11 Jul 2024
693 points (100.0% liked)

linuxmemes

21322 readers
816 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack members of the community for any reason.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn. Even if you watch it on a Linux machine.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, and wants to interject for a moment. You can stop now.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't fork-bomb your computer.

    founded 1 year ago
    MODERATORS