Re: [NTG-context] Bibliography, unicode strings, @ELECTRONIC, sorting and bibtex

2012-09-18 Thread Marco Patzer
2012-09-18 "Schmitz Thomas A." :

Hi Thomas

> On Sep 18, 2012, at 2:25 PM, Marco Patzer  wrote:
> > 
> > This doesn't work, either:
> > 
> > \setupbibtex   [database=sample]
> > \setuppublications [alternative=apa, criterium=cite, sorttype=author]
> > \starttext
> >  \cite[hh2010a]
> >  \cite[Eijkhout1991]
> >  \placepublications
> > \stoptext
> > 
> This works for me, I get Eijkhout sorted before Hagen.

I deleted all temp files, but still get “Hagen” before “Eijkhout”.
My test file is attached.

> > If I only had time…
> 
> Yes, had we but world enough and time… Anyway, Hans began playing
> with transforming bibtex to xml and loading this. There is no user
> interface yet, but if you want to see what's possible, have a look
> at bibl-bib.lua and bibl-tst.lua

Thanks, I will have a look.


Marco
@STRING{hh = {Hans Hagen}}

@ELECTRONIC{hh2010,
  author = hh,
  year = {2010},
  title = {Metafun. \CONTEXT\ mkiv},
  url = {http://www.pragma-ade.nl/general/manuals/metafun-s.pdf},
}

@ARTICLE{hh2010a,
  author = hh,
  title = {The Font Name Mess},
  journal = {MAPS},
  year = {2010},
  volume = {40},
  pages = {2-8},
  keywords = {context},
}

@ARTICLE{hh2010b,
  author = hh,
  title = {Grouping in Hybrid Environments},
  journal = {MAPS},
  year = {2010},
  volume = {40},
  pages = {67-71},
  keywords = {context},
}

@BOOK{Eijkhout1991,
  title = {\TeX\ by Topic. A \TeX nician's Reference},
  publisher = {Addison-Wesley},
  year = {1991},
  author = {Victor Eijkhout},
  address = {London},
  keywords = {general},
}



t.pdf
Description: Adobe PDF document
\setupbibtex   [database=sample]
\setuppublications [alternative=apa, criterium=cite, sorttype=author]
\starttext
 \cite[hh2010a]
 \cite[Eijkhout1991]
 \placepublications
 \contextversion
\stoptext
___
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] Bibliography, unicode strings, @ELECTRONIC, sorting and bibtex

2012-09-18 Thread Marco Patzer
2012-09-18 Philipp Gesang :

> [0] http://www.mail-archive.com/ntg-context@ntg.nl/msg62855.html

Thanks for the link. Since I usually don't deal much with
different bibliography styles I tend to skip those threads.

> >And BibTeX is used since it understands the semantics of
> > bib files, although a pure ConTeXt/Lua solution would be possible.
> > Without BibTeX this functionality would be missing since no one is
> > willing to implement a parser for .bib databases.
> 
> Context happens to have such a parser, written in Lua. Probably
> the best one around:
> 
> ···
> \starttext
>   \startluacode
> local db = bibtex.new()
> bibtex.load(db, "filename.bib")
> table.print(db)
>   \stopluacode
> \stoptext

Interesting, I didn't know that. But the values are only parsed, not
interpreted. That means the only thing left for BibTeX is to do is
to interpret the ugly “author” field?


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] Publicationlist

2012-09-19 Thread Marco Patzer
2012-09-19 "Eidenbenz  Michael" :

Hi Michael

> is there a way to setup the layout of the publicationlist? I would
> like to add a blank line after every entry.

untested:

\setuplist
  [pubs]
  [after=\blank]


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] tolerance and whitespace settings inside a TEXpage

2012-09-20 Thread Marco Patzer
Hi,

inside a TEXpage the tolerance and the whitespace settings are not
applied. The whitespace can be set in a setup and the tolerance can
be set directly with \spaceskip, but that seems a bit hackish.

Is that intended and is there a cleaner solution? Example:

\setuplayout   [width=8cm]
\setupbodyfont [mono]
\startsetups [myset]
  \setupwhitespace [big]
  \setuptolerance  [space]
\stopsetups
\setups{myset}

\starttext
  \startTEXpage [setups=myset]
%% \spaceskip .5em plus .25em minus .25em
\input knuth
  \stopTEXpage

  \input knuth
\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] Space after caption of a float

2012-09-25 Thread Marco Patzer
2012-09-25 Procházka Lukáš Ing. - Pontex s. r. o. :

Hi Lukáš,


> is there a built-in parameter for \setupcaptions which would affect the space 
> after the caption?

\setupcaptions
  [figure]
  [spaceafter=1cm,align=middle]

\starttext
  \placefigure[place]{Caption1}{\externalfigure[cow][width=.1\textwidth]}
  \placefigure[place]{Caption2}{\externalfigure[cow][width=.1\textwidth]}
  \placefigure[place]{Caption3}{\externalfigure[cow][width=.1\textwidth]}
\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] \define a command with square-bracket arguments

2012-09-27 Thread Marco Patzer
2012-09-27 Sietse Brouwer :

Hi Sietse,

> As I understand it, \define[2] is preferred over \def#1#2 because it
> refuses to overwrite existing commands.

\define overwrites existing commands with pleasure. In contrast to
\def it prints a message to the log file: “\mycommand is already
defined”.

> Can I use \define, or a related command, to define a command that
> takes square-bracket arguments, like so:
> \mycommand[...][...]

\def\mycommand
  {\dodoubleempty\domycommand}

\def\domycommand [#1][#2]
  {first: #1, second: #2}

\mycommand [foo] [bar]
\mycommand [foo][bar]
\mycommand [foo]

Question for the others: What's the difference of \dodoubleargument
and \dodoubleempty? I expected \dodoubleargument to throw an error
since the arguments are supposed to be mandatory.


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] Referring to multiple elements

2012-09-28 Thread Marco Patzer
2012-09-28 Sietse Brouwer :

Hi Sietse,

> > \in{figure}[alpha,beta,gamma]
> >
> > This outputs “figure 1”. What I'd like to have is “figure 1-3”.
> 
> The attached quasi-module seems to do it! On my computer, at least. (I
> call it 'quasi' because it is really nothing more than code in a file
> of its own.No configurability whatsoever, except to the extent that I
> tried to comment well, and split things up into functions.) I'd have
> written it so that it properly identifies runs like '1.2.1, 1.2.2,
> 1.2.3', too, but I can't find a function that will turn reference
> strings into such a prefixed strings.
> 
> I hope it does what you want! Let me know if you want/need any
> alterations, or discover bugs.

Thanks a lot for that. I'd adjust the interface, so that it matches
the behaviour of \in:

\def\inrange
  {\dodoublegroupempty\doinrange}

\def\doinrange#left#right#dummy[#label]
  {\iffirstargument
 {#left }%%
   \fi
   \ctxlua{userdata.inwithranges("#label")}%%
   \ifsecondargument
 {#right}%%
   \fi}

Then you can write:

See \inrange{figures} [fig:a,fig:c,fig:d,fig:e,fig:g,fig:x,fig:h]
See \inrange{figures}{TT} [fig:a,fig:c,fig:d,fig:e,fig:g,fig:x,fig:h]
See \inrange  [fig:a,fig:c,fig:d,fig:e,fig:g,fig:x,fig:h]

Maybe worth mentioning: You need the additional module
`showtable.lua` from http://article.gmane.org/gmane.comp.tex.context/78336


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] Wrong results for chemical structures and reactions

2012-10-02 Thread Marco Patzer
Hi,

chemical structures and reactions produce wrong results. Here is one
example from the wiki and two from the manual.

\starttext

%% does not typeset the reaction, prints the commas, wrong spacing
%% and no arrow
\startformula
 \chemical{2H_2,+,O_2,->,2H_2O}
\stopformula

%% same here, GIVES is not interpreted
\startformula
  \chemical{A,GIVES,B,EQUILIBRIUM,C,MESOMERIC,D}
\stopformula

%% wrong alignment, rules overlay symbols
\startformula
  \setupchemical
[width=fit,
 height=fit,
 scale=small,
 size=small]
  \startchemical
\chemical[ONE,Z0,DB1,SB46,MOV1,Z0,SB28][C,C]
  \stopchemical
  \startchemical
\chemical[SPACE,PLUS,SPACE]
  \stopchemical
  \startchemical
\chemical[ONE,Z0,SB146,Z6][N,H]
  \stopchemical
  \startchemical
\chemical[SPACE,GIVES,SPACE]
  \stopchemical
  \startchemical
\chemical[ONE,Z07,SB1357,MOV1,Z0,SB27,PB:Z2,ONE,Z0,SB13,PE][C,H,C,N]
  \stopchemical
\stopformula

\stoptext

Am I missing something? Is this mechanism not supported any more or
just broken?


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] Wrong results for chemical structures and reactions

2012-10-02 Thread Marco Patzer
2012-10-02 Alan BRASLAU :

Hi Alan

> > chemical structures and reactions produce wrong results. Here is one
> > example from the wiki and two from the manual.
> > 
> > […]
> > 
> \startchemicalformula
> not
> \startformula
> 
> \startchemicalformula
> \chemical{2H_2}
> \chemical{PLUS}
> \chemical{O_2}
> \chemical{GIVES}
> \chemical{2H_2O}
> \stopchemicalformula

The spacing is still wrong. Compare:

\starttext
  \chemical{2H_2,+,O_2,->,2H_2O}\blank
  \startchemicalformula
\chemical{2H_2}
\chemical{PLUS}
\chemical{O_2}
\chemical{GIVES}
\chemical{2H_2O}
  \stopchemicalformula
\stoptext

How to mid-align the reaction? Wrapping the \startchemicalformula in
\startformula works, but it's clumsy.

> Also, the shorthand "+" for "PLUS", "->" for "GIVES", etc.
> seems to be interpreted only inline, not in displayed chemical formula
> mode.
> 
> 
> I am working (with Hans) to correct the mkiv chemical code,
> which has been completely re-written (from ppchTeX macros).
> Also working on a new manual, at the same time...

That's brilliant!


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] Wrong results for chemical structures and reactions

