On 2/22/2025 11:20 PM, Mohammad Hossein Bateni wrote:
Hi,
In the example below, when the "text" is non-English and we want a
titled serried enumeration, bidi stops working in rendering of title.
This works fine when I use other alternatives (top, left, etc.).
Setting headalign=r2l or using \setupalign[r2l] has no effect.
Best,
Mohammad
\setupdirections[bidi=global,method=unicode]
\definefontfeature[default][arabic]
\setupbodyfont[dejavu,sans]
\defineenumeration[Theorem]
\setupenumeration[Theorem][alternative=serried,title=yes,text=قضیه]
\starttext
\startTheorem[title=عنوان]
Test
\stopTheorem
\stoptext
Here is a hack but if we go that route
- we need to look at other (similar) cases
- we need to make examples and document it
- WS and I should be able to predict no side effects
- we need to get a clear picture of mixed lr / rl layouts
so in the end it comes down to you dedicating time on this. The problem
with all these specific issues is that once a single issue is solved the
user moves on (problem solved, right?) and we never converge to complete
solutions and we en dup with hacks. In this case, beating some
heuristics that interfere with e.g. explicit spacing and guesswork wrt
fences.
\unprotect
\permanent\protected\def\foolbidimode
{\ifzero\currentbidimode\else\bidilre\fi}
\protected\def\strc_enumerations_inject_extra_text_indeed
{\begingroup
\hskip{\constructionparameter\c!titledistance}% we listen to the
headstyle
\useconstructionstyleandcolor\c!titlestyle\c!titlecolor
\constructionparameter\c!titlecommand
{\foolbidimode % experiment
\constructionparameter\c!titleleft
\clf_savedlisttitle{\currentconstructionmain}\currentconstructionlistentry\relax
\constructionparameter\c!titleright
}%
\endgroup}
\protect
\enabletrackers[typesetters.directions.details]
\enabletrackers[typesetters.directions.list]
\setupdirections[bidi=global,method=unicode]
\definefontfeature[default][arabic]
\setupbodyfont[dejavu,sans]
\defineenumeration[Theorem]
\setupenumeration[Theorem][alternative=serried,title=yes,text=قضیه]
\starttext
\startTheorem[title=عنوان]
test
\stopTheorem
\startTheorem[title=oeps]
test
\stopTheorem
\setupenumeration[Theorem][alternative=serried,title=yes,text=oeps]
\startTheorem[title=عنوان]
test
\stopTheorem
\startTheorem[title=oeps]
test
\stopTheorem
\stoptext
-----------------------------------------------------------------
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 /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________