[ pdftex-Patches-257 ] Experimental patch for pdftex character protrusion
Patches item #257, was opened at 2005-01-10 21:43 You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=495&aid=257&group_id=106 Category: None Group: Unstable (example) Status: Open Resolution: None Priority: 3 Submitted By: Hartmut Henkel (hhenkel) Assigned to: Nobody (None) Summary: Experimental patch for pdftex character protrusion Initial Comment: Normally items inside a \hbox are not considered for protrusion. With this experimental patch also nested \hboxes at the left and right margin are recursively searched for items with \lpcode or \rpcode, and the outmost containing boxes are protruded correspondingly. This seems to be practical e. g. if an elevated \footnote{foo} (LaTeX) index happens to be at the right margin; in this case the footnote index normally is placed too far inward the line. This disturbance was detected by Peter Muthesius in an de.comp.text.tex news thread "pdfcprot und Ziffern am rechten Rand" started Sat Jan 08 14:05:23 CET 2005. Rough experimental patch, rudimentarily tested with left and right protrusion, see test file xx.tex with output xx.pdf. Just for discussion. No warranty. Have fun! Regards, Hartmut ---------------------------------------------------------------------- You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=495&aid=257&group_id=106
Hi, this is also an observation by Peter Muthesius on de.comp.text.tex: A LaTeX \\ line ending will not get the rightmost character in that line protruded. Reason is that \\ puts a glue_node "width 0pt plus 1fil" at the end of the line, which is not skipped by the cp_skipable macro in hz.ch. Now, should one add also or ((type(#) = glue_node) and (width(glue_ptr(#)) = 0)) to the cp_skipable() macro? Then there would be "correct" protrusion also with lines ended by LaTeX \\. But as the glue provided by \\ has some fil component, this would influence also positioning of text with protrusion component on the line if \hfil is used on the same line. Here some pdfLaTeX example: \documentclass[a4paper]{article} \pdfprotrudechars=1 \tracingall \rpcode\font`\-=1000 \begin{document} Es kommt eine Zeile mit hfil \hfil Ein-\\ \hrule Es kommt eine Zeile mit hfill \hfill Ein-\\ \hrule \pdfprotrudechars=0 Es kommt eine Zeile mit hfil \hfil Ein-\\ \end{document} With normal pdflatex the 2nd "Ein-" will not protrude into the margin, but it would if the above line is inserted in hz.ch. However one sees the side effect, that the positioning of the "Ein-" is affected in the \hfil case, depending on whether protrusion is activated or not. Any idea what would be the right behavior? Regards, Hartmut
Hi, in my opinion we should not change anything to make \\ work with character protrusion. \\ is used to end a line at an arbitrary position, not at the right margin. When one says '...foo\\', he/she doesn't expect that 'foo' ends up exactly at the right margin, but anywhere. In the below case, I think '\break' should be used instead of '\\' Regards, Thanh On Mon, Jan 10, 2005 at 11:52:05PM +0100, Hartmut Henkel wrote:
Hi,
this is also an observation by Peter Muthesius on de.comp.text.tex: A LaTeX \\ line ending will not get the rightmost character in that line protruded. Reason is that \\ puts a glue_node "width 0pt plus 1fil" at the end of the line, which is not skipped by the cp_skipable macro in hz.ch.
Now, should one add also
or ((type(#) = glue_node) and (width(glue_ptr(#)) = 0))
to the cp_skipable() macro? Then there would be "correct" protrusion also with lines ended by LaTeX \\. But as the glue provided by \\ has some fil component, this would influence also positioning of text with protrusion component on the line if \hfil is used on the same line. Here some pdfLaTeX example:
\documentclass[a4paper]{article} \pdfprotrudechars=1 \tracingall \rpcode\font`\-=1000 \begin{document} Es kommt eine Zeile mit hfil \hfil Ein-\\ \hrule Es kommt eine Zeile mit hfill \hfill Ein-\\ \hrule \pdfprotrudechars=0 Es kommt eine Zeile mit hfil \hfil Ein-\\ \end{document}
With normal pdflatex the 2nd "Ein-" will not protrude into the margin, but it would if the above line is inserted in hz.ch. However one sees the side effect, that the positioning of the "Ein-" is affected in the \hfil case, depending on whether protrusion is activated or not.
Any idea what would be the right behavior?
Regards, Hartmut _______________________________________________ ntg-pdftex mailing list ntg-pdftex@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-pdftex
On Mon, 10 Jan 2005, Hartmut Henkel wrote:
Now, should one add also
or ((type(#) = glue_node) and (width(glue_ptr(#)) = 0))
(after having slept over this) it's rubbish as it messes up fil/fill based alignment (could bee seen already in the example). Regards, Hartmut
participants (3)
-
Hartmut Henkel
-
noreply@sarovar.org
-
The Thanh Han