ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Scale notation base on current font
@ 2024-06-08 11:16 seyal.zavira
  2024-06-08 11:54 ` [NTG-context] " Pablo Rodriguez via ntg-context
  2024-06-08 14:02 ` vm via ntg-context
  0 siblings, 2 replies; 8+ messages in thread
From: seyal.zavira @ 2024-06-08 11:16 UTC (permalink / raw)
  To: ntg-context

Hi all,

There's a problem when I want to define the note so that it's displayed according to the size and font of the text:

this MWE change the notation size:
\definenote[Mynote][location=text,before={},]
\setupnote[Mynote]
    [location=left,
     textcommand=\tfb \raise 0.2ex\hbox,
    ]
\starttext
hello \Mynote{refrence}
\placenotes[Mynote]
\stoptext

but i cannot set it for \tfxx.
also it's relative to my main body font, and my current font and color doesn't apply to text.
for example if my current text has color red with another font the note doesn't change according to it, and will display identical everywhere.

And when I try to define it like this MWE:

\definenote[Mynote][location=text,before={},]
\setupnote[Mynote]
    [location=left,
     textcommand= \scale [height=0.7ex] \raise 0.2ex\hbox,
    ]
\starttext
hello \Mynote{refrence}
\placenotes[Mynote]
\stoptext

it doesn't work.

how i should define such notes?
___________________________________________________________________________________
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] 8+ messages in thread

* [NTG-context] Re: Scale notation base on current font
  2024-06-08 11:16 [NTG-context] Scale notation base on current font seyal.zavira
@ 2024-06-08 11:54 ` Pablo Rodriguez via ntg-context
  2024-06-08 14:02 ` vm via ntg-context
  1 sibling, 0 replies; 8+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2024-06-08 11:54 UTC (permalink / raw)
  To: ntg-context; +Cc: Pablo Rodriguez

On 6/8/24 13:16, seyal.zavira@gmail.com wrote:
> Hi all,
>
> There's a problem when I want to define the note so that it's
> displayed according to the size and font of the text:

Not sure I’m getting your point.

But this should show a difference in font size:

  \definenote[Mynote]
  \starttext
  \color[green]{\tfd hello \Mynote{refrence} not really required}

  \switchtobodyfont[36pt]
  \color[green]{hello \Mynote{refrence} not really required}
  \stoptext

> but i cannot set it for \tfxx.
> also it's relative to my main body font, and my current font andI
> color doesn't apply to text.
> for example if my current text has color red with another font the
> note doesn't change according to it, and will display identical
> everywhere.

Could you show how the second paragraph above doesn‘t inherit both size
and color from the current font?

Sorry, otherwise I simply don’t get it.

> And when I try to define it like this MWE:
>
> \definenote[Mynote][location=text,before={},]
> \setupnote[Mynote]
>     [location=left,
>      textcommand= \scale [height=0.7ex] \raise 0.2ex\hbox,
>     ]

I don’t think the text command value is right.

Besides, if you intend the second paragraph from the sample, this
approach looks unnecessarily complex for me.

I hope it might help,

Pablo
___________________________________________________________________________________
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] 8+ messages in thread

* [NTG-context] Re: Scale notation base on current font
  2024-06-08 11:16 [NTG-context] Scale notation base on current font seyal.zavira
  2024-06-08 11:54 ` [NTG-context] " Pablo Rodriguez via ntg-context
@ 2024-06-08 14:02 ` vm via ntg-context
  2024-06-08 15:09   ` seyal zavira
  1 sibling, 1 reply; 8+ messages in thread
From: vm via ntg-context @ 2024-06-08 14:02 UTC (permalink / raw)
  To: ntg-context; +Cc: vm



On 08/06/2024 13:16, seyal.zavira@gmail.com wrote:
> \definenote[Mynote][location=text,before={},]
> \setupnote[Mynote]
>      [location=left,
>       textcommand= \scale [height=0.7ex] \raise 0.2ex\hbox,
>      ]
> \starttext
> hello \Mynote{refrence}
> \placenotes[Mynote]
> \stoptext


add {} this works:

\setupnote[Mnote]
[location=left,
textcommand={\scale[height=0.7ex] \raise 0.2ex\hbox},
]

___________________________________________________________________________________
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] 8+ messages in thread

* [NTG-context] Re: Scale notation base on current font
  2024-06-08 14:02 ` vm via ntg-context
