[NTG-context] Re: After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread ai2472206007
I was careless. thank you
___
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
___


[NTG-context] After using a custom command in the title, the table of contents is not generated properly

2024-06-05 Thread ai2472206007
As described, here is example:

%
\def\cmd#1{{\tt\textslash #1}}
\def\cmdii#1{\tt #1}
\def\cmdiii#1{\rm #1}

\starttext

\placecontent% if i dont place toc command , ConText can render it.

\chapter{anything else}
\section{\cmdi{with command} section}
\section{\cmdii{with command} section}
\section{\cmdiii{with command} section}
\section{{\rm with command} section} % only this one work well

\stoptext


Am I missing something important? If so, please tell me what to do. Thank you 
so much.

Muyik
___
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
___


[NTG-context] Re: Draft vertical text in margins

2024-06-03 Thread ai2472206007
you can try 'setuptext' and '\setuptexttexts' to put "draft" in margin.and use 
'orientation' to change direction.


\defineframed[marginframe]
 [width=max, height=max,   style=\ss,
  corner=08, location=lohi,frame=off]
\setuptext [style={\ss}]
\setuptexttexts  [margin] []
[\marginframe{\hbox orientation 1 {DRAFT}}]
[\marginframe{\hbox orientation 1 {DRAFT}}]
   []

\starttext
\chapter{C:Some Word}
\dorecurse{5}{
\section{S:Some Word}
\input knuth}
\stoptext
%%%
___
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
___


[NTG-context] Re: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread ai2472206007
I must have made a mistake with something, I changed a counter and it somehow 
worked properly. Because I've designed too many counters, I still haven't 
figured out exactly what the problem is doing. But admittedly, the question I 
asked is non-existent. It's a problem with my design.
___
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
___


[NTG-context] Re: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread ai2472206007
Thank you. I will try again.
___
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
___


[NTG-context] Re: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread ai2472206007
Thanks, probably interfered with his output in other parts of my command. I 
didn't locate the error correctly.
___
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
___


[NTG-context] Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread ai2472206007
I'm defining a command to generate options for multiple choice questions, 
but at the moment I'm stuck at this step. 
I want to get a number and assign a value to the counter, but why can't I get 
it?


\starttext
\definedataset [myset]
\setdataset[myset] [foo=1,boo=4]
\newcount\tempa
\datasetvariable{myset}{1}{boo} % definitely get 4
%\tempa=\datasetvariable{myset}{1}{boo} % why i cannt pass 4 to tempa?
%\number\tempa
\stoptext
%

If anyone can fix it, thanka very much

Muyik
___
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
___


[NTG-context] Re: How to Define a New Language

2024-05-27 Thread ai2472206007
Thanks for your reply, I found out that I just deleted the code 'default=cn', 
and it actually worked.

With just this code system can install the language normally, and then get the 
correct 'labeltext'.

%%%
\installlanguage [zh-tw] [patterns=cn]% install traditional chinese
%%%
___
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
___


[NTG-context] Re: How to Define a New Language

2024-05-24 Thread ai2472206007
3. In general, it is enough to distinguish between Chinese Simplified Chinese 
and Chinese Traditional.

Chinese has a large number of Chinese characters, therefore the fonts produced 
are generally divided into Chinese Simplified and Chinese Traditional. This 
causes Chinese Simplified Chinese fonts to fail to display Chinese Traditional. 

In addition to the differences in fonts, Chinese mainland, Taiwan(china), Hong 
Kong(china), etc. use different punctuation marks, expressions, etc. For 
example, Chinese mainland mainly uses "", while Taiwan may use 「」 more often. 
and the difference between the two Chinese expressions, such as when using 
labeltext.

While it's great to set up new languages at the system level, there is always 
the possibility that new languages will be added for one reason or another. 

As far as Chinese is concerned, it has a very large number of dialects. We 
can't be fully integrated into the system. Opening up suitable interfaces to 
add new languages can reduce the cost of system maintenance. 

As far as I know, the characters used (Chinese Simplified, Chinese 
Traditional), the punctuation marks used (Chinese mainland, Taiwan, Hong Kong), 
and the expressions used (Chinese mainland, Taiwan, Hong Kong) are basically 
different between the dialects of Chinese. There is no hyphenation difference 
in any dialect. 

As far as I am currently using, the context is not very well set for 
localization, and there are many words in lang-txt.lua that have not been 
translated into Chinese. I think that as an ordinary user, it is very dangerous 
to modify information at the system level.

Although, as a temporary alternative, we can use 'newif' or 'startmode' to add 
a new condition to accommodate both Chinese Simplified and Chinese Traditional 
in the same document. However, it would be nice to have support at the system 
level.

