I am getting an unexpected results with framedtexts.Why is the second "centered" not centered? \starttext \startframedtext[left][frame=on,offset=0pt,width=broad] left\hfill \stopframedtext \startframedtext[middle][frame=on,offset=0pt,width=broad] \hfil centered\hfil \stopframedtext \startframedtext[middle][frame=on,offset=0pt,width=broad] \hfill centered\hfill \stopframedtext \startframedtext[right][frame=on,offset=0pt,width=broad] \hfill right \stopframedtext \startframedtext[none][frame=on,offset=0pt,width=broad] none \stopframedtext \stoptext This is LuaTeX, Version beta-0.90.0 (TeX Live 2016) ConTeXt ver: 2016.04.01 13:01 MKIV beta fmt: 2016.4.5 int: english/english Hans van der Meer
On Mon, Apr 11, 2016 at 1:08 PM, Meer, Hans van der
\startframedtext[middle][frame=on,offset=0pt,width=broad] \hfil centered\hfil \stopframedtext \startframedtext[middle][frame=on,offset=0pt,width=broad] \hfill centered\hfill \stopframedtext
One has \hfil with one l and the other has \hfill with two l:s. \hfil with one l seems to produce centering, while \hfill with two l:s makes the text end up on the right. Don't know if this is a feature or a bug, but this is the reason to why those lines differ. Mari
On 11 Apr 2016, at 12:28, Mari Voipio
wrote: On Mon, Apr 11, 2016 at 1:08 PM, Meer, Hans van der
wrote: \startframedtext[middle][frame=on,offset=0pt,width=broad] \hfil centered\hfil \stopframedtext \startframedtext[middle][frame=on,offset=0pt,width=broad] \hfill centered\hfill \stopframedtext
One has \hfil with one l and the other has \hfill with two l:s. \hfil with one l seems to produce centering, while \hfill with two l:s makes the text end up on the right.
Don't know if this is a feature or a bug, but this is the reason to why those lines differ.
Indeed, but that is just what puzzles me and why I posted my question. \hfill is stronger than \hfil and thus it seems all the more strange that the left and right \hfill do not produce the same centering as the \hfil's do. Hans van der Meer
Would it not be better to use ConTeXt alignment, rather than the TeX
primitives \hfil and \hfill?
\starttext
\startframedtext[left][frame=on,offset=0pt,width=broad,align=flushleft]
left
\stopframedtext
\startframedtext[middle][frame=on,offset=0pt,width=broad,align=middle]
centered
\stopframedtext
\startframedtext[right][frame=on,offset=0pt,width=broad,align=flushright]
right
\stopframedtext
\stoptext
On Mon, 11 Apr 2016 13:28:47 +0300
Mari Voipio
On Mon, Apr 11, 2016 at 1:08 PM, Meer, Hans van der
wrote: \startframedtext[middle][frame=on,offset=0pt,width=broad] \hfil centered\hfil \stopframedtext \startframedtext[middle][frame=on,offset=0pt,width=broad] \hfill centered\hfill \stopframedtext
One has \hfil with one l and the other has \hfill with two l:s. \hfil with one l seems to produce centering, while \hfill with two l:s makes the text end up on the right.
Don't know if this is a feature or a bug, but this is the reason to why those lines differ.
On 11 Apr 2016, at 18:13, Alan BRASLAU
On 4/11/2016 6:49 PM, Meer, Hans van der wrote:
On 11 Apr 2016, at 18:13, Alan BRASLAU
mailto:alan.braslau@cea.fr> wrote: Would it not be better to use ConTeXt alignment, rather than the TeX primitives \hfil and \hfill?
\startframedtext[left][frame=on,offset=0pt,width=broad,align=flushleft] left \stopframedtext
Could be of course. But the question is: from where the counterintuitive behavioud of \hfil and \hfil? It is my nature to be not satisfied until I know ;-)
because internally the framed align can inject \hfil \hfill \hss or whatever was decided best ... it's already complex enough to write macros like \framed that adapt to all cases users throw at it so the options (like align) are there for a reason if you don't want that you need to wrap your stuff in a box in which case you can do inside that box what you like Hans (you can use \showmakeup to see what is in a \framed box) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Meer, Hans van der mailto:H.vanderMeer@uva.nl 11. April 2016 um 18:49
Could be of course. But the question is: from where the counterintuitive behavioud of \hfil and \hfil? It is my nature to be not satisfied until I know ;-) It's easy to explain on the following example.
%%%% begin example \starttext \hfil Text\hfil \hfill Text\hfill \stoptext %%%% end example At the end of a paragraph TeX removes the last skip and inserts the \parskipfill [1] value which is by default "0pt plus 1fil". For the first text line this results in the expected output but not for the second line because the inserted "fil" is smaller than the needed "fill". You can check this when you change the \parskipfill stretchability from fil to fill: %%%% begin example \starttext \hfill Text\hfill \start \parfillskip = 0pt plus 1 fill \hfill Text\hfill \par \stop \stoptext %%%% end example [1] https://www.tug.org/utilities/plain/cseq.html#parfillskip-rp Wolfgang
Wolfgang, Hans,
Thanks for your explanations.
Hans van der Meer
On 11 Apr 2016, at 19:10, Wolfgang Schuster
participants (5)
-
Alan BRASLAU
-
Hans Hagen
-
Mari Voipio
-
Meer, Hans van der
-
Wolfgang Schuster