ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Bug with \wordright in LMTX version 2020-08-03 14:25
Date: Wed, 5 Aug 2020 21:15:58 +0200	[thread overview]
Message-ID: <3d5e945e-10e1-d3eb-0c82-0b84cf71511b@gmail.com> (raw)
In-Reply-To: <CACyK-eo4ZN5kx2eriAFynm0s6=23vGEdyBEKfOKFHMDazOG02A@mail.gmail.com>

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
___________________________________________________________________________________

  reply	other threads:[~2020-08-05 19:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 20:10 Otared Kavian
2020-08-04  7:06 ` Hans Hagen
     [not found]   ` <D707379C-DC0F-4EEA-9332-B98531BFD02E@gmail.com>
     [not found]     ` <da525156-014d-a587-c2be-abb70ae090f4@xs4all.nl>
2020-08-04 12:02       ` Otared Kavian
2020-08-05 17:33         ` Fabrice Couvreur
2020-08-05 19:15           ` Wolfgang Schuster [this message]
2020-08-08 13:39             ` Defining \qed (was: Bug with \wordright...) Otared Kavian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d5e945e-10e1-d3eb-0c82-0b84cf71511b@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).