Maybe I'm just not searching for the right thing, because this seems to be something that TeX would just 'have something' for.
Is there any way to simply return to the left margin (or originating margin, in the case of bidi documents)? I want functionality similar to how \llap behaves when you use it on the start of a line. (This might be a bit of a red herring though, since interfacing with TeX's computed linebreaks is, in my experience, very messy.)
MWE
\documentclass{article}
\newcommand\mystery[1]{%
Should be placed on left margin: \llap{#1}}
\begin{document}
Hello. This is some text to push this out to the side: \mystery{test}
\end{document}
I'd like to be able to put any hbox into \mystery, if possible.
\llapwould print its argument in the left margin. – egreg Jun 21 '14 at 18:21\llapand friends are pretty particular commands. I believe they're mostly equivalent to\makebox[r]{#1}(with[r],[l], and[c]as appropriate) – Sean Allred Jun 21 '14 at 18:23\marginpar, yes, but… I dunno.\marginparI know is a 'floating' thing (sort of) and I think that is the kind of behavior I'm asking for. TeX doesn't know where to put it until it has computed the linebreaks. Is http://tex.stackexchange.com/q/101553 the answer I'm looking for? It just seems… needlessly complicated. – Sean Allred Jun 21 '14 at 18:25eplainimplements index terms in the (right-hand) margin; you might be able to get some ideas there. – barbara beeton Jun 21 '14 at 19:11eplain—thanks:)– Sean Allred Jun 22 '14 at 03:06