Text Formattingcurrent line accessible?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

current line accessible?

Post by Laurentius »

Is the current line accessible in some \box ?
Last edited by cgnieder on Fri Jan 25, 2013 12:16 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

current line accessible?

Post by Stefan Kottwitz »

For what it's desired?

I guess the current line is not easily accessible. However, with LuaTeX you could use a callback such as post_linebreak_filter to get access to the line. It would require to learn and to program a bit of Lua.

Stefan
LaTeX.org admin
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

current line accessible?

Post by cgnieder »

To quote David Carlisle:
Basic answer is no. Donald Arseneau's magaz package goes to heroic lengths to apply different formatting to the first line of a paragraph. [...] doing that for an arbitrary point in the paragraph would be even harder.

[...]

The basic point is that that the entire paragraph is set essentially as a single line, by the time the paragraph breaker is invoked to break the paragraph into lines, all macros (and assignments) have been done. The linebreaker just deals with boxes.

Note luatex provides callbacks that probably invalidate the above answer
Regards
site moderator & package author
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

Re: current line accessible?

Post by Laurentius »

Thanks. What I wanted was an easy way to skip to the next line but continue from the same horizontal position. I know that this is easy to do; I just wondered if there were a (very) simple way to do it, but I suppose there is not.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

current line accessible?

Post by cgnieder »

There might be ways to achieve what you want but it will be much easier to recommend anything if you'd tell us the real use case, i.e. what you are actually trying to typeset.

Regards
site moderator & package author
Post Reply