(ConTeXt LMTX 2024, monospace font) Why does monospaced text go out of the margin for me? is this supposed to happen?
https://pastebin.com/2ce1xSYf The code linked above has 3 paragraphs. One in TImes New Roman, the other in Aptos and the last in Aptos Mono. The paragraph with \tt seems to go over my margin of .5 inches for the left and right side of my doc., but the serif and sans serif text doesn't. I can't seem to figure out why exactly this is. Did I set up \setuplayout incorrectly? I wanted .5in margins but I kind of 'hacked' the way I got things. Is there a better way that I could have gotten .5 inch margins and a.5in header/footer? I can't seem to understand why the output is what it is. I would greatly appreciate any help! Feel free to switch out the fonts if you'd like
Felix schrieb am 14.09.2024 um 06:40:
The code linked above has 3 paragraphs. One in TImes New Roman, the other in Aptos and the last in Aptos Mono.
The paragraph with \tt seems to go over my margin of .5 inches for the left and right side of my doc., but the serif and sans serif text doesn't. I can't seem to figure out why exactly this is.
Did I set up \setuplayout incorrectly? I wanted .5in margins but I kind of 'hacked' the way I got things. Is there a better way that I could have gotten .5 inch margins and a.5in header/footer? I can't seem to understand why the output is what it is. I would greatly appreciate any help!
Feel free to switch out the fonts if you'd like
You're trying to justify a text with a fixed width font which fails because the often have a fixed width space. When you have a space a fixed width TeX can stretch or shrink the space between the word to align them with the right margin. The best solution is to disable justification and use ragged text on the right side. An alternative is to allow bigger spaces between words but as you can see in the following example the gaps between words can be quite large. %%%% begin example \showframe \setupbodyfont[tt] \starttext \samplefile{zapf} \blank \start \setuptolerance[space] \samplefile{zapf} \par \stop \stoptext %%%% end example Wolfgang
participants (2)
-
Felix
-
Wolfgang Schuster