Click here to Skip to main content
15,612,734 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Over the past few months, I have been racking my brain to try and work out how, or even if it is possible to implement tabstops (and I do mean tabstops NOT tables) within lines broken using Knuths line breaking algorithm.

It seems to me that the very nature of the algorithm means that when building a list of boxes, glue and penalties one cannot set a fixed length space that is a known distance from the left margin, rather than a known distance from the previous word.

It is possible with a line by line first fit based libe breaking algorithm, but I cannot see how it is possible with Knuths algorithm.

Any ideas people?
jsolutions_uk 13-Apr-13 17:29pm    
Why downvoted, just interested in what's wrong with the question?
jsolutions_uk 14-Apr-13 3:23am    
I shall just add that I am more than aware of various tabular environments, which are all well and good, but I have a need for old school tabstops where a tab inserted in a paragraph causes the text following it to shift immediately to the position specific and when the line with the tabstop in it reaches the line break it restarts at the beginning of the next line, not at the tabstop position. I hope that makes it a little clearer. I have, of course, tried to argue against such functionality being required, but there are some genuine use cases for it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900