Am 09.09.2026 um 11:38 schrieb Hans Hagen via ntg-context:
\permanent\protected\def\doifelseframed#1%
         {\ifcstok{#1\c!frame      }\v!on \expandafter\firstoftwoarguments
   \orelse\ifcstok{#1\c!frame }\v!closed\expandafter\firstoftwoarguments
   \orelse\ifcstok{#1\c!frame      }\v!round \expandafter\firstoftwoarguments    \orelse\ifcstok{#1\c!topframe   }\v!on \expandafter\firstoftwoarguments    \orelse\ifcstok{#1\c!bottomframe}\v!on \expandafter\firstoftwoarguments    \orelse\ifcstok{#1\c!leftframe  }\v!on \expandafter\firstoftwoarguments    \orelse\ifcstok{#1\c!rightframe }\v!on \expandafter\firstoftwoarguments
   \orelse\ifempty{#1\c!background }\expandafter\secondoftwoarguments
     \else \expandafter\firstoftwoarguments\fi}

Still to simple because it will fail for frame=dash, frame=small etc. (and frame=round doesn't exist).

\permanent\protected\def\doifelseframed#1%
  {\ifcstok{#1\c!frame}\v!closed\expandafter\firstoftwoarguments
   \orelse\ifcsname\??framedtop   #1\c!frame#1\c!topframe  \endcsname\expandafter\firstoftwoarguments
 
\orelse\ifcsname\??framedbottom#1\c!frame#1\c!bottomframe\endcsname\expandafter\firstoftwoarguments
   \orelse\ifcsname\??framedleft  #1\c!frame#1\c!leftframe \endcsname\expandafter\firstoftwoarguments    \orelse\ifcsname\??framedright #1\c!frame#1\c!rightframe \endcsname\expandafter\firstoftwoarguments
 \orelse\ifempty{#1\c!background}\expandafter\secondoftwoarguments
   \else\expandafter\firstoftwoarguments
   \fi}

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
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
___________________________________________________________________________________

Reply via email to