Re: [NTG-context] Vertically Aligning inmargin Text to Figure

2013-05-24 Thread Malte Stien
Wolfgang,

Thank you for this. I can see what you are trying to do here, but this does not 
actually compile for me. Unfortunately, I don't know enough about the 
implementation of ConTeXt to track the problem down. I am getting:

! Undefined control sequence.

system   tex  error on line 14 in file test.tex: Undefined control 
sequence ...

 4  
\copy\nextbox\rlap{\hskip\rightmargindistance\framed[frame=off,width=\rightmarginwidth,height=\nextboxht]{\floatuserdataparameter{text}}}
 5  \stoplinealignment}
 6 \hbox}
 7 
 8 \setupfloat[figure][command=\FigureText]
 9 
10 \starttext
11 
12 \startplacefigure[title=Dummy figure][text=Margin dummy]
13 \externalfigure[dummy][width=.8\textwidth]
14   \stopplacefigure
15 
16 \stoptext
17 


\syst_boxes_with_next_box -\startlinealignment 
[middle] \copy \nextbox \rla...
\strc_floats_place_packaged_boxes_indeed ...tbox }
  }\strc_floats_set_natural_...
\strc_floats_finish_placement ...e_packaged_boxes 
  \dostoptagged \global \d_p...
l.14 \stopplacefigure

Admittedly, I am on version 2012.10.20, which is about six months old now, but 
I am hesitant to update as I have a lot of co-workers using the same version 
and our configuration management processes dictate that we always update 
together.

Could you please help me out.

Thank you,
Malte.


--
“The Electric Monk was a labour-saving device, like a dishwasher or a video 
recorder... Electric Monks believed things for you, thus saving you what was 
becoming an increasingly onerous task, that of believing all the things the 
world expected you to believe.”

― Douglas Adams, Dirk Gently's Holistic Detective Agency

On 29/04/2013, at 9:04 PM, Wolfgang Schuster schuster.wolfg...@gmail.com 
wrote:

 
 Am 29.04.2013 um 09:33 schrieb Malte Stien ma...@stien.de:
 
 Hi,
 
 I need to associate a bit of text with a figure in a book. The text is 
 not---and cannot be---the figure caption (it's providing some explanation 
 with respect to some labels in the figure). I have tried the following based 
 on some other post on the mailing list:
 
 \definepapersize[eightsquare][width=8in, height=8in]
 \setuppapersize[eightsquare]
 
 \setuplayout[
  location=doublesided, marking=on, backspace=43mm, leftmargin=18mm,
  leftmargindistance=4mm, rightmargin=35mm, rightmargindistance=4mm, 
 rightedgewidth=6mm,
  topspace=12mm, header=15mm, footer=15mm, height=179mm, width=115mm
 ]
 
 \starttext
 
 \startplacefigure[location=force, title={First dummy caption}]
 \inmargin{First margin dummy}
 \externalfigure[dummy][width=115mm]
 \stopplacefigure
 
 \stoptext
 
 However, that results in the text being down the bottom of the figure. I 
 need the text to be vertically aligned with the top of the figure. I have 
 attached the resulting PDF for illustration purposes (is that okay on this 
 mailing list? It's very small).
 
 Any hints would be much appreciated.
 
 
 You can set the text in the margin with the second argument of 
 \startplacefigure.
 
 \define\FigureText
  {\dowithnextbox
 {\startlinealignment[middle]
  
 \copy\nextbox\rlap{\hskip\rightmargindistance\framed[frame=off,width=\rightmarginwidth,height=\nextboxht]{\floatuserdataparameter{text}}}
  \stoplinealignment}
 \hbox}
 
 \setupfloat[figure][command=\FigureText]
 
 \starttext
 
 \startplacefigure[title=Dummy figure][text=Margin dummy]
 \externalfigure[dummy][width=.8\textwidth]
 \stopplacefigure
 
 \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
 ___

___
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] Installing Scribuntu, for Lua on the wiki

2013-05-24 Thread Taco Hoekwater

On May 23, 2013, at 2:46 PM, Sietse Brouwer sbbrou...@gmail.com wrote:

 Hi Taco,
 
 I'd like to propose thse three extensions for the wiki:

No problem for any of them, but you will have to wait a bit. I am too stressed 
out right now, after the weekend life should be better.

