ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Multi-line labels in MetaPost MKIV
@ 2010-07-28  8:03 Richard Stephens
  2010-07-28  8:10 ` Wolfgang Schuster
  2010-07-28 10:22 ` Richard Stephens
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Stephens @ 2010-07-28  8:03 UTC (permalink / raw)
  To: Context User Group


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

Hello all,

What is the recommended method for creating multi-line labels in MetaPost in
MKIV, please?
I have the following code:

\definetextext[mplabel]{\framed[frame=off,align=middle]}
\starttext
\startMPpage
input mp-tool;

draw fullcircle scaled 5cm;
label(\sometxt[mplabel]{One\\Two}, (0,0));
\stopMPpage
\stoptext

which gives a line feed between One and Two using MKII, but no line feed in
MKIV.

Thanks,

Richard

Converteam UK Ltd. Registration Number: 5571739 and Converteam Ltd. Registration Number: 2416188 Registered in England and Wales. Registered office: Boughton Road, Rugby, Warwickshire, CV21 1BU.

CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. 
If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.

http://www.converteam.com

Please consider the environment before printing this e-mail.

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

[-- Attachment #2: Type: text/plain, Size: 486 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Multi-line labels in MetaPost MKIV
  2010-07-28  8:03 Multi-line labels in MetaPost MKIV Richard Stephens
@ 2010-07-28  8:10 ` Wolfgang Schuster
  2010-07-28 10:22 ` Richard Stephens
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2010-07-28  8:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

  Am 28.07.10 10:03, schrieb Richard Stephens:
> Hello all,
>
> What is the recommended method for creating multi-line labels in 
> MetaPost in MKIV, please?
> I have the following code:
>
> \definetextext[mplabel]{\framed[frame=off,align=middle]}
> \starttext
> \startMPpage
> input mp-tool;
>
> draw fullcircle scaled 5cm;
> label(\sometxt[mplabel]{One\\Two}, (0,0));
> \stopMPpage
> \stoptext
>
> which gives a line feed between One and Two using MKII, but no line 
> feed in MKIV.

\defineframed[mplabel][frame=off,align=middle]

\starttext
\startMPpage
draw fullcircle scaled 5cm ;
label(textext("\mplabel{One\\Two}"),origin)) ;
\stopMPpage
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Multi-line labels in MetaPost MKIV
  2010-07-28  8:03 Multi-line labels in MetaPost MKIV Richard Stephens
  2010-07-28  8:10 ` Wolfgang Schuster
@ 2010-07-28 10:22 ` Richard Stephens
  2010-07-28 10:39   ` Hans Hagen
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Stephens @ 2010-07-28 10:22 UTC (permalink / raw)
  To: ntg-context


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

 Am 28.07.10 10:03, schrieb Richard Stephens:
>
>> Hello all,
>>
>> What is the recommended method for creating multi-line labels in MetaPost
>> in MKIV, please?
>> I have the following code:
>>
>> \definetextext[mplabel]{\framed[frame=off,align=middle]}
>> \starttext
>> \startMPpage
>> input mp-tool;
>>
>> draw fullcircle scaled 5cm;
>> label(\sometxt[mplabel]{One\\Two}, (0,0));
>> \stopMPpage
>> \stoptext
>>
>> which gives a line feed between One and Two using MKII, but no line feed
>> in MKIV.
>>
>
> \defineframed[mplabel][frame=off,align=middle]
>
> \starttext
> \startMPpage
> draw fullcircle scaled 5cm ;
> label(textext("\mplabel{One\\Two}"),origin)) ;
> \stopMPpage
> \stoptext
>
> Wolfgang
>

Thanks for the suggestion, but I still don't get a line feed! I am using
ConTeXt from 15-May-2010, has something changed since then?

Richard

Converteam UK Ltd. Registration Number: 5571739 and Converteam Ltd. Registration Number: 2416188 Registered in England and Wales. Registered office: Boughton Road, Rugby, Warwickshire, CV21 1BU.

CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. 
If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.

http://www.converteam.com

Please consider the environment before printing this e-mail.

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

[-- Attachment #2: Type: text/plain, Size: 486 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Multi-line labels in MetaPost MKIV
  2010-07-28 10:22 ` Richard Stephens
@ 2010-07-28 10:39   ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2010-07-28 10:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Richard Stephens

