0

I'm writing a book using the scrbook class. Every once in awhile, one of the lines ends (or sometimes begins) with a black mark. See this screenshot: Screenshot (The full document can be found here with the LaTeX code found here.)

I thought perhaps there was an unprintable character, but I can't seem to find that in the text that I've written. This happens several times throughout the text and I can't figure out what is happening nor how to fix it. Nothing in the log file immediately jumps out at me.

I don't think this is a problem with scrbook. I'm guessing it's a font problem and I don't know enough about fonts to know how to fix it. It's a space making a line ending. I don't understand why a black mark shows up.

jlconlin
  • 10,172
  • 1
    you get a warning in the log for each such line (overfull hbox on line ...) – David Carlisle Mar 16 '24 at 23:15
  • I do get several message about overfull hbox. I've ignored them because I didn't know what it meant and I didn't make the connection to the black marks. – jlconlin Mar 16 '24 at 23:39
  • https://tex.stackexchange.com/questions/50830/do-i-have-to-care-about-bad-boxes/50850#50850 – David Carlisle Mar 16 '24 at 23:46
  • Your github links retuen page not found! – yannisl Mar 17 '24 at 00:43
  • @yannisl I'm not sure why that is. When using a browser where I've logged into GitHub, the links seem to work. When using a browser where I'm not logged into GitHub, the links do not work. – jlconlin Mar 17 '24 at 00:48
  • it's a private repo, we can't see it, but anyway you should not use external links, the question here is archived forever and the links will change you should make a small 1-paragraph document that shows the problem and add it to the question to reproduce the problem, then people can test answers, – David Carlisle Mar 17 '24 at 01:25
  • In this particular case, you may be able to "cheat" and backspace the footnote marker over the period; a negative thin space may be enough to allow microtype to compress the line enough that the overage isn't noticeable. – barbara beeton Mar 17 '24 at 01:39
  • In this case, since this is your own writing, you could delete the word "two" before "women", and it would probably then be fine. – dedded Mar 17 '24 at 02:11

1 Answers1

2

That is a mark of a overfull line and is shown when you use the draft option.

The meaning is: LaTeX tried to make the line fit in the margins, but was not able to do it at least in a nice way, so a bit of text is protruding outside the margins.

Delete the draft option if you don't want to see them, but I should consider fixing it or at least loading microtype package

Mane32
  • 1,252
  • How would I fix these lines? They are just text. Do I need to help LaTeX know how to break the lines so they don't overflow? – jlconlin Mar 16 '24 at 23:38
  • 2
    try adding \usepackage{microtype} it might be enough as it's not very over-full @jlconlin – David Carlisle Mar 16 '24 at 23:46
  • Alas, @DavidCarlisle, I tried loading the microtype package, but that didn't seem to make much of a difference. I'm still seeing the black marks. Setting draft=false in my \KOMAoptions does remove the black mark. But if it is a problem that needs to be fixed, I want to fix it.

    Thanks for helping out. I've used LaTeX a lot, but have never dug into the guts like this.

    – jlconlin Mar 16 '24 at 23:55
  • @jlconlin even without the black rule the line is clearly over-full, women sticks in to the margin. The first line of a paragraph is always tricky as there is little flexibility, you need to decide what to do. leave it as it is (I wouldn't} surround that paragraph with \begin{sloppypar}..\end{sloppypar} to allow white space to stretch women doesn't hyphenate but you may decide that is better and use wo\-men which might work. In some cases you can re-write to fit but perhaps the words are fixed here..... – David Carlisle Mar 17 '24 at 00:02
  • 1
    The best option is usually to edit the text so the line breaks occur elsewhere (which is why TeX defaults to this behavior). If changing hyphenation points, loading microtype, and other suggestions made above do not fix the overfull hbox, then it sometimes works to change the length of \emergencystretch; I wouldn't advocate setting this in most situations, but it does occasionally allow slightly wider spaces in situations in which they don't actually look incredibly bad but TeX "thinks" they look incredibly bad. – karlh Mar 17 '24 at 00:09
  • I'm afraid microtype won't help much because I'm using XeTeX (I need some fonts on my computer that are not available in LaTeX). The documentation notes that only protrusion is available when using XeTeX. – jlconlin Mar 17 '24 at 00:18
  • 2
    You can use lualatex and still be able to use your system fonts. Furthermore microtype supports more features in lualatex than in xelatex – Mane32 Mar 17 '24 at 00:41
  • You might find a word at the end of the overflow line, or at the end of the previous line, that could be hyphenated but isn't. (I keep a copy of Merriam-Webster's near.) You can add a \- at the potential hyphenation point, and that might enable Latex to solve the problem.

    I 2nd the recommendation of microtype with lualatex, however. It's amazing.

    – dedded Mar 17 '24 at 02:07