Best wishes,
Taco

 
 * Scribunto [1], which allows writing wikicode extensions in Lua. I
 ran into a limitation of the template expansion system the other day.
 Also, this may come in useful for the command reference. [2]
 [1] http://www.mediawiki.org/wiki/Extension:Scribunto
 [2] http://www.mail-archive.com/ntg-context@ntg.nl/msg68550.html
 
 * BacktickCode, which allows writing `...` instead of code.../code
 — rather pleasant when writing about commands. The code needs a slight
 modification so as to ignore backticks inside texcode and context
 tags, too; see bottom of this e-mail.
 http://www.mediawiki.org/wiki/Extension:BacktickCode
 
 * Semantic Forms (which requirs Semantic Mediawiki), which allows
 presenting people with a form when creating certain types of pages.
 http://www.mediawiki.org/wiki/Extension:Semantic_Forms
 
 How does that sound to you?
 Thank you very much,
 
 Sietse
 
 Here's the modification to BacktickCode:
 
 function backtickCodeParse( $parser, $text, $stripState ) {
// We replace '`...`' by 'code.../code' and '\`' by '`'.
// Text between pre tags is not modified.
$text = preg_replace_callback('/pre(.*?)\/pre/s', function
 ($match) {
return 'pre' . preg_replace('/`/', '\`', $match[1]) . '/pre';
}, $text);
 +$text = preg_replace_callback('/texcode(.*?)\/texcode/s',
 function ($match) {
 +return 'texcode' . preg_replace('/`/', '\`', $match[1])
 . '/texcode';
 +}, $text);
 +$text = preg_replace_callback('/context(.*?)\/context/s',
 function ($match) {
 +return 'context' . preg_replace('/`/', '\`', $match[1])
 . '/context';
 +}, $text);
$text = preg_replace('/([^]|^)`([^`]*)`/',
 '$1code$2/code', $text);
$text = preg_replace('/\`/', '`', $text);
 
return true;
 }
 ___
 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] Vertically Aligning inmargin Text to Figure

2013-05-24 Thread Hans Hagen

On 5/24/2013 8:46 AM, Malte Stien wrote:

Wolfgang,

Thank you for this. I can see what you are trying to do here, but this does not 
actually compile for me. Unfortunately, I don't know enough about the 
implementation of ConTeXt to track the problem down. I am getting:

! Undefined control sequence.

system   tex  error on line 14 in file test.tex: Undefined control 
sequence ...

  4 
\copy\nextbox\rlap{\hskip\rightmargindistance\framed[frame=off,width=\rightmarginwidth,height=\nextboxht]{\floatuserdataparameter{text}}}
  5 \stoplinealignment}
  6 \hbox}
  7
  8 \setupfloat[figure][command=\FigureText]
  9
10 \starttext
11
12 \startplacefigure[title=Dummy figure][text=Margin dummy]
13 \externalfigure[dummy][width=.8\textwidth]
14   \stopplacefigure
15
16 \stoptext
17


\syst_boxes_with_next_box -\startlinealignment
 [middle] \copy \nextbox \rla...
\strc_floats_place_packaged_boxes_indeed ...tbox }
   }\strc_floats_set_natural_...
\strc_floats_finish_placement ...e_packaged_boxes
   \dostoptagged \global \d_p...
l.14 \stopplacefigure

Admittedly, I am on version 2012.10.20, which is about six months old now, but 
I am hesitant to update as I have a lot of co-workers using the same version 
and our configuration management processes dictate that we always update 
together.

Could you please help me out.


you can do a fresh install alongside an existing one and then run some 
tests


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] Understanding the imposing-mechanism

2013-05-24 Thread H. Özoguz

Hi there,

following Wolfgangs suggestion, I set every game-card on a single page 
now. All cards are in one pdf-File, each on his own page. Every page has 
the size 47,5mm x 76mm.


Now I tried to place the pages on a big sheet, its size is 660mm x 
330mm, s.th. the small cards are set in a 4*13 sceme (floor(330/76)=4 
and floor(660/47,5) = 13) - but I failed.


There is an example in the wiki for imposing existing pdf-pages, but I 
do not understand it, and if I try to change its values for my example, 
I get nothing reasonable, nor even understandable.

The example of the wiki is here: http://wiki.contextgarden.net/Imposition

And here my failed try:

\definepapersize[sheet][width=660mm,height=330mm]
\definepapersize[bigsheet][width=\dimexpr\paperwidth+4mm\relax,height=\dimexpr\paperheight+4mm\relax]
\setuppaper[sheet][bigsheet]
\setuppaper[nx=13, ny=4]
\setuplayout[page][location=middle, marking=on]
\setuparranging [XY]