@ 2024-06-08 15:09   ` seyal zavira
  2024-06-08 15:25     ` Wolfgang Schuster
  2024-06-08 15:35     ` Pablo Rodriguez via ntg-context
  0 siblings, 2 replies; 8+ messages in thread
From: seyal zavira @ 2024-06-08 15:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1908 bytes --]

Thanks

sorry for incomplete example
the code below shows the problem better:
\setupinteraction[state=start]
\definenote[Mynote][location=text,before={},]
\setupnote[Mynote]
    [location=left,
     textcommand={\tfa \raise 0.2ex\hbox},
    ]

\definefont[highfont][name:ibmplexsansbold*default at 10pt]
\definehighlight[newhigh][color=darkblue,style=highfont]

\starttext
\input{knuth} \Mynote{refrence}

\startitemize
\item \newhigh{\input{knuth}\Mynote{refrenceTwo}}
\stopitemize

\placenotes[Mynote]
\stoptext

as you can see the note number has same style all over the document.
but i want it to have style base on current font
and if the font changes, the style should change, while maintaining the
ratio of sizes(i.e., at the half of current font).
i attached the resulted pdf

On Sat, Jun 8, 2024 at 10:04 AM vm via ntg-context <ntg-context@ntg.nl>
wrote:

>
>
> On 08/06/2024 13:16, seyal.zavira@gmail.com wrote:
> > \definenote[Mynote][location=text,before={},]
> > \setupnote[Mynote]
> >      [location=left,
> >       textcommand= \scale [height=0.7ex] \raise 0.2ex\hbox,
> >      ]
> > \starttext
> > hello \Mynote{refrence}
> > \placenotes[Mynote]
> > \stoptext
>
>
> add {} this works:
>
> \setupnote[Mnote]
> [location=left,
> textcommand={\scale[height=0.7ex] \raise 0.2ex\hbox},
> ]
>
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3188 bytes --]

[-- Attachment #2: test.pdf --]
[-- Type: application/pdf, Size: 15259 bytes --]

[-- Attachment #3: 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] 8+ messages in thread

* [NTG-context] Re: Scale notation base on current font
  2024-06-08 15:09   ` seyal zavira
@ 2024-06-08 15:25     ` Wolfgang Schuster
  2024-06-08 15:49       ` seyal.zavira
  2024-06-08 15:35     ` Pablo Rodriguez via ntg-context
  1 sibling, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2024-06-08 15:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users, seyal zavira

seyal zavira schrieb am 08.06.2024 um 17:09:
> Thanks
> 
> sorry for incomplete example
> the code below shows the problem better:
> \setupinteraction[state=start]
> \definenote[Mynote][location=text,before={},]
> \setupnote[Mynote]
>      [location=left,
>       textcommand={\tfa \raise 0.2ex\hbox},
>      ]
> 
> \definefont[highfont][name:ibmplexsansbold*default at 10pt]
> \definehighlight[newhigh][color=darkblue,style=highfont]
> 
> \starttext
> \input{knuth} \Mynote{refrence}
> 
> \startitemize
> \item \newhigh{\input{knuth}\Mynote{refrenceTwo}}
> \stopitemize
> 
> \placenotes[Mynote]
> \stoptext
> 
> as you can see the note number has same style all over the document.
> but i want it to have style base on current font
> and if the font changes, the style should change, while maintaining the 
> ratio of sizes(i.e., at the half of current font).
> i attached the resulted pdf

1. You can use the \offset command to raise the footnote number.

2. Disable the value of the textstyle to ensure you get current style 
for the footnote number.

%%%% begin example
\define[1]\MyNoteTextcommand
   {\offset[y=-0.2ex]{#1}}

\definenote
   [Mynote]

\setupnote
   [Mynote]
   [location=text,
    textstyle=,
    textcommand=\MyNoteTextcommand]

\starttext

\input{knuth}\Mynote{First note.}

\startstyle[style=\ss]
\input{knuth}\Mynote{Second note.}
\stopstyle

\startstyle[style=\tt\bf]
\input{knuth}\Mynote{Third note.}
\stopstyle

\placenotes[Mynote]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [NTG-context] Re: Scale notation base on current font
  2024-06-08 15:09   ` seyal zavira
  2024-06-08 15:25     ` Wolfgang Schuster
@ 2024-06-08 15:35     ` Pablo Rodriguez via ntg-context
  2024-06-08 16:56       ` seyal.zavira
  1 sibling, 1 reply; 8+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2024-06-08 15:35 UTC (permalink / raw)
  To: ntg-context; +Cc: Pablo Rodriguez

On 6/8/24 17:09, seyal zavira wrote:
> Thanks
>
> sorry for incomplete example
> the code below shows the problem better:
> \setupinteraction[state=start]

As for the color, it is caused by \setupinteraction.

You can remove it with:

  \setupinteraction[state=start, style=, color=, contrastcolor=,]

This disables default style and color in links (footnote markers are links).

I hope it helps,

Pablo
___________________________________________________________________________________
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] 8+ messages in thread

* [NTG-context] Re: Scale notation base on current font
  2024-06-08 15:25     ` Wolfgang Schuster
@ 2024-06-08 15:49       ` seyal.zavira
  0 siblings, 0 replies; 8+ messages in thread
From: seyal.zavira @ 2024-06-08 15:49 UTC (permalink / raw)
  To: ntg-context

Thanks so much
it works great.
___________________________________________________________________________________
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] 8+ messages in thread

* [NTG-context] Re: Scale notation base on current font
  2024-06-08 15:35     ` Pablo Rodriguez via ntg-context
@ 2024-06-08 16:56       ` seyal.zavira
  0 siblings, 0 replies; 8+ messages in thread
From: seyal.zavira @ 2024-06-08 16:56 UTC (permalink / raw)
  To: ntg-context

This is also important
Thanks for your helpful hint.
___________________________________________________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2024-06-08 16:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-08 11:16 [NTG-context] Scale notation base on current font seyal.zavira
2024-06-08 11:54 ` [NTG-context] " Pablo Rodriguez via ntg-context
2024-06-08 14:02 ` vm via ntg-context
2024-06-08 15:09   ` seyal zavira
2024-06-08 15:25     ` Wolfgang Schuster
2024-06-08 15:49       ` seyal.zavira
2024-06-08 15:35     ` Pablo Rodriguez via ntg-context
2024-06-08 16:56       ` seyal.zavira

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).