I don't know if I'm getting my point right. Because of the above, I used 
translation software to translate my thoughts.

Muyik
___
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
___


[NTG-context] Re: How to Define a New Language

2024-05-24 Thread ai2472206007
Thanks for the reply, the part about fonts is no problem on my system.
___
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
___


[NTG-context] Re: How to Define a New Language

2024-05-24 Thread ai2472206007
and ,I've found that along with the language, there is also a 'mode', 
and when I define a new language, does I also define such a new mode, like 
'startmode[*en]stopmode'?
___
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
___


[NTG-context] How to Define a New Language

2024-05-24 Thread ai2472206007
Hello, everyone. 

As the title describes, I want to define a new language: Chinese Traditional. 
Based on what I could find on the Internet, I made these settings. 
But I couldn't get the results I wanted.

%%%start example 
\usetypescriptfile[osx]
\setupbodyfont   [stfangsong]
\unprotect
\installlanguage[cnt] [default=cn,patterns=cn,factor=yes]
\setuplanguage  [cnt] [spacing=packed,default=cn,patterns=cn,factor=yes]
\setuplabeltext [cnt] [appendix={附錄}]
\protect
\mainlanguage[cnt]
\currentmainlanguage
\labeltext{appendix}
%%% stopexample

I think I'm going to get the two kanji [附錄]. But the truth is, he has nothing. 
But when I converted to Chinese Simplified, he magically appeared. 

%%%start example 
\usetypescriptfile[osx]
\setupbodyfont   [stfangsong]
\unprotect
\setuplabeltext [cn] [appendix={附錄}] %%% here switch to Chinese-Simplified
\protect
\currentmainlanguage
\labeltext{appendix}
%%% stopexample

So, what should I do to get it. Of course, my original assumption was that 
when I changed the language, these labels, fonts, indentations, line spacing, 
etc., 
would change. But for now, I'm stuck at defining a new language.

 If anyone can give advice, appreciate it

Muyik
___
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
___


[NTG-context] Re: Define a new command that inherits from multiple other command options

2024-04-28 Thread ai2472206007
Thanks for the detailed answer, my problem was solved very well through the 
code you provided

--

Muyik
___
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
___


[NTG-context] Re: Define a new command that inherits from multiple other command options

2024-04-26 Thread ai2472206007
Thanks for your reply. 

The kanji part requires a specific font and typescript file, which I defined on 
my own computer but forgot to add to this example. This is something I didn't 
take into account. It's true, I need to think about what exactly my command 
needs, not build an all-powerful command. It's my poor consideration.
___
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
___


[NTG-context] Define a new command that inherits from multiple other command options

2024-04-25 Thread ai2472206007
hi!

I'm new to ConTeXt. I want to define a command with sidenote function. This 
[setupsidenote] command inherits the options of [setupmargindata], 
[setupcounter] and [setupframed]. just like [setupenumeration] inherits the 
option of [setupcounter].

I've defined the following sidenote command by searching, and I know how to 
define a new option for it. But what I don't know is how to get it to inherit 
the options of other commands and perform these features correctly.

Any clue is warmly welcome.

```
% macros=mkvi
\unprotect
\installnamespace  {sidenote}
\installcommandhandler \sidenote  {sidenote}  \sidenote
\setupsidenote[
   align=,
   conversion=n,
   way=bytext,
   style=,
]

\definecounter[SidenoteMarkNumber] [prefix=no]
\definemargindata [SidenoteContent][outer]
  [margin=margin,width=\outermarginwidth]
\setupmargindata  [SidenoteContent][stack=yes,style=\it]
\def\sidenotemark{\rawcountervalue[SidenoteMarkNumber]}
\def\convertsidenotemark#1{\high{\convertnumber{#1}{\sidenotemark}}}
\def\sidenote{\dosingleempty\dosidenote}
\def\dosidenote[#1]#2{%
\getparameters[SMsidenote]
  [align=\sidenoteparameter{align},
  conversion=\sidenoteparameter{conversion},
  way=\sidenoteparameter{way},
   #1]%
 \setupcounter[SidenoteMarkNumber] [#1]
 \incrementcounter[SidenoteMarkNumber]
 \convertsidenotemark{\SMsidenoteconversion}% mark in text
 \SidenoteContent[#1]{\setscript[hanzi]\setup[\SMsidenotealign]%
  \convertsidenotemark{\SMsidenoteconversion}% mark with 
note
  #2
}}
\protect
\starttext
天地玄黄,宇宙洪荒。日月盈昃,辰宿列张。寒来暑往,秋收冬\sidenote[align=flushleft] {天地玄黄,宇宙洪荒。}
\stoptext
```
___
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
___