2012-10-02 Thread Marco Patzer
2012-10-02 Alan BRASLAU :

> Try the following:
> 
> \starttext
> 
> \startchemicalformula
>  \chemical{2H_2}
>  \chemical{+}
>  \chemical{O_2}
>  \chemical{->}
>  \chemical{2H_2O}
> \stopchemicalformula

\chemical{->} is not rendered correctly.

> \startchemicalformula
>  \chemical{2H_2}
>  \chemical{PLUS}
>  \chemical{O_2}
>  \chemical{GIVES}
>  \chemical{2H_2O}
> \stopchemicalformula

The spacing is wrong. The following yields to better spacing:

\startchemicalformula
 \chemical{2H_2}
 \chemical{PLUS}
 \chemical{}
 \chemical{O_2}
 \chemical{GIVES}
 \chemical{}
 \chemical{2H_2O}
\stopchemicalformula

> \startchemicalformula
>   \chemical{A}
>   \chemical{GIVES}
>   \chemical{B}
>   \chemical{EQUILIBRIUM}
>   \chemical{C}
>   \chemical{MESOMERIC}
>   \chemical{D}
> \stopchemicalformula

Same spacing problem, workaround: \chemical{}

> \setupchemical
> [width=fit,
>  height=fit,
>  scale=small,
>  size=small]
> 
> \hbox{
> \startchemical
> \chemical[ONE,Z0,DB1,SB46,MOV1,Z0,SB28][C,C]
> \stopchemical
> \startchemicalformula
> \chemical{PLUS}
> \stopchemicalformula
> \startchemical
> \chemical[ONE,Z0,SB146,Z6][N,H]
> \stopchemical
> \startchemicalformula
> \chemical{GIVES}
> \stopchemicalformula
> \startchemical
> \chemical[ONE,Z07,SB1357,MOV1,Z0,SB27,MOV2,Z0,SB13][C,H,C,N]
> \stopchemical
> }

Worse than before.

> 3. I believe that the syntax should be rationalized, but I will have to
> discuss this further with Hans. Normally, commands have keywords
> between [] and text to be typeset between {}. This would mean
> \startchemical
>   \chemical[ONE,Z0,SB146,Z6]{N}{H}
> \stopchemical
> 
> Alternatively:
> \startchemical
>   \chemical[ONE,Z0=N,SB146,Z6=H]
> \stopchemical
> but currently this puts "N" and "H" into lowercase as "n" and "h"
> as a side effect of the way that Hans wrote the lua code.

If you redo the syntax: My suggestion would be to try to reduce the
use of the string “chemical” if that's feasible.

> How to deal with inline equations, as in \chemical{2H_2,+,O_2,->,2H_2O}?
> I would think that it could work as does math mode:
> \chemical{2H_2 + O_2 -> 2H_2O} (no commas) with spaces (or none)
> delimiting the keywords.

That looks more practical.

> Hans will have to answer me on this. We need to be a bit patient,

I don't need that now. For the current project all structures look
fine (ugly hacks included :). You may consider my comments above
when you (or Hans) are redoing the code. Thanks for the
\startchemicalformula hint, that was the missing piece.

> as I'm sure that he is currently VERY busy preparing for EuroTeX 2012!

Sure. Unfortunately I cannot come, I can't get a week off and for
1-2 days it's too far.


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] Split \starttabulates

2012-10-03 Thread Marco Patzer
2012-10-03 Malte Stien :

Hi Malte

>  \placetable[here][tab:some-table]{Some Table}
>  \starttabulate[|w(.30\textwidth)p|w(.70\textwidth)p|]
>  \HL
>  \NC {\bf Animal} \NC {\bf Comment}   \NC\FR
>  \HL
>  \NC Cat  \NC Pretty cool \NC\MR
>  \NC Bear \NC Kind of lazy\NC\MR
>  \NC Sheep\NC Always hungry   \NC\MR
>  \HL
>  \stoptabulate
> 
> However, I need one of these tables to split over adjacent pages, which 
> according to the documentation should be achievable with
> 
>  \setuptabulate[split=yes]
> 
> However, that does not seem to work in connection with the \placetable line.

\startplacetable [title=Some Table, reference=tab:some-table, 
location={split,here}]
  \starttabulate[|w(.30\textwidth)p|w(.70\textwidth)p|]
\HL
\NC {\bf Animal} \NC {\bf Comment}  \NC\FR
\HL
\NC Cat \NC Pretty cool \NC\MR
\NC Bear\NC Kind of lazy\NC\MR
\NC Sheep   \NC Always hungry   \NC\MR
\HL
  \stoptabulate
\stopplacetable


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] Alignment in combination

2012-10-03 Thread Marco Patzer
Hi,

how to left align the elements of a combination?

\useMPlibrary [dum]
\setupexternalfigures [height=2cm]
\starttext

%% does nothing: \setupcombinations [align=flushleft]
\startcombination [2*2]
  {\externalfigure[dummy][width=2cm]} {}
  {\externalfigure[dummy][width=2cm]} {}
  {\externalfigure[dummy][width=4cm]} {}
  {\externalfigure[dummy][width=3cm]} {}
\stopcombination \blank[2cm]

%% desired:
\startcombination [2*2]
  {\kern-2cm\externalfigure[dummy][width=2cm]} {}
  {\kern-1cm\externalfigure[dummy][width=2cm]} {}
  {\externalfigure[dummy][width=4cm]} {}
  {\externalfigure[dummy][width=3cm]} {}
\stopcombination

\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] Strange behaviour by processing a project file

2012-10-03 Thread Marco Patzer
2012-10-03 pa...@hanak.name:

Hi Pavel

> But when I try to process the whole project with "context
> my-project.tex", the file is processed but I get no pdf output,
> which surprise me, because in the reference manual contextref.pdf
> I read:

A project cannot be typeset, only products and components. The
mechanism was recently changed from a tolerant to a more strict
version that now causes your problem.

  “Projects are just there to help clever editors to identify
  products.” [1]


Marco

[1] http://article.gmane.org/gmane.comp.tex.context/70876

___
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] Issues with the legend mechanism

2012-10-04 Thread Marco Patzer
Hi,

I discovered some issues with the legend mechanism.

1) A newline after \startplacelegend fails:

\starttext
\startplacelegend

  \startcontent
Foo
  \stopcontent
  \startcaption
Bar
  \stopcaption
\stopplacelegend
\stoptext


2) location != top | bottom throws “Infinite glue shrinkage found in
   a paragraph”:

\starttext
  \startplacelegend [location=left]
\startcontent
  Foo
\stopcontent
\startcaption
  Bar
\stopcaption
  \stopplacelegend
\stoptext


3) tabulate inside the content fails when not boxed:

\starttext
  \startplacelegend [location=left]
\startcontent
  \starttabulate
\NC Alpha \NC Beta \NC\NR
  \stoptabulate
\stopcontent
\startcaption
  Bar
\stopcaption
  \stopplacelegend
\stoptext


Just reporting, nothing which needs to be fixed before EuroTeX.


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] Need help with \definetabulate

2012-10-07 Thread Marco Patzer
2012-10-08 Malte Stien:

Hi Malte

> I am trying to define two tabulate styles as follows:
> 
> - \setuptabulate[split=yes, bodyfont=small]
> - \setuptabulate[split=yes]

\definetabulate [alpha] [|l|l|l|]
\setuptabulate  [alpha] [bodyfont=small]

\definetabulate [beta] [|l|l|]
\setuptabulate  [beta] [bodyfont=small, split=yes]

\starttext
  \startalpha
\NC first \NC second \NC third \NC\NR
  \stopalpha

  \startbeta
\NC lorem \NC ipsum \NC\NR
  \stopbeta
\stoptext

> ...such that I can just refer to them when I
> \starttabulate...\stoptabulate somewhere.

To refer to a table, you place it as a float and use the
`reference=tab:alphatable` key. Then in the text you refer to the
table, see \in{table}[tab:alphatable].

> I thought, the command \definetabulate would come in handy here,
> but I can't work it out and it appears the documentation on that
> command is pretty scarce.
> 
>   http://wiki.contextgarden.net/Command/definetabulate

Feel free to add an example. It's a wiki!


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] Header without chapters/sections

2012-10-08 Thread Marco Patzer
2012-10-08 Troy Henderson:

> I would like to create a header on every page with some fixed text in the
> header.  Simply doing
> 
> \setupheadertexts[Some text]
> \setupheader[state=start]
> 
> Does not produce a header on any page, yet
> 
> \setupfootertexts[Some text]
> \setupfooter[state=start]
> 
> does produce a footer on every page.

This works here:

\setupheadertexts [Some header text]
\setupfootertexts [Some footer text]

\starttext
  \dorecurse{5}{\null\page}
\stoptext

> Why does one work and the other does not?

Can you provide a minimal example and state what exactly does not
work?


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] \unit and french

2012-10-09 Thread Marco Patzer
2012-10-09 Wolfgang Schuster:

> Can you explain which numbers this should represent:
> 
> \m{12\,345,567\,89}~kg

12345.56789 kg

> \m{345,567\,89}~kg

345.56789 kg


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] \unit and french

2012-10-09 Thread Marco Patzer
2012-10-09 Wolfgang Schuster:

> The problem is that Hans number parser doesn’t check for a
> separator in the decimal numbers.

If the unit code is being touched maybe you can address this one as
well:

http://article.gmane.org/gmane.comp.tex.context/78251


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] Using a search engine.

