1

Is it possible to detect when LaTeX breaks a long line of text and add some custom behavior to it?

Specifically, If a long sentence breaks, I want to prepend some code to all but the first line, similar to what the listings package provides with postbreak.

I tried hinting where LaTeX should break using discretionary and it works in some cases, but not when I try to prepend the lines with horizontal whitespace. What are the alternatives?

closed as unclear what you're asking by Andrew Swann, user31729, barbara beeton, jub0bs, user13907 Sep 8 '14 at 20:12

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    your question isn't very clear, adding arbitrary material is not really possible unless you take over the line breaking completely but the white space to the left and right of each line is controllable by the paragraph parameters, or the \parshape primitive, or more usually in latex by use of a list environment – David Carlisle Aug 11 '14 at 21:37
  • \parshape looks like the way to go when you want to indent broken lines. I can then add some (non-space) characters using discretionary as I mentioned. This fits my current needs. – neXus Aug 11 '14 at 23:07
  • Using a custom list environment might even be better. But then my problem is that multiple items are allowed on the same line. Only when the line is full, I want the \item commands to include some extra code. – neXus Aug 11 '14 at 23:10

Browse other questions tagged or ask your own question.