* [NTG-context] bidi gone in serried enumeration
@ 2025-02-22 22:20 Mohammad Hossein Bateni
2025-02-23 10:33 ` [NTG-context] " Hans Hagen via ntg-context
0 siblings, 1 reply; 2+ messages in thread
From: Mohammad Hossein Bateni @ 2025-02-22 22:20 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 593 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 751 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
* [NTG-context] Re: bidi gone in serried enumeration
2025-02-22 22:20 [NTG-context] bidi gone in serried enumeration Mohammad Hossein Bateni
@ 2025-02-23 10:33 ` Hans Hagen via ntg-context
0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen via ntg-context @ 2025-02-23 10:33 UTC (permalink / raw)
To: ntg-context; +Cc: Hans Hagen
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-23 10:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-22 22:20 [NTG-context] bidi gone in serried enumeration Mohammad Hossein Bateni
2025-02-23 10:33 ` [NTG-context] " Hans Hagen via ntg-context
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).