2012-10-14 Thread Marco Patzer
2012-10-14 Andre Caldas:

> Since "context" is a very common word, I'd like to know from ConTeXt users...
> How do you look for "ConTeXt" stuff using search engines?

http://tex.stackexchange.com/questions/41918/how-to-search-for-information-about-context-in-search-engines


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] Commutative diagrams.

2012-10-14 Thread Marco Patzer
2012-10-14 Andre Caldas:

> How can I make commutative diagrams in ConTeXt?

Have a look at the MetaFun manual¹ and the TikZ manual²


Marco

[1] http://www.pragma-ade.com/general/manuals/metafun-s.pdf
[2] 
http://www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf

___
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] Index and Publications suddenly remain empty??? [not solved yet]

2012-10-15 Thread Marco Patzer
2012-10-15 Otared Kavian:

> On 14 oct. 2012, at 15:52, Wolfgang Schuster  
> wrote:
> > […]
> > I don’t know if the bug was also in the stable but it’s in the beta version 
> > I use. You can use the following example to check for the bug:
> > 
> > \starttext
> > \placeontopofeachother{A}{B}
> > \stoptext

Here is a fix (not thoroughly tested, though):

pack-com.mkiv:

- 
\def\pack_topofeachother_one{\bgroup\setbox0\box\nextbox\dowithnextboxcs\pack_topofeach_two
 \hbox}
+ 
\def\pack_topofeachother_one{\bgroup\setbox0\box\nextbox\dowithnextboxcs\pack_topofeachother_two\hbox}

- 
\def\pack_topofeachother_two{\setbox2\box\nextbox\halign{\hss\hss\cr\box0\cr\box2\cr}\egroup\egroup}
+ 
\def\pack_topofeachother_two{\setbox2\box\nextbox\halign{\hss##\hss\cr\box0\cr\box2\cr}\egroup\egroup}


Test:

\unprotect
\def\pack_topofeachother_one{\bgroup\setbox0\box\nextbox\dowithnextboxcs\pack_topofeachother_two\hbox}
\def\pack_topofeachother_two{\setbox2\box\nextbox\halign{\hss##\hss\cr\box0\cr\box2\cr}\egroup\egroup}
\protect

\starttext
\placeontopofeachother{alpha}{beta}
\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] How to put a \placefigure with no caption?

2012-10-15 Thread Marco Patzer
2012-10-15 Marcin Borkowski:

Hi Marcin

> \placefigure[here]{none}{} seems to actually typeset "none" as a
> caption.  What do I do if I want no caption (not even the "Figure 1"
> thing, in fact)?

\startplacefigure [location=none]
  \externalfigure [cow]
\stopplacefigure


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] RFC: path relative to current file.

2012-10-15 Thread Marco Patzer
2012-10-15 Aditya Mahajan:

> >> 2. check if the file "somefile.tex" exists in the directory being
> >> popped from the stack.
> >> Just for "bug catching"...
> >
> > it all happens before a file is loaded so the normal reporting is applied
> 
> Actually, it is a bit annoying that \environment and \component
> do not report an error (or at least a warning message) when the file is 
> not found.

+1


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] How to put a \placefigure with no caption?

2012-10-15 Thread Marco Patzer
2012-10-15 Marcin Borkowski:

> > > \placefigure[here]{none}{} seems to actually typeset "none"
> > > as a caption.  What do I do if I want no caption (not even the
> > > "Figure 1" thing, in fact)?
> > 
> > \startplacefigure [location=none]
> >   \externalfigure [cow]
> > \stopplacefigure
> 
> Interesting.  Is
> 
> \startplacefigure[location=...]
>   ...
> \stopplacefigure
> 
> equivalent to \placefigure[...]{}{...}?

Yes. \placefigure is the old syntax. \start…\stopplacefigure the new
one. The new one uses a the key=value syntax also present in other MkIV
commands. Compare:

\startplacefigure [title=Lorem, reference=fig:lorem]
…
\stopplacefigure

\startchapter [title=Lorem, reference=sec:lorem]
…
\stopchapter

They are both supported, I personally stick to the new variant. I
find the interface much more memorable.


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] Total Number of Pages

2012-10-16 Thread Marco Patzer
2012-10-16 Nicholas Ulle:

Hi Nicholas

> How would I go about inserting the total number of pages in my document?

\lastpage


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] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Patzer
> > A week ago I had a conversation with mpfusion and another user over IRC
> > about the ConTeXt test suite. mpfusion had a tarball with some test and
> > an elaborate machinery to see if the testfiles compile. He kindly
> > provided the tarball,

That's me, by the way.

> and I took the liberty to do it my way (I didn't
> > hear back from him, I assume he's working on his solution), using the
> > testfiles and rewriting the code.

I cleaned up the code and rewrote some part of it. But it's in a
stage where it does not compile. At the moment I'm quite busy and
don't have time to work on that, that's why I didn't publish, yet.


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] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Patzer
2012-10-17 Marco Pessotto:

> luigi scarso  writes:
> 
> > It's not a huge difference, but it can integrated better with mkiv; see
> > http://meeting.contextgarden.net/2011/talks/day1_05_luigi_graphicmagick/
> > (if you like these kind of things)
> 
> I think I'll have to run some benchmark to see if it can save some
> resources and speed up the testing. I don't care too much for the mkiv
> integration. The other Marco's idea was exactly to make conTeXt run the
> tests.

I removed that part, it was a stupid idea. At the moment it's a pure
Lua solution. It's divided into two parts. The first part is the
database update, Lua runs context on the tests and writes the
results to a database (a Lua table stored in a file). For the second
part context is run on the database to generate the report from the
database. With this database you can display information like “What
broke in the last beta”.

> Looking at the diffs, many of the differences are really tiny, but
> differences exist nevertheless. It will take me some time to sort out
> which ones are just tiny space shifting, and which ones give really
> different output.

That's why I use a header for each test file. You can specify
“sensitivity=low|medium|high”, this sets a predefined tolerance for
the page difference. I don't see any other option. There is no
single value which is sensitive enough, for instance to detect if a
footnote is subscripted or not and at the same time tolerant enough
not to always mark a fifty page document as “failed”.


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] font features in beta

2012-10-17 Thread Marco Patzer
2012-10-17 Philipp Gesang:

> With Context as of today and Luatex from minimals, I get lining
> figures and a triple dash.
> 
> Did I miss something?

Confirmed.

works with 2012.09.23 12:40
fails with 2012.10.16 23:38


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] ConTeXt unofficial test suite stub

2012-10-17 Thread Marco Patzer
2012-10-17 Marco Pessotto:

> Ok, this is my first bug report. I noticed that the column width/margin
> is quite altered since TL12. There are some other problems, tough.
> 
> Full report here:
> 
> https://github.com/melmothx/context-unofficial-test-suite/commit/8575456ae9e5dfe1f5dea5ac1224f75b5d1eb0a2
> 
> (It's stored in the commit log).
> 
> I also caught some problems which are fixed in the beta, but broken in
> TL12.

I don't know if Hans appreciates a test suite, seems like plenty of
work for him ;)


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] Current ConTeXt & wiki

2012-10-20 Thread Marco Patzer
2012-10-20 Hans Hagen:

> > Another option is to use pdftrimwhite, which is part of the minimals rather 
> > than pdfcrop.
> 
> if needed I can make a mtx-trimwhite (lua instead of perl)

If you decide to rewrite pdftrimwhite, maybe you can consider making
it work with multiple page files as well. The current version only
crops the first page and discards the rest.


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] way setting does not work in \setupcaptions

2012-10-20 Thread Marco Patzer
Hi,

the `way` setting cannot be applied globally to all floats using
`\setupcaptions`. For the `prefix` value it works. Can this be
fixed?

\setupblackrules
  [width=4cm, height=1cm]

%% prefix is applied, way is not
%% \setupcaptions
%%  [prefix=no,
%%   way=bytext]

%% prefix and way is applied
\setupcaption
  [figure, table]
  [prefix=no,
   way=bytext]

\starttext
\dorecurse{2}{%
  \startchapter [title=Chapter]
\dorecurse{2}{%
  \startplacefigure
\blackrule
  \stopplacefigure
  \startplacetable
\blackrule
  \stopplacetable}
  \stopchapter}
\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
___


[NTG-context] Overlapping margin figures

2012-10-21 Thread Marco Patzer
Hi,

I have narrow margin floats and wide floats that protrude into the
margin. Currently they overlap with the narrow figures. How to avoid
this?

\useMPlibrary [dum]

\definefloat
  [marginfigure] [marginfigures]
  [figure]

\setupfloat
  [marginfigure]
  [default=margin]

\definefloat
  [widefigure] [widefigures]
  [figure]

\setupfloat
  [widefigure]
  [location=left]

\starttext
  \dorecurse{5}{%%
\startplacemarginfigure
  \externalfigure [dum] [width=\rightmarginwidth, height=2cm]
\stopplacemarginfigure}

  \startplacewidefigure
\externalfigure [dum] [width=\dimexpr\textwidth+\rightmargintotal\relax, 
height=3cm]
  \stopplacewidefigure
\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] TABLE: header with a thick bottom line

2012-10-22 Thread Marco Patzer
2012-10-22 Procházka Lukáš Ing. - Pontex s. r. o.:

> On Mon, 22 Oct 2012 16:41:46 +0200, Aditya Mahajan  wrote:
> 
> > If you want only the bottom border (and no other border),
> 
> ... No, I want all borders with default thickness but head bottom border 
> thicker;
> this is most common look of my tables:

http://wiki.contextgarden.net/TABLE#Rules_with_different_thickness


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] Suppressing Page Numbers

2012-10-23 Thread Marco Patzer
2012-10-23 Malte Stien:

Hi Malte

