Re: [NTG-context] definesortkey

2006-04-04 Thread Hans Hagen
Mojca Miklavec wrote:
> On 4/4/06, Hans Hagen wrote:
>   
>> i added a few things to the sorter; can you try the beta?
>> 
>
> Thanks, Hans! Much better. \ccaron is now handled OK (which wasn't the
> case before), but � in utf-8 encoded file stil turns into
> r e {index} {2} {} {ī} {2::0:0:0:0:0:0:0::1} {1}
> and is sorted under A (as expected from the content of tui file, but
> probably not as the user would like to have it).
>   
Can you make me an example test file with \named and utf example entries? 
Zipped in order not to loose the utf-8 

Hans 


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] modules

2006-04-04 Thread Hans Hagen
Hi,

In order to be able to generate new zips i'd like the modules in the 
wiki to be tds compliant as soon as possible.

Hans 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Extending the black circled numbers

2006-04-04 Thread Taco Hoekwater


nico wrote:
> Hello,
> 
> For those who know, I'm trying to have the DocBook callout mechanism with  
> context. Basically, there are some numbers in lines of verbatim text, and  
> below the verbatim text the numbers are used to explain the portion of the  
> text (kind of footnote). Typically the numbers are rendered white in black  
> circle. I could use the Dingbats numbers, but it is limited to 10, so that  
> I emulated them with the following code to be able to go up to 99.
> 
> The questions I have:
> - Is it the right way to do it in context (do I really need metafont?  
> Simpler, smarter method?)

This is pretty smart, I'd say. Of course it would be better to have an
official font with encircled numbers for reasons of efficiency, but this
looks pretty good and the code is quite clean so i believe you did
well enough. One remark only: if you would know that want them all the
same size (beforehand), you can call \evalwidth only once.

> - What should I do to make them as anchors, so that it can be  
> cross-referenced (I mean, one can click on a hot spot that jump to the  
> number in the verbatim text).

