Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    This is actually a little tricky to do with Lua; see [1] or [2] for solutions to (somewhat) similar problems. Commented Jan 13 at 12:09
  • 1
    @UdiFogiel I think that \framed is just a fancy \hbox; I don't think that it shrinks itself to the size of the content while ignoring trailing whitespace. There might be some key/setting that makes it do this that I'm not aware of though. Commented Jan 13 at 13:01
  • 1
    If I understand well, your second problem is very similar to problem solved by OpTeX trick 0134 which is based on Lua code and LuaTeX. Commented Jan 13 at 16:22
  • 1
    @MaxChernoff see tug.org/TUGboat/tb29-3/tb93hagen-framed.pdf, I was talking about the second example. Commented Jan 13 at 17:34
  • 2
    @UdiFogiel That removes any stretch inside the box, not just the trailing stretch. Try the following (replace the | with newlines for readability): \let|=\relax | \define\content{\llap{\the\hsize\ }a\hskip 0pt plus 10pt a\hskip 0pt plus 10pt} | \setupframed[offset=overlay] | \startTEXpage[offset=1ex, loffset=\widthofstring{000.00000pt}] | \framed{\hbox to 20pt{\content}} | \framed[width=20pt, align=disable]{\content} | \framed[width=20pt, align=disable, autowidth=force]{\content} | \framed[width=fit]{\content} | \stopTEXpage Commented Jan 13 at 21:35