> For a particular document, though, I don't want page numbers. Is
> there a way of locally suppressing the page numbers while still
> importing (via environment) the layout.tex file? I guess, what I
> am asking is, is there a way to "override" the setuppagenumbering
> setup locally?

\setuppagenumbering
  [state=stop]


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] setuphead and newline

2012-10-25 Thread Marco Patzer
2012-10-25 WolfgangZ:

Hi WolfgangZ

> I'm trying to insert a newline between the number and the head text 
> (chaper). Where do I have to put the \crlf ?
> 
> It sohould look like:
> 
> 1
> This is the chapter text

\defineheadalternative
  [mine]
  [renderingsetup=mine]

\startsetups [mine]
  \headsetupspacing
  \startframedtext [offset=none, frame=off]
\headnumbercontent\\
\headtextcontent
  \stopframedtext
\stopsetups

\setuphead
  [section]
  [alternative=mine]

\starttext
  \startsection [title=FooBar]
  \stopsection
\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] \dorecurse within TABLE

2012-10-26 Thread Marco Patzer
2012-10-26 Alan BRASLAU:

> Does anyone have a solution to \dorecurse within TABLE?
> Alan
> 
> Minimal example:
> 
> \starttext
> \dorecurse{8}{\recurselevel\crlf}
> 
> \bTABLE

> \dorecurse{8}{\bTR\bTD\recurselevel\eTD\eTR}

\dorecurse{8}{\expanded{\bTR\bTD\recurselevel\eTD\eTR}}

> \eTABLE
> \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] defineindenting

2012-10-26 Thread Marco Patzer
2012-10-26 Sietse Brouwer:

> Hello Piotr,
> 
> > I cannot get defineindenting to work. Example attached.
> 
> 
> To input example text, use
> \input knuth
> not
> \knuth .
> 
> After that change your example works for me, apart from producing something 
> like
> '. . .   :' in the indent space --- I am not familiar with
> MkII, so I can't tell you whether this behaviour is expected or
> another bug.

An MkIV 2011.11.29 23:11 produces the same result as MkII, the wiki
however says "Mkii only". It seems that this command was removed or
changed in 2012.01.11 10:58. I never used it myself.


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] defineindenting

2012-10-26 Thread Marco Patzer
2012-10-26 Piotr Kopszak:

> Right, so is there a replacement for \defineindenting which works in
> the recent version?

I don't know what \defineindenting is supposed to do. I can hardly
believe that the dots in the output are intended. What about this:

\definedelimitedtext
  [indenting]
  [leftmargin=4cm, rightmargin=]

\starttext
  \startindenting
\input knuth
  \stopindenting
\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] \dorecurse within TABLE

2012-10-26 Thread Marco Patzer
2012-10-26 Alan BRASLAU:

> Now, is there some better way, or perhaps not, around creating my own
> counter (of course, I can use a counter for the column as well...)

You can use \currentTABLEcolumn and \currentTABLErow

\starttext
\bTABLE
  \dorecurse{8}{
\bTR
\dorecurse{5}{\bTD \currentTABLErow,\currentTABLEcolumn \eTD} \eTR }
  \eTABLE
\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] defineindenting

2012-10-26 Thread Marco Patzer
2012-10-26 Piotr Kopszak:

> Many thanks! The wiki says it is used to "define a collection of
> indenting settings". I used it to indent more then in the case of
> other paragraphs the  first line of the first paragraph in a chapter,
> so your solution is unfortunately not exactly what I mean.

To indent the first line you can use

  \setupindenting [yes, 2cm]

That, however, is not configurable. And frankly I've never seen
varying paragraph indentations in a document. If you really need it
you can build a wrapper around this.


\def\defineindenting
  {\dodoubleempty\dodefineindenting}

\def\dodefineindenting [#1][#2]
  {\setvalue{#1}{\setupindenting[yes, #2]}}

\defineindenting [first]  [2cm]
\defineindenting [second] [3cm]

\starttext
  \first
  \input knuth

  \second
  \input knuth
\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] align and location in \setupcombination

2012-10-28 Thread Marco Patzer
2012-10-27 Jeong Dal:

> In the output of the following sample, figures are left flushed.
> I found some discussions about the align and location in \setupcombination.
> "align=" is for caption and "location=middle" is for figures' location.
> 
> But "align=   " worked while "location= " has no effect at all.

location is the vertical location of the element within the
combination. Compare:

\startcombination[2*1]
  {\externalfigure[dummy][height=1cm]}{aa}
  {\externalfigure[dummy][height=4cm]}{bb}
\stopcombination

\setupcombination
  [location=middle]

\startcombination[2*1]
  {\externalfigure[dummy][height=1cm]}{aa}
  {\externalfigure[dummy][height=4cm]}{bb}
\stopcombination

> So I have to enclose \startcombination … \stopcombination in 
> \placefigure[][]{}.
> How to locate the combined figures at the horizontal center?

\midaligned
  {\startcombination[2*1]
{\externalfigure[dummy][]}{aa}
{\externalfigure[dummy][]}{bb}
   \stopcombination}


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] Creating a background texture with text/graphic

2012-10-29 Thread Marco Patzer
2012-10-29 Mari Voipio:

> The problem: I don't know how to input the logo graphic into Metapost
> code. This did not work, even though the pdf is in the same directory:
> 
> externalfigure "vaaka-logo.pdf" scaled 1cm;

This works here:

\startbuffer [image]
  \useMPlibrary [dum]
  \startTEXpage
\externalfigure [dummy]
  \stopTEXpage
\stopbuffer

\ctxcommand{runbuffer("\jobname.tmp", "image", true)}

\starttext

\startMPcode
  picture pic;
  pic = externalfigure "\jobname-\jobname.tmp.pdf" scaled 1cm;
  draw pic rotated 20;
\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] align and location in \setupcombination

2012-10-30 Thread Marco Patzer
2012-10-30 Wolfgang Schuster:

> > \midaligned
> >  {\startcombination[2*1]
> >{\externalfigure[dummy][]}{aa}
> >{\externalfigure[dummy][]}{bb}
> >   \stopcombination}
> 
> With the new beta you can replace
> 
> \midaligned{…}
> 
> with
> 
> \startmidaligned
> …
> \stopmidaligned

I already noted that. I appreciate the movement to a more uniform
\start…\stop syntax.

Just a random thought: Would it be possible or even make sense to
uniform the syntax even further and maybe merge the functionality
into \startalignment? At the moment we have one command with an
argument for alignments:

\startalignment [right|middle|left]
\input knuth
\stopalignment

however three different command for boxed alignments (furthermore,
\startrightaligned works just the opposite of \startalignment[right]):

\startrightaligned
FooBar
\stoprightaligned

\startmidaligned
FooBar
\stopmidaligned

\startleftaligned
FooBar
\stopleftaligned

This might be easy to remember for us who still know the
\midaligned{} syntax, but I guess for new users it's confusing.
Additionally, the difference between the commands is unclear. What
about an interface like this:

\startlinealignment [right|middle|left]
FooBar
\stoplinealignment

Taking this one step further would be to merge both into one
command:

\startalignment [align=left, alternative=???]
\input knuth
\stopalignment

\startalignment [align=left, alternative=!!!]
FooBar
\stopalignment


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] Search path for .tex files (mkiv)

2012-10-30 Thread Marco Patzer
2012-10-30 John Devereux:

> What is the correct way to set or modify the search path for tex files?
> 
> I want to make it mode-dependent. For example, for figures I have
> something like
> 
> \doifmode{en} 
> {\def\FigDirLanguage{fig/lang_en}\def\DocumentSuffix{EN}\mainlanguage[en]}
> \doifmode{de} 
> {\def\FigDirLanguage{fig/lang_de}\def\DocumentSuffix{DE}\mainlanguage[de]}
> 
> [...]
> 
> \setupexternalfigures[directory={fig,{\FigDirLanguage},{../fig},{../\FigDirLanguage}}]
> 
> 
> I want to be able to do for example
> 
> \input disclaimer

You can either trigger on the language or on the mode. The directory
structure looks like this

text/en/alpha.tex
text/en/beta.tex
text/de/alpha.tex
text/de/beta.tex
images/en
images/de

You can create the individual files as components and create a
product file:

\startproduct *

  \mainlanguage [de]
  \project [project]

  \component [a]
  \component [b]

\stopproduct

and a project file:

\startproject *

  \startmode [*en]
  \usepath
[text/en]
  \setupexternalfigures
[directory={images/en}]
  \stopmode

  \startmode [*de]
  \usepath
[text/de]
  \setupexternalfigures
[directory={images/de}]
  \stopmode

\stopproject

To trigger by language, you use *en, *de, etc. To trigger by mode,
you use the mode name, in that case you can move the \mainlanguage
call to the corresponding language setup.


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] Search path for .tex files (mkiv)

2012-10-30 Thread Marco Patzer
2012-10-30 John Devereux:

> It looks like \usepath is the key to what I want, thank you.

Yes, combine \usepath with the \startmodeset syntax that Wolfgang
suggested and you should have a clean solution.

> I don't quite understand your overall structure.

You're right. Without file names it's hard to follow, especially
with the mistake I made.

> Is the "*" a literal "*" with some special meaning, or are you
> using it as a placeholder for something?

It is a literal `*`. That means that the file name will be used as a
component (or product) name.

> I am not using the project/product/component system, perhaps I should
> look into it again.
> 
> Hmmm, alpha.tex defines component "a", beta.tex defines "b", is that
> right?

No, that's my fault. Of course they have to match.


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] scripts

2012-11-01 Thread Marco Patzer
2012-11-01 Uwe Koloska:

> There is stability in that /bin/sh always must be a (posix compatible)
> bourne (not again) style shell!

True