\setuplayout
  [backspace=0pt,
topspace=0pt,
   width=middle,
  height=middle,
location=middle,
  header=0pt,
  footer=0pt]
\setuppagenumbering[]

\starttext
\insertpages
  [eslami_karten.pdf][]
\stoptext

Thanks for help.
Huseyin


___
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] Vertically Aligning inmargin Text to Figure

2013-05-24 Thread Wolfgang Schuster

Am 24.05.2013 um 08:46 schrieb Malte Stien ma...@stien.de:

 Wolfgang,
 
 Thank you for this. I can see what you are trying to do here, but this does 
 not actually compile for me. Unfortunately, I don't know enough about the 
 implementation of ConTeXt to track the problem down. I am getting:
 
 ! Undefined control sequence.
 
 system   tex  error on line 14 in file test.tex: Undefined control 
 sequence ...
 
 4 
 \copy\nextbox\rlap{\hskip\rightmargindistance\framed[frame=off,width=\rightmarginwidth,height=\nextboxht]{\floatuserdataparameter{text}}}
 5 \stoplinealignment}
 6 \hbox}
 7 
 8 \setupfloat[figure][command=\FigureText]
 9 
 10 \starttext
 11 
 12 \startplacefigure[title=Dummy figure][text=Margin dummy]
 13 \externalfigure[dummy][width=.8\textwidth]
 14   \stopplacefigure
 15 
 16 \stoptext
 17 
 
 
 \syst_boxes_with_next_box -\startlinealignment 
[middle] \copy \nextbox \rla...
 \strc_floats_place_packaged_boxes_indeed ...tbox }
  }\strc_floats_set_natural_...
 \strc_floats_finish_placement ...e_packaged_boxes 
  \dostoptagged \global \d_p...
 l.14 \stopplacefigure
 
 Admittedly, I am on version 2012.10.20, which is about six months old now, 
 but I am hesitant to update as I have a lot of co-workers using the same 
 version and our configuration management processes dictate that we always 
 update together.
 
 Could you please help me out.


You can replace \startlinealignment … \stoplinealignment with \midaligned:

\define\FigureText
 {\dowithnextbox
{\scratchdimen\nextboxht
 \midaligned\bgroup
   
\flushnextbox\rlap{\hskip\rightmargindistance\framed[frame=off,width=\rightmarginwidth,height=\scratchdimen]{\floatuserdataparameter{text}}}
 \egroup}
\hbox}

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] Understanding the imposing-mechanism

2013-05-24 Thread Wolfgang Schuster

Am 24.05.2013 um 15:49 schrieb H. Özoguz h.oezo...@mmnetz.de:

 Hi there,
 
 following Wolfgangs suggestion, I set every game-card on a single page now. 
 All cards are in one pdf-File, each on his own page. Every page has the size 
 47,5mm x 76mm.
 
 Now I tried to place the pages on a big sheet, its size is 660mm x 330mm, 
 s.th. the small cards are set in a 4*13 sceme (floor(330/76)=4 and 
 floor(660/47,5) = 13) - but I failed.
 
 There is an example in the wiki for imposing existing pdf-pages, but I do not 
 understand it, and if I try to change its values for my example, I get 
 nothing reasonable, nor even understandable.
 The example of the wiki is here: http://wiki.contextgarden.net/Imposition
 
 And here my failed try:
 
 \definepapersize[sheet][width=660mm,height=330mm]
 \definepapersize[bigsheet][width=\dimexpr\paperwidth+4mm\relax,height=\dimexpr\paperheight+4mm\relax]
 \setuppaper[sheet][bigsheet]
 \setuppaper[nx=13, ny=4]
 \setuplayout[page][location=middle, marking=on]
 \setuparranging [XY]
 
 \setuplayout
  [backspace=0pt,
topspace=0pt,
   width=middle,
  height=middle,
location=middle,
  header=0pt,
  footer=0pt]
 \setuppagenumbering[]
 
 \starttext
 \insertpages
  [eslami_karten.pdf][]
 \stoptext


You have to change the size for the page and paper, the first has to be the 
size of the cards
while the second is the size of the paper which you use to print all cards.

\definepapersize [card] [width=47.5mm,height=76mm]
\definepapersize [sheet] [width=660mm,height=330mm]

\setuppapersize [card][sheet]

\setuplayout [page] [location=middle,marking=on]
\setuplayout [page]

\setuppaper[nx=13,ny=4]
\setuparranging [XY]

\starttext
\showframe
\dorecurse{100}{\centerbox{\definedfont[Sans sa 5]\pagenumber}\page}
\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
___