Re: [NTG-context] [Solved] Line breaks, \wordright and hyphenation
On Monday, October 25, 2021 7:34:06 AM IST kauśika cittūr wrote: > On Sunday, October 24, 2021 7:42:59 AM IST kauśika cittūr wrote: > > Dear list, > > > > In short, my question is: why does \wordright cause a line-break when the > > line preceding it breaks with hyphenation and does not otherwise? How to > > avoid it (if at all possible)? > > > > I have this delimitedtext instance called 'amnata' defined as below: > > > > \definemeasure[amnatamargin][3cm] > > \definedelimitedtext > > > > [amnata] > > > > \setupdelimitedtext > > > > [amnata] > > [ > > > > left=, > > right=, > > leftmargin={\measure{amnatamargin}}, > > rightmargin={\measure{amnatamargin}}, > > > > ] > > > > I am using this to quote paragraph(s) of other authors. > > Since, I also want to indicate where the quote is from, I use this as > > follows: > > > > \startamnata > > > > ⋮ > > > > \wordright{author} > > \stopamnata > > > > so that the author's name appears at the right-edge of the block. > > > > When the penultimate line inside the block breaks without hyphenation, > > then > > argument of \wordright is typeset as expected (i.e. in the same line). > > > > On the other hand, when the penultimate line inside this block breaks with > > hyphenation, the argument of \wordright is pushed to the next line even > > when there is enough space for it on the same line. > > > > Here is a sample illustrating this: > > > > \startamnata > > A quote from another author : Suppose that thereisalongwordhere. > > \wordright{– author} > > \stopamnata > > > > \startamnata > > A quote from another author : Here, the text does not cause > > hyphenation in the first line. > > \wordright{– author} > > \stopamnata > > > > [I have attached the output here as an image] > > > > How do I ensure that this does not happen, if that is possible at all? I > > suppose this is expected behaviour but I am not able to understand why. > > > > Thanks, > > kauśika > > Dear list, > > Although, not a fix for the issue, here is a workaround that allowed me to > achieve what I wanted: > > \definedescription[amnata] > \setupdescription[amnata] > [closesymbol={}, >closecommand=\wordright, >before=\startamnatanarrower, >after=\stopamnatanarrower] > > \startamnata > A quote from another author : Suppose that thereisalongwordhere. > \wordright{– author} > \stopamnata > > With this the argument of \wordright appears correctly at the right-edge of > the block. Note that this does not work (as expected) when closesymbol is > not set (or, is empty). Therefore, here I have set closesymbol={U+200B}, > which is the zero width space. > > Thanks, > kauśika Dear list, As it turns out, my workaround here is subpar since it inserts an undesired line after the description block. Hans was very kind to send me a fix to place in cont-new.mkxl that fixes the issue. However, due to my errors in properly pasting the fix correctly, it did not work. I updated LMTX today and the fix is already merged. I am pasting below Hans' fix for reference (for anyone who might come across this later) – \protect \protected\def\spac_word_right_indeed#1#2% {\registerparwrapper {\v!word:\v!right} {\begingroup \frozen\parfillskip\zeropoint \frozen\finalhyphendemerits\zerocount \endgroup} {\doifelseparwrapper{\v!word:\v!right}{\unregisterparwrapper{\v!word:\v! right}}\donothing \removeunwantedspaces \doifelse{#1}\v!right{\kern-\rightskip}{\doifsomething{#1}{\kern-#1}}% \hfilll \discretionary{\strut}{\strut}{\strut}% \allowbreak % changed back from \hskip\zeropoint \hfilll \quad % decent spacing #2}} \unprotect kauśika ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Line breaks, \wordright and hyphenation
On Sunday, October 24, 2021 7:42:59 AM IST kauśika cittūr wrote: > Dear list, > > In short, my question is: why does \wordright cause a line-break when the > line preceding it breaks with hyphenation and does not otherwise? How to > avoid it (if at all possible)? > > I have this delimitedtext instance called 'amnata' defined as below: > > \definemeasure[amnatamargin][3cm] > \definedelimitedtext > [amnata] > \setupdelimitedtext > [amnata] > [ > left=, > right=, > leftmargin={\measure{amnatamargin}}, > rightmargin={\measure{amnatamargin}}, > ] > > I am using this to quote paragraph(s) of other authors. > Since, I also want to indicate where the quote is from, I use this as > follows: > > \startamnata > ⋮ > \wordright{author} > \stopamnata > > so that the author's name appears at the right-edge of the block. > > When the penultimate line inside the block breaks without hyphenation, then > argument of \wordright is typeset as expected (i.e. in the same line). > > On the other hand, when the penultimate line inside this block breaks with > hyphenation, the argument of \wordright is pushed to the next line even when > there is enough space for it on the same line. > > Here is a sample illustrating this: > > \startamnata > A quote from another author : Suppose that thereisalongwordhere. > \wordright{– author} > \stopamnata > > \startamnata > A quote from another author : Here, the text does not cause > hyphenation in the first line. > \wordright{– author} > \stopamnata > > [I have attached the output here as an image] > > How do I ensure that this does not happen, if that is possible at all? I > suppose this is expected behaviour but I am not able to understand why. > > Thanks, > kauśika Dear list, Although, not a fix for the issue, here is a workaround that allowed me to achieve what I wanted: \definedescription[amnata] \setupdescription[amnata] [closesymbol={}, closecommand=\wordright, before=\startamnatanarrower, after=\stopamnatanarrower] \startamnata A quote from another author : Suppose that thereisalongwordhere. \wordright{– author} \stopamnata With this the argument of \wordright appears correctly at the right-edge of the block. Note that this does not work (as expected) when closesymbol is not set (or, is empty). Therefore, here I have set closesymbol={U+200B}, which is the zero width space. Thanks, kauśika ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Line breaks, \wordright and hyphenation
On Sunday, October 24, 2021 5:31:32 PM IST Hans Hagen wrote: > On 10/24/2021 1:08 PM, Benjamin Buchmuller via ntg-context wrote: > > Maybe > > > > \hfill author > > It's anyway nicer to use > > % \definenarrower > % [amnata] > % [left=\measure{amnatamargin}, > %right=\measure{amnatamargin}, > %default={left,right}] > > \definenarrower >[amnata] >[middle=\measure{amnatamargin}] > > but then them, the fact that we get something hyphenated interferes .. > tricky Dear Benjamin and Hans, Thanks for your responses. I did not mention this in my initial question but I am not exactly doing 'author' in the last line. Instead I usually do \cite[alternative=authoryears,righttext={Ch. 12}][author1992]. That is, almost always, I need to refer to a specific chapter/page number in the work. The issue with this and \hfill is that the 'righttext' part gets nudged into the next line. Sreeram ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Line breaks, \wordright and hyphenation
On 10/24/2021 1:08 PM, Benjamin Buchmuller via ntg-context wrote: Maybe \hfill author It's anyway nicer to use % \definenarrower % [amnata] % [left=\measure{amnatamargin}, %right=\measure{amnatamargin}, %default={left,right}] \definenarrower [amnata] [middle=\measure{amnatamargin}] but then them, the fact that we get something hyphenated interferes .. tricky On 24. Oct 2021, at 04:12, kauśika cittūr wrote: Dear list, In short, my question is: why does \wordright cause a line-break when the line preceding it breaks with hyphenation and does not otherwise? How to avoid it (if at all possible)? I have this delimitedtext instance called 'amnata' defined as below: \definemeasure[amnatamargin][3cm] \definedelimitedtext [amnata] \setupdelimitedtext [amnata] [ left=, right=, leftmargin={\measure{amnatamargin}}, rightmargin={\measure{amnatamargin}}, ] I am using this to quote paragraph(s) of other authors. Since, I also want to indicate where the quote is from, I use this as follows: \startamnata ⋮ \wordright{author} \stopamnata so that the author's name appears at the right-edge of the block. When the penultimate line inside the block breaks without hyphenation, then argument of \wordright is typeset as expected (i.e. in the same line). On the other hand, when the penultimate line inside this block breaks with hyphenation, the argument of \wordright is pushed to the next line even when there is enough space for it on the same line. Here is a sample illustrating this: \startamnata A quote from another author : Suppose that thereisalongwordhere. \wordright{– author} \stopamnata \startamnata A quote from another author : Here, the text does not cause hyphenation in the first line. \wordright{– author} \stopamnata [I have attached the output here as an image] How do I ensure that this does not happen, if that is possible at all? I suppose this is expected behaviour but I am not able to understand why. Thanks, kauśika ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Line breaks, \wordright and hyphenation
Maybe \hfill author ? > On 24. Oct 2021, at 04:12, kauśika cittūr wrote: > > Dear list, > > In short, my question is: why does \wordright cause a line-break when the > line > preceding it breaks with hyphenation and does not otherwise? How to avoid it > (if at all possible)? > > I have this delimitedtext instance called 'amnata' defined as below: > > \definemeasure[amnatamargin][3cm] > \definedelimitedtext > [amnata] > \setupdelimitedtext > [amnata] > [ >left=, >right=, >leftmargin={\measure{amnatamargin}}, >rightmargin={\measure{amnatamargin}}, > ] > > I am using this to quote paragraph(s) of other authors. > Since, I also want to indicate where the quote is from, I use this as follows: > > \startamnata > ⋮ > \wordright{author} > \stopamnata > > so that the author's name appears at the right-edge of the block. > > When the penultimate line inside the block breaks without hyphenation, then > argument of \wordright is typeset as expected (i.e. in the same line). > > On the other hand, when the penultimate line inside this block breaks with > hyphenation, the argument of \wordright is pushed to the next line even when > there is enough space for it on the same line. > > Here is a sample illustrating this: > > \startamnata > A quote from another author : Suppose that thereisalongwordhere. > \wordright{– author} > \stopamnata > > \startamnata > A quote from another author : Here, the text does not cause > hyphenation in the first line. > \wordright{– author} > \stopamnata > > [I have attached the output here as an image] > > How do I ensure that this does not happen, if that is possible at all? I > suppose this is expected behaviour but I am not able to understand why. > > Thanks, > kauśika > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Line breaks, \wordright and hyphenation
On Sunday, October 24, 2021 7:42:59 AM IST kauśika cittūr wrote: > Dear list, > > In short, my question is: why does \wordright cause a line-break when the > line preceding it breaks with hyphenation and does not otherwise? How to > avoid it (if at all possible)? > > I have this delimitedtext instance called 'amnata' defined as below: > > \definemeasure[amnatamargin][3cm] > \definedelimitedtext > [amnata] > \setupdelimitedtext > [amnata] > [ > left=, > right=, > leftmargin={\measure{amnatamargin}}, > rightmargin={\measure{amnatamargin}}, > ] > > I am using this to quote paragraph(s) of other authors. > Since, I also want to indicate where the quote is from, I use this as > follows: > > \startamnata > ⋮ > \wordright{author} > \stopamnata > > so that the author's name appears at the right-edge of the block. > > When the penultimate line inside the block breaks without hyphenation, then > argument of \wordright is typeset as expected (i.e. in the same line). > > On the other hand, when the penultimate line inside this block breaks with > hyphenation, the argument of \wordright is pushed to the next line even when > there is enough space for it on the same line. > > Here is a sample illustrating this: > > \startamnata > A quote from another author : Suppose that thereisalongwordhere. > \wordright{– author} > \stopamnata > > \startamnata > A quote from another author : Here, the text does not cause > hyphenation in the first line. > \wordright{– author} > \stopamnata > > [I have attached the output here as an image] > > How do I ensure that this does not happen, if that is possible at all? I > suppose this is expected behaviour but I am not able to understand why. > > Thanks, > kauśika Just noticed that the attachment image does not seem to have been sent. Resending … kauśika ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Line breaks, \wordright and hyphenation
Dear list, In short, my question is: why does \wordright cause a line-break when the line preceding it breaks with hyphenation and does not otherwise? How to avoid it (if at all possible)? I have this delimitedtext instance called 'amnata' defined as below: \definemeasure[amnatamargin][3cm] \definedelimitedtext [amnata] \setupdelimitedtext [amnata] [ left=, right=, leftmargin={\measure{amnatamargin}}, rightmargin={\measure{amnatamargin}}, ] I am using this to quote paragraph(s) of other authors. Since, I also want to indicate where the quote is from, I use this as follows: \startamnata ⋮ \wordright{author} \stopamnata so that the author's name appears at the right-edge of the block. When the penultimate line inside the block breaks without hyphenation, then argument of \wordright is typeset as expected (i.e. in the same line). On the other hand, when the penultimate line inside this block breaks with hyphenation, the argument of \wordright is pushed to the next line even when there is enough space for it on the same line. Here is a sample illustrating this: \startamnata A quote from another author : Suppose that thereisalongwordhere. \wordright{– author} \stopamnata \startamnata A quote from another author : Here, the text does not cause hyphenation in the first line. \wordright{– author} \stopamnata [I have attached the output here as an image] How do I ensure that this does not happen, if that is possible at all? I suppose this is expected behaviour but I am not able to understand why. Thanks, kauśika___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Change to wordright behavior?
On 4/18/2021 22:12, Rik Kabel wrote: Dear all, At some time in the last couple of years the behavior of \wordright seems to have changed, at least in the following situation. With the following example: \starttext \hsize3cm Aaa\wordright{Aaa}\par \sc{Bbb\wordright{Bbb}}\par {\sc Ccc\wordright{Ccc}}\par \sc{Ddd}\wordright{\sc{Ddd}}\par \stoptext Produces: The second and third lines with \wordright (Bbb and Ccc) each generate two lines. They previously produced one line each. Placing each part of the line in its own \sc addresses it here (Ddd), but it does seem that it should not be necessary to do that. Was this an intentional change? -- Rik This has been fixed in the 20210421 release. Thank you. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Change to wordright behavior?
Dear all, At some time in the last couple of years the behavior of \wordright seems to have changed, at least in the following situation. With the following example: \starttext \hsize3cm Aaa\wordright{Aaa}\par \sc{Bbb\wordright{Bbb}}\par {\sc Ccc\wordright{Ccc}}\par \sc{Ddd}\wordright{\sc{Ddd}}\par \stoptext Produces: The second and third lines with \wordright (Bbb and Ccc) each generate two lines. They previously produced one line each. Placing each part of the line in its own \sc addresses it here (Ddd), but it does seem that it should not be necessary to do that. Was this an intentional change? -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Defining \qed (was: Bug with \wordright...)
Hi Wolfgang, Thanks for your explanations and the correct definition of the close symbol in an enumeration. Following up the discussions with Hans, in order to put a close sympbol at the end of a formula, I have the following for the definition of \qed: %% begin example-qed.tex \showframe \definesymbol[Fin][\mathematics{\square}] \def\qed{% \ifmmode \inrightmargin{\hskip-7.5mm\symbol[Fin]} % --> attention here \else \dontleavehmode\wordright{\symbol[Fin]} \fi} \setupformulas[location=left] \starttext One sees that \placeformula \startformula a^2 + b^2 = c^2 \stopformula which is the Pythagoras theorem. \qed Another proof of Pythagors theorem is based on the figure below in which one sees that: \placeformula \startformula (a+b)^2 = c^2 + 2ab \quad \imply \quad a^2 + b^2 = c^2. \qed \stopformula \stoptext %% end example-qed.tex Now how can I replace « \hskip-7.5mm » (which was found by trial and error…) in a robust manner so that the close symbols in the formulas are vertically aligned with the close symbols in the text? In other terms can one compute automatically the amount of negative \hskip so that the definition is correct when one changes the font size and the layout? Thanks in advance: Otared > On 5 Aug 2020, at 21:15, Wolfgang Schuster > wrote: > […] > > Below is a cleaner version to put a symbol at the end of each proof. The > \blank setting in the \PlaceProofSymbol definition moves the symbol back in > the math formula to avoid the vertical space between them, you can remove it > but I would at leas use \blank[back] to get rid of the empty line between the > formula and the symbol. > > \define[1]\PlaceProofSymbol > {\blank[back,overlay]% > \dontleavehmode\wordright{#1}} > > \defineenumeration > [proof] > [ closesymbol={\symbol[square]}, > closecommand=\PlaceProofSymbol] > > \starttext > > \startproof > \startformula >a^2 + b^2 = c^2 > \stopformula > \stopproof > > \stoptext > > Wolfgang > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
Fabrice Couvreur schrieb am 05.08.2020 um 19:33: Hello, I also use a square to complete a demonstration. I tried this without success Thank you Fabrice \definesymbol[Fin][\mathematics{\square}] \def\qed{\strut\wordright{\symbol[Fin]}} \defineenumeration [proof] [..., closesymbol={\symbol[\qed]}] 1. \symbol is meant to access pre defined symbols, as fallback method when the requested symbol doesn't exist ConTeXt outputs the argument. This fallback is in my opinion problematic because it's easy to miss it. \starttext \symbol[square] \symbol[quadrat] \stoptext 2. When you use the closesymbol for a enumeration ConTeXt uses also the argument of the closecommand to apply something to the symbol, by default the argument to the closecommand key is \wordright. This means you're putting \wordright (which itself is flushed as symbol) within \wordright which has to fail at some point. Below is a cleaner version to put a symbol at the end of each proof. The \blank setting in the \PlaceProofSymbol definition moves the symbol back in the math formula to avoid the vertical space between them, you can remove it but I would at leas use \blank[back] to get rid of the empty line between the formula and the symbol. \define[1]\PlaceProofSymbol {\blank[back,overlay]% \dontleavehmode\wordright{#1}} \defineenumeration [proof] [ closesymbol={\symbol[square]}, closecommand=\PlaceProofSymbol] \starttext \startproof \startformula a^2 + b^2 = c^2 \stopformula \stopproof \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
Hello, I also use a square to complete a demonstration. I tried this without success Thank you Fabrice \definesymbol[Fin][\mathematics{\square}] \def\qed{\strut\wordright{\symbol[Fin]}} \defineenumeration [proof] [text=Démonstration, alternative=serried, distance=\zeropoint, number=no, headstyle=boldslanted, width=broad, closesymbol={\symbol[\qed]}] \starttext \startproof \startformula a^2 + b^2 = c^2 \stopformula \stopproof \stoptext Le mar. 4 août 2020 à 14:02, Otared Kavian a écrit : > Hi Hans, > > Thanks for the hint which consists in adding an \ifmmode to the definition > of \qed. > However, as you suggest, one needs some other mechanism in math mode, > since with your new definition of \qed the alignment of the formula changes > when one adds this close symbol: > > begin-example-qed.tex > \definesymbol[Fin][\mathematics{\square}] > \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi} > \starttext > \startformula > a^2 + b^2 = c^2. > \stopformula > \startformula > a^2 + b^2 = c^2. \qed > \stopformula > One sees that\type{\qed} in the formula changes the alignment of the > formula. \qed > \stoptext > end-example-qed.tex > > Thanks a lot for everything: Otared > > > On 4 Aug 2020, at 13:24, Hans Hagen wrote: > > > > On 8/4/2020 11:17 AM, Otared Kavian wrote: > >> Thanks Hans for your explanations. > >> The problem I encountered is that, the command \qed is used dozens of > time in my text without any issue because it was preceded by something on > th eline, but the only place where it was alone after a formula resulted in > the error and it was not easy for me to isolate the issue… > >> By the way, in mkii it was possible to add \qed on the last line of a > math formula, but that does not work anymore: > >> \definesymbol[Fin][\mathematics{\square}] > >> \def\qed{\strut\wordright{\symbol[Fin]}} > >> \starttext > >> \startformula > >> a^2 + b^2 = c^2. \qed > >> \stopformula > >> The above formula does not show the close symbol.\qed > >> \stoptext > >> Is there a way to have something like \qed work in math formulas? > > because that's now hwpo wordright works ... > > > > \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi} > > > > but we probably need something different, something that hooks into > display math > > > > Hans > > > > > > - > > Hans Hagen | PRAGMA ADE > > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > > - > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
Hi Hans, Thanks for the hint which consists in adding an \ifmmode to the definition of \qed. However, as you suggest, one needs some other mechanism in math mode, since with your new definition of \qed the alignment of the formula changes when one adds this close symbol: begin-example-qed.tex \definesymbol[Fin][\mathematics{\square}] \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi} \starttext \startformula a^2 + b^2 = c^2. \stopformula \startformula a^2 + b^2 = c^2. \qed \stopformula One sees that\type{\qed} in the formula changes the alignment of the formula. \qed \stoptext end-example-qed.tex Thanks a lot for everything: Otared > On 4 Aug 2020, at 13:24, Hans Hagen wrote: > > On 8/4/2020 11:17 AM, Otared Kavian wrote: >> Thanks Hans for your explanations. >> The problem I encountered is that, the command \qed is used dozens of time >> in my text without any issue because it was preceded by something on th >> eline, but the only place where it was alone after a formula resulted in the >> error and it was not easy for me to isolate the issue… >> By the way, in mkii it was possible to add \qed on the last line of a math >> formula, but that does not work anymore: >> \definesymbol[Fin][\mathematics{\square}] >> \def\qed{\strut\wordright{\symbol[Fin]}} >> \starttext >> \startformula >> a^2 + b^2 = c^2. \qed >> \stopformula >> The above formula does not show the close symbol.\qed >> \stoptext >> Is there a way to have something like \qed work in math formulas? > because that's now hwpo wordright works ... > > \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi} > > but we probably need something different, something that hooks into display > math > > Hans > > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
On 8/3/2020 10:10 PM, Otared Kavian wrote: Hi Hans, A file which used to be typeset correctly with the previous versions of lmtx, now produces an error. Despite the error message being extremely cryptic: Error ! Missing number, treated as zero I could guess the origin of the bug, which seems to be \wordright, but although the following minimal example shows a bug it does not produce the same ERROR output page: the square ''end of proof'' \definesymbol[Fin][\mathematics{\square}] \def\qed{\wordright{\symbol[Fin]}} \starttext \startformula a^2 + b^2 = c^2 \stopformula \qed % the problem is here \stoptext In the above example if one adds something before \qed, then the square end-of-proof appears. However in my real file ConTeXt ouputs an error page and says: Error ! Missing number, treated as zero. One can debate if the old behavior was ok ... wordright is meant for adding something at the end of a paragraph and you have none here. You can add a \strut in your definition to force a line. The lmtx implementation actually permit this: \definesymbol[Fin][\mathematics{\square}] \def\qed{\strut\wordright{\symbol[Fin1]}\wordright{\symbol[Fin2]}\wordright{\symbol[Fin3]}} \starttext \startformula a^2 + b^2 = c^2 \stopformula \qed % the problem is here \stoptext i'm still exploring this but it has to do with collecting stuff, as in: \wordright{before} test \par test \wordright{before} \par (i'll look at the number issue which indeed looks a like a bug) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
Hi Hans, A file which used to be typeset correctly with the previous versions of lmtx, now produces an error. Despite the error message being extremely cryptic: Error ! Missing number, treated as zero I could guess the origin of the bug, which seems to be \wordright, but although the following minimal example shows a bug it does not produce the same ERROR output page: the square ''end of proof'' \definesymbol[Fin][\mathematics{\square}] \def\qed{\wordright{\symbol[Fin]}} \starttext \startformula a^2 + b^2 = c^2 \stopformula \qed % the problem is here \stoptext In the above example if one adds something before \qed, then the square end-of-proof appears. However in my real file ConTeXt ouputs an error page and says: Error ! Missing number, treated as zero. Best regards: Otared ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] \wordright and line break
On 21-1-2010 14:53, Andreas Harder wrote: Hello Hans, is there a reason (I’m sure there is) that \finalhyphendemerits\zerocount in the \wordright-definition is commented out? Without this line I get wrong line breaks with hyphenated words followed by \wordright{…}. \starttext \setupframedtexts[width=.65\textwidth,offset=none] \startTEXpage[offset=1ex] \hsize=.65\textwidth \startframedtext test text test text test text test text test text test testtext \wordright{(S.\,3, Z.\,78–97)} \stopframedtext \startframedtext test text test text test text test text test text test test- text \wordright{(S.\,4, Z.\,117–121)} \stopframedtext \stopTEXpage \stoptext well, the comment says: yes or no, so let's uncomment it (interesting example) 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 - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] \wordright and line break
Hello Hans, is there a reason (I’m sure there is) that \finalhyphendemerits\zerocount in the \wordright-definition is commented out? Without this line I get wrong line breaks with hyphenated words followed by \wordright{…}. \starttext \setupframedtexts[width=.65\textwidth,offset=none] \startTEXpage[offset=1ex] \hsize=.65\textwidth \startframedtext test text test text test text test text test text test testtext \wordright{(S.\,3, Z.\,78–97)} \stopframedtext \startframedtext test text test text test text test text test text test test- text \wordright{(S.\,4, Z.\,117–121)} \stopframedtext \stopTEXpage \stoptext Greetings, Andreas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] \wordright{…} and hyphens
Hi, \wordright{something} don’t like it if the preceding line have a hyphenated word. It seems to work if one changes \allowbreak to hskip\zeropoint in the macro-definition. Here an example: \mainlanguage[de] % \unprotect % \def\dowordright[#1]% % {% don't change %\groupedcommand % {\removeunwantedspaces % \hfill % \allowbreak % changed back from \hskip\zeropoint % % \hskip\zeropoint % - solves the problem % \strut % \hfill % \quad % decent spacing % \hbox} % {\doifelse{#1}\v!right{\kern-\rightskip}{\doifsomething{#1}{\kern-#1}}% % \parfillskip\zeropoint % %\finalhyphendemerits\zerocount % yes or no % \par}} % \protect \setupframedtexts [width=\dimexpr.65\textwidth, offset=none] \starttext \startframedtext ein Jahr da gewohnt in Rülzheim, waren noch Schwiegereltern dabei.. \wordright{(S.\,3, Z.\,78–97)} \stopframedtext \startframedtext wenn du Ro, Mund aufmachst hörst das du nicht da geboren bist (lacht verlegen). \wordright{(S.\,4, Z.\,117–121)} \stopframedtext \startframedtext ein Jahr da gewohnt in Rülzheim, waren noch Schwie- gereltern dabei \wordright{(S.\,3, Z.\,78–97)} \stopframedtext \stoptext By the way: I can’t make a minimal example yet but I have a text where the same word appears on one place with ligatures and on another place without. Perhaps this is known …? Greetings Andreas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___