ai2472206...@yeah.net schrieb am 11.09.2024 um 04:22:
Thank you for your careful and patient explanation.
I'll check my code again.
Because it's still very simple,
and some situations haven't been taken into account.
In particular, the condition judgment to split the part of the box.
I run your code and already found a few example where it fails, e.g.
- when you have a very short text it is spread over the while line and
you get a line break at the end
- when you use it in the narrower environment you don't compensate the
left/right indentations
Regarding the part about referencing commands,
I inadvertently forgot to delete it.
I have a question about the command "\warichuparameter\c!XXX" :
Why can we use "\warichuparameter\c!XXX" instead of "\warichuparameter{XXX}" in
most cases,
but in some cases, it says that the command is not defined?
For example, \warichuparameter\c!pointstyle --> Control sequence expected
instead of undefined
I've used "\warichuparameter\c!XXX" before, but it causes the error
because there are some keys that are specifically named.
For the sake of stylistic consistency, I used "\warichuparameter{XXX}" for all
command.
Maybe it's because I didn't define it? Should I define the following in advance?
%%%
\def\c!pointstyle{pointstyle}
%%%
Yes, these constants are predefined to have language dependent keys in
the setup command, e.g.
\setupitemize[width=1cm]
is written as
\stelleaufzaehlungein[breite=1cm]
with the german interface.
To ensure you use the correct name for the key you use \c!width as
argument for the \xxxparameter command.
While you can use \def\c!...{...} to create a new constant the proper
method is to use \setinterfaceconstant.
You can run the following example to get a list with a predefined
constant. When you uncomment the first three lines you see the new entry
also appears in the list.
%%%% begin example
% \startinterface all
% \setinterfaceconstant {pointstyle} {pointstyle}
% \stopinterface
\setuplayout[tight]
\starttext
\startluacode
context.startcolumns({n=3})
for constant, _ in table.sortedpairs(interfaces.constants) do
context.mono(constant)
context.par()
end
context.stopcolumns()
\stopluacode
\stoptext
%%%% end example
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________