Like this maybe:

   \def\markline#1%
 {\conum{#1}%
  \expanded{\textreference[line#1]{\noexpand\conum{#1
   \def\refline#1{\in{line }[line#1]}

   \dorecurse{99}{\markline{\recurselevel}, }
   \dorecurse{99}{\refline{\recurselevel}, }



Cheers, taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Extending the black circled numbers

2006-04-04 Thread Hans Hagen
nico wrote:
> Hello,
>
> For those who know, I'm trying to have the DocBook callout mechanism with  
> context. Basically, there are some numbers in lines of verbatim text, and  
> below the verbatim text the numbers are used to explain the portion of the  
> text (kind of footnote). Typically the numbers are rendered white in black  
> circle. I could use the Dingbats numbers, but it is limited to 10, so that  
> I emulated them with the following code to be able to go up to 99.
>
> The questions I have:
> - Is it the right way to do it in context (do I really need metafont?  
> Simpler, smarter method?)
> - What should I do to make them as anchors, so that it can be  
> cross-referenced (I mean, one can click on a hot spot that jump to the  
> number in the verbatim text).
>
> Thanks for any hint,
>
> \newdimen \cowidth
>
> % Maximum size of the circle fits for number 99
> \def\evalwidth%
>{\bgroup%
> \setbox0\hbox{\small\bf{\ss 99}}%
> \global\cowidth=1.2\wd0%
> \egroup}
>
> % Background black circle
> \startuniqueMPgraphic{CoCircle}
>fill fullcircle scaled \overlaywidth withcolor black ;
> \stopuniqueMPgraphic
>
> \defineoverlay[cocircle][\uniqueMPgraphic{CoCircle}]
>
> % Display the black circled number
> \def\conum#1%
>{\evalwidth%
> \framed[background=cocircle,strut=no,frame=off,
> width=\the\cowidth,height=\the\cowidth,offset=overlay]
> {\color[white]{\small\bf{\ss #1
>
> \starttext
>
> \dorecurse{99}{\conum{\recurselevel}, }
>
> \stoptext
>   
\setupcolors[state=start]

\startuniqueMPgraphic{CoCircle}
   fill fullcircle xysized (OverlayWidth,OverlayHeight) withcolor OverlayColor ;
\stopuniqueMPgraphic

\defineoverlay[cocircle][\uniqueMPgraphic{CoCircle}]

\definecolor[CoBackgroundColor] [red]
\definecolor[CoForegroundColor] [white]

\def\conum#1%
   {\setbox\scratchbox\hbox
  {\small\ss\bf
   \setbox\scratchbox\hbox{99}%
   \hbox to 1.2\wd\scratchbox{\hss#1\hss}}%
\framed
  [background=cocircle,
   offset=overlay,
   frame=off,
   width=\the\wd\scratchbox,
   height=\the\wd\scratchbox,
   backgroundcolor=CoBackgroundColor,
   foregroundcolor=CoForegroundColor]
  {\box\scratchbox}}


\starttext
\dontleavehmode \dorecurse{99}{\conum{\recurselevel}, }
\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] beta

2006-04-04 Thread Hans Hagen
Hi,

later taco will give more details about changes/additions in his change-log

for the moment:

- for index users: you can test utf 8, sort order (swedish) etc

- for cp1250 users: it's there and you only need to give \enableregime 
since the vector will be loaded at runtime

- for mojca: take a look at regi-syn and let me know what vectors need 
to be be added to the distribution

- for taco: thanks for your patience but textext seems to work ok now

Hans 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] beta

2006-04-04 Thread Taco Hoekwater


Hans Hagen wrote:
> Hi,
> 
> later taco will give more details about changes/additions in his change-log

Mojca, it would be nice if you could give a go/nogo signal quickly.
I am slowly getting drowned with all the diff files so I am really
eager to have Hans go ahead and release a new version :)


Here is the list compared to the 2006.03.31 beta.

new files:
* regi-cp1250.tex, regi-syn.tex




tex.rb:
* additional tcxflag-s when calling pdftex and mpost
* extra \setupsystem[\c!method=2]
* use one dash in front of passed-on options (instead of gnu-style
   double dashes)
* processmpx fixes so that textext() works again

texutil.rb:
* downcasing (register sort routines)

context.tex:
* \input sort-ini.tex  (only when newtexexec is used)
* \TEXEXECcommand{texmfstart newtexexec} when newtexexec is used
   (bugfix for textext())

core-itm.tex:
* new, expanded macro \getitemparameter

core-ref.tex:
* some \predefinereference and \predefinedreference changes (?)

core-sys.tex:
* new macro \systemparameter (for the \input sort-ini test)

enco-ini.tex:
* \docurrentencoding renamed to \dopureencodingname

meta-ini.tex:
* \settrue \manyMPspecials

page-flt.tex:
* "retain special alignments"

page-lay.tex:
* extended tests for layout states

page-txt.tex:
* optimization for background  calculations
* extended tests for layout states

sort-ini.tex:
* extra \savesortkey magic

sort-lan.tex:
* a bit of extra (test) code for sorting

supp-mps.tex:
* use \TEXEXECcommand







___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] placefigure feature request ?

2006-04-04 Thread Renaud AUBIN





Hi all,

It seems this is for you, Hans:

It would be nice if placefigure can be able to detect if the best place
is the top or the bottom of the page accordingly to its call, i.e.:
if placefigure call is near to the top -> figure will go to the top
else figure will go to the bottom...

Cheers,

Renaud




___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Miktex, Metapost and \loadfontfilesoncetrue

2006-04-04 Thread WN
Apologies for not replying to earlier emails. To be honest
it is sometimes difficult to keep track of the threads
and especially to whom the emails are directed.

I was/am busy in doing a lot of the Latex -> Context conversions
with a small perl script and this consumes a lot of my time.
Perhaps I should make this perl script public, as more people are making
the switch to Context, however my perl programming skills
are not that good, just a beginner. If someone is interested,
just write an email and I will send you a copy.

I will certainly try to follow and implement your suggetions
and I will try to give you feedback.

Thanks for your time/help
Kind regards

Wim

[EMAIL PROTECTED] wrote:

> On 3/28/06, WN wrote:
>   
>> Hi,
>>
>> I am using Miktex (latest updated version) and the latest
>> Context on WindowsXP (write18 enabled).
>>
>> This is what happens :
>>
>> 1) First run of texexec gives me
>> ! Undefined control sequence
>> l 1 \global \loadfontfileoncetrue
>> 
>
> On 3/31/06, Taco Hoekwater wrote:
>   
>> For the original problem, I guess Mojca is closest to the
>> actual problem. She herself has a continuing fight with
>> btex/etex and textext(). If you can, you should try to post
>> a 'recipe': make a minimal example in a clean directory,
>> post that here along with what commands to run, and all
>> of the results (logs, temp files) you get.
>> 
>
> The perl script (texexec.pl) has some difficulties (sometimes the
> problem with wrong format loding appears and sometimes not), but since
> the ruby script is supposed to replace it anyway it doesn't really
> make sense to lose time fixing old stuff.
>
> Hans has just fixed the behaviour of newtexexec.rb, so I would suggest
> you to do the following:
>
> 1. create a file texexec.bat with the following content:
> texmfstart newtexexec.rb %*
> and place that file to some arbitrary folder in PATH (but has to be in
> front of MikTeX in PATH). So that after you type "texexec",
> "texmfstart newtexexec.rb" will be executed.
> You might have to download "texmfstart" if you don't have it yet
> (cont-win.zip from pragma website, simply drop it into MikTeX bin
> folder for example).
>
> You may also try to politely ask the maintainer of MikTeX to include
> the texmfstart.exe into MikTeX by default (the more users ask for it,
> the more likely will be that he'll do that).
>
> 2. wait until Hans uploads the new beta & extract the content from
> cont-tfm.zip into the MikTeX tree (to the proper place); I guess that
> it should be enough if you only replace the content of /scripts/ruby/*
> (Theoretically you can also wait for update in MikTeX, but that would
> definitely take much longer.)
>
>
> Then cross your fingers and try to compile your file again!
>
> Mojca
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>   

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] placefigure feature request ?

2006-04-04 Thread Hans Hagen
Renaud AUBIN wrote:
>
> Hi all,
>
> It seems this is for you, Hans:
>
> It would be nice if placefigure can be able to detect if the best 
> place is the top or the bottom of the page accordingly to its call, i.e.:
> if placefigure call is near to the top -> figure will go to the top
> else figure will go to the bottom...
hm, as long as it's ok that it's a rough heuristic ... i'll send you something 
to play with 

Hans 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] tpm

2006-04-04 Thread Hans Hagen
Hi module writers,

If you have a valid subtree, like

tex/context/third/...
doc/context/third/...
tpm
etc

you can use "textools --tpmmake t-yourmodule" to update the filesize 
info in your tpm file as well as to generate a zip file

Hans


-- 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] placefigure feature request ?

2006-04-04 Thread Sanjoy Mahajan
>> It would be nice if placefigure can be able to detect if the best
>> place is the top or the bottom of the page accordingly to its call,

A related point, which I didn't fiugre out how for my own TeX
figure-placement macros, is correct sequential numbering when some
figures are at the top of the page.  Some pseudocode on one page:

=== snip ===
\ref{figure:narrow} is a narrow figure.

\figuremacro{figure:narrow}{narrowfig.1}{A narrow figure.}

\ref{figure:wide} is a wide figure.

\figuremacro{figure:wide}{widefig.1}{A wide figure}
=== snip ===

Here \figuremacro figures out (sorry) that narrow figures go in the
margin and wide figures go at the top of the page.  But the page will
look funny: The narrow figure will be numbered, say, Figure 10, and
the wide figure will be Figure 11, but Figure 11 will appear before
Figure 10 on the page.  Which is disconcerting to the reader.  

One solution is to look at all the figures on the page and then number
them, instead of numbering them when \figuremacro is executed.  I
couldn't figure out how to do that in my TeX macros, but maybe there
are hooks into the context output routine for such tricks?

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
 --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Extending the black circled numbers

2006-04-04 Thread nico
On Tue, 04 Apr 2006 11:40:30 +0200, Taco Hoekwater <[EMAIL PROTECTED]>  
wrote:

> nico wrote:
>> Hello,
>>
>> For those who know, I'm trying to have the DocBook callout mechanism  
>> with
>> context. [...]. Typically the numbers are rendered white in black
>> circle. I could use the Dingbats numbers, but it is limited to 10, so  
>> that
>> I emulated them with the following code to be able to go up to 99.
>>
>> The questions I have:
>> - Is it the right way to do it in context (do I really need metafont?
>> Simpler, smarter method?)
>
> This is pretty smart, I'd say. Of course it would be better to have an
> official font with encircled numbers for reasons of efficiency, but this
> looks pretty good and the code is quite clean so i believe you did
> well enough.

Ok, thanks.

> One remark only: if you would know that want them all the
> same size (beforehand), you can call \evalwidth only once.

I tried this, but I had a weird behaviour with size (I have the same  
behaviour with the Hans example), and the other thing is that the size to  
use depends on the environment where you are. In the verbatim text (where  
I ask small font) the circled numbers must be smaller than in the current  
text flow.

>> - What should I do to make them as anchors, so that it can be
>> cross-referenced (I mean, one can click on a hot spot that jump to the
>> number in the verbatim text).
>
> Like this maybe:
>
>\def\markline#1%
>  {\conum{#1}%
>   \expanded{\textreference[line#1]{\noexpand\conum{#1
>\def\refline#1{\in{line }[line#1]}
>
>\dorecurse{99}{\markline{\recurselevel}, }
>\dorecurse{99}{\refline{\recurselevel}, }

Yes, it works fine! Thanks much!

Regards,
BG
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Extending the black circled numbers

2006-04-04 Thread nico
On Tue, 04 Apr 2006 14:44:28 +0200, Hans Hagen <[EMAIL PROTECTED]> wrote:

> nico wrote:
>> Hello,
>>
>> Typically the numbers are rendered white in black
>> circle. I could use the Dingbats numbers, but it is limited to 10, so  
>> that
>> I emulated them with the following code to be able to go up to 99.
>>
>> The questions I have:
>> - Is it the right way to do it in context (do I really need metafont?
>> Simpler, smarter method?)

> \setupcolors[state=start]
>
> \startuniqueMPgraphic{CoCircle}
>fill fullcircle xysized (OverlayWidth,OverlayHeight) withcolor  
> OverlayColor ;
> \stopuniqueMPgraphic

I see here the Hans touch again: it's better and I don't really understand  
how it works :-)
But there's something strange: the first circle is greater than the others  
(but the numbers have all the same size). Tracing a bit I see that the  
first circle has a width=16.5333pt, the others 13.19997pt. What's the  
reason for this?

Thanks much!

Regards,
BG
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Extending the black circled numbers

2006-04-04 Thread Hans Hagen
nico wrote:
> On Tue, 04 Apr 2006 14:44:28 +0200, Hans Hagen <[EMAIL PROTECTED]> wrote:
>
>   
>> nico wrote:
>> 
>>> Hello,
>>>
>>> Typically the numbers are rendered white in black
>>> circle. I could use the Dingbats numbers, but it is limited to 10, so  
>>> that
>>> I emulated them with the following code to be able to go up to 99.
>>>
>>> The questions I have:
>>> - Is it the right way to do it in context (do I really need metafont?
>>> Simpler, smarter method?)
>>>   
>
>   
>> \setupcolors[state=start]
>>
>> \startuniqueMPgraphic{CoCircle}
>>fill fullcircle xysized (OverlayWidth,OverlayHeight) withcolor  
>> OverlayColor ;
>> \stopuniqueMPgraphic
>> 
>
> I see here the Hans touch again: it's better and I don't really understand  
> how it works :-)
> But there's something strange: the first circle is greater than the others  
> (but the numbers have all the same size). Tracing a bit I see that the  
> first circle has a width=16.5333pt, the others 13.19997pt. What's the  
> reason for this?
>   
what os the exact code that you use?how many mp runs do yuo have? 

Hans 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] XML element strip?

2006-04-04 Thread Johannes Graumann
Hello,

I have a strange question. While working with XML and ConTeXt, I have run
into the TeXnic problem of the interpretation of line breaks. What I would
prefer to do for code clarity sake are things like the following:

  
Something
  
  
else
  


This is however screwed up by TeXs line break interpretation, forcing me to
format the input like so:

  Something
  else


The question now is: is there any way to tell context to strip trailing
whitespaces/line breaks from XML nodes?

Thanks, Joh

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] placefigure feature request ?

2006-04-04 Thread Hans Hagen
Sanjoy Mahajan wrote:
>>> It would be nice if placefigure can be able to detect if the best
>>> place is the top or the bottom of the page accordingly to its call,
>>>   
>
> A related point, which I didn't fiugre out how for my own TeX
> figure-placement macros, is correct sequential numbering when some
> figures are at the top of the page.  Some pseudocode on one page:
>
> === snip ===
> \ref{figure:narrow} is a narrow figure.
>
> \figuremacro{figure:narrow}{narrowfig.1}{A narrow figure.}
>
> \ref{figure:wide} is a wide figure.
>
> \figuremacro{figure:wide}{widefig.1}{A wide figure}
> === snip ===
>
> Here \figuremacro figures out (sorry) that narrow figures go in the
> margin and wide figures go at the top of the page.  But the page will
> look funny: The narrow figure will be numbered, say, Figure 10, and
> the wide figure will be Figure 11, but Figure 11 will appear before
> Figure 10 on the page.  Which is disconcerting to the reader.  
>
> One solution is to look at all the figures on the page and then number
> them, instead of numbering them when \figuremacro is executed.  I
> couldn't figure out how to do that in my TeX macros, but maybe there
> are hooks into the context output routine for such tricks?
>   
maybe

\setupfloats[numbering=nocheck]

does what you want

-- 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] More on XML and citations

2006-04-04 Thread Johannes Graumann
Hello again,

I have a matching rule for cite commands that look as follows:


The rule is this (kudoos to Taco):
\defineXMLargument
  [cite]
  {\expanded{\cite[\XMLpar{cite}{opt}{}][\XMLpar{cite}{id}{}]}}

Sometimes I would like to have the '(Hunt et. al., 1986)' produced by above
combination to look like '(see e.g. Hunt et. al., 1986)'. Taco pointed out
in response to a question to list that I could do that by handing
a 'left={(see e.g. }' to the cite command, however I fail to be able to do
that. A XML node like this 

results on compilation with above rule in the following error:
! Missing \endcsname inserted.

   \leftargument
\XML:ent:tex-leftbrace ...ace \else \leftargument
  \fi
 ...r,left=\getXMLentity {tex-leftbrace}
  see e.g.\getXMLentity
{tex...

\expanded ...\long \xdef \@@expanded {\noexpand #1
  }\@@expanded
\docite ...on [\csname @@pv#2compress\endcsname ]}
   [ \v!yes
=>\bibcitecompre...

\XML:ele:cite/ ...}{opt}{}][\XMLpar {cite}{id}{}]}
  {}
l.112 ...nt:86" opt="authoryear,left={see e.g.}"/>
  ) changed the field
dramat...

Can anybody help me out with this?

Thanks, Joh

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] placefigure feature request ?

2006-04-04 Thread Hans Hagen
Sanjoy Mahajan wrote:
>>> It would be nice if placefigure can be able to detect if the best
>>> place is the top or the bottom of the page accordingly to its call,
>>>   
>
> A related point, which I didn't fiugre out how for my own TeX
> figure-placement macros, is correct sequential numbering when some
> figures are at the top of the page.  Some pseudocode on one page:
>
> === snip ===
> \ref{figure:narrow} is a narrow figure.
>
> \figuremacro{figure:narrow}{narrowfig.1}{A narrow figure.}
>
> \ref{figure:wide} is a wide figure.
>
> \figuremacro{figure:wide}{widefig.1}{A wide figure}
> === snip ===
>
> Here \figuremacro figures out (sorry) that narrow figures go in the
> margin and wide figures go at the top of the page.  But the page will
> look funny: The narrow figure will be numbered, say, Figure 10, and
> the wide figure will be Figure 11, but Figure 11 will appear before
> Figure 10 on the page.  Which is disconcerting to the reader.  
>   
this 'choose between locations' feature is kind of present but only with 
'here' as fallback but it's trivial to make that configurable:

% first a new key

\startconstantsdutch english
   germanczech
   italian   romanian
   french

 fallback: terugval  fallback
   fallback  fallback
   fallback  fallback
   fallback
\stopconstants

% use that key

\long\def\dofloat#1#2#3#4%
  {\dosetfloatbox{#1}{#2}{#3}{#4}%
   \doifelsevaluenothing{\??fl#4\c!criterium}
 {\dogetfloatbox{#1}\empty}
 {\ifdim\wd\floatbox>\getvalue{\??fl#4\c!criterium}\relax
\postcenterfloatbox{\wd\floatbox}% else we get left aligned
%dogetfloatbox{#1}\v!here% see details/pascal

\dogetfloatbox{#1}{\executeifdefined{\??fl#4\c!fallback}\v!here}% PATCHED
  \else
\dogetfloatbox{#1}\empty
  \fi}}

% pass the new location (will be done differently, hack

\def\dogetfloatbox#1#2%
  {\ifvisible
 \doifelsenothing{#2}
   {\getfromcommalist[#1][1]%
[EMAIL PROTECTED]:\to\floatmethod
[EMAIL PROTECTED] \commalistelement\at:\to\floatcolumn
[EMAIL PROTECTED] \floatcolumn\at*\to\floatrow
[EMAIL PROTECTED]
% todo: nog algemeen otr
\ifx\OTRSETsetpreferedcolumnslot\undefined\else
  \OTRSETsetpreferedcolumnslot\floatcolumn\floatrow
\fi}
   {\let\floatcolumn\empty
\let\floatrow\empty
\edef\floatmethod{#2}}%
 \doifundefined{\string\floatmethod\floatmethod}
   {\let\floatmethod\v!here}%
 \getvalue{\string\floatmethod\floatmethod}[\floatmethod,#1]% PATCHED
   \fi}

\setupfloats[numbering=nocheck]

% we use the marginwidth as criterium

\setupfloat[figure][criterium=\marginwidth,fallback=bottom]

\starttext

\placefigure[bottom]{}{} \input tufte
\placefigure[left]{}{} \input tufte
\placefigure[left]{}{\framed[width=.8\marginwidth]{}} \input tufte

\stoptext

(we needed that feature a  couple of years ago in a project -)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Cite module: APA citation proposals

2006-04-04 Thread Johannes Graumann
Hello,

I'm using Tacos cite module with the default APA style. I'm a biochemist and
the majority of my cited sources derives from www.pubmed.org, which I
import into BibTeX via pybliographic. I have some slight problems with the
formating as provided by the database and was wondering whether it's
possible to fix them ...
1) Titles from PubMed always end with a '.'. Since the cite module (at least
the version with Tetex in Debian unstable) does not check for the presence
of a '.', but just appends one, I end up with 2 '.'s after the title when
using a unmanipulated *.bib file. Would it be possible to include a check
for that into the module?
2) Pybliographic also delivers the article language in a 'language' field
and not in the 'lang' field the cite module expects, which terminates
compilation with an unmanipulated *.bib file. Would it be possible to make
the module more promiscuous in this respect?

Thanks for any consideration of these minor, but inconvenient, points,

Joh

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] More on XML and citations

2006-04-04 Thread Hans Hagen
Johannes Graumann wrote:
> Hello again,
>
> I have a matching rule for cite commands that look as follows:
> 
>
> The rule is this (kudoos to Taco):
> \defineXMLargument
>   [cite]
>   {\expanded{\cite[\XMLpar{cite}{opt}{}][\XMLpar{cite}{id}{}]}}
>   
- reset opt, otherwise the previous one will be used when no opt is given
- \XMLop (own parameter) saves a few bytes and can be used here

\defineXMLargument
  [cite]
  [opt=]
  {\expanded{\cite[\XMLop{opt}][\XMLop{id}]}}


> Sometimes I would like to have the '(Hunt et. al., 1986)' produced by above
> combination to look like '(see e.g. Hunt et. al., 1986)'. Taco pointed out
> in response to a question to list that I could do that by handing
> a 'left={(see e.g. }' to the cite command, however I fail to be able to do
> that. A XML node like this 
> 
> results on compilation with above rule in the following error:
>   

hm, the problem is that the { } are  no longer tex's braces (grouping)

\starttext

\defineXMLcommand
  [whatever]
  [test=unknown]
  {\XMLop{test}}

\startXMLdata

\stopXMLdata

\def\defXMLtex#1#2% the appended space will go away when
  {\begingroup% \scantokens is fixed
   \disableXML
   \everyeof{\noexpand}% br's hack
   \edef\ascii{#2}%
   \edef\ascii{\scantokens\expandafter{\ascii}}% space appended
   \expandafter\endgroup\expandafter\def\expandafter#1\expandafter{\ascii}}
  
\defineXMLcommand
  [whatever]
  [test=unknown]
  {\defXMLtex\SomethingTex{\XMLop{test}}%
   \SomethingTex}

\startXMLdata

\stopXMLdata

\stoptext

so, then you can for instance feed \SomethingTex into the scite macros

however, best is not to mix tex this way with xml

Hans  

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] XML element strip?

2006-04-04 Thread Hans Hagen
Johannes Graumann wrote:
> Hello,
>
> I have a strange question. While working with XML and ConTeXt, I have run
> into the TeXnic problem of the interpretation of line breaks. What I would
> prefer to do for code clarity sake are things like the following:
> 
>   
> Something
>   
>   
> else
>   
> 
>
> This is however screwed up by TeXs line break interpretation, forcing me to
> format the input like so:
> 
>   Something
>   else
> 
>
> The question now is: is there any way to tell context to strip trailing
> whitespaces/line breaks from XML nodes?
>   
\defineXMLenvironment
  [item]
  {...\ignorespaces}
  {\removeunwantedspaces ...}


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Extending the black circled numbers

2006-04-04 Thread nico

On Tue, 04 Apr 2006 22:50:58 +0200, Hans Hagen <[EMAIL PROTECTED]> wrote:


nico wrote:

On Tue, 04 Apr 2006 14:44:28 +0200, Hans Hagen <[EMAIL PROTECTED]> wrote:



nico wrote:


Hello,

Typically the numbers are rendered white in black
circle. I could use the Dingbats numbers, but it is limited to 10, so
that
I emulated them with the following code to be able to go up to 99.

The questions I have:
- Is it the right way to do it in context (do I really need metafont?
Simpler, smarter method?)





\setupcolors[state=start]

\startuniqueMPgraphic{CoCircle}
   fill fullcircle xysized (OverlayWidth,OverlayHeight) withcolor
OverlayColor ;
\stopuniqueMPgraphic



I see here the Hans touch again: it's better and I don't really  
understand

how it works :-)
But there's something strange: the first circle is greater than the  
others

(but the numbers have all the same size). Tracing a bit I see that the
first circle has a width=16.5333pt, the others 13.19997pt. What's the
reason for this?


what os the exact code that you use?how many mp runs do yuo have?


It's exactly the one you gave. I attach the file I compile. Two mpruns; I  
attach the log too.


Regards,
BG

cotest.tex
Description: TeX document


cotest.log
Description: Binary data
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] placefigure feature request ?

2006-04-04 Thread Sanjoy Mahajan
Hans Hagen wrote:
> maybe
> \setupfloats[numbering=nocheck]
> does what you want

I think I want the opposite.  The documentation for \setupfloats at
 says

  New option:
  numbering   yes nocheck (default yes)
nocheck causes no renumbering so it preserves figure's source order

My problem was that the source order (which is the order of first
reference, probably) is not the order on the page.  The wide figure
floats to the top of the page (because it's wide) even though its
source position is later than the narrower figure that fits in the
margin.

So 'numbering=yes' will number according to position on the page?

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
 --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Problems with Standalone distribution

2006-04-04 Thread wwl
> Date: Tue, 04 Apr 2006 00:26:12 +0200
> From: Hans Hagen <[EMAIL PROTECTED]>
> Subject: Re: [NTG-context] ntg-context Digest, Vol 22, Issue 1
> To: mailing list for ConTeXt users 
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=UTF-8; format=flowed
> 
> [EMAIL PROTECTED] wrote:
> >> texexec.ini is not found in 'context\config'
> >> I copyed it in 'scripts\context\perl'
> >> now it is found. 
> >
> > Is this normal? Or is this a symptome of the problem I am looking
> > for?
> >   
> it depends on what system you use; the settinsg default to 
> tetex/fptex/gwtex so in that case no ini is needed

As I said, I work with the standalone distri?
And I thought, the binaries are from fptex, right?
And if both texexec.ini's are removed:

texexec complains: 

  warning: texexec.ini not found, try 'texexec --verbose'

(the same with texexec --verbose)
 
> newtexexec.rb (which will replace texexec.pl) has no ini file but
> uses 
> some heuristics to determine what environment it runs in
> >  
> >   
> >> 'texexec --verbose' tries to compile all the files in the aktuel
> >> path.
> >>
> >> but
> >>
> >> 'texmfstart texexec.pl --verbose' works ok.
> >>
> >> same with
> >>
> >> 'texexec --make --all' doesn't work
> >>
> >> but 
> >>
> >> 'texmfstart texexec.pl --make --all' works!
> >> 
> good

upps?

texexec (without parameters)

compiles cscite.bat! Why?

 
> on windows: you need to associate the pl suffix to perl
> on linux you need to make  texexec into a script (suffixless)
> 
> on both you can best use texmfstart to launch the scripts since
> that's 
> upward compatible (and in some respects this call is more clever);
> if 
> needef you can create stubs with texmfstart (see manual)

This works!

But next Problem:

pdfetex can not find pk-fonts.

I have written: 

PKFONTS = .;$TEXMF/fonts/pk//

in 'texmf.cnf'

font-file lies in

texmf-project/fonts/pk/ricoh/local/msl/msl50.pk

what else can I do?

Wolfgang
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] XML element strip?

2006-04-04 Thread Johannes Graumann
As always: thanks to the Wiz!

Joh

Hans Hagen wrote:

> Johannes Graumann wrote:
>> Hello,
>>
>> I have a strange question. While working with XML and ConTeXt, I have run
>> into the TeXnic problem of the interpretation of line breaks. What I
>> would prefer to do for code clarity sake are things like the following:
>> 
>>   
>> Something
>>   
>>   
>> else
>>   
>> 
>>
>> This is however screwed up by TeXs line break interpretation, forcing me
>> to format the input like so:
>> 
>>   Something
>>   else
>> 
>>
>> The question now is: is there any way to tell context to strip trailing
>> whitespaces/line breaks from XML nodes?
>>   
> \defineXMLenvironment
>   [item]
>   {...\ignorespaces}
>   {\removeunwantedspaces ...}
> 
> 
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>  | www.pragma-pod.nl
> -


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Myway on using mathalign

2006-04-04 Thread WN




Hi Aditya,

I read you MyWay document on using \startalign and I was
interested in section 4.2 numbering subformula's
Everything works fine as stated in your nice document.

One thing I want to do with a set of subformula's is 
to reference the main formula but still subnumbering the equations
like 
\starttext
\incrementnumber[formula]
\placesubformula
\startformula
\startalign
\NC div  \vec{E} \NC =  \epsilon_{0}^{-1} \rho  \NR[eqn1:A][a]
\NC rot  \vec{E} \NC =  0 \NR
\NC div  \vec{B} \NC =  0 \NR[eqn1:B][b]
\NC rot  \vec{B} \NC =  \mu_{0} \vec{j} \NR
\stopalign
\stopformula
See \in[eqn1] for the static Maxwell equations, where we are
going to examine \in[eqn1:A] a bit further 
\stoptext

Hope you can help
Thanks
Wim


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] More on XML and citations

2006-04-04 Thread Johannes Graumann
Hans Hagen wrote:

> however, best is not to mix tex this way with xml
H ... will heed that advice then ... as a remedy: Taco, how would I
define a new 'cite' alternative along the lines
of 'authoryear'/'authoryears' that would result in 'Author et. al., 2004'?

Thanks for any hint, Joh


pgp2BhaGnDLoC.pgp
Description: PGP signature
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Problem with encoding, XML and writetolist...

2006-04-04 Thread Martin Kolařík
Hi Hans,

I've analyzed the situation using different combinations of regimes and 
encodings, including switching off handling (\donothandleactivecharacter) and 
it seems to me, that every text with chars > 127, which is fully expanded (as 
in 8bit.tex), must cause difficulties, because TOC entry read back from TUO is 
scanned independently and thus spaces are gobbled.

Now I have solved it using not-stable solution -- I am using triple sequence of 
\expandafter to expand \XMLflush after \chapter instead \expanded. The solution 
is not stable as it is ConTeXt implementation dependent.

On the other side, now I do not know, how to partially expand code 
\chaper{\XMLflush{XMLTag}} to obtain sequence of simple unexpanded chars. 
Simple \expandafter is not sufficient, more \expandafters is dirty trick and 
full expansion (\expanded) leads to TOC entry problem. In TeX source this 
cannot occur (or can occur in strange situations :-), in XML source this is 
almost rule.

Maybe it would be useful to have in XML engine macro, which expands XMLdata 
exactly to get read (original) content (like mine triple \expandafter). Maybe 
such macro already exists and I am a real fool :-)

Thank you for help, have a nice day,

Martin

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Hans Hagen
> Sent: Monday, April 03, 2006 11:57 AM
> To: [EMAIL PROTECTED]; mailing list for ConTeXt users
> Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...
> 
> 
> Martin Kolařík wrote:
> > Aha, here maybe will be the solution :-)
> >
> > I'am using standalone Win32 distribution from Pragma and I'm 
> running texexec with --translate=cp1252cs. Typescripts use il2, 
> which corresponds to fonts, of course. If I run the code without 
> XML (if I transcribe XML to \chapter etc.) I get toc entry correctly too.
> >
> > Where should I look for more? What is natural.ctx?
> >   
> this is a one-to-one translation vector, and the one standard 
> used by context; forget about all those other mappings, they can 
> be done using regimes; you can use an il2 input regime, and any 
> (resonable) font encoding, 
> 
> Hans 
> 
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>  | www.pragma-pod.nl
> -
> 
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Absolute positioning of grafics in ConTeXt

2006-04-04 Thread Johannes Fichtinger
Hi all, 

I'm quite new to ConTeXt, but I've been working with LaTeX for several years
now. Now I faced a problem which I'm not able to solve in LaTeX which
probably can be solved in ConTeXt:

I need a possibility to set grafics in a book on exact, absolute positions.
Now I found the way for background images, like in the attached example.
But obviously, normal text is written above the background image. I need
now a possibility like this but for foreground grafics.

So, how can I set the position of grafics absolutely in ConTeXt?

Thanks,
Johannes.

My example:

--
\enableregime           [il1]
\mainlanguage           [de]
\setuplayout            [grid=yes,marking=on,horoffset=2cm,veroffset=2cm]
\definepapersize        [jo][width=14cm,height=18cm]
\setuppapersize         [jo][a4]

\useexternalfigure[wr][dpm][type=png, width=5cm, height=4cm]
\definelayer[wr-layer]
\defineoverlay[wr-overlay][\composedlayer{wr-layer}]
\setupbackgrounds[page][background={wr-overlay}]

\starttext

\setlayer[wr-layer][x=-0.1cm,y=-0.1cm]{\externalfigure[wr]}
Blablabla

\stoptext
--
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Metafun - Metapost capacity exceeded

2006-04-04 Thread Taco Hoekwater
Thomas Engel wrote:
> Hello Hans,
> 
> 
> this is the message I got after running texexec pro_mcc_a3.tex.
> As you can see I have increased the memory size for mp.
> I have attached the two tex-files.
> Maybe there is a mistake in the mp-code. A pdf-file will be produced,
> but if you check the output you will see, that one cubicle is missing!

No problems here. It uses 2351976 words of memory, though.

Cheers, Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Metafun - Metapost capacity exceeded

2006-04-04 Thread Thomas Engel
Hello Hans,


this is the message I got after running texexec pro_mcc_a3.tex.
As you can see I have increased the memory size for mp.
I have attached the two tex-files.
Maybe there is a mistake in the mp-code. A pdf-file will be produced,
but if you check the output you will see, that one cubicle is missing!

Thanks for your help!

Thomas




 TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

  metapost : pro_mcc_a3-mpgraph
format : metafun
This is MetaPost, Version 0.901 (Web2C 7.5.3)
(/home/thomas/texmf/web2c/natural.tcx)
(pro_mcc_a3-mpgraph.mp [1] [2] [3] [4] [5] [6] [7] [8] [9]
! MetaPost capacity exceeded, sorry [main memory size=200].
 ;

l.2277 ...aw he_zehn ((1.75),(5.6), (0.2),(17.5));

9 output files written: pro_mcc_a3-mpgraph.1 .. pro_mcc_a3-mpgraph.9
Transcript written on pro_mcc_a3-mpgraph.log.
 error in metapost run : pro_mcc_a3-mpgraph.mp:2277

total run time : 0 seconds
  sorting and checking : running texutil

 TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004

action : processing commands, lists and registers
option : sorting IJ under Y
option : converting high ASCII values
input file : pro_mcc_a3.tui
   output file : pro_mcc_a3.tuo
   passed commands : 18
 remapped keys : 0
  register entries : 0 -> 0 entries 0 references
   synonym entries : 0 -> 0 entries
embedded files : 2

total run time : 7 seconds



\startproduct prd_mcc_a3
\project pro_mcc_a3
\setuppapersize[A3, landscape][A3, landscape]


\startMPenvironment
  \setupbodyfont[pos]
\stopMPenvironment

\startuseMPgraphic{fra}

   StartPage ;
   u:=10mm;
 draw Page enlarged -1cm;
 draw Page enlarged -0.80cm;
 draw (1u,2u)--(41u,2u)--cycle;
   StopPage ;

\stopuseMPgraphic



\startuniqueMPgraphic{bottomline}
  draw bottomboundary OverlayBox
  leftenlarged 6pt rightenlarged 6pt
  shifted (0,.75HeaderHeight) ;
  setbounds currentpicture to OverlayBox ; % forces dimensions
\stopuniqueMPgraphic

\startuseMPgraphic{ruler}
u:=5mm;
draw(0,0)--(78u,0)--(0,0);
defaultfont:="cmr5";
draw (0,0)--(0,-0.5u);
label(decimal 0,(0,-1u+4));
for n=1 upto 77:
   draw (1u*n,0)--(1u*n,-0.5u);
endfor
for n=1 upto 38.5 :
   defaultfont:="cmr5";
   label(decimal (2n*100),(1u*2n,-1u+4));
  % draw (2u*n,0)--(2u*n,-0.5u);
  % defaultfont:="cmr5";
   label(decimal (2n*100-100),(1u*2n-1u,-1.1u));
endfor
\stopuseMPgraphic

\startuseMPgraphic{vruler}
u:=5mm;
draw(0,0)--(0,24u)--(0,0);
defaultfont:="cmr5";
draw (0,0)--(-0.5u,0);
label(decimal 0,(-1u+4,0));
for n=1 upto 24:
   draw (0,1u*n)--(-0.5u,1u*n);
endfor
for n=1 upto 24 :
   defaultfont:="cmr5";
   label(decimal (n*100),(-1.2u,1u*n));
endfor
\stopuseMPgraphic







\setupMPvariables[mcc1000][e1=0,e2=0,e3=0,e4=0,e5=0,e6=0,e7=0,e8=0,e9=0]
\startuseMPgraphic{mcc1000}{e1,e2,e3,e4,e5,e6,e7,e8,e9}
  vardef he_eins (expr h, b, ho, vo) =
 save Panel, z;
 picture Panel;
 path s[] ;
 u:=5mm;
 s1 := (0,0)--(b*u,0)--(b*u,h*u)--(0,h*u)--cycle;
 s2 := (0.2u,0.1u)--(0.2u,(h-0.05)*u);
 s3 := ((b-0.2)*u,0.1u)--((b-0.2)*u,(h-0.05)*u);
 s4 := (4.8u,0.3u)--(4.8u,0.7u);
 draw s1 shifted (ho*u,vo*u);
 pickup pencircle scaled 1;
 draw s2 shifted (ho*u,vo*u);
 draw s3 shifted (ho*u,vo*u);
 pickup pencircle scaled 0.5;
%%Simocode
 draw unitsquare xscaled 1.4u yscaled 0.6u shifted ((ho+0.4)*u,(vo+h-0.8)*u) ;
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+0.5)*u,(vo+h-0.7)*u);
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+0.8)*u,(vo+h-0.7)*u);
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+1.1)*u,(vo+h-0.7)*u);
%%Schalter
draw unitsquare xscaled 0.6u yscaled 0.6u shifted ((ho+4.5)*u,(vo+0.2)*u);
draw fullcircle scaled 0.45u shifted  ((ho+4.8)*u,(vo+0.5)*u);
draw fullcircle scaled 0.3u shifted  ((ho+4.8)*u,(vo+0.5)*u);
pickup pencircle scaled 1;
draw s4 shifted (ho*u,vo*u) ;
   pickup pencircle scaled 0.5;
   Panel:=currentpicture;
   Panel
enddef;

  vardef he_zehn (expr h, b, ho, vo) =
 save Panel, z;
 picture Panel;
 path s[] ;
 u:=5mm;
 s1 := (0,0)--(b*u,0)--(b*u,h*u)--(0,h*u)--cycle;
 s2 := (0.2u,0.1u)--(0.2u,(h-0.05)*u);
 s3 := ((b/2+0.2)*u,0.1u)--((b/2+0.2)*u,(h-0.05)*u);
 s4 := (4.8u,0.3u)--(4.8u,0.7u);
 s5 := (2u,0.3u)--(2u,0.7u);
 s6 := (2.8u,0)--(2.8u,1.75u);
draw s1 shifted (ho*u,vo*u);
pickup pencircle scaled 1;
draw s2 shifted (ho*u,vo*u);
pickup pencircle scaled 0.5;
%%Simocode
 draw unitsquare xscaled 1.4u yscaled 0.6u shifted ((ho+0.4)*u,(vo+h-0.8)*u) ;
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+0.5)*u,(vo+h-0.7)*u);
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+0.8)*u,(vo+h-0.7)*u);
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+1.1)*u,(vo+h-0.7)*u);
%%Schalter
draw unitsquare xscaled 0.6u yscaled 0.6u shifted ((ho+1.7)*u,(vo+0.2)*u);

Re: [NTG-context] More on XML and citations

2006-04-04 Thread Taco Hoekwater
Johannes Graumann wrote:
> Hans Hagen wrote:
> 
> 
>>however, best is not to mix tex this way with xml
> 
> H ... will heed that advice then ... as a remedy: Taco, how would I
> define a new 'cite' alternative along the lines
> of 'authoryear'/'authoryears' that would result in 'Author et. al., 2004'?

Easiest is by using a special macro breaking it up in two bits, like so:

   \def\mycite#1{\cite[author][#1], \cite[year][#1]}

there is a way to create 'official' alternatives, but it is quite a
bit more cumbersome.

Cheers, taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Different pagebreaks for component and whole document

2006-04-04 Thread Aditya Mahajan
On Mon, 3 Apr 2006, Taco Hoekwater wrote:

>
>
> Aditya Mahajan wrote:
>>
>> Each component starts with \title which does a page break. There are
>> no local setups in any component. I expected that each component will
>> be typed out in the same manner, whether I compile the a component,
>> a product or the entire project.
>
> The fact that the page breaks are different indicates an
> imperfection somewhere in the internal macro definitions
> for \startproject c.s., and is definately not related to
> the length of your document.
>
> But, since you are not really supposed to compile the project
> file in the first place, fixing this will be very low on the
> list of to-be-fixed problems, I wager. The manual is not as
> clear on that as it could be (I suppose), but you are definately
> not expected to be compiling project definition files.

Thanks. I will only compile the products and join then using 
--pdfcombine. Each product has separate pagenumbering, so this will 
work for my project as of now.

Hans, I will try to make a minimum example to illustrate the problem.

Thanks,
Aditya


-- 
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Myway on using mathalign

2006-04-04 Thread Aditya Mahajan
On Wed, 5 Apr 2006, WN wrote:
> One thing I want to do with a set of subformula's is
> to reference the main formula but still subnumbering the equations
> like

Try this. Warning: I do not know everything that is happening here. 
There may be some unexpected side effects.

\unprotect
\def\placesubformulawithnumber{%
   \dodoubleempty\doplacesubformulawithnumber}

\def\doplacesubformulawithnumber[#1][#2]%#2 gobbles spaces
   {\iffirstargument
 \incrementnumber[\v!formula]
 \makesectionnumber[\v!formula]
 \rawreference{\s!for}{#1}{\composedsectionnumber}
   \else
 \incrementnumber[\v!formula]
   \fi\placesubformula}
\protect


> \starttext
%% > \incrementnumber[formula]
%% > \placesubformula
\placesubformulawithnumber[eqn1] %I need to think of a smaller name
> \startformula
> \startalign
> \NC div  \vec{E} \NC =  \epsilon_{0}^{-1} \rho  \NR[eqn1:A][a]
> \NC rot  \vec{E} \NC =  0 \NR
> \NC div  \vec{B} \NC =  0 \NR[eqn1:B][b]
> \NC rot  \vec{B} \NC =  \mu_{0} \vec{j} \NR
> \stopalign
> \stopformula
> See *\in[eqn1] *for the static Maxwell equations, where we are going to 
> examine \in[eqn1:A] a bit further 
> \stoptext
>

Also, note that div and rot should be in text font. You should 
probably do
\startmathcollection[default]
   \definemathcommand [div]  [nolop] {\mfunction{div}}
   \definemathcommand [rot]  [nolop] {\mfunction{rot}}
\stopmathcollection

and use \div \rot etc.

HTH,
Aditya


-- 
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context