> * rewrite the scripts to be truly posix and use #! /bin/sh (the dash
> links from another mail may help)
> * leave the scripts alone with all their bashisms and declare them with
> #! /bin/bash
> 
> My advice on this is: in all shellscripts you write, declare the shell
> that you are testing the script with -- so on most linux systems (and in
> windows unix environments like msys) use /bin/bash and only change this
> to /bin/sh if you have to.

I do it the other way. Always write /bin/sh compatible scripts
(actually first-setup.sh uses /bin/sh) and resort to /bin/bash if
bash specific features save considerable effort.

> For example to make it compatible to a minimal system (a jeos VM
> comes to mind) that is not supposed to provide /bin/bash.

FreeBSD comes without bash installed by default.

The point is that it's easy for shell scripts like first-setup.sh
that can easily declare the shell in the she-bang line. But setuptex
cannot start a new well-defined shell since it's supposed to modify
the current environment. That's why setuptex is sourced instead of
executed. That however implies that setuptex has to conform to the
current shell, which is unknown and needs to be guessed without
relying on anything the shell might not provide.


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] Highlight current chapter in list

2012-11-07 Thread Marco Patzer
Hi!

How do I highlight the current chapter in the table of contents? The
TOC is displayed on each page. For illustration I misused the
interaction colour, which of course only works for the first page of
a chapter.

  \setupheadertexts
[\setups{headlist}]

  \startsetups [headlist]
\framed[align=normal, frame=off]
  {\placelist [chapter] [alternative=f, criterium=all]}
  \stopsetups

  \setupinteraction
[state=start,
 color=lightgray,
 contrastcolor=darkgreen]

  \starttext
\startchapter [title=alpha]   \stopchapter
\startchapter [title=beta]  \page\input knuth \stopchapter
\startchapter [title=gamma]   \stopchapter
  \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] Highlight current chapter in list

2012-11-08 Thread Marco Patzer
2012-11-08 Wolfgang Schuster:

Hi Wolfgang!

> \startsetups [headlist]
>   \framed[align=normal, frame=off]
> {\placelist [chapter] [alternative=highlight, criterium=all]}
> \stopsetups
> 
> \definelistalternative
>   [highlight]
>   [renderingsetup=list:highlight]

I like the flexibility of renderingsetups for \defineheadalternative,
but frankly, I didn't know they can be used for lists as well and
I was clueless about the best place to hook into.

> \startsetups [list:highlight]
>   \par
>   \startlinealignment[middle]
> \doifelse{\fetchmark[chapter][first]}{\currentlistentrytitle}
>
> %\doifelse{\fetchmark[chapter][first]}{\ctxcommand{listtitle("\currentlist",\currentlistindex)}}
>   {\color[red] {\currentlistentrytitle}}
>   {\color[blue]{\currentlistentrytitle}}
>   \stoplinealignment
>   \par
> \stopsetups

That's a neat and clean solution. Thanks Wolfgang.


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] Highlight current chapter in list

2012-11-08 Thread Marco Patzer
2012-11-08 Hans Hagen:

> the next beta has: \namedstructureheadlocation{name}
> 
> so that you can compare
> 
>\currentlistentrylocation
> 
> with
> 
>\namedstructureheadlocation{chapter}

Thanks Hans.

> Best document this before we forget about it.

I assume that's my part, right? I'll extend or add a wiki page the
weekend after the beta is released.


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] Highlight current chapter in list

2012-11-08 Thread Marco Patzer
2012-11-08 Marco Patzer:

> > Best document this before we forget about it.
> 
> I assume that's my part, right? I'll extend or add a wiki page the
> weekend after the beta is released.

http://wiki.contextgarden.net/Command/definelistalternative


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] \chapter{} vs \startchapter..\stopchapter

2012-11-08 Thread Marco Patzer
2012-11-08 Bill Meahan:

> I note there are two different ways of handling a chapter:
> 
> The traditional \chapter{mytitle}
> 
> \startchapter[title=mytitle, ownnumber=N ..]
>blah
> \stopchapter
> 
> Is there any difference or advantage/disadvatage to using one method or 
> the other?

With the start…stop syntax you can easily apply different options to
the individual structure elements or add additional information. The
\chapter syntax is less verbose but less flexible. But it has at
least one caveat that I know: The insidesection key of \setuphead
does not work.

> Other than the source code, is there anything that lists the keys for 
> \startchapter somewhere?

Keys that I know about:

  \startchapter[
  label=...,
  title=...,
  marking=...,
  list=...,
  bookmark=...,
  reference=... ]
  \stopchapter

You can also add an additional pair of brackets with custom
settings:

  \startchapter
[title={First chapter}]
[foo=bar]
  \stopchapter

In the setups this information is accessible as:

  \structureuservariable{foo}

> It's not documented in even the most recent command reference.

Welcome to ConTeXt :)

Be the first of your friends to add this information to the wiki.


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] Highlight current chapter in list

2012-11-08 Thread Marco Patzer
2012-11-08 Wolfgang Schuster:

> \setupheadertexts
>   [\setups{headlist}]
> 
> \startsetups [headlist]
>   \framed[align=normal, frame=off]
> {\placelist [chapter] [alternative=highlight, criterium=all]}
> \stopsetups
> 
> \definelistalternative
>   [highlight]
>   [renderingsetup=list:highlight]

Why does the custom list alternative succeed in a header but fails
in a layer? A predefined alternative works perfectly in a layer.

  \setupfootertexts
[\setups{footlist}]

  \setupbackgrounds
[page]
[background=layer:chapter]

  \definelayer
[layer:chapter]
[state=repeat]

  \setlayer
[layer:chapter]
{\placelist [chapter] [alternative=f, criterium=all]}%% works
%% {\placelist [chapter] [alternative=highlight, criterium=all]} %% fails

  \definelistalternative
[highlight]
[renderingsetup=list:highlight]

  \startsetups [list:highlight]
\currentlistentrytitle
  \stopsetups

  %% works
  \startsetups [footlist]
\placelist [chapter] [alternative=highlight, criterium=all]
  \stopsetups

  \starttext
\startchapter [title=Alpha] \stopchapter
\startchapter [title=Beta]  \stopchapter
\startchapter [title=Gamma] \stopchapter
  \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] Highlight current chapter in list

2012-11-08 Thread Marco Patzer
2012-11-08 Marco Patzer:

I just realized when I presses “send”:

> Why does the custom list alternative succeed in a header but fails
> in a layer? A predefined alternative works perfectly in a layer.
> 
>   \setupfootertexts
> [\setups{footlist}]
> 
>   \setupbackgrounds
> [page]
> [background=layer:chapter]

\setupbackgrounds
  [page]
  [background=layer:chapter, setups=setups:headlayer]

>   \setlayer
> [layer:chapter]
> {\placelist [chapter] [alternative=f, criterium=all]}%% works
> %% {\placelist [chapter] [alternative=highlight, criterium=all]} %% fails

\startsetups [setups:headlayer]
  \setlayer
[layer:chapter]
{\placelist [chapter] [alternative=highlight, criterium=all]}
\stopsetups

Well, we have dynamic content, so wrap it in a setup.


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] Presets in collectors

2012-11-09 Thread Marco Patzer
Hi!

Is there a reason that presets don't work with collectors?
Collectors are based on layers and that's what presets are made for,
right? Bug or feature?

  \definecollector
[mycollector]
[width=\textwidth]

  \setcollector
[mycollector]
{\framed[width=5cm,height=2cm]{Foo}}

  \setcollector
[mycollector]
[preset=rightbottom]%% not recognized
%% [corner={right, bottom}, %% works
%%  location={left, top}]
{\framed{Bar}}

  \flushcollector [mycollector]
  \starttext\null\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] Presets in collectors

2012-11-10 Thread Marco Patzer
2012-11-10 Wolfgang Schuster:

> The collector macros aren’t based on layers.

I don't know why I thought they were.

What is the correct way to place a collector mid aligend underneath another? I
manage to place them underneath left aligned using

location={right, bottom}, corner=bottom

and mid aligned as in the example below. However, I prefer not to adjust
the distance manually.

\setupbodyfont [12pt]

\definecollector
[mycollector]

\setcollector
[mycollector]
{\framed[align=normal]{\input khatt-en\par}}

%% this is the desired output, but without the manual adjustment
\setcollector
[mycollector]
[location=bottom,
 corner=middle,
 %% voffset=.5\layerheight,  %% no effect
 voffset=.8cm]
{\framed[width=5cm,align=normal]{\input ward\par}}

\flushcollector [mycollector]

\starttext\null\stoptext

Intuitively I would expect the following to work, but I guess the `middle`
syntax is not supported or I am using it in the wrong way.

\setcollector
[mycollector]
[corner={middle, bottom},
 location={middle, bottom}]
{\framed[width=5cm,align=normal]{\input ward\par}}


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] Beginner question. Chapter heading in words

2012-11-10 Thread Marco Patzer
2012-11-10 Hans Hagen:

> On 11/10/2012 1:38 PM, Andrew Dowell wrote:
> >
> >Chapter One
> >
> >This is the Name of the First Chapter
> 

I assume the OP was looking for a way to convert a counter to the
corresponding English word:

  \defineconversion
[words]
[One, Two, Three, Four, Five]

  \definecounter [mycount]
  \setupcounter  [mycount] [numberconversion=words]

  \starttext
\dorecurse{5}{%%
  \incrementcounter [mycount]
  \convertedcounter [mycount]}
  \stoptext

Maybe there is a conversion built-in that does this automatically
without having to define the words yourself.


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] Beginner question. Chapter heading in words

2012-11-10 Thread Marco Patzer
2012-11-10 Marco Patzer:

> 2012-11-10 Hans Hagen:
> 
> > On 11/10/2012 1:38 PM, Andrew Dowell wrote:
> > >
> > >Chapter One
> > >
> > >This is the Name of the First Chapter
> > 
> 
> I assume the OP was looking for a way to convert a counter to the
> corresponding English word:
> 
>   \defineconversion
> [words]
> [One, Two, Three, Four, Five]

