* Bar within math (amended)
@ 2020-06-09 18:28 Lukas/ConTeXt
2020-06-09 18:41 ` Wolfgang Schuster
0 siblings, 1 reply; 4+ messages in thread
From: Lukas/ConTeXt @ 2020-06-09 18:28 UTC (permalink / raw)
To: ntg-context
[-- Attachment #1: Type: text/plain, Size: 954 bytes --]
Hello,
it seems that bar (even with option 'continue=yes') is not rendered in place of '~' within math. See the sample:
----
\definebar[MyBar][color=green,rulethickness=2.8,order=background,offset=1.5,continue=yes]
\starttext
1 + 2 = \startbar[MyBar]3~kN\stopbar % OK
$1 + 2 = \startbar[MyBar]3~\text{kN}\stopbar$ % No background behind space
$1 + 2 = \inframed[frame=off,background=color,backgroundcolor=green,offset=0pt,]{3~\text{kN}}$ % OK!
\stoptext
----
In the sample 'kN' is a unit, which should be separated by space from the result (here: 3);
I am used to put the unit into the math environment and enclose it into \text{...}.
Is there a way to make the bar be rendered in places of blanks within math, too (like if it was inside $ ... $ - as the first line of the sample)?
- Note that I can use \inframed to get background filled fully, but anyway - how about usage of "bar" for this?
Best regards,
Lukas
[-- Attachment #2: Bar.mkiv --]
[-- Type: text/plain, Size: 307 bytes --]
\definebar[MyBar][color=green,rulethickness=2.8,order=background,offset=1.5,continue=yes]
\starttext
1 + 2 = \startbar[MyBar]3~kN\stopbar
$1 + 2 = \startbar[MyBar]3~\text{kN}\stopbar$
$1 + 2 = \inframed[frame=off,background=color,backgroundcolor=green,offset=0pt,]{3~\text{kN}}$
\stoptext
[-- Attachment #3: Bar.pdf --]
[-- Type: application/pdf, Size: 7665 bytes --]
[-- Attachment #4: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Bar within math (amended)
2020-06-09 18:28 Bar within math (amended) Lukas/ConTeXt
@ 2020-06-09 18:41 ` Wolfgang Schuster
2020-06-11 11:41 ` Axel Kielhorn
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2020-06-09 18:41 UTC (permalink / raw)
To: mailing list for ConTeXt users, Lukas/ConTeXt
Lukas/ConTeXt schrieb am 09.06.2020 um 20:28:
> Hello,
>
> it seems that bar (even with option 'continue=yes') is not rendered in place of '~' within math. See the sample:
>
> ----
> \definebar[MyBar][color=green,rulethickness=2.8,order=background,offset=1.5,continue=yes]
>
> \starttext
> 1 + 2 = \startbar[MyBar]3~kN\stopbar % OK
>
> $1 + 2 = \startbar[MyBar]3~\text{kN}\stopbar$ % No background behind space
>
> $1 + 2 = \inframed[frame=off,background=color,backgroundcolor=green,offset=0pt,]{3~\text{kN}}$ % OK!
> \stoptext
> ----
>
> In the sample 'kN' is a unit, which should be separated by space from the result (here: 3);
> I am used to put the unit into the math environment and enclose it into \text{...}.
>
> Is there a way to make the bar be rendered in places of blanks within math, too (like if it was inside $ ... $ - as the first line of the sample)?
>
> - Note that I can use \inframed to get background filled fully, but anyway - how about usage of "bar" for this?
Use a textbackground to highlight parts of your text.
\definetextbackground
[Highlight]
[frame=off,
background=color,
backgroundcolor=yellow]
\starttext
\m{1 + 2 = \unit{3 kilo newton}}
\m{1 + 2 = \Highlight{\unit{3 kilo newton}}}
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Bar within math (amended)
2020-06-09 18:41 ` Wolfgang Schuster
@ 2020-06-11 11:41 ` Axel Kielhorn
2020-06-15 17:57 ` Henning Hraban Ramm
0 siblings, 1 reply; 4+ messages in thread
From: Axel Kielhorn @ 2020-06-11 11:41 UTC (permalink / raw)
To: ntg-context
> Am 09.06.2020 um 20:41 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
>
> Use a textbackground to highlight parts of your text.
>
> \definetextbackground
> [Highlight]
> [frame=off,
> background=color,
> backgroundcolor=yellow]
>
> \starttext
>
> \m{1 + 2 = \unit{3 kilo newton}}
>
> \m{1 + 2 = \Highlight{\unit{3 kilo newton}}}
>
> \stoptext
>
> Wolfgang
>
Is there a way to highlight just the words and leave the space white?
Something like \overstrikes?
Greetings
Axel
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Bar within math (amended)
2020-06-11 11:41 ` Axel Kielhorn
@ 2020-06-15 17:57 ` Henning Hraban Ramm
0 siblings, 0 replies; 4+ messages in thread
From: Henning Hraban Ramm @ 2020-06-15 17:57 UTC (permalink / raw)
To: mailing list for ConTeXt users
> Am 11.06.2020 um 13:41 schrieb Axel Kielhorn <tex@axelkielhorn.de>:
>
>> Am 09.06.2020 um 20:41 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
>>
>> Use a textbackground to highlight parts of your text.
>>
>> \definetextbackground
>> [Highlight]
>> [frame=off,
>> background=color,
>> backgroundcolor=yellow]
>>
>> \starttext
>>
>> \m{1 + 2 = \unit{3 kilo newton}}
>>
>> \m{1 + 2 = \Highlight{\unit{3 kilo newton}}}
>>
>> \stoptext
>>
>> Wolfgang
>>
>
> Is there a way to highlight just the words and leave the space white?
> Something like \overstrikes?
Wolfgang or whoelse,
when would you advise to use textbackgrounds and when bars? E.g. if I need a “marker” highlighting.
Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-15 17:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09 18:28 Bar within math (amended) Lukas/ConTeXt
2020-06-09 18:41 ` Wolfgang Schuster
2020-06-11 11:41 ` Axel Kielhorn
2020-06-15 17:57 ` Henning Hraban Ramm
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).