Re: [NTG-context] Q about hangaround commands

2012-12-06 Thread Mikael P. Sundqvist
On Wed, Nov 3, 2010 at 7:51 AM, Wolfgang Schuster 
schuster.wolfg...@googlemail.com wrote:


 Am 03.11.2010 um 05:47 schrieb Vladimir Lomov:

  Hi.
 
  Some answers I found myself :)
 
  P.S. I have feeling that feature like 'hangaround' doesn't fit well
  with tex (page layout ...?) model.

 Hangaround is a very robust command and works in more cases than
 \placefigure[left] but you have a conflict with the \item command
 which place the itemize symbol before the following text which
 is indented in your case.

 \unprotect

 \def\stophangaround
   {\endgraf
\egroup}

 \def\starthangaround
   {\dosingleempty\dostarthangaround}

 \def\dostarthangaround[#1]%
   {\doifelse{#1}{\v!right}
  {\dostartrighthangaround}
  {\dostartlefthangaround }}

 \def\dostartlefthangaround
   {\noindent\bgroup
\dowithnextbox
  {\ifdim\nextboxht\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
   \setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
   \getboxheight\scratchdimen\of\box\nextbox
   \getnoflines\scratchdimen
   \nextboxht\strutht
   \nextboxdp\strutdp
   \hangindent\nextboxwd
   \hangafter-\noflines
   \llap{\flushnextbox}\ignorespaces}
\hbox}

 \def\dostartrighthangaround
   {\noindent\bgroup
\dowithnextbox
  {\ifdim\nextboxht\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
   \setbox\nextbox\hbox{\hskip\@@hadistance\flushnextbox}%
   \getboxheight\scratchdimen\of\box\nextbox
   \getnoflines\scratchdimen
   \nextboxht\strutht
   \nextboxdp\strutdp
   \hangindent-\nextboxwd
   \hangafter-\noflines
   \rlap{\hskip\hsize\llap{\flushnextbox}}\ignorespaces}
\hbox}

 \protect

 \starttext

 \starthangaround{\externalfigure[cow][scale=500]}
 \input tufte
 \stophangaround

 \blank

 \starthangaround[right]{\externalfigure[cow][scale=500]}
 \input tufte
 \stophangaround

 \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

 ___


Dear ConTeXt list,

I apologize for digging up an old thread. I was searching for
\starthangaround[right] and found this thread. I tried the code that
Wolfgang gave in this thread but I guess something has changed since then,
because it does not work with latest minimals. Would it be possible to get
(a working) version of \starthangaround[right]? I think it even would be
nice to have it in the core.

As a minimal nonworking example, see the email from Wolgang in this thread.

With best regards, Mikael
___
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
___

Re: [NTG-context] Q about hangaround commands

2012-12-06 Thread Otared Kavian
Hi Mikael,

The example given by Wolfgang works fine for me with mkii, but not in mkiv: 
probably something has changed in mkiv, for example the way [scale=500] must be 
used in mkiv.

Best regards: OK

On 6 déc. 2012, at 10:58, Mikael P. Sundqvist mic...@gmail.com wrote:

 On Wed, Nov 3, 2010 at 7:51 AM, Wolfgang Schuster 
 schuster.wolfg...@googlemail.com wrote:
 
 Am 03.11.2010 um 05:47 schrieb Vladimir Lomov:
 
  Hi.
 
  Some answers I found myself :)
 
  P.S. I have feeling that feature like 'hangaround' doesn't fit well
  with tex (page layout ...?) model.
 
 Hangaround is a very robust command and works in more cases than
 \placefigure[left] but you have a conflict with the \item command
 which place the itemize symbol before the following text which
 is indented in your case.
 
 \unprotect
 
 \def\stophangaround
   {\endgraf
\egroup}
 
 \def\starthangaround
   {\dosingleempty\dostarthangaround}
 
 \def\dostarthangaround[#1]%
   {\doifelse{#1}{\v!right}
  {\dostartrighthangaround}
  {\dostartlefthangaround }}
 
 \def\dostartlefthangaround
   {\noindent\bgroup
\dowithnextbox
  {\ifdim\nextboxht\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
   \setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
   \getboxheight\scratchdimen\of\box\nextbox
   \getnoflines\scratchdimen
   \nextboxht\strutht
   \nextboxdp\strutdp
   \hangindent\nextboxwd
   \hangafter-\noflines
   \llap{\flushnextbox}\ignorespaces}
\hbox}
 
 \def\dostartrighthangaround
   {\noindent\bgroup
\dowithnextbox
  {\ifdim\nextboxht\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
   \setbox\nextbox\hbox{\hskip\@@hadistance\flushnextbox}%
   \getboxheight\scratchdimen\of\box\nextbox
   \getnoflines\scratchdimen
   \nextboxht\strutht
   \nextboxdp\strutdp
   \hangindent-\nextboxwd
   \hangafter-\noflines
   \rlap{\hskip\hsize\llap{\flushnextbox}}\ignorespaces}
\hbox}
 
 \protect
 
 \starttext
 
 \starthangaround{\externalfigure[cow][scale=500]}
 \input tufte
 \stophangaround
 
 \blank
 
 \starthangaround[right]{\externalfigure[cow][scale=500]}
 \input tufte
 \stophangaround
 
 \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
 ___
 
 Dear ConTeXt list,
 
 I apologize for digging up an old thread. I was searching for 
 \starthangaround[right] and found this thread. I tried the code that Wolfgang 
 gave in this thread but I guess something has changed since then, because it 
 does not work with latest minimals. Would it be possible to get (a working) 
 version of \starthangaround[right]? I think it even would be nice to have it 
 in the core.
 
 As a minimal nonworking example, see the email from Wolgang in this thread.
 
 With best regards, Mikael
 ___
 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
 ___

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

Re: [NTG-context] Wrong float numbering with default=top

2012-12-06 Thread Marco Patzer
On 2012-12-04, Marco Patzer wrote:

 2012-12-04 Hans Hagen:

 Hi Hans,

  As an experiment I've added some trickery. But keep in mind that messing
  with numbers is never 100% foolproof. So, for the moment you can say
 
  \ctxlua{structures.lists.autoreorder = true}
 
  till we're sure about what level of control is needed. Beta later today.

 Thank you for the quick fix. It works for the minimal example, but it
 fails in my document. Defining custom float types seems to break the auto
 reordering.

New defined floats are still wrongly enumerated. Is there a workaround for
this?

Marco

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


[NTG-context] Math not loaded?

2012-12-06 Thread Rogers, Michael K
The following gives the error with the latest beta:

! Math error: parameter \Umathquad\displaystyle is not set.

with or without setting the font.  Is there a quick fix?


%\usetypescript[pagella]
%\setupbodyfont[pagella,12pt]
\starttext
$f$
\stoptext


Thanks,

Michael



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___
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
___


Re: [NTG-context] Math not loaded?

2012-12-06 Thread Otared Kavian
Hi Michael,

Your example typesets without problem on my machine (running Mac OS X 10.8 and 
ConTeXt  ver: 2012.12.06 01:21 MKIV).
Which version rae you testing?

Best regards: OK

On 6 déc. 2012, at 13:13, Rogers, Michael K mrog...@emory.edu wrote:

 The following gives the error with the latest beta:
 
 ! Math error: parameter \Umathquad\displaystyle is not set.
 
 with or without setting the font.  Is there a quick fix?
 
 
 %\usetypescript[pagella]
 %\setupbodyfont[pagella,12pt]
 \starttext
 $f$
 \stoptext
 
 
 Thanks,
 
 Michael
 
 
 
 This e-mail message (including any attachments) is for the sole use of
 the intended recipient(s) and may contain confidential and privileged
 information. If the reader of this message is not the intended
 recipient, you are hereby notified that any dissemination, distribution
 or copying of this message (including any attachments) is strictly
 prohibited.
 
 If you have received this message in error, please contact
 the sender by reply e-mail message and destroy all copies of the
 original message (including attachments).
 ___
 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
 ___

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


Re: [NTG-context] Math not loaded?

2012-12-06 Thread Philipp Gesang
···date: 2012-12-06, Thursday···from: Rogers, Michael K···

 The following gives the error with the latest beta:
 
 ! Math error: parameter \Umathquad\displaystyle is not set.

I can confirm this for version 2012.12.06 01:21. It’s OK with
2012.11.23 17:35.

Regards
Philipp



pgpBC0m0QZ9L5.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] Math not loaded?

2012-12-06 Thread Hans Hagen

On 12/6/2012 2:21 PM, Philipp Gesang wrote:

···date: 2012-12-06, Thursday···from: Rogers, Michael K···


The following gives the error with the latest beta:

! Math error: parameter \Umathquad\displaystyle is not set.


I can confirm this for version 2012.12.06 01:21. It’s OK with
2012.11.23 17:35.


are there messages on the console with respect to missing fonts?

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


Re: [NTG-context] Math not loaded?

2012-12-06 Thread Mojca Miklavec
On Thu, Dec 6, 2012 at 2:21 PM, Philipp Gesang wrote:
 ···date: 2012-12-06, Thursday···from: Rogers, Michael K···

 The following gives the error with the latest beta:

 ! Math error: parameter \Umathquad\displaystyle is not set.

 I can confirm this for version 2012.12.06 01:21. It’s OK with
 2012.11.23 17:35.

http://tug.org/svn/texlive?view=revisionrevision=28443

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

Re: [NTG-context] Math not loaded?

2012-12-06 Thread Mojca Miklavec
On Thu, Dec 6, 2012 at 2:29 PM, Hans Hagen wrote:

 are there messages on the console with respect to missing fonts?

The font is now called latinmodernmath-regular.otf. You need to
change or add that name.

Mojca

PS: but at least you cannot argue that you haven't been warned ;)
___
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
___


Re: [NTG-context] Math not loaded?

2012-12-06 Thread Alan BRASLAU
On Thu, 6 Dec 2012 14:29:04 +0100
Hans Hagen pra...@wxs.nl wrote:

 On 12/6/2012 2:21 PM, Philipp Gesang wrote:
  ···date: 2012-12-06, Thursday···from: Rogers, Michael K···
 
  The following gives the error with the latest beta:
 
  ! Math error: parameter \Umathquad\displaystyle is not set.
 
  I can confirm this for version 2012.12.06 01:21. It’s OK with
  2012.11.23 17:35.
 
 are there messages on the console with respect to missing fonts?

Reversion of lm.lfg

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

Re: [NTG-context] Wrong float numbering with default=top

2012-12-06 Thread Hans Hagen

On 12/6/2012 12:43 PM, Marco Patzer wrote:

On 2012-12-04, Marco Patzer wrote:


2012-12-04 Hans Hagen:

Hi Hans,


As an experiment I've added some trickery. But keep in mind that messing
with numbers is never 100% foolproof. So, for the moment you can say

\ctxlua{structures.lists.autoreorder = true}

till we're sure about what level of control is needed. Beta later today.


Thank you for the quick fix. It works for the minimal example, but it
fails in my document. Defining custom float types seems to break the auto
reordering.


New defined floats are still wrongly enumerated. Is there a workaround for
this?



adapted

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


Re: [NTG-context] Q about hangaround commands

2012-12-06 Thread Mikael P. Sundqvist
On Thu, Dec 6, 2012 at 11:44 AM, Otared Kavian ota...@gmail.com wrote:

 Hi Mikael,

 The example given by Wolfgang works fine for me with mkii, but not in
 mkiv: probably something has changed in mkiv, for example the way
 [scale=500] must be used in mkiv.

 Best regards: OK

 On 6 déc. 2012, at 10:58, Mikael P. Sundqvist mic...@gmail.com wrote:

 On Wed, Nov 3, 2010 at 7:51 AM, Wolfgang Schuster 
 schuster.wolfg...@googlemail.com wrote:


 Am 03.11.2010 um 05:47 schrieb Vladimir Lomov:

  Hi.
 
  Some answers I found myself :)
 
  P.S. I have feeling that feature like 'hangaround' doesn't fit well
  with tex (page layout ...?) model.

 Hangaround is a very robust command and works in more cases than
 \placefigure[left] but you have a conflict with the \item command
 which place the itemize symbol before the following text which
 is indented in your case.

 \unprotect

 \def\stophangaround
   {\endgraf
\egroup}

 \def\starthangaround
   {\dosingleempty\dostarthangaround}

 \def\dostarthangaround[#1]%
   {\doifelse{#1}{\v!right}
  {\dostartrighthangaround}
  {\dostartlefthangaround }}

 \def\dostartlefthangaround
   {\noindent\bgroup
\dowithnextbox
  {\ifdim\nextboxht\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
   \setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
   \getboxheight\scratchdimen\of\box\nextbox
   \getnoflines\scratchdimen
   \nextboxht\strutht
   \nextboxdp\strutdp
   \hangindent\nextboxwd
   \hangafter-\noflines
   \llap{\flushnextbox}\ignorespaces}
\hbox}

 \def\dostartrighthangaround
   {\noindent\bgroup
\dowithnextbox
  {\ifdim\nextboxht\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
   \setbox\nextbox\hbox{\hskip\@@hadistance\flushnextbox}%
   \getboxheight\scratchdimen\of\box\nextbox
   \getnoflines\scratchdimen
   \nextboxht\strutht
   \nextboxdp\strutdp
   \hangindent-\nextboxwd
   \hangafter-\noflines
   \rlap{\hskip\hsize\llap{\flushnextbox}}\ignorespaces}
\hbox}

 \protect

 \starttext

 \starthangaround{\externalfigure[cow][scale=500]}
 \input tufte
 \stophangaround

 \blank

 \starthangaround[right]{\externalfigure[cow][scale=500]}
 \input tufte
 \stophangaround

 \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

 ___


 Dear ConTeXt list,

 I apologize for digging up an old thread. I was searching for
 \starthangaround[right] and found this thread. I tried the code that
 Wolfgang gave in this thread but I guess something has changed since then,
 because it does not work with latest minimals. Would it be possible to get
 (a working) version of \starthangaround[right]? I think it even would be
 nice to have it in the core.

 As a minimal nonworking example, see the email from Wolgang in this thread.

 With best regards, Mikael

 ___
 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

 ___




 ___
 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

 ___


Hi Otared,

thank you for your answer. I work in mkiv, so I have to wait for a fix if
there will be one.

(I work in a two-column document, so \placefigure[right]... does not work,
it seems, otherwise I could have used that)

Best regards, Mikael
___
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

Re: [NTG-context] Q about hangaround commands

2012-12-06 Thread Hans Hagen

On 12/6/2012 10:58 AM, Mikael P. Sundqvist wrote:

On Wed, Nov 3, 2010 at 7:51 AM, Wolfgang Schuster
schuster..wolfg...@googlemail.com
mailto:schuster.wolfg...@googlemail.com wrote:


Am 03.11.2010 um 05:47 schrieb Vladimir Lomov:

  Hi.
 
  Some answers I found myself :)
 
  P.S. I have feeling that feature like 'hangaround' doesn't fit well
  with tex (page layout ...?) model.

Hangaround is a very robust command and works in more cases than
\placefigure[left] but you have a conflict with the \item command
which place the itemize symbol before the following text which
is indented in your case.

\unprotect

\def\stophangaround
   {\endgraf
\egroup}

\def\starthangaround
   {\dosingleempty\dostarthangaround}

\def\dostarthangaround[#1]%
   {\doifelse{#1}{\v!right}
  {\dostartrighthangaround}
  {\dostartlefthangaround }}

\def\dostartlefthangaround
   {\noindent\bgroup
\dowithnextbox
  {\ifdim\nextboxht\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
   \setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
   \getboxheight\scratchdimen\of\box\nextbox
   \getnoflines\scratchdimen
   \nextboxht\strutht
   \nextboxdp\strutdp
   \hangindent\nextboxwd
   \hangafter-\noflines
   \llap{\flushnextbox}\ignorespaces}
\hbox}

\def\dostartrighthangaround
   {\noindent\bgroup
\dowithnextbox
  {\ifdim\nextboxht\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
   \setbox\nextbox\hbox{\hskip\@@hadistance\flushnextbox}%
   \getboxheight\scratchdimen\of\box\nextbox
   \getnoflines\scratchdimen
   \nextboxht\strutht
   \nextboxdp\strutdp
   \hangindent-\nextboxwd
   \hangafter-\noflines
   \rlap{\hskip\hsize\llap{\flushnextbox}}\ignorespaces}
\hbox}

\protect

\starttext

\starthangaround{\externalfigure[cow][scale=500]}
\input tufte
\stophangaround

\blank

\starthangaround[right]{\externalfigure[cow][scale=500]}
\input tufte
\stophangaround

\stoptext


as mkiv has a starthangaround but uses a different parameter handler, 
this works:


\unexpanded\def\starthangaround
  {\dontleavehmode\bgroup
   \dosingleempty\spac_hanging_around_start}

\def\spac_hanging_around_start[#1]%
  {\edef\m_spac_hanging_location{#1}%
   \dowithnextboxcs\spac_hanging_around_finish\hbox}

\def\spac_hanging_around_finish
  {\scratchdistance\directhangingparameter\c!distance\relax
   \ifdim\ht\nextbox\strutht
 \setbox\nextbox\tbox{\box\nextbox}%
   \fi
   \getboxheight\scratchdimen\of\box\nextbox
   \getnoflines\scratchdimen
   \ht\nextbox\strutht
   \dp\nextbox\strutdp
   \hangafter-\noflines
   \scratchwidth\dimexpr\wd\nextbox+\scratchdistance\relax
   \ifx\m_spac_hanging_location\v!right
 \hangindent-\scratchwidth
 \rlap{\hskip\dimexpr\hsize-\wd\nextbox\relax\box\nextbox}%
   \else
 \hangindent\scratchwidth
 \llap{\box\nextbox\hskip\scratchdistance}%
   \fi
   \ignorespaces}

i adapted the core code


Wolfgang


___
If your question is of interest to others as well, please add an
entry to the Wiki!

maillist : ntg-context@ntg.nl mailto: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

___


Dear ConTeXt list,

I apologize for digging up an old thread. I was searching for
\starthangaround[right] and found this thread. I tried the code that
Wolfgang gave in this thread but I guess something has changed since
then, because it does not work with latest minimals. Would it be
possible to get (a working) version of \starthangaround[right]? I think
it even would be nice to have it in the core.

As a minimal nonworking example, see the email from Wolgang in this thread.

With best regards, Mikael


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




--

-
  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

[NTG-context] drops module (draft)

2012-12-06 Thread Peter Rolf
Hi all,

a first version of the 'drops'-module (MkIV only) is available at

https://www.wuala.com/indiego/public/ConTeXt/drops/?key=caiCGLasLFmJ


Taken from the included documentation..
[..]
'drops' is a small extension for ConTeXt, that allows you to add drop
shadows to rectangular regions (so called boxshadows). A working
installation of ImageMagick (IM) is required to create the shadow
graphics. The supported color spaces are CMYK, RGB and Gray, the file
formats are limited to PNG and JPG.
[..]
Read the manual for detailed information.

The attached example is just a small test file for the 'rotation'
parameter (a compensation for the object rotation, so that the shadow
stays at the given direction). You will find other examples in the
documentation and there is also a 'pile' example with the complete
source. The 'presets' pdf contains the predefined setups for different
shadow (or frame) types and it's source is a good starting point for
your own experiments.

This is a first draft, but most things work quite stable. If you want to
help, test as much as possible. :-)

*You need a recent version of ImageMagick for this module.*

6.7.8-2 to 6.8.0-7 (wrong version info 6.8.0-6): used here, should work
6.7.6-0 or lower: will fail due to incompatibilities
7.0.0.0 alpha: untested ('magick' is used instead of 'convert')

Tested on Windows7 64bit and Debian 6.0.5-i386 (IM compiled from source)


Happy TeXing!


Peter


rotate.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] Q about hangaround commands

2012-12-06 Thread Hans Hagen

Hi,

I combined some functionality into:

\showframe

\starttext

\starthanging{\externalfigure[cow][scale=500]}
\input tufte
\stophanging

\blank

\starthanging[right]{\externalfigure[cow][scale=500]}
\input tufte
\stophanging

\blank

\starthanging[location=right,n=2,distance=1cm]{\externalfigure[cow][scale=500]}
\input tufte
\stophanging

\stoptext

after all, these were yet unofficial commands

Hans

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


Re: [NTG-context] drops module (draft)

2012-12-06 Thread Aditya Mahajan

On Thu, 6 Dec 2012, Peter Rolf wrote:


Hi all,

a first version of the 'drops'-module (MkIV only) is available at

https://www.wuala.com/indiego/public/ConTeXt/drops/?key=caiCGLasLFmJ


Taken from the included documentation..
[..]
'drops' is a small extension for ConTeXt, that allows you to add drop
shadows to rectangular regions (so called boxshadows). A working
installation of ImageMagick (IM) is required to create the shadow
graphics. The supported color spaces are CMYK, RGB and Gray, the file
formats are limited to PNG and JPG.
[..]
Read the manual for detailed information.


Nice.


The attached example is just a small test file for the 'rotation'
parameter (a compensation for the object rotation, so that the shadow
stays at the given direction). You will find other examples in the
documentation and there is also a 'pile' example with the complete
source. The 'presets' pdf contains the predefined setups for different
shadow (or frame) types and it's source is a good starting point for
your own experiments.

This is a first draft, but most things work quite stable. If you want to
help, test as much as possible. :-)

*You need a recent version of ImageMagick for this module.*


I always thought that shadows were possible to do in PDF 
(after all TikZ does it using some type of PDF primitives). Since you are 
the PDF expert, I am interested in knowing why you choose to go the 
ImageMagic route.


In terms of interface, wouldn't it be better if this somehow interfaced 
with the background/overlay mechanism. For example,


\definedropshadow[identifier][...options...]

which will define an overlay that will call ImageMagic with appropriate 
parameters (and caching the results if speed is a concern),


and then

\externalfigure[name][background=identifier]

should draw a dropped shadow around the image

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


Re: [NTG-context] drops module (draft)

2012-12-06 Thread Wolfgang Schuster

Am 06.12.2012 um 19:05 schrieb Aditya Mahajan adit...@umich.edu:

 On Thu, 6 Dec 2012, Peter Rolf wrote:
 
 Hi all,
 
 a first version of the 'drops'-module (MkIV only) is available at
 
 https://www.wuala.com/indiego/public/ConTeXt/drops/?key=caiCGLasLFmJ
 
 
 Taken from the included documentation..
 [..]
 'drops' is a small extension for ConTeXt, that allows you to add drop
 shadows to rectangular regions (so called boxshadows). A working
 installation of ImageMagick (IM) is required to create the shadow
 graphics. The supported color spaces are CMYK, RGB and Gray, the file
 formats are limited to PNG and JPG.
 [..]
 Read the manual for detailed information.
 
 Nice.

The module would be cleaner with a MkIV rewrite and I would drop the option
to accept each module parameter with \usemodule.

I would also create a new namespace for the \setupdrops command because
currently it uses the “module” namespace.

\def\dosetupdrops[#1]%
  {\iffirstargument\getparameters[\??module drops:][#1,{\c!setup=}]\else % 
never parameter 'setup'
   \ctxlua{thirddata.drops.resetdrops()}\fi} % reset all parameters to their 
default, when no argument is given

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
___


Re: [NTG-context] drops module (draft)

2012-12-06 Thread Marco
On 2012–12–06 Aditya Mahajan wrote:

 I always thought that shadows were possible to do in PDF (after all
 TikZ does it using some type of PDF primitives).

It is. I use MetaPost to draw the shadows using the shading
mechanism:

  withshading(circular, urcorner bottom_left, urcorner bottom_left, radius, 0)
  withfromshadecolor \MPcolor{c:transparent}
  withtoshadecolor   col;

and it works well if placed in an overlay. However, I did not manage
to get it working in TikZ, it could not display shadings to
transparent colours (which is very handy for slides where the
shadings might overlay graphics with a non-uniform colour).

 Since you are the PDF expert, I am interested in knowing why you
 choose to go the ImageMagic route.

From my experience shadows made from MetaPost shadings (which uses
PDF shadings, I assume) are quite low level. It's harder to get the
angle, distance and shadow size correctly implemented. I think the
ImageMagick shadings are more high level and ready to use.


Marco

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

Re: [NTG-context] Math not loaded?

2012-12-06 Thread Rogers, Michael K
On Dec 6, 2012, at 8:39 AM, Mojca Miklavec mojca.miklavec.li...@gmail.com
 wrote:

 On Thu, Dec 6, 2012 at 2:29 PM, Hans Hagen wrote:

 are there messages on the console with respect to missing fonts?

 The font is now called latinmodernmath-regular.otf. You need to
 change or add that name.

Yes, that's one it complains about for me (ConTeXt  ver: 2012.12.06 01:21 MKIV  
fmt: 2012.12.6  int: english/english).

Am I right to assume that Hans is the person to change this in a future beta, 
or is it something I can do?

Thanks for all the replies.

Michael



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___
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
___


Re: [NTG-context] Math not loaded?

2012-12-06 Thread Wolfgang Schuster

Am 06.12.2012 um 19:35 schrieb Rogers, Michael K mrog...@emory.edu:

 On Dec 6, 2012, at 8:39 AM, Mojca Miklavec mojca.miklavec.li...@gmail.com
 wrote:
 
 On Thu, Dec 6, 2012 at 2:29 PM, Hans Hagen wrote:
 
 are there messages on the console with respect to missing fonts?
 
 The font is now called latinmodernmath-regular.otf. You need to
 change or add that name.
 
 Yes, that's one it complains about for me (ConTeXt  ver: 2012.12.06 01:21 
 MKIV  fmt: 2012.12.6  int: english/english).
 
 Am I right to assume that Hans is the person to change this in a future beta, 
 or is it something I can do?

Hans already fixed it.

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
___


Re: [NTG-context] drops module (draft)

2012-12-06 Thread Hans Hagen

On 12/6/2012 7:05 PM, Aditya Mahajan wrote:

On Thu, 6 Dec 2012, Peter Rolf wrote:


Hi all,

a first version of the 'drops'-module (MkIV only) is available at

https://www.wuala.com/indiego/public/ConTeXt/drops/?key=caiCGLasLFmJ


Taken from the included documentation..
[..]
'drops' is a small extension for ConTeXt, that allows you to add drop
shadows to rectangular regions (so called boxshadows). A working
installation of ImageMagick (IM) is required to create the shadow
graphics. The supported color spaces are CMYK, RGB and Gray, the file
formats are limited to PNG and JPG.
[..]
Read the manual for detailed information.


Nice.


The attached example is just a small test file for the 'rotation'
parameter (a compensation for the object rotation, so that the shadow
stays at the given direction). You will find other examples in the
documentation and there is also a 'pile' example with the complete
source. The 'presets' pdf contains the predefined setups for different
shadow (or frame) types and it's source is a good starting point for
your own experiments.

This is a first draft, but most things work quite stable. If you want to
help, test as much as possible. :-)

*You need a recent version of ImageMagick for this module.*


I always thought that shadows were possible to do in PDF (after all TikZ
does it using some type of PDF primitives). Since you are the PDF
expert, I am interested in knowing why you choose to go the ImageMagic
route.


Some tricks are possible with functions that repeat bitmap patterns in 
clever ways but I lost the code that does it. If Peter can tell us what 
graphics are needed we can also make them directly as the img library 
has that possibility (we use it in mojca's gnuplot module)


Anyhow, as you are the math magician, here's a start:

\starttext

\startluacode
local format = string.format
function document.TestBitmap(nx,ny)
local r = { }
local s = 1/nx
for i=1,ny do
local c = { }
for j=1,nx/2 do
c[#c+1] = format(%02x,j*s*255)
end
for j=nx/2,1,-1 do
c[#c+1] = format(%02x,j*s*255)
end
c = table.concat(c,,1,nx)
r[#r+1] = c
end
r = table.concat(r,\r,1,ny)
print(r)
context(r)
end
\stopluacode

\startMPcode
draw 
textext(\bitmapimage[x=100,y=100,color=gray]{\ctxlua{document.TestBitmap(100,100)}}) 
xsized 10cm ;

\stopMPcode

\stoptext

So, what's needed is some edge related jugling.

Hans


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


Re: [NTG-context] MetaPost instance mechanism broken

2012-12-06 Thread Marco Patzer
On 2012–11–25 Marco Patzer wrote:

 in one of the last few betas the MetaPost instance
 mechanism broke.

Did the interface change again? The following does not work on
today's beta, only “alpha” and “gamma” are printed.

\defineMPinstance
  [myinstance]
  [metafun]

\startuseMPgraphic{alpha}
  draw textext(alpha) ;
\stopuseMPgraphic

\startuseMPgraphic{myinstance::beta}
  draw textext(beta) ;
\stopuseMPgraphic

\starttext
  \useMPgraphic{alpha}
  \useMPgraphic{myinstance::beta}
  \startMPcode{myinstance}
draw textext(gamma) ;
  \stopMPcode
\stoptext


Marco

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

Re: [NTG-context] drops module (draft)

2012-12-06 Thread Hans Hagen

On 12/6/2012 7:05 PM, Aditya Mahajan wrote:


I always thought that shadows were possible to do in PDF (after all TikZ
does it using some type of PDF primitives). Since you are the PDF
expert, I am interested in knowing why you choose to go the ImageMagic
route.


not so efficient but it shows a bit what bitmaps can do

\starttext

\startluacode
local format = string.format
local concat = table.concat
function document.TestBitmap(nx,ny)
nx = math.round(nx/65536)
ny = math.round(ny/65536)
nx = 2 * math.round(nx/2)
ny = 2 * math.round(ny/2)
local r = { }
local dx = 255/nx
local dy = 255/ny
for i=1,ny/2 do
local n = i*dy
local c = { }
for j=1,nx/2 do
c[#c+1] = format(%02x,j*dx+n)
end
for j=nx/2,1,-1 do
c[#c+1] = format(%02x,j*dx+n)
end
c = concat(c,,1,nx)
r[#r+1] = c
end
for i=ny/2,1,-1 do
local n = i*dy
local c = { }
for j=1,nx/2 do
c[#c+1] = format(%02x,j*dx+n)
end
for j=nx/2,1,-1 do
c[#c+1] = format(%02x,j*dx+n)
end
c = concat(c,,1,nx)
r[#r+1] = c
end
r = concat(r,\r,1,ny)
figures.bitmapimage {
data= r,
xresolution = nx,
yresolution = ny,
}
end
\stopluacode

\defineoverlay
  [BitMess]
  [{\scale
  [width=\dimexpr\overlaywidth+2ex,height=\dimexpr\overlayheight+2ex]

{\ctxlua{document.TestBitmap(\number\dimexpr\overlaywidth,\number\dimexpr\overlayheight)}}}]

\framed
  [width=10cm,
   height=10cm,
   frame=off,
   background={BitMess,color},
   backgroundcolor=white]
  {test}

\stoptext

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


Re: [NTG-context] drops module (draft)

2012-12-06 Thread Hans Hagen

On 12/6/2012 7:35 PM, Marco wrote:

On 2012–12–06 Aditya Mahajan wrote:


I always thought that shadows were possible to do in PDF (after all
TikZ does it using some type of PDF primitives).


It is. I use MetaPost to draw the shadows using the shading
mechanism:

   withshading(circular, urcorner bottom_left, urcorner bottom_left, radius, 
0)
   withfromshadecolor \MPcolor{c:transparent}
   withtoshadecolor   col;

and it works well if placed in an overlay. However, I did not manage
to get it working in TikZ, it could not display shadings to
transparent colours (which is very handy for slides where the
shadings might overlay graphics with a non-uniform colour).


I think drops are somewhat different as they might follow different 
rules than circular or linear shades



Since you are the PDF expert, I am interested in knowing why you
choose to go the ImageMagic route.


 From my experience shadows made from MetaPost shadings (which uses
PDF shadings, I assume) are quite low level. It's harder to get the
angle, distance and shadow size correctly implemented. I think the
ImageMagick shadings are more high level and ready to use.


Yes. Of course we can make shading more clever, but to be honest I never 
had the need.


Hans

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

[NTG-context] Doubled annotation content

2012-12-06 Thread Marco Patzer
In the following example the content of the annotation is printed
twice. Bug?

\usemodule [annotation]

\defineannotation
  [myannotation]
  [alternative=command,
   command=\cmd]

\def\cmd
  {\placeannotationcontent}

\starttext
  \startmyannotation
foo
  \stopmyannotation
\stoptext


Marco

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


Re: [NTG-context] Doubled annotation content

2012-12-06 Thread Otared Kavian
Hi Marco,

It seems that your command \cmd places again the content… Why do you want that 
command?
This works fine:

\usemodule [annotation]
\defineannotation
 [myannotation]

\starttext
 \startmyannotation
   foo
   
   \input knuth.tex
 \stopmyannotation
\stoptext

Best regards: OK

On 6 déc. 2012, at 21:24, Marco Patzer home...@lavabit.com wrote:

 In the following example the content of the annotation is printed
 twice. Bug?
 
 \usemodule [annotation]
 
 \defineannotation
  [myannotation]
  [alternative=command,
   command=\cmd]
 
 \def\cmd
  {\placeannotationcontent}
 
 \starttext
  \startmyannotation
foo
  \stopmyannotation
 \stoptext
 
 
 Marco
 
 ___
 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
 ___

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


Re: [NTG-context] Doubled annotation content

2012-12-06 Thread Marco Patzer
On 2012–12–06 Otared Kavian wrote:

 It seems that your command \cmd places again the content…

That's not the case. Check this example:

\usemodule [annotation]

\defineannotation
  [first]
  [alternative=command,
   command=\cmdFirst]

\defineannotation
  [second]
  [alternative=command,
   command=\cmdSecond]

\def\cmdFirst{}
\def\cmdSecond
  {\placeannotationcontent}

\starttext
\startfirst
  first  %% not printed
\stopfirst

\startsecond
  second %% printed twice
\stopsecond
\stoptext


 Why do you want that command?

???
It allows for flexible placement of the content.

 This works fine:
 
 \usemodule [annotation]
 \defineannotation
  [myannotation]
 
 \starttext
  \startmyannotation
foo

\input knuth.tex
  \stopmyannotation
 \stoptext

Try to use a custom command.


Marco

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

Re: [NTG-context] MetaPost instance mechanism broken

2012-12-06 Thread Hans Hagen

On 12/6/2012 8:10 PM, Marco Patzer wrote:

On 2012–11–25 Marco Patzer wrote:


in one of the last few betas the MetaPost instance
mechanism broke.


Did the interface change again? The following does not work on
today's beta, only “alpha” and “gamma” are printed.

\defineMPinstance
   [myinstance]
   [metafun]

\startuseMPgraphic{alpha}
   draw textext(alpha) ;
\stopuseMPgraphic

\startuseMPgraphic{myinstance::beta}
   draw textext(beta) ;
\stopuseMPgraphic

\starttext
   \useMPgraphic{alpha}
   \useMPgraphic{myinstance::beta}
   \startMPcode{myinstance}
 draw textext(gamma) ;
   \stopMPcode
\stoptext


sure, we have a different interface on odd days

Currently instances are played with a bit (as Alan and I want the 
chemical module to run in its own but also want it to be public).


Anyhow, one complication is in the related variables. I now have a 
version that supports this:


\defineMPinstance
  [myinstance]
  [metafun]

\startuseMPgraphic{alpha}
draw textext(alpha) ;
\stopuseMPgraphic

\startuseMPgraphic{myinstance::beta}
  draw textext(beta) ;
\stopuseMPgraphic

\startuniqueMPgraphic{myinstance::beta}{width}
  draw textext(beta) xsized \MPvar{width} ;
\stopuniqueMPgraphic

\startuseMPgraphic{myinstance::epsilon}{width,height}
  draw textext(epsilon) xysized (\MPvar{width},\MPvar{height}) ;
\stopuseMPgraphic

\setMPvariables
  [myinstance::beta]
  [width=5cm]

\setMPvariables
  [epsilon]
  [width=5cm,
   height=5cm]

\starttext

one   : \useMPgraphic{alpha} \blank

two   : \useMPgraphic{myinstance::beta} \blank

three : \startMPcode{myinstance} draw textext(gamma) ; 
\stopMPcode \blank


four  : \reuseMPgraphic{myinstance::beta}{width=2cm} \blank

five  : \startMPcode{myinstance} draw textext(delta) ; 
\stopMPcode \blank


six   : \reuseMPgraphic{myinstance::epsilon}{height=2cm} \blank

seven : \reuseMPgraphic{myinstance::epsilon} \blank

\stoptext

Hans


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

Re: [NTG-context] Doubled annotation content

2012-12-06 Thread Aditya Mahajan

On Thu, 6 Dec 2012, Marco Patzer wrote:


On 2012–12–06 Otared Kavian wrote:


It seems that your command \cmd places again the content…


That's not the case. Check this example:

\usemodule [annotation]

\defineannotation
 [first]
 [alternative=command,
  command=\cmdFirst]

\defineannotation
 [second]
 [alternative=command,
  command=\cmdSecond]

\def\cmdFirst{}
\def\cmdSecond
 {\placeannotationcontent}


Untested: Does

\unexpanded\def\cmdSecond ... help?


\starttext
\startfirst
 first  %% not printed
\stopfirst

\startsecond
 second %% printed twice
\stopsecond
\stoptext


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

Re: [NTG-context] Doubled annotation content

2012-12-06 Thread Wolfgang Schuster

Am 06.12.2012 um 21:24 schrieb Marco Patzer home...@lavabit.com:

 In the following example the content of the annotation is printed
 twice. Bug?
 
 \usemodule [annotation]
 
 \defineannotation
  [myannotation]
  [alternative=command,
   command=\cmd]
 
 \def\cmd
  {\placeannotationcontent}

The argument for the command keys has to be a macro with two parameters,
the first parameters contains the formatted header and the second argument
the formatted content of the environment.

You have to change your definition of \cmd to

  \define[2]\cmd{#2}

or

  \define[2]\cmd{\placeannotationcontent}

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
___


Re: [NTG-context] Doubled annotation content

2012-12-06 Thread Wolfgang Schuster

Am 06.12.2012 um 23:00 schrieb Marco Patzer home...@lavabit.com:

 Why do you want that command?
 
 ???
 It allows for flexible placement of the content.

You can also use \defineannotationalternative to create your own styles, see

  - http://www.ntg.nl/pipermail/ntg-context/2012/070019.html and
  - http://www.ntg.nl/pipermail/ntg-context/2012/070327.html

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
___