I forgot to add how to hook this into Hans' example:

\defineconversion
  [words]
  [One, Two, Three, Four, Five]

\setuphead
   [chapter]
   [header=high,
command=\MyChapterTitle,
style=\bfc,
conversion=words,
numberstyle=\bfb]


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] Annotation module broken

2012-11-11 Thread Marco Patzer
Hi Wolfgang,

the annotation module broke within the last few betas.

  \usemodule [annotation]

  \starttext
\startannotation {Foo}
  Bar
\stopannotation
  \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] margintext and placefigure

2012-11-11 Thread Marco Patzer
2012-11-11 Andy Thomas:

> Is there a way to avoid that and have the figure always placed in
> the margin?

\startplacefigure [title=Foo, location=margin]
\stopplacefigure


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] margintext and placefigure

2012-11-11 Thread Marco Patzer
2012-11-11 Andy Thomas:

> That was my first choice as well. But it does not play nice with
> margintext.

The both use two different mechanisms AFAIK, and there's no or not
much communication between them. Mixing both leads to overprinted
content.

> Also, the figure is moved all the way up, which is strange.

That's intended. The margin texts stack up from the top to the
bottom. For figures this usually does makes sense since the figures
are referred to by number anyway.


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] How to put a \placefigure with no caption?

2012-11-12 Thread Marco Patzer
2012-11-12 Andy Thomas:

> I guess, I do not understand the relation completely. Please
> compare the following
> 
> -- startcode --
> 
> \starttext
> %
> \chapter{One}
> \input tufte
> \placefigure[margin,none]{}{Let's put some text of at least two lines.}
> \placefigure[none,margin]{}{Let's put some text of at least two lines.}
> \input tufte
> \stoptext
> 
> -- stopcode --
> 
> The first one works as intended, the second one does not. Also, I
> cannot figure out the equivalent new syntax.

> \placefigure[margin,none]{}{Let's put some text of at least two lines.}

  \startplacefigure [location={margin, none}]
Let's put some text of at least two lines.
  \stopplacefigure

> \placefigure[none,margin]{}{Let's put some text of at least two lines.}

  \startplacefigure [location={none, margin}]
Let's put some text of at least two lines.
  \stopplacefigure

> I tried 'caption=none' and 'location=none'.

location=none works here:

  \startplacefigure [location=none]
Let's put some text of at least two lines.
  \stopplacefigure

> But even if the latter one would work, having a caption (or not)
> and placing the figure on the page are two different things?

The first argument of `location` determines the location of the
figure, the second one the location of the caption. If only one
argument is provided, it is used for both. So the following
statements have the same effect.

  \startplacefigure [location={none, none}]
Let's put some text of at least two lines.
  \stopplacefigure

  \startplacefigure [location=none]
Let's put some text of at least two lines.
  \stopplacefigure

That's the reason why the figure in your second example is not
placed in the margin.


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] images and text stacked in the margin

2012-11-12 Thread Marco Patzer
2012-11-12 Andy Thomas:

> I am still struggling to achieve the page layout/look that I am
> trying to get. For an image of the desired page spread please look
> here: https://dl.dropbox.com/u/9089117/tufte-spread.png

How about this:

\useMPlibrary
[dum]

\setuplayout
[width=10cm,
 rightmargin=5cm]

\setupmargindata
[inouter]
[location=outer,
 stack=continue]

\definefloat
[marginfigure]
[marginfigures]
[figure]

\setupfloat
[marginfigure]
[default=margin]

\definefloat
[margintext]
[margintexts]

\setupfloat
[margintext]
[default=margin]

\setupcaption
[margintext]
[location=none]

\starttext

\input knuth

\startplacemarginfigure [title=Foo]
\externalfigure [dum] [width=\rightmarginwidth]
\stopplacemarginfigure

\startplacemargintext
\input ward
\stopplacemargintext

\input knuth

\startplacemarginfigure [title=Bar]
\externalfigure [dum] [width=\rightmarginwidth]
\stopplacemarginfigure

\stoptext


You need to put the \placemargintext at the beginning of a
paragraph, otherwise it will cause an unwanted break.


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] Macro in macro?

2012-11-12 Thread Marco Patzer
2012-11-12 H. Özoguz:

> but it returns the ending quotation mark in the wrong order. Why?

You forgot the braces:

Quote: \wr[{He said: \wrr[Hello!]}]

> And  how to correct that?

\setuplanguage
  [leftquotation=»,
   rightquotation=«,
   leftquote=›,
   rightquote=‹]

\starttext
  Quote: \quotation{He said: \quote{Hello!}}
\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] ntg-context Digest, Vol 101, Issue 30

2012-11-12 Thread Marco Patzer
2012-11-12 H. Özoguz:

> And if I want to have in
> 
>   \quotation and \quote
> 
> additionaly \emphasis, how to make that?
> 
> To be clear (sorry for my english):
> \quotation{\emph{Quote}}

\definehighlight
  [emph]
  [style=bolditalic]

Quote: \quotation{He said: \quote{Hello \emph{World!}}}


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] ntg-context Digest, Vol 101, Issue 31

2012-11-13 Thread Marco Patzer
2012-11-13 H. Özoguz:

Advice for your next posts: Try to provide a meaningful subject line
like “Enclosing quotations in guillemets” or “Emphasising
quotations”. And configure your mail reader to include a
“In-Reply-To” header to not break the thread with each post.

> I want the complete quotation emphasized- without extra writing \emph.

  \setuplanguage
[leftquotation=»,
 rightquotation=«]

  \define[1]\quotation
{\italic{\symbol[leftquotation]#1\symbol[rightquotation]}}

  \starttext
\quotation{Whatever}
  \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] How to display source in ConTeXt?

2012-11-13 Thread Marco Patzer
2012-11-13 yang.zhao:

> is there a good way to display source(such as C language)  in ConTeXt?

There is the vim module. It uses the editor vim to mark up the
source with syntax highlighting code. However, it does only
highlighting, not indentation. But it might be possible to hook in
an auto-indenter or a formatter like `astyle`. Here's an example:

\usemodule
  [vim]

\definevimtyping
  [C]
  [syntax=c,
   style=smalltype,
   tab=2]

\starttext

\startC
void EBI_BankByteLaneEnable(uint32_t banks, bool enable)
{
  EFM_ASSERT((banks & ~(EBI_BANK0 | EBI_BANK1 | EBI_BANK2 | EBI_BANK3)) == 0);

  /* Configure byte lane support for each selected bank */
  if (banks & EBI_BANK0)
  {
BITBAND_Peripheral(&(EBI->CTRL), _EBI_CTRL_BL_SHIFT, enable);
  }
  if (banks & EBI_BANK1)
  {
BITBAND_Peripheral(&(EBI->CTRL), _EBI_CTRL_BL1_SHIFT, enable);
  }
}
\stopC

\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] Tolerance and Stretch versus Protrusion and Ugliness

2012-11-15 Thread Marco Patzer
2012-11-15 H. Özoguz:

> \setuptolerance[stretch]

Are you sure, you want to use stretch? It will probably product
ugly results.

> \tolerance 70

Why 70? I don't understand the use of stretch with such a strict
tolerance. What about using

  \setuptolerance [tolerant] %% or verytolerant

instead of using stretch?

> Is it suitable to use tolerance and stretch in this way together?

It will probably work (though I never used it myself), but using the
ConTeXt interface \setuptolerance is the better approach.

> Of course I want a nice type area - but for me that means that I definitely 
> don't want a word written in the margin!

Use a higher tolerance, not a lower one.

> (That happens with the default \tolerance 250 (without using stretch).

What version are you using? A current ConTeXt has the \tolerance set to 200.

\starttext\the\tolerance\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] Changing the font in quotation

2012-11-16 Thread Marco Patzer
2012-11-16 H. Özoguz:

> I use \startquotation \stopquotation for longer quotations.
> 
> I want to globally change the font in this quotations (f.e. to garamond 
> or helvetica - my default is times new roman). How to make this?

Quotations are defined as delimited text, see

  http://wiki.contextgarden.net/Command/setupdelimitedtext

That means, you can use the style key as follows:

\setupdelimitedtext
  [quotation]
  [style=sans]

If you defined sans to be Helvetica, that's all you need, but this
depends on you document setup. You can also use \switchtobodyfont.

\setupdelimitedtext
  [quotation]
  [style={\switchtobodyfont[helvetica]}]


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] Wrong \unit spacing

2012-11-17 Thread Marco Patzer
Hi,

the \unit command produces wrong spacing when only the unit is given
without a value. Is there a way to improve the \unit command to not
print this space?

\starttext
\starttabulate
\NC wrong spacing \EQ (\unit{micro mol})   \NC\NR
\NC spacing OK\EQ (µmol)   \NC\NR
\NC spacing OK\EQ (3\,µmol)\NC\NR
\NC spacing OK\EQ (3 \unit{micro mol}) \NC\NR
\NC spacing OK\EQ (\unit{3 micro mol}) \NC\NR
\stoptabulate
\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] Equivalent of Includeonly?

2012-11-19 Thread Marco Patzer
2012-11-19 H. Özoguz:

> Is there an equivalent of the LaTeX "\includeonly" ?

You can place individual chapters in components and use the mode
mechanism:

  \startproduct *

  \startmodeset
[alpha] {\component [alpha]}
[beta]  {\component [beta]}
[gamma] {\component [gamma]}
  \stopmodeset

  \stopproduct

Then compile with `context --mode=alpha,gamma main.tex`.

http://wiki.contextgarden.net/Project_structure


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] A problem with units

2012-11-25 Thread Marco Patzer
Hi Hans,

since you are working on the \unit code at the moment, I want to
remind you about an issue I reported a while ago.

