I seem to have a problem with alignment in \framed; these are small examples with there outcome: \leftaligned{\framed[width=4cm,align=no]{xyz} "no" comes out to the left} \leftaligned{\framed[width=4cm,align=no]{\hfil xyz} "no" comes out in the middle} \leftaligned{\framed[width=4cm,align=middle]{\hfil xyz} "middle" comes out to the right} \leftaligned{\framed[width=4cm,align=right]{\hfil xyz} "right" comes out in the middle} \leftaligned{\framed[width=4cm,align=right]{xyz} "right" comes out to the left} I get the impression that although "align=no", there still is a \hfil put in at the right. Searched through the sources, especially core-rule.tex but could not find the right place; it is fairly complicated code, isn't it? Using \hfill to force the alignment is not an option, because I need that for overriding the alignment when using these alignments in macros. I would like very much to have "align=no" putting no glue, neither to the right nor to the left, thus making it different from "align=right". If I am right: 1. can someone point me to the point in the source where I can change things for the moment? 2. will this be changed then in the next release? Hans van der Meer
Hans van der Meer wrote:
I get the impression that although "align=no", there still is a \hfil put in at the right.
Yes, but it is an implied fil, from \parfillskip. Because you limited the width of the \framed, it is processed in vertical mode, so \parfillskip is added to the end of the paragraph. This should help: \unprotect % for core-spa.tex \setvalue{\@@ragged@@command\v!disable}% {\appendtoks \raggedright \parfillskip\zeropoint \to\everyraggedcommand} \protect \starttext \framed[width=4cm,align=disable] {\hfil xyz} \stoptext Greetings, Taco
Taco Hoekwater wrote:
Hans van der Meer wrote:
I get the impression that although "align=no", there still is a \hfil put in at the right.
Yes, but it is an implied fil, from \parfillskip. Because you limited the width of the \framed, it is processed in vertical mode, so \parfillskip is added to the end of the paragraph.
This should help:
\unprotect % for core-spa.tex \setvalue{\@@ragged@@command\v!disable}% {\appendtoks \raggedright \parfillskip\zeropoint \to\everyraggedcommand} \protect
\starttext \framed[width=4cm,align=disable] {\hfil xyz} \stoptext
ah, i missed that mail -) let me think a while about that keyword (btw, {line,right} is somehow broken) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Jun 28, 2006, at 17:45, Taco Hoekwater wrote:
Hans van der Meer wrote:
I get the impression that although "align=no", there still is a \hfil put in at the right.
Yes, but it is an implied fil, from \parfillskip. Because you limited the width of the \framed, it is processed in vertical mode, so \parfillskip is added to the end of the paragraph.
This should help:
\unprotect % for core-spa.tex \setvalue{\@@ragged@@command\v!disable}% {\appendtoks \raggedright \parfillskip\zeropoint \to\everyraggedcommand} \protect
\starttext \framed[width=4cm,align=disable] {\hfil xyz} \stoptext
Thanks. I installed it and it works. Witness the examples below. Will this be installed in next ConTeXt versions? I would be grateful. One question of naming: I think "none" is a better descriptive name then "disable" \leftaligned{\framed[width=4cm,align=no]{xyz} "no" comes out to the left} \leftaligned{\framed[width=4cm,align=no]{\hfil xyz} "no+hfil" comes out in the middle} \leftaligned{\framed[width=4cm,align=no]{\hfil xyz\hfil} "no+hfil +hfil" comes out left of the middle} \leftaligned{\framed[width=4cm,align=none]{xyz} "none" comes out to the left} \leftaligned{\framed[width=4cm,align=none]{\hfil xyz} "none+hfil" comes out to the right} \leftaligned{\framed[width=4cm,align=none]{\hfil xyz\hfil} "none+hfil +hfil" comes out in the middle} Hans van der Meer
Hans van der Meer wrote:
On Jun 28, 2006, at 17:45, Taco Hoekwater wrote:
Hans van der Meer wrote:
I get the impression that although "align=no", there still is a \hfil put in at the right.
Yes, but it is an implied fil, from \parfillskip. Because you limited the width of the \framed, it is processed in vertical mode, so \parfillskip is added to the end of the paragraph.
This should help:
\unprotect % for core-spa.tex \setvalue{\@@ragged@@command\v!disable}% {\appendtoks \raggedright \parfillskip\zeropoint \to\everyraggedcommand} \protect
\starttext \framed[width=4cm,align=disable] {\hfil xyz} \stoptext
Thanks. I installed it and it works. Witness the examples below. Will this be installed in next ConTeXt versions? I would be grateful. One question of naming: I think "none" is a better descriptive name then "disable"
other keywords are already taken Hans -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Jun 29, 2006, at 13:53, Hans Hagen wrote:
Thanks. I installed it and it works. Witness the examples below. Will this be installed in next ConTeXt versions? I would be grateful. One question of naming: I think "none" is a better descriptive name then "disable"
other keywords are already taken
A pity, but I think one could live with that. From your reply I infer that the next ConTeXt release will contain this option. If not expressis verbis denied, I will count on it. Hans van der Meer
On Jun 29, 2006, at 17:16, Hans van der Meer wrote:
On Jun 29, 2006, at 13:53, Hans Hagen wrote:
Thanks. I installed it and it works. Witness the examples below. Will this be installed in next ConTeXt versions? I would be grateful. One question of naming: I think "none" is a better descriptive name then "disable"
other keywords are already taken
A pity, but I think one could live with that. From your reply I infer that the next ConTeXt release will contain this option. If not expressis verbis denied, I will count on it.
I am afraid I was too optimistic here. 1. the keyword "disable" seems already been taken in relation to \blanksdisabletrue in core-spa.tex. I changed it to the unused "disabled" in order to experiment without interference. 2. the solution given by Taco was: % added (Taco Hoekwater 2006-06-28) \def\v!disabled{disabled} \setvalue{\@@ragged@@command\v!disabled}% {\appendtoks \raggedright \parfillskip\zeropoint \to\everyraggedcommand} There must be another interference here, because surprisingly this silently changes the default alignment in vertical sense to "high". The code below shows it in the leftmost box, that I added to the previous examples that Hans Hagen has sent back. 3. Alignment in these examples is not correct. I add some \hfil's to show that. In the combination {disable,lohi} somehow the horizontal alignment change from the disable is killed by the lohi. The order {lohi,disabled} or {disabled,lohi} has no effect. I looked into cor- spa.tex but could not figure out how setting top and bottom vglue could re-enable the old parfillskip value. I did add the parfillskip= \zeropoint code to lohi/high/low but could not get a good result. Do you mind looking further into this? It would be much nicer if horizontal and vertical alignment could behave orthogonal to each other, instead of having some seemingly complex interdepency. \hbox{% \vbox{\vskip5mm\framed [frame=on,strut=no,align=disabled,width=1cm,height=2cm,offset=0pt]% {\framed[frame=on,strut=no,offset=0pt]{lp}}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,strut=no,align= {disable,high},width=1cm,height=2cm,offset=0pt]% {\framed[frame=on,strut=no,offset=0pt]{l}\hfil}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,strut=no,align= {disable,low},width=1cm,height=2cm,offset=0pt]% {\hfil\framed[frame=on,strut=no,offset=0pt]{c}\hfil}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,strut=no,align= {disable,lohi},width=1cm,height=2cm,offset=0pt]% {\hfil\framed[frame=on,strut=no,offset=0pt]{r}}\vskip5mm}% } Hans van der Meer
Hans van der Meer wrote:
On Jun 29, 2006, at 17:16, Hans van der Meer wrote:
On Jun 29, 2006, at 13:53, Hans Hagen wrote:
Thanks. I installed it and it works. Witness the examples below. Will this be installed in next ConTeXt versions? I would be grateful. One question of naming: I think "none" is a better descriptive name then "disable"
other keywords are already taken
A pity, but I think one could live with that. From your reply I infer that the next ConTeXt release will contain this option. If not expressis verbis denied, I will count on it.
I am afraid I was too optimistic here.
1. the keyword "disable" seems already been taken in relation to \blanksdisabletrue in core-spa.tex. I changed it to the unused "disabled" in order to experiment without interference.
blank has its own namespace, so there cannot be interference
2. the solution given by Taco was: % added (Taco Hoekwater 2006-06-28) \def\v!disabled{disabled} \setvalue{\@@ragged@@command\v!disabled}% {\appendtoks \raggedright \parfillskip\zeropoint \to\everyraggedcommand} There must be another interference here, because surprisingly this silently changes the default alignment in vertical sense to "high". The code below shows it in the leftmost box, that I added to the previous examples that Hans Hagen has sent back.
it depends ... align={disable,high} (or whatever combination wanted)
3. Alignment in these examples is not correct. I add some \hfil's to show that. In the combination {disable,lohi} somehow the horizontal alignment change from the disable is killed by the lohi. The order {lohi,disabled} or {disabled,lohi} has no effect. I looked into cor- spa.tex but could not figure out how setting top and bottom vglue could re-enable the old parfillskip value. I did add the parfillskip= \zeropoint code to lohi/high/low but could not get a good result.
Do you mind looking further into this? It would be much nicer if horizontal and vertical alignment could behave orthogonal to each other, instead of having some seemingly complex interdepency.
\hbox{% \vbox{\vskip5mm\framed [frame=on,strut=no,align=disabled,width=1cm,height=2cm,offset=0pt]% {\framed[frame=on,strut=no,offset=0pt]{lp}}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,strut=no,align= {disable,high},width=1cm,height=2cm,offset=0pt]% {\framed[frame=on,strut=no,offset=0pt]{l}\hfil}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,strut=no,align= {disable,low},width=1cm,height=2cm,offset=0pt]% {\hfil\framed[frame=on,strut=no,offset=0pt]{c}\hfil}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,strut=no,align= {disable,lohi},width=1cm,height=2cm,offset=0pt]% {\hfil\framed[frame=on,strut=no,offset=0pt]{r}}\vskip5mm}% }
according to taco (sitting next to me): tex removes the last hfil before applying parfilskip you need to keep in mind that begin/end paragraph handling is also influenced by hard coded tex behaviour if we start messing around with tricks to bypass that we end up in a mess this is one reason for using struts (adding kern 0 pt may also help: ... \hfil \kern0pt Hans
Hans van der Meer wrote:
I seem to have a problem with alignment in \framed; these are small examples with there outcome:
\leftaligned{\framed[width=4cm,align=no]{xyz} "no" comes out to the left} \leftaligned{\framed[width=4cm,align=no]{\hfil xyz} "no" comes out in the middle} \leftaligned{\framed[width=4cm,align=middle]{\hfil xyz} "middle" comes out to the right} \leftaligned{\framed[width=4cm,align=right]{\hfil xyz} "right" comes out in the middle} \leftaligned{\framed[width=4cm,align=right]{xyz} "right" comes out to the left}
I get the impression that although "align=no",� there still is a \hfil put in at the right.
no means ragged (i.e. no justification) best investigate this with paragraphs: \framed[width=4cm,align=no]{\input tufte } \framed[width=4cm,align=no]{\hfil \input tufte } \framed[width=4cm,align=middle]{\hfil \input tufte } \framed[width=4cm,align=right]{\hfil \input tufte } \framed[width=4cm,align=right]{\input tufte } the last line gets a parfillskip which is why you see interference with your hfil's ('use hfill or hfilll ro be sure), compare: \hsize 10cm \hfil xyz \input tufte \parfillskip0pt \hfil xyz \input tufte \end
Searched through the sources, especially core-rule.tex but could not find the right place; it is fairly complicated code, isn't it? Using \hfill to force the alignment is not an option, because I need that for overriding the alignment when using these alignments in macros.
I would like very much to have "align=no" putting no glue, neither to the right nor to the left, thus making it different from "align=right". If I am right: 1. can someone point me to the point in the source where I can change things for the moment? 2. will this be changed then in the next release?
no, it would break many things (proper alignment of multi line paragraphs to start with) I can imagine an extension: \framed[width=4cm,align=no]{\hfil xxx} \framed[width=4cm,align=no]{\parfillskip0pt\hfil xxx\endgraf} \unprotected \setvalue{\@@ragged@@command abc}% {\appendtoks\raggedright\parfillskip\zeropoint\to\everyraggedcommand} \framed[width=4cm,align=abc]{\hfil xxx} but i don't know what keyword to use Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Hans van der Meer
-
Taco Hoekwater