[NTG-context] Re: How to make superscript text match footnote mark formatting?

2024-04-27 Thread Joel via ntg-context
 Thank you! --Joel

On Saturday, April 27, 2024 at 12:08:13 PM MDT, Wolfgang Schuster 
 wrote:  
 
 Joel via ntg-context schrieb am 27.04.2024 um 19:16:
> \starttext
>   test\high{1}test\footnote{some text}
> \stoptext
> 
> How can I create a superscript number that has exactly the same 
> formatting as a footnote, but which won't create a footnote. I tried 
> \high{}, which I believe should be the way to superscript text, but if 
> you compile this, you can see the first "1" and second "1" have entirely 
> different formatting. How do I make the first one have the same exact 
> formtating as the real footnote?

Footnotes apply the \tx style to the number in the running text and to 
get the same text size with \high you need \tx before the argument.

Another solution is to create your own \high command where you set the 
text size as default value but now you have to pass \txx as value 
because by default \high already uses style=\tx. When you now combine 
the default \tx from \high and the \tx from the footnote you get the 
\txx size (which is used in the custom \high command).

 begin example
\definehigh[fakenotesymbol][style=\txx]

\starttext

\startlines
test\footnote{\unknown}
test\high{\tx 1}
test\fakenotesymbol{1}
\stoplines

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


[NTG-context] Re: How to make superscript text match footnote mark formatting?

2024-04-27 Thread Wolfgang Schuster

Joel via ntg-context schrieb am 27.04.2024 um 19:16:

\starttext
  test\high{1}test\footnote{some text}
\stoptext

How can I create a superscript number that has exactly the same 
formatting as a footnote, but which won't create a footnote. I tried 
\high{}, which I believe should be the way to superscript text, but if 
you compile this, you can see the first "1" and second "1" have entirely 
different formatting. How do I make the first one have the same exact 
formtating as the real footnote?


Footnotes apply the \tx style to the number in the running text and to 
get the same text size with \high you need \tx before the argument.


Another solution is to create your own \high command where you set the 
text size as default value but now you have to pass \txx as value 
because by default \high already uses style=\tx. When you now combine 
the default \tx from \high and the \tx from the footnote you get the 
\txx size (which is used in the custom \high command).


 begin example
\definehigh[fakenotesymbol][style=\txx]

\starttext

\startlines
test\footnote{\unknown}
test\high{\tx 1}
test\fakenotesymbol{1}
\stoplines

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


[NTG-context] How to make superscript text match footnote mark formatting?

2024-04-27 Thread Joel via ntg-context
\starttext
 test\high{1}test\footnote{some text}
\stoptext
How can I create a superscript number that has exactly the same formatting as a 
footnote, but which won't create a footnote. I tried \high{}, which I believe 
should be the way to superscript text, but if you compile this, you can see the 
first "1" and second "1" have entirely different formatting. How do I make the 
first one have the same exact formtating as the real footnote?
--Joel
___
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-27 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 25.04.2024 um 10:24:

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.


Hi ???,

not all commands provide a way to inherit their options but the "framed" 
and "counter" mechanism supports it.


To use the framed mechanism with your own command replace 
\installcommandhandler with \installframedcommandhandler. This creates a 
command named \inherited...framed which can be customized with the 
setups of the new namespace.


 begin example
\unprotect

\installnamespace  {sidenote}
\installframedcommandhandler \sidenote {sidenote} \sidenote

\protect

\starttext

\inheritedsidenoteframed{Text in a frame!}

\setupsidenote[framecolor=red,width=8cm,height=2cm]

\inheritedsidenoteframed{Text in a frame!}

\stoptext
 end example

To use the counter mechanism with your commands you have to first use 
\installcounterassociation to create the two new commands 
\register...counter (this ensures the default counter values are used 
when you don't set anything) and \synchronize...counters (which updates 
the counter values when you use the setup of your own command).


Unlike the framed mechanism this no longer works with the root instance 
of your own commands because we create a new counter only when you 
create a instance (with \define...) of the new command.


 begin example
\unprotect

\installnamespace{sidenote}
\installcommandhandler \sidenote {sidenote} \sidenote

\installcounterassociation{sidenote}

\appendtoks
  \registersidenotecounter\currentsidenote
  \definecounter[\currentsidenote]%
\to \everydefinesidenote

\appendtoks
  \synchronizesidenotecounters
\to \everysetupsidenote

\protect

\starttext

% create a new sidenote instance with a associated counter
\definesidenote[example]

\start % use grouping to keep the sidenote instance local
\def\currentsidenote{example}% set the sidenote instance to example
\incrementcounter[example]% increment the example/sidenote counter
\convertedcounter[example]% print the example/sidenote counter
\stop

% change the number format of the example/sidenote counter
\setupsidenote[example][numberconversion=romannumerals]

\start
\def\currentsidenote{example}
\incrementcounter[example]
\convertedcounter[example]
\stop

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


[NTG-context] Re: \par and \startlines

2024-04-27 Thread Henning Hraban Ramm

Am 26.04.24 um 18:24 schrieb Wolfgang Schuster:
BTW: ConTeXt has a module for poems which can be loaded with 
\usemodule[format].


Never heard of it. Version says “ancient” ;)

https://source.contextgarden.net/tex/context/modules/mkiv/m-format.mkiv

What’s the advantage of all this markup over simple "lines" (or even 
\par after each line)?


I’ll need to typeset a book of poetry soon, that will probably need a 
lot of different indentation/aligments…


Hraban

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