ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] underbrace label across two lines
@ 2023-12-20  7:00 Dean Hung
  2023-12-20  8:25 ` [NTG-context] " Mikael Sundqvist
  0 siblings, 1 reply; 3+ messages in thread
From: Dean Hung @ 2023-12-20  7:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi list,

Following on from Aditya's solution to my previous question, I have run
into a separate issue and would appreciate any assistance.

Sometimes text under the underbrace can become quite long, and should be
split into two (or more) lines.  In the example below, "firstline" should
be the top line of the underbrace label, and "secondline" should be on the
lower line of the underbrace label, but as it stands, both are printed on
the same line.

\underbrace[mindepth=0.5cm]{\tf x+y+z}_{\vrule width 0pt height
0.5cm\relax\text{firstline secondline}}

I have tried using \\ and \crlf, but to no avail.

Any help would be greatly appreciated!

Dean

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

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

* [NTG-context] Re: underbrace label across two lines
  2023-12-20  7:00 [NTG-context] underbrace label across two lines Dean Hung
@ 2023-12-20  8:25 ` Mikael Sundqvist
  2023-12-20 20:55   ` Dean Hung
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Sundqvist @ 2023-12-20  8:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

On Wed, Dec 20, 2023 at 8:01 AM Dean Hung <deanyhung@gmail.com> wrote:
>
> Hi list,
>
> Following on from Aditya's solution to my previous question, I have run into a separate issue and would appreciate any assistance.
>
> Sometimes text under the underbrace can become quite long, and should be split into two (or more) lines.  In the example below, "firstline" should be the top line of the underbrace label, and "secondline" should be on the lower line of the underbrace label, but as it stands, both are printed on the same line.
>
> \underbrace[mindepth=0.5cm]{\tf x+y+z}_{\vrule width 0pt height 0.5cm\relax\text{firstline secondline}}
>
> I have tried using \\ and \crlf, but to no avail.
>
> Any help would be greatly appreciated!
>
> Dean

Hi,

Hans will add some annotation mechanism (already on my computer to
test a bit). In your case you can use the first example here:

\startbuffer
\unframed
[align=middle,toffset=0.5cm]
{firstline\crlf secondline}
\stopbuffer

$
\underbrace
[mindepth=0.5cm]
{\tf x + y + z}
_
{\mtext{\getbuffer}}

\quad

\mathannotation
[bottom={\getbuffer}]
{\underbrace
[mindepth=0.5cm]
{\tf x + y + z}
}
$

Since I am the curious type, I wonder a bit what is the use case here?
Do you mind explaining and providing the complete example? (The reason
I ask is that there might be better ways to do what you are doing.)

/Mikael
___________________________________________________________________________________
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] 3+ messages in thread

* [NTG-context] Re: underbrace label across two lines
  2023-12-20  8:25 ` [NTG-context] " Mikael Sundqvist
@ 2023-12-20 20:55   ` Dean Hung
  0 siblings, 0 replies; 3+ messages in thread
From: Dean Hung @ 2023-12-20 20:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Mikael,

Thanks for your reply -- I was able to get great results after using the
\startbuffer ... \stopbuffer approach.

I'm still a bit of a beginner with ConText so I wasn't clear on what the
meaning of the $ symbols in your reply?

The reason I have been using the underbraces is for explaining how
botanical naming conventions work.
In certain fields of botany/horticulture, plant types follow certain rules
for naming.  Here is a fictitious name
as an example:

Loremphylla mikaelii forma alba 'Aditya'

Genus = Loremphylla
Species = mikaelii
botanical form = forma
Cultivar Epithet = 'Aditya'

The problem I was running into was the labels might have more words than
can be contained within the space allotted
on one line (i.e., Cultivar Epithet would not fit in the space on the same
line, and hence my question on how to force a \crlf
between those two words).

Best,

Dean


On Wed, Dec 20, 2023 at 2:27 AM Mikael Sundqvist <mickep@gmail.com> wrote:

> Hi,
>
> On Wed, Dec 20, 2023 at 8:01 AM Dean Hung <deanyhung@gmail.com> wrote:
> >
> > Hi list,
> >
> > Following on from Aditya's solution to my previous question, I have run
> into a separate issue and would appreciate any assistance.
> >
> > Sometimes text under the underbrace can become quite long, and should be
> split into two (or more) lines.  In the example below, "firstline" should
> be the top line of the underbrace label, and "secondline" should be on the
> lower line of the underbrace label, but as it stands, both are printed on
> the same line.
> >
> > \underbrace[mindepth=0.5cm]{\tf x+y+z}_{\vrule width 0pt height
> 0.5cm\relax\text{firstline secondline}}
> >
> > I have tried using \\ and \crlf, but to no avail.
> >
> > Any help would be greatly appreciated!
> >
> > Dean
>
> Hi,
>
> Hans will add some annotation mechanism (already on my computer to
> test a bit). In your case you can use the first example here:
>
> \startbuffer
> \unframed
> [align=middle,toffset=0.5cm]
> {firstline\crlf secondline}
> \stopbuffer
>
> $
> \underbrace
> [mindepth=0.5cm]
> {\tf x + y + z}
> _
> {\mtext{\getbuffer}}
>
> \quad
>
> \mathannotation
> [bottom={\getbuffer}]
> {\underbrace
> [mindepth=0.5cm]
> {\tf x + y + z}
> }
> $
>
> Since I am the curious type, I wonder a bit what is the use case here?
> Do you mind explaining and providing the complete example? (The reason
> I ask is that there might be better ways to do what you are doing.)
>
> /Mikael
>
> ___________________________________________________________________________________
> 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: 4356 bytes --]

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

end of thread, other threads:[~2023-12-20 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20  7:00 [NTG-context] underbrace label across two lines Dean Hung
2023-12-20  8:25 ` [NTG-context] " Mikael Sundqvist
2023-12-20 20:55   ` Dean Hung

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