Any thoughts on that one?

http://article.gmane.org/gmane.comp.tex.context/79275


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] MetaPost instance mechanism broken

2012-11-25 Thread Marco Patzer
Hi,

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

\defineMPinstance
  [myinstance]
  [metafun]

\startuseMPgraphic{mympgraphic}
  fill fullsquare scaled 1cm withcolor blue;
\stopuseMPgraphic

\starttext\null
  \useMPgraphic{myinstance::mympgraphic}
\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] MetaPost instance mechanism broken

2012-11-25 Thread Marco Patzer
2012-11-25 Aditya Mahajan:


> I am still using the old 2012.11.16 version, but now you have to specify 
> the instance in the \startuseMPgraphic as well (Hans had announced this 
> on the mailing list a few weeks ago):

I missed that.

> \startuseMPgraphic{instance::mygraphic}
> ...
> \stopuseMPgraphic

This works. Thanks to both of you, Wolfgang and Aditya.


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-11-26 Thread Marco Patzer
2012-11-26 Sietse Brouwer:

> Since I don't use MetaPost, I don't think I'm the best person to
> document this. But I took this as an opportunity to create the command
> reference pages for a bunch of the \...MP... commands; perhaps one of
> you could add this info to the proper page(s)?

Thanks. I added some info about the change mentioned in this thread.

> Also: a question about
> \startuseMPgraphic and
> \startuniqueMPgraphic.
> Both are supposed to be recompiled at every usage, so how are they
> different? Actually trying it out suggests that useMPgraphic is the
> only one of the two that re-evaluates its code every time; compare the
> examples at

AFAIK useMPgraphic is always recalculated, reusableMPgraphic never
is. uniqueMPgraphic takes the size into account and recalculates if
the graphic dimensions change. If I recall correctly this is
mentioned somewhere in the MetaFun manual. But I agree, all these
commands for including MP graphics are confusing, given the fact
that one can survive pretty well with only useMPgraphic. I attached
a small example to show the difference.


Marco
\startuseMPgraphic{alpha}
	fill unitsquare
		xyscaled (\overlaywidth, \overlayheight)
		withcolor (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);
\stopuseMPgraphic

\defineoverlay
	[alpha]
	[\useMPgraphic{alpha}]

\startreusableMPgraphic{beta}
	fill unitsquare
		xyscaled (\overlaywidth, \overlayheight)
		withcolor (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);
\stopreusableMPgraphic

\defineoverlay
	[beta]
	[\reuseMPgraphic{beta}]

\startuniqueMPgraphic{gamma}
	fill unitsquare
		xyscaled (\overlaywidth, \overlayheight)
		withcolor (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);
\stopuniqueMPgraphic

\defineoverlay
	[gamma]
	[\uniqueMPgraphic{gamma}]

\starttext

\dontleavehmode
\framed[background=alpha]{foo}
\framed[background=alpha]{foo}
\framed[background=alpha]{foobar}

\dontleavehmode
\framed[background=beta]{foo}
\framed[background=beta]{foo}
\framed[background=beta]{foobar}

\dontleavehmode
\framed[background=gamma]{foo}
\framed[background=gamma]{foo}
\framed[background=gamma]{foobar}

\stoptext
___
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] Underlined section

2012-11-30 Thread Marco Patzer
2012-11-30 H. Özoguz:

> How to define a new title - like section, but aligned in the center and 
> underlined?
> 
> So far I got:
> 
> \definehead[mysection][section]
> \setuphead[mysection][alternative=middle]
> 
> How to get the underlining in that?

The following code is quite verbose, but it's the most flexible way
of implementing a structure head design. See also:

http://wiki.contextgarden.net/Titles

\definehead
  [mysection]
  [section]

\setuphead
  [mysection]
  [alternative=mysection]

\defineheadalternative
  [mysection]
  [renderingsetup=setup:mysection]

\defineframedtext
  [mysectionframe]
  [width=broad,
   align=middle,
   frame=off,
   bottomframe=on]

\startsetups [setup:mysection]
  \headsetupspacing
  \startmysectionframe
\ifconditional\headshownumber
  \headnumbercontent
  \hskip\headnumberdistance
\fi
\headtextcontent
  \stopmysectionframe
\stopsetups

\starttext
  \startmysection [title=Foo]
\input knuth
  \stopmysection
\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] Start\Stop with Wolfgangs Annotation Module

2012-11-30 Thread Marco Patzer
2012-11-30 H. Özoguz:

> Hi,
> 
> Im using Wolfgangs annotation module and have defined an annotation:
> 
> \defineannotation[bigquote]
> 
> with some setups.
> 
> Now \bigquote{...} works correctly. But I want for big annotations 
> \startbigquote \stopbigquote, how to do that?

First: Create a minimal running example. Then we can just mark the
code in the email, press a button and have the PDF opened. You'll
more likely get responses if you make it as easy as possible to deal
with your problem.

This works here:

\usemodule [annotation]
\defineannotation [bigquote] [style=bold]

\starttext
  \bigquote{Foo}
  \startbigquote
Bar
  \stopbigquote
\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
___

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

2012-12-04 Thread Marco Patzer
Hi,

The setting

\setupfloat
  [figure]
  [default=top]

not only places the figures at the top of the page, but also messes
up the float numbering (the float placement is fine). In the
following example “Figure 2” comes after “Figure 3”. How to fix
that?

\useMPlibrary
  [dum]

\setupfloat
  [figure]
  [default=top]

\starttext
\input knuth

\startplacefigure
  \externalfigure [dummy]
\stopplacefigure

\startplacefigure
  \externalfigure [dummy] [width=10cm, height=16cm]
\stopplacefigure

\startplacefigure
  \externalfigure [dummy]
\stopplacefigure

\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] Wrong float numbering with default=top

2012-12-04 Thread Marco Patzer
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.

\useMPlibrary
  [dum]

\setupfloat
  [figure]
  [default=top]

\definefloat
  [newfigure]
  [newfigures]
  [figure]

\ctxlua{structures.lists.autoreorder = true}

\starttext
\input knuth

\startplacefigure
  \externalfigure [dummy]
\stopplacefigure

\startplacenewfigure
  \externalfigure [dummy] [width=10cm, height=16cm]
\stopplacenewfigure

\startplacefigure
  \externalfigure [dummy]
\stopplacefigure

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


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
___

[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 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] Doubled annotation content

2012-12-07 Thread Marco Patzer
On 2012–12–07 Wolfgang Schuster wrote:

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

That's how I used it in the past, but after an update I got an error
which vanished after I removed the two arguments. I thought the
interface might have changed.

I used it as follows. What's wrong with that?

%% macros=mkvi
\usemodule [annotation]

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

\starttexdefinition cmd #first #second
  \placeannotationcontent
\stoptexdefinition

\starttext
\startmyannotation
  foo
\stopmyannotation
\stoptext


Thanks for the annotationalternative tip, I didn't know that one.


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-07 Thread Marco Patzer
On 2012–12–07 Peter Rolf wrote:

> Am 06.12.2012 19:35, schrieb 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;
> >
> 
> Don't mix Type2/3 with Type 4/5 shadings (see my answer to Aditya). They
> are all called 'shadings', but only the latter can be used for the
> creation of realistic looking drop shadows.

Thanks for pointing that out. I will have a look into my code again.

I was (and actually I still am) confused by the different shading
methods provided by MetaFun. I admit that I never read the PDF
reference which means that I don't know the shading internals. I
experimented a little and came up with a working solution to add
some eye-candy to presentations.

> And to repeat myself: there is nothing wrong with bitmaps.

I agree. Even Knuth designed his fonts as bitmaps (at least the
output is a bitmap). However, bitmaps always have a fixed size and
thus are not scalable.

> Take the best from both worlds ;-)

ACK

And thanks for this nice module and especially for the well-written
documentation.


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-07 Thread Marco Patzer
On 2012–12–07 Wolfgang Schuster wrote:

> Commands need to be unexpandable because when you use the “command”.
> 
> This is necessary because I check for a command and this needs 
> \unexpanded\def to work.
> 
> You can create a unexpandable command with \starttexdefintion by adding
> the unexpanded keyword as first argument to the environment.
> 
> \starttexdefinition unexpanded cmd #first #second
>  \placeannotationcontent
> \stoptexdefinition

That does the trick. Thanks Wolfgang!


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] Wrong float numbering with default=top

2012-12-08 Thread Marco Patzer
On 2012–12–06 Hans Hagen wrote:

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

Thanks. It does not break anything in the final document and all
numbers are correct.


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] New module: simplesteps.

2012-12-15 Thread Marco Patzer
On 2012–12–15 Sietse Brouwer wrote:

> But when I tried to write a minimal example, I couldn't get it to compile.
> 
> %% begin example
> \grabbufferdata[mybuffer][thisisthestart][thisistheend]
> \thisisthestart
> My friend, you would not tell with such high zest
> To children ardent for some desparate glory,
> The old Lie: Dulce et decorum est
> Pro patria mori.
> \thisistheend
> 
> \typebuffer[mybuffer]
> %% end example
> 
> What am I doing wrong?

You have to wrap it in a macro:

\starttext

\define\thisisthestart
  {\grabbufferdata[mybuffer][thisisthestart][thisistheend]}

\let\thisistheend\relax %% not necessary

\thisisthestart
My friend, you would not tell with such high zest
To children ardent for some desparate glory,
The old Lie: Dulce et decorum est
Pro patria mori.
\thisistheend

\typebuffer[mybuffer]

\stoptext


Marco


signature.asc
Description: Digital 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
___

[NTG-context] Whitespace and quotechar in database module

2012-12-18 Thread Marco Patzer
Hi,

the following two database examples produce different output due to
the white space between the field separator and the quotechar.


\usemodule [database]