On 28-7-2010 12:22, Richard Stephens wrote:
>   Am 28.07.10 10:03, schrieb Richard Stephens:
>>
>>> Hello all,
>>>
>>> What is the recommended method for creating multi-line labels in MetaPost
>>> in MKIV, please?
>>> I have the following code:
>>>
>>> \definetextext[mplabel]{\framed[frame=off,align=middle]}
>>> \starttext
>>> \startMPpage
>>> input mp-tool;
>>>
>>> draw fullcircle scaled 5cm;
>>> label(\sometxt[mplabel]{One\\Two}, (0,0));
>>> \stopMPpage
>>> \stoptext
>>>
>>> which gives a line feed between One and Two using MKII, but no line feed
>>> in MKIV.
>>>
>>
>> \defineframed[mplabel][frame=off,align=middle]
>>
>> \starttext
>> \startMPpage
>> draw fullcircle scaled 5cm ;
>> label(textext("\mplabel{One\\Two}"),origin)) ;
>> \stopMPpage
>> \stoptext
>>
>> Wolfgang
>>
>
> Thanks for the suggestion, but I still don't get a line feed! I am using
> ConTeXt from 15-May-2010, has something changed since then?

in pack-rul.mkiv add \unexpanded here:

\unexpanded\def\vboxednewline
   {\endgraf\ignorespaces}

\unexpanded\def\hboxednewline
   {\unskip\normalspace\ignorespaces}

and then remake the format

(it's a side effect of nested framed usage)

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Multi-line labels in MetaPost MKIV
  2010-07-28 14:08 Richard Stephens
@ 2010-07-28 14:18 ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2010-07-28 14:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Richard Stephens

On 28-7-2010 4:08, Richard Stephens wrote:

> Thanks Hans, that works.
> Will this change be added to the next release, or do I have to
> re-apply it manually?

will be in next release

> Is \sometxt not recommended now? Should I be using textext throughout?

\sometxt will stay



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Multi-line labels in MetaPost MKIV
@ 2010-07-28 14:08 Richard Stephens
  2010-07-28 14:18 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stephens @ 2010-07-28 14:08 UTC (permalink / raw)
  To: ntg-context

>>>> What is the recommended method for creating multi-line labels in MetaPost
>>>> in MKIV, please?
>>>> I have the following code:
>>>>
>>>> \definetextext[mplabel]{\framed[frame=off,align=middle]}
>>>> \starttext
>>>> \startMPpage
>>>> input mp-tool;
>>>>
>>>> draw fullcircle scaled 5cm;
>>>> label(\sometxt[mplabel]{One\\Two}, (0,0));
>>>> \stopMPpage
>>>> \stoptext
>>>>
>>>> which gives a line feed between One and Two using MKII, but no line feed
>>>> in MKIV.
>>>>
>>>
>>> \defineframed[mplabel][frame=off,align=middle]
>>>
>>> \starttext
>>> \startMPpage
>>> draw fullcircle scaled 5cm ;
>>> label(textext("\mplabel{One\\Two}"),origin)) ;
>>> \stopMPpage
>>> \stoptext
>>>
>>> Wolfgang
>>>
>>
>> Thanks for the suggestion, but I still don't get a line feed! I am using
>> ConTeXt from 15-May-2010, has something changed since then?
>
> in pack-rul.mkiv add \unexpanded here:
>
> \unexpanded\def\vboxednewline
>  {\endgraf\ignorespaces}
>
> \unexpanded\def\hboxednewline
>  {\unskip\normalspace\ignorespaces}
>
> and then remake the format
>
> (it's a side effect of nested framed usage)
>
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE

Thanks Hans, that works.
Will this change be added to the next release, or do I have to
re-apply it manually?

Is \sometxt not recommended now? Should I be using textext throughout?

Richard
Converteam UK Ltd. Registration Number: 5571739 and Converteam Ltd. Registration Number: 2416188 Registered in England and Wales. Registered office: Boughton Road, Rugby, Warwickshire, CV21 1BU.

CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. 
If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.

http://www.converteam.com

Please consider the environment before printing this e-mail.

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2010-07-28 14:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-28  8:03 Multi-line labels in MetaPost MKIV Richard Stephens
2010-07-28  8:10 ` Wolfgang Schuster
2010-07-28 10:22 ` Richard Stephens
2010-07-28 10:39   ` Hans Hagen
2010-07-28 14:08 Richard Stephens
2010-07-28 14:18 ` Hans Hagen

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