\defineseparatedlist
  [CSV]
  [quotechar=",
   before={\starttabulate[|l|l|]},
   after=\stoptabulate,
   first=\NC,last=\NR,
   left=,right=\NC]

\starttext

\startCSV
  alpha, loremloremlorem
  beta,"ipsum, ipsum, ipsum"
\stopCSV

\startCSV
  alpha, loremloremlorem
  beta, "ipsum, ipsum, ipsum"
\stopCSV

\stoptext


Can the parser be made tolerant to this space?

Marco


signature.asc
Description: Digital 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] Wrong float numbering with default=top

2012-12-18 Thread Marco Patzer
On 2012–12–08 Marco Patzer wrote:

> Thanks. It does not break anything in the final document and all
> numbers are correct.

Referring to the figures is messed up:

\useMPlibrary
  [dum]

\setupfloat
  [figure]
  [default=top]

\ctxlua{structures.lists.autoreorder = true}

\starttext
\input knuth

alpha: \in{figure}[alpha] \par
beta:  \in{figure}[beta]  \par
gamma: \in{figure}[gamma] \par

\startplacefigure [title=Alpha, reference=alpha]
  \externalfigure [dummy]
\stopplacefigure

\startplacefigure [title=Beta, reference=beta]
  \externalfigure [dummy] [width=10cm, height=16cm]
\stopplacefigure

\startplacefigure [title=Gamma, reference=gamma]
  \externalfigure [dummy]
\stopplacefigure

\stoptext

For the moment I would actually be happy with a workaround to get
the numbers right. With autoreorder the referencing is wrong,
without autoreorder the float numbers are not in order.


Marco


signature.asc
Description: Digital 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] Wrong float numbering with default=top

2012-12-19 Thread Marco Patzer
On 2012–12–19 Hans Hagen wrote:

> this kind of messy stuff needs some time to get right (apart from
> messing up de code)
> 
> you cna try to patch this in strc-ref.lua

This seems to fix it. Thanks for the quick patch, Hans.

Marco


signature.asc
Description: Digital 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] Numerical Calculations

2012-12-19 Thread Marco Patzer
On 2012–12–19 Troy Henderson wrote:

> In case anyone cares, here is the "finished" product which is a
> frame-by-frame animation of a hypocycloid.  The following code will produce
> a 190 page PDF where each page is an individual frame of the animation.
> 
> […]

Very nice work, indeed. It reminds me of a drawing toy I had when I
was a kid. Thanks a lot for sharing.

Marco


signature.asc
Description: Digital 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] Numerical Calculations

2012-12-19 Thread Marco Patzer
On 2012–12–19 Troy Henderson wrote:

> >
> > Very nice work, indeed. It reminds me of a drawing toy I had when I
> > was a kid. Thanks a lot for sharing.
> >
> 
> Spirograph?
> 
> http://en.wikipedia.org/wiki/Spirograph

Exactly, that's it.

Plenty of beautiful patterns with just small change in parameters.
Maybe this can be adapted for (non-circular) ornaments as well,
which could be used for text decorations. It would make for a nice
module.

Marco


signature.asc
Description: Digital 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
___

[NTG-context] Error markers for invalid section references

2013-01-07 Thread Marco Patzer
Hi,

in the final stage of a document I always run a grep for ?? and
 on the document to find invalid references and missing
bibliography entries.

However, in documents that do not have a section number the
references to the number are also wrong, they need to be references
to the name instead of the number. In this case no error marker is
printed and AFAIK not even a hint in the log file. The correct way
is to use \about instead of \in. Here's an example:

\setuphead [section] [number=no]
\starttext

\startsectionlevel [title=Alpha]
  See section \in[invalid]. \par %% prints ??
  See section \in[sec:bar]. \par %% prints nothing
  See section \about[sec:bar].   %% correct reference
  
  \startsectionlevel [title=Foo]
  \stopsectionlevel
  \startsectionlevel [title=Bar, reference=sec:bar]
  \stopsectionlevel
\stopsectionlevel

\stoptext

The wrong \in[invalid] reference receives an easy to find error
marker and an entry in the log file. The wrong entry \in[sec:bar] is
hard to find.

Is there a way to add ?? for those cases as well?


Marco


signature.asc
Description: Digital 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] MetaPost Animations

2013-01-07 Thread Marco Patzer
On 2013–01–07 Troy Henderson wrote:

> http://www.tlhiv.org/animations
> 
> There is one in particular that, I think, is quite impressive.  It is an
> animation of a function f(x,y,t) where t is time.

I love that one. Very impressive, indeed! Although my browser
flickers for about 20s until it eventually starts, but that might
just be my flash player. Thanks for providing such nice animations.
I can't wait for the next one. Where's the RSS feed? ;)

Side note: When I access your site I get the following warning:

  Internal Server Error

  The server encountered an internal error or misconfiguration and was
  unable to complete your request.

  Please contact the server administrator, [no address given] and
  inform them of the time the error occurred, and anything you might
  have done that may have caused the error.

  More information about this error may be available in the server
  error log.

Marco


signature.asc
Description: Digital 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
___

[NTG-context] Place an annotation before it is defined

2013-01-07 Thread Marco Patzer
Hi,

what is the best solution to place the content of annotations before
they are defined in the text? What comes to mind is writing the
content into an external file and read it in the next run. But maybe
I overcomplicate things (usually I do) and there's a simpler
solution. Here's an example:

\usemodule
  [annotation]

\defineannotation
  [myannotation]

\setupannotation
  [myannotation]
  [alternative=myalternative]

\defineannotationalternative
  [myalternative]
  [renderingsetup=annotation:myalternative]

\startsetups [annotation:myalternative]
  Content: \placeannotationcontent
\stopsetups

\starttext

%% The annotation content should be placed here.

\input ward \blank

%% Although it is defined later
\startmyannotation
  \input knuth
\stopmyannotation

\stoptext

Marco


signature.asc
Description: Digital 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
___

[NTG-context] Make annotations tolerant against empty lines

2013-01-07 Thread Marco Patzer
Hi,

if the first line after an annotation start is empty, a new line is
introduced. How can I make it tolerant so that the following both
examples come out equal (Content and the annotation text on the same
line)?

\usemodule
  [annotation]

\defineannotation
  [myannotation]

\setupannotation
  [myannotation]
  [alternative=myalternative]

\defineannotationalternative
  [myalternative]
  [renderingsetup=annotation:myalternative]

\startsetups [annotation:myalternative]
  Content: \placeannotationcontent
\stopsetups

\starttext

\startmyannotation

  \input knuth

\stopmyannotation
\blank

\startmyannotation
  \input knuth
\stopmyannotation

\stoptext

Marco


signature.asc
Description: Digital 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] Place an annotation before it is defined

2013-01-07 Thread Marco Patzer
On 2013–01–07 Hans Hagen wrote:

> buffers (or blocks)

Buffers apparently can't be used before the content is defined, but
it works for blocks (I never used them). Test:

\defineblock [bar]

\starttext

buf: \getbuffer[foo]
BBB

\startbuffer[foo]
buf: AAA
\stopbuffer

\useblocks [bar]
DDD

\beginbar
block: CCC
\endbar

\stoptext

Is there a reason why the blocks favour begin/end instead of
start/stop? Looks weird somehow.


Marco


signature.asc
Description: Digital 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] Place an annotation before it is defined

2013-01-07 Thread Marco Patzer
On 2013–01–07 Wolfgang Schuster wrote:

> That’s not possible because the content is stored only in memory and is 
> therefore only available after you put the environment in your document.
> 
> What you can do is to set the content of the environment at the begin of the 
> document and refer to it at a later position like you can do with buffers.
> 
> \usemodule[annotation]
> 
> \defineannotation[test][method=buffer,text=Test]

Nice, I didn't know the “method” key.

Blocks, in contrast to buffers, seem to be able to place content
before it is defined. I did not check how they work, but since I
didn't see any temporary files, the only possibility is to write the
data to the tuc file, I assume. It is by any chance possible to
provide a “method=block”?


Marco


signature.asc
Description: Digital 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] Error markers for invalid section references

2013-01-07 Thread Marco Patzer
On 2013–01–07 Hans Hagen wrote:

> >The wrong \in[invalid] reference receives an easy to find error
> >marker and an entry in the log file. The wrong entry \in[sec:bar] is
> >hard to find.
> >
> >Is there a way to add ?? for those cases as well?
> 
> I'll print an !! although it might become optional

That's totally fine with me. Optional means one can turn it on and
off, perfect.

> at some point if I find that it has unwanted side effects.

Using \in with numbering turned off has side-effects, too ;)

Thanks Hans!

Marco


signature.asc
Description: Digital 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] Place an annotation before it is defined

2013-01-07 Thread Marco Patzer
On 2013–01–07 Wolfgang Schuster wrote:

> > Blocks, in contrast to buffers, seem to be able to place content
> > before it is defined. I did not check how they work, but since I
> > didn't see any temporary files, the only possibility is to write the
> > data to the tuc file, I assume. It is by any chance possible to
> > provide a “method=block”?
> 
> Yes, blocks are stored in the tux-file while buffers are only stored in 
> memory.
> 
> I played for a while with \setdataset to store the content but dropped it 
> because
> it required multiple runs and especially in the first run the output would be 
> always
> wrong

That's no problem IMO. Two-pass data is always wrong the first run.
In the worst case, it needs an additional run if text moves around
too much. But since it's just another method, which is optional,
this only applies if it's activated and then the user knows what
he/she is doing and that it might be slower.

> I can consider it as a optional method.

I think it would be a nice feature. It enables placement of elements
where they logically belong, instead of where they are supposed to
be printed. It's nothing mission critical though, but you can keep
it in mind for a rainy afternoon.

Marco


signature.asc
Description: Digital 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
___

<    1   2   3   4   5   6   7   8   >