Re: [NTG-context] define vs setup

2012-07-26 Thread Marco Patzer
On 2012-07-26 Bill Meahan wmeaha...@gmail.com wrote:

Hi Bill,

it's a typo:

 \stopmakup

\stopmakeup


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] alternative=d gives attr

2012-07-30 Thread Marco Patzer
On 2012-07-30 Steffen Wolfrum cont...@st.estfiles.de wrote:

Hi Steffen,

 Any idea where this attr2 comes from, and how to get rid of it??

Sorry, no clue.

 Second question: how can I add a separator, like this: 
 
 a) Test one 47–   b) Test two 51

\setuplist
  [section]
  [alternative=d,
   textcommand=\SectionCommand]

\define[1]\SectionCommand{#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] footnote numbers turn red

2012-07-31 Thread Marco Patzer
On 2012-07-31 Martin martin.alth...@yahoo.com wrote:

Hi Martin,

 The footnote numbers turn red(ish) as soon as \setupinteraction is present.
 
 Is that intended?

Yes, it is. There is a special setting, when the link appears on the
same page, it's contrastcolor.

\setupinteraction
  [state=start,
   color=darkblue,
   contrastcolor=green]


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] footnote numbers turn red

2012-07-31 Thread Marco Patzer
On 2012-07-31 Martin Althoff martin.alth...@yahoo.com wrote:

 With the definition, as you give it, the footnote numbers at the
 bottom of the page turn green, but the ones in the text remain
 black.

Not here with 2012.07.27 16:41. Which context version are you
running?


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] Left margin of vim module output

2012-08-01 Thread Marco Patzer
Hi,

how can I adjust the left margin of the output of the vim module?

The core typing mechanism implements a “margin” key for this. The
vim output also does not react to the “leftoffset” setting of the
background mechanism.

\usemodule [vim]

\definetextbackground [code]
  [location=paragraph,
   %leftoffset=1cm,
   topoffset=5mm]

\definevimtyping [C]
  [syntax=c,
   before={\starttextbackground[code]},
   after=\stoptextbackground]

\setuptyping [typing]
  [margin=1cm,
   before={\starttextbackground[code]},
   after=\stoptextbackground]

\starttext

\startC
/* This MEMB() definition defines a memory pool from
 * which we allocate neighbour entries. */
MEMB(neighbours_memb, struct neighbour, MAX_NEIGHBOURS);
\stopC

\blank

\starttyping
/* This MEMB() definition defines a memory pool from
 * which we allocate neighbour entries. */
MEMB(neighbours_memb, struct neighbour, MAX_NEIGHBOURS);
\stoptyping

\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] Left margin of vim module output

2012-08-01 Thread Marco Patzer
On 2012-08-01 Aditya Mahajan adit...@umich.edu wrote:

  I'll add a margin key to vim module (but not the oddmargin and
  evenmargin keys; they would require a complete low-level rewrite
  of the module).

Thanks a million. That was fast :)

 The dev version on github now includes a margin key,

Does it? I just can see a new test file in the recent commit history
(without margin key, however). Did you already push the changes to
the public repo?

 I haven't tested it too much

That's my part, I guess

 hence no new release at the moment).

No problem, I'm totally fine with the git repo.

 Note that this works differently from \definetyping. The typing
 environment honors the leftskip set by its parent environment (for
 example, if typing is inside startbackground); vimtyping
 environment resets all the settings of its parent environment.

That's why the hacks that I tried before all miserably failed.

Thanks again!


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 MPgraphics as externalfigures?

2012-08-02 Thread Marco Patzer
On 2012-08-02 Mari Voipio mari.voi...@iki.fi wrote:

Hi Mari,

 I'm being a bit clueless about the MPgraphics again...

Read http://wiki.contextgarden.net/Metapost and 3.3 Integrated
Graphics in the MetaFun Manual.

 Any ideas of how to do this in a smart way? Preferably without having
 to go into the bowels of ConTeXt to get it done...

\defineframed
  [graphicframe]
  [frame=on,offset=none]

\define[1]\MPframed
  {\graphicframe{\useMPgraphic{#1}}}

\startuseMPgraphic{first}
  fill fullcircle scaled 2cm withcolor red;
\stopuseMPgraphic

\startreusableMPgraphic{second}
  fill fullsquare rotated 45 scaled 2cm withcolor blue;
\stopreusableMPgraphic

\startbuffer [third]
  fill fullsquare scaled 1cm withcolor green;
\stopbuffer

\starttext
  \useMPgraphic{first}
  \reuseMPgraphic{second}
  \processMPbuffer [third]
  \MPframed{second}
\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] Argument of \myheading has an extra }

2012-08-02 Thread Marco Patzer
On 2012-08-02 Jan Pohanka xhpoha...@gmail.com wrote:

Hi Jan,

 \def\myheading#1#2{%
   #1 #2}

\define[2]\myheading{%
#1 #2}

Also interesting in this context:
http://article.gmane.org/gmane.comp.tex.context/77610


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] Marking a textfragment for later reference

2012-08-05 Thread Marco Patzer
Hi Robert,

\starttext
See \in{section}[sec:foo] on \at{page}[sec:foo]
or the text on \at{page}[ref:a].

\page
\startsection [title=Foo, reference=sec:foo]
\stopsection
\page

Some text\reference[ref:a]
\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] Multiple arguments bug in \showhyphens

2012-08-30 Thread Marco Patzer
The following example throws a LuaTeX error:

\starttext
\showhyphens{foolish bartender}
\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] Divided cells and bullet points in tables

2012-08-30 Thread Marco Patzer
On 2012-08-30 Malte Stien ma...@stien.de wrote:

Hi Malte,

 1. The top left cell is divided in two by a diagonal line with
 separate text into each triangle

This should get you started:
http://article.gmane.org/gmane.comp.tex.context/67721

 2. Another cell in the table body has a bulleted list

This is possible with natural tables.


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] Disappearing content when floats are used in columnset

2012-08-30 Thread Marco Patzer
Hi,

in the following example the AAAs disappear. Column sets without
float and floats without column sets work fine.

\definecolumnset [Columns] [n=2]
\starttext
  \startcolumnset [Columns]
AAA
\startplacefigure [title=Some figure]
\stopplacefigure
BBB
  \stopcolumnset
\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] Diagonal rule in table (was: Divided cells and bullet points in tables)

2012-08-31 Thread Marco Patzer
 Hi Malte,
 
  1. The top left cell is divided in two by a diagonal line with
  separate text into each triangle
 
 This should get you started:
 http://article.gmane.org/gmane.comp.tex.context/67721

That solution is very hackish and the result ugly. Here is a more
clean solution. It has (at least ) one caveat: Because the first
tabulate column is set in paragraph mode, it will eat up as much
space as *possible*, in contrast to occupying as much space as
*necessary*. That is why the width of the column has to be set
explicitly.

\startuseMPgraphic{DiagonalRule}
  rulethickness := \frameddimension{rulethickness};

  drawoptions(
withpen pencircle scaled rulethickness
withcolor \MPcolor{\framedparameter{framecolor}});

  pair leftcorner, rightcorner;
  leftcorner  := (rulethickness, \overlayheight-rulethickness);
  rightcorner := (\overlaywidth-rulethickness, rulethickness);

  draw leftcorner -- rightcorner;
\stopuseMPgraphic

\defineoverlay
  [DiagonalRule]
  [\useMPgraphic{DiagonalRule}]

\define[2]\DiagonalLabel{%
  \setuptabulate [after={\blank[\frameddimension{offset}]}]
  \starttabulate [|p|r|]
\NC\NC #2 \NC\NR
\NC #1 \NC\NC\NR
  \stoptabulate
}

\starttext
  \setupTABLE [1] [width=2cm]
  \bTABLE
\bTR
  \bTD [background=DiagonalRule]
\DiagonalLabel{Foo}{Bar}
  \eTD
  \bTD Second \eTD
  \bTD Third \eTD
\eTR
\bTR
  \bTD Alpha \eTD
  \bTD Beta  \eTD
  \bTD Gamma \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
___


[NTG-context] Subfootnotes broken

2012-08-31 Thread Marco Patzer
Hi,

the subfootnote feature is broken or changed the interface. Is there
a workaround or fix?

\starttext
  Alpha\footnote{alpha}
  Beta\subfootnote{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
___


[NTG-context] Page number in the edge

2012-09-03 Thread Marco Patzer
Hi,

moving the page number into the edge in the following way seems
straightforward, but fails. “edge” is not recognised as “margin” or
“header” is. I wonder why.

Is this intended or am I misusing the command?

\setuplayout
  [backspace=5cm,
   width=10cm,
   edge=1cm]

\setuppagenumbering
  [location={header, edge}] % fails: centred in the header
  % [location={header, margin}] % works

% also works
%\setupheadertexts
  %[edge] [] [pagenumber]

\starttext
  \showframe
  \dorecurse{10}{\null\page}
\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] Include chapter number in figure numbering

2012-09-03 Thread Marco Patzer
Hi,

how do I include the chapter number in the figure numbering?

The following example used to produce (as of November 2011) “Figure 1.1”.
A current beta yields merely “Figure 1”.

\starttext
  \startchapter [title=Foo]
\startplacefigure [title=Bar]
\stopplacefigure
  \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] Include chapter number in figure numbering

2012-09-04 Thread Marco Patzer
On 2012-09-04 Sietse Brouwer sbbrou...@gmail.com wrote:

Hi Sietse,

  how do I include the chapter number in the figure numbering?
 
 Untested:
 \setupcaptions[prefixsegment=chapter]

This works with beta 2011-11-29, but unfortunately not in a current
one. Does it work for you?


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] \startchapter[title=Test] is not working inside \startcomponent

2012-09-04 Thread Marco Patzer
On 2012-09-04 Jeong Dalyoung hak...@me.com wrote:

Hi Jeong,

 \startchapter[title=Test] is working inside \starttext and \stoptext.
 But it is not working inside \startcomponent and \stopcomponent.
 Is it a natural behavior? 

Yes. \startcomponent expects an argument.

\startcomponent somecomponent

or

\startcomponent *

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


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] Include chapter number in figure numbering

2012-09-04 Thread Marco Patzer
On 2012-09-04 Rogers, Michael K mrog...@emory.edu wrote:

Hi Rogers,

 I think the key name is plural, and you need to turn on prefixes.
 
 \setupcaptions[prefix=yes,prefixsegments=chapter]

Thanks, that works. I updated 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
___


[NTG-context] Lua conditionals fail inside \starttexdefinition

2012-09-04 Thread Marco Patzer
Hi,

I discovered strange behaviour concerning Lua conditionals within
texdefinitions.

ConTeXt complains: 'then' expected near 'thenelseend'.

I guess it has something to do with how the content of a
texdefinitions is grabbed. Seems like a bug or is this by design?


% This works fine
\def\mycmd{%
  \startluacode
if true then
else
end
  \stopluacode}

% This one fails
% \starttexdefinition mycmd
%   \startluacode
% if true then
% else
% end
%   \stopluacode
% \stoptexdefinition

\startluacode
  userdata = userdata or { }
  function userdata.myfun()
if true then
else
end
  end
\stopluacode

% This also works fine
\starttexdefinition mycmd
  \luacode{userdata.myfun()}
\stoptexdefinition

\mycmd


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] \startluacode and macro names with underscores

2012-09-04 Thread Marco Patzer
Hi,

the luacode environment chokes on macro names with underscores.
Example:

\starttext
\unprotect

\def\number_two{two}

\startluacode
  userdata = userdata or { }
  function userdata.number_one() context(one) end

  -- works
  userdata.number_one()

  -- fails
  -- context.number_two()

  -- workaround
  tex.print(\\number_two)
\stopluacode

\protect
\stoptext

Why is that and what can be done to access underscored macros in the
usual way? I guess it's some catcode change from the function that
prints into the TeX stream.


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] TeX expansion within lua

2012-09-04 Thread Marco Patzer
Hi,

please have a look at the following example:

\starttext

\def\cmd{%
  \def\mymacro{Foobar}
  \newtoks\mytoks
  \mytoks={mytoks}}

\startluacode
  context.cmd()
  context.mymacro()
  -- this fails
  -- context(tex.toks.mytoks)
\stopluacode

-- this works
\startluacode
  context(tex.toks.mytoks)
\stopluacode

\stoptext

Why does the first call to tex.toks.mytoks fail?

Apparently the luacode environment has to be closed for cmd to be
expanded. I guess that the call to mymacro() succeeds is a quirk due
to the face that the macro is expanded later, in contrast to tokens,
dimens and counters.

Is there a command I can use within Lua to expand a macro
immediately or to expand the pending macros to be able to access the
values like the token register in the example?


Another question which is related:

Is there a way to access the contents of the macro from within Lua
like counters and token registers?

\starttext

\newtoks\mytoks
\mytoks={Foobar}

\startluacode
  local tok = tex.toks.mytoks

  -- something like this is what I have in mind
  -- local mac = tex.macros.somemacro
\stopluacode

\stoptext

I am just interested in a text string, not a box with typeset
material. I guess that's more difficult, since macros are expanded
and not just simply read.


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] TeX expansion within lua

2012-09-04 Thread Marco Patzer
On 2012-09-04 Aditya Mahajan adit...@umich.edu wrote:

Hi Aditya,

 Instead of
 
context(tex.toks.mytoks)
 
 use
 
context(function () context(tex.toks.mytoks) end)
 
 See the ConTeXt Lua Document manual for explanation.

Thanks. This works indeed. But what to do in the following
case? It's hard to find a proper wording for this problem which
makes searching on the net or in the documentation difficult.

\starttext

\def\cmd
  {\newdimen\mydimen
   \mydimen=50pt}

\startluacode
  context.cmd()
  if tex.dimen.mydimen  tex.dimen.textwidth then
context(is smaller)
  else
context(is not smaller)
  end
\stopluacode

\stoptext

  Is there a way to access the contents of the macro from within Lua
  like counters and token registers?
 
  […]
 
 AFAIK, this is not possible.

Thanks.


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] TeX expansion within lua

2012-09-04 Thread Marco Patzer
On 2012-09-04 Martin Schröder mar...@oneiros.de wrote:

Hi Martin,

 http://tracker.luatex.org/view.php?id=682

It seems that I just hit a very hard to solve issue which needs
not yet available support from the luatex side.

Patricks solution seems not very practical and error prone, so I
settled with this ugly but still readable workaround:

\def\cmd
{\newdimen\mydimen
 \mydimen=50pt}

\starttexdefinition action
\cmd
\startluacode
if tex.dimen.mydimen  tex.dimen.textwidth then %
context(is smaller)
else %
context(is not smaller)
end %
\stopluacode
\stoptexdefinition

\action


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] TeX expansion within lua

2012-09-04 Thread Marco Patzer
On 2012-09-04 Wolfgang Schuster wolfgang.schus...@gmail.com wrote:

 Is there a good reason why you put \newdimen because dimen/count
 etc. registers should always be defined once.

The definitions are not in a macro, they are defined at the top of
the file. I messed around while creating a minimal example. However,
the problem remains the same since the assignment does not happen
within Lua.

But, thanks for the hint. I am always happy for improvements and
feedback about my code.


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] Lua conditionals fail inside \starttexdefinition

2012-09-04 Thread Marco Patzer
On 2012-09-04 Wolfgang Schuster wolfgang.schus...@gmail.com wrote:

  Why does adding semicolon not work?
 
 Do you have a example?


\starttext
\startluacode
  if true then;
context(true)
  else;
context(false)
  end
\stopluacode
\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] TeX expansion within lua

2012-09-04 Thread Marco Patzer
On 2012-09-04 Wolfgang Schuster wolfgang.schus...@gmail.com wrote:

 What prevents you from setting the dimen value in Lua?

Some background:

The code is part of a smarter float placement. It takes the size of
the float into account and decides for a location. For example, it
positions the float in the margin if it fits or it prints the
caption underneath the float if the float spans the margin as well
(captions are in the margin by default in this layout).

Most of the code is written in TeX and I don't feel it's necessary
to rewrite it in Lua. I am more fluent in TeX than in Lua.

In this case a TeX helper function computes the size and saves the
results in dimen registers. I use Lua for calculations especially
when it comes to dimensions. It's a nightmare in TeX and hard to
find errors easily creep in.


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] Lua conditionals fail inside \starttexdefinition

2012-09-04 Thread Marco Patzer
On 2012-09-04 Herbert Voss herbert.v...@fu-berlin.de wrote:

Hi Herbert,

  \starttext
  \startluacode
 if true then;
   context(true)
 else;
   context(false)
 end
  \stopluacode
  \stoptext
 
 that is no Lua syntax

if true then;
  print(true)
else;
  print(false)
end

This snippet fed into a standalone Lua interpreter prints “true” on
the terminal.

I admit, I did not look up the syntax in the manual, but I have in
mind that semicolons can be used to separate statements that are on
one line.


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] Lua conditionals fail inside \starttexdefinition

2012-09-04 Thread Marco Patzer
On 2012-09-04 Herbert Voss herbert.v...@fu-berlin.de wrote:

 voss@shania:~/ConTeXt lua zzz.lua
 lua: zzz.lua:1: unexpected symbol near ';'

marco@homerow:/tmp$ lua t.lua
true

 voss@shania:~/ConTeXt lua -v
 Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio

marco@homerow:/tmp$ lua -v
Lua 5.2.1  Copyright (C) 1994-2012 Lua.org, PUC-Rio


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] Lua conditionals fail inside \starttexdefinition

2012-09-04 Thread Marco Patzer
On 2012-09-04 Herbert Voss herbert.v...@fu-berlin.de wrote:

  voss@shania:~/ConTeXt lua -v
  Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
 
  marco@homerow:/tmp$ lua -v
  Lua 5.2.1  Copyright (C) 1994-2012 Lua.org, PUC-Rio
 
 the syntax changes, see http://www.lua.org/manual/5.2/manual.html#9

You're totally right. LuaTeX uses does not use lua 5.2 and therefore
the semicolon syntax is wrong. I also get an “unexpected symbol”
with lua5.1

Thanks for the clarification


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] Automatic margin floats using the criterium parameter

2012-09-05 Thread Marco Patzer
Hi,

I am working on some float placement code for a project. To
not reinvent the wheel I like to know what is currently possible in
ConTeXt.

Small floats should be placed in the margin and bigger ones centred
in the text. Captions always go into the margin. That is the idea.
The key to automate this seems to be the \setupfloat[criterium=…]
parameter. Details:

1) Captions always in the margin
2) Captions left aligned
3) Figures smaller or equal \marginwidth go into the outer margin
4) Margin figures are aligned to the inner side of the margin
5) Margin figure captions underneath the figure
6) Figures wider than the margin go centred into the text
7) Text figure captions top aligned

I got almost everything working. A minimal example is attached.

Problems:

Mf 1-2 are placed correctly. Problematic are Mf 3-4. The caption is
not placed in the margin because of the

\setupcaptions
  [mf]
  [location=bottom]

setting for margin figures. Another thing is the weird alignment of
Mf 3-4, I expect the figures to be centred. The reason is the
following setting.

\setupfloat
  [mf]
  [location=inner]

If uncommented, the alignment of the margin figures is wrong. Figure
1-2 are examples of how it should look like.

I could come up with a hackish solution on my own but maybe someone
has an idea how to achieve this with built-in support.


Marco


floatmargin.pdf
Description: Adobe PDF document
\setupexternalfigures
  [height=2cm]

\setupblackrules
  [height=2cm]

\def\graph
  {\blackrule}

\setuplayout
  [width=9cm,
   margin=4cm]

\setupcaptions
  [location={outermargin, high},
   width=\marginwidth]

\setupcaptions
  [mf]
  [location=bottom,
   width=\marginwidth]

\definefloat
  [mf]
  [mfs]

\setupfloat
  [mf]
  [criterium=\rightmarginwidth,
   location=inner,
   default=margin]

\starttext
\showframe

\input knuth

\startplacefigure [title=Figure description] \graph[width=3cm] \stopplacefigure
\startplacefigure [title=Figure description] \graph[width=5cm] \stopplacefigure

\startplacemf [title=Short]  \graph[width=2cm]   \stopplacemf
\startplacemf [title=Figure description] \graph[width=4cm]   \stopplacemf
\startplacemf [title=Figure description] \graph[width=4.2cm] \stopplacemf
\startplacemf [title=Figure description] \graph[width=8cm]   \stopplacemf

\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] TeX expansion within lua

2012-09-05 Thread Marco Patzer
On 2012-09-05 Hans Hagen pra...@wxs.nl wrote:

Hi Hans,

 you probably over code things

Yes, that's not unlikely, I tend to do that (unintentional).

 instead of storing you can pass the valus directly
 
 \def\largerthantextwidth#1%
{\cldcontext
   {if \number\dimexpr#1tex.dimen.textwidth then
  is smaller
else
  is equal or larger
fi}}

This code does not work for me, but I get the idea of injecting
macro parameters into the Lua code.


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] Automatic margin floats using the criterium parameter

2012-09-05 Thread Marco Patzer
On 2012-09-05 Hans Hagen pra...@wxs.nl wrote:

Hi Hans,

  I am working on some float placement code for a project. To
  not reinvent the wheel I like to know what is currently possible in
  ConTeXt.
 
 fyi: As I often need conditional placement in projects (mostly width 
 related), it's likely that there will be a pluggable system some day 

I already consider the entire float mechanism very flexible and
feature rich.

 It's somewhat complicated by the fact that one has to decide what
 to do with delayed placement.

I'm quite happy with the placement in general. The exact problem
here is that if the \setupfloat[criterium=…] value is exceeded, it
seems that ConTeXt adjusts the values “location” and “default” to
place the float in the text. A solution would be to be able to state
a fallback float class in case criterium is exceeded. Idea:

\definefloat
  [marginfigure]
  [marginfigures]

\definefloat
  [marginfigurefallback]
  [marginfiguresfallbacks]
  [marginfigure]

\setupfloat
  [marginfigure]
  [criterium=\marginwidth,
   criteriumfallback=marginfigurefallback]

This way full control is being maintained, since the float and
caption style of the fallback class can be individually adjusted.


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] Promotion of the ConTeXt IRC channel

2012-09-07 Thread Marco Patzer
Hi,

I was wandering if we should promote the ConTeXt IRC channel on the
contextgarden home page, e.g. underneath “Welcome to ConTeXt garden”
or “External Help”. The current page
(http://wiki.contextgarden.net/IRC) is unlikely to be found by
anyone.

I think most questions should stay on the mailing list, since I
consider the mailing list almost as “the second ConTeXt manual” and
it can easily be searched, in contrast to IRC.

At the moment the channel is dead, which is probably due to the fact
that no one knows of its existence. But it might turn into a
valuable source of information, e.g. regarding installation problems
for which the mailing list might not be as suitable.


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] Promotion of the ConTeXt IRC channel

2012-09-07 Thread Marco Patzer
On 2012-09-07 Bill Meahan subscribed_li...@meahan.net wrote:

 After being on the internet since the early 1980's I can say with 
 certainty if one person is having a particular problem others have or 
 will have it, too. A searchable archive of answers (like a mailing list 
 archive) is far more valuable than the ephemeral presence of any sort of 
 IM channel.

I totally agree. If I get you right, you think that the IRC will
receive problem solutions that the mailing list will miss. That's a
valid point I had in mind, as well. With another channel the
information will be spread out even more, which might not be
desirable.

 IM channels are really helpful when an expert needs to walk someone 
 through something or do interactive problem investigations in real-time, 

That was the scenario I had in mind.

 but answers, regardless of how unique they seem at the time, are best 
 kept where others can find them because they *will* be needed again.

Cannot agree more.

Thanks for your opinion.


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] Promotion of the ConTeXt IRC channel

2012-09-08 Thread Marco Patzer
 I've added a note to the [[Main Page]] (edit it at
 http://wiki.contextgarden.net/Template:Main_Page), and a note to the
 [[IRC]] page. How does that look to you guys?

Looks good to me. Future will show if this leads to interesting
conversations. Everyone is invited.

 I think that someone who knows the channel could make a more
 appetizing description on the [[IRC]] page than the one I just
 wrote. Make it sound fun! (Presuming it is fun. ;-))

I think the IRC page is not really necessary. An IRC howto doesn't
really belong to contextgarden. Pointing to the freenode #context
channel should be enough.

A nice thing to know (and add to the IRC page) would be how to
operate Troys bot and which version of context it's running.


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] Passing variables on invocation- and reading them in ConTEXt

2012-09-10 Thread Marco Patzer
On 2012-09-10 Ian Lawrence physics.roo...@gmail.com wrote:

Hi Ian,

 I'd like to pass variables into context on invocation, just as you can do 
 with setting modes
 
 So
 
 context --arguments=number=8, time=full-time --mode=trial test.tex

context --number=8 --time=full-time test.tex

 \starttext
 
 Hello world
 
 % This is \getvariables{arguments}{number} it. % this does not work - what do 
 I need here to write out the next line?
 
 This is 8.
 
 % This is \getvariables{arguments}{time} it. % Nor does this - what do I need 
 here to write out the next line?
 
 This is full-time.
 
 \stoptext

\starttext

This is \doifdocumentargument{number}{\getdocumentargument{number}} it.

This is \doifdocumentargument{time}{\getdocumentargument{time}} it.

\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] Passing variables on invocation- and reading them in ConTEXt

2012-09-10 Thread Marco Patzer
2012-09-10: Peter Münster pmli...@free.fr

 Then you have to be sure, that --number and --time will never be special
 parameters for context.

Indeed.

 Alternatives:
 
 --MarcoPatzerNumber=8 --MarcoPatzerTime=full-time
 
 Or:
 
 % context --arguments=number=8,time=full-time test.tex

This seems the better alternative, since that's what the option was
made for.


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 spacing in \unit

2012-09-13 Thread Marco Patzer
Hi,

when \unit is used just with a unit, without a number, the spacing
at the left is wrong. Example:

\starttext
  % wrong spacing
  (\unit{micro mol per second})

  % spacing OK
  (\unit{3 micro mol per second})
\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] Adaptive section structuring

2012-09-13 Thread Marco Patzer
Hi,

I am often surprised that some nice-to-have feature is already
present in ConTeXt and I just wasn't aware. But I am not sure about
this one.

Is there something like an adaptive structure code which keeps track
of the nesting level? In this example the first structure would
become the chapter, the second one a section, etc.

\starttext
  \startstructure [title=Alpha]
\startstructure [title=Beta]
  \startstructure [title=Gamma]
  \stopstructure
\stopstructure
  \stopstructure
\stoptext

This would ease moving around sections, which might end up as
subsections and vice versa.


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

2012-09-13 Thread Marco Patzer
Hi,

how can I refer to multiple elements at the same time?

\starttext

\startplacefigure [title=foo, reference=alpha]
\stopplacefigure
\startplacefigure [title=bar, reference=beta]
\stopplacefigure
\startplacefigure [title=bar, reference=gamma]
\stopplacefigure

\in{figure}[alpha,beta,gamma]

\stoptext

This outputs “figure 1”. What I'd like to have is “figure 1-3”.


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-14 Thread Marco Patzer
2012-09-13 Andreas Mang m...@imt.uni-luebeck.de:

 I do not know if there is a solution to this. The following would
 work for your example:
 
 \in{figure}[alpha]--\in[gamma]
 
 Of course this is a quite rigid solution, that does not safeguard
 against changes in figure order

That's what I am using at the moment. Apparently there is no such
functionality. This one would go on my wish list.


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] Wide descriptions protruding into the margin

2012-09-14 Thread Marco Patzer
Hi,

with wide description heads I have the problem that the following
description protrudes into the margin.

\definedescription
  [description]
  [alternative=hanging,
   width=broad]

\starttext
\startdescription{conclusion that}
  \input knuth
\stopdescription

\startdescription{conclusion that the designer of a new system must not only be 
literally}
  \input knuth
\stopdescription
\stoptext

In the second case the “Thus,” should be placed on the line after
the head. How do I achieve that? My current workaround is to append
a \hbox{  } to the problematic entries.


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] Wide descriptions protruding into the margin

2012-09-14 Thread Marco Patzer
2012-09-14 Philipp Gesang ges...@stud.uni-heidelberg.de:

Hi Philipp,

 you can hack the hanging alternative and substitute a glue for
 the kern that is used for spacing (strc-con.mkvi):
 
 […]
 

This works perfectly. Thanks a lot for digging into the sources.

 But maybe this could be made an option?

\dorecurse{10}{+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] Referring to multiple elements

2012-09-16 Thread Marco Patzer
2012-09-14 Sietse Brouwer sbbrou...@gmail.com:

Hi Sietse,

I'm sorry for my late reply.

 The heart of what you need is a lua function that will take an array
 of numbers, and return an array of consective-number runs, like so:

 […]

 I've written one below, plus the scaffolding required to feed it the
 right input, and print its output to ConTeXt.

I wonder if this function is not already present in ConTeXt. The
register mechanism, for instance, already does something very
similar:

\setupregister
  [index]
  [compress=yes]

\starttext

A\index{A} \page
A\index{A} \page
aaa\page
bbb\page
A\index{A} \page
A\index{A} \page
A\index{A}

\placeindex %% = A 1-2, 5-7

\stoptext

 Only two functions still need writing --- one to turn the context
 argument [fig:f1, fig:f2, fig:f4] into a lua array of strings, and
 one to turn each reference string into a figure number.

I'm quite sure that all the building blocks are already present. I'm
not sure about the case when the float number is preceded by a
chapter number.

 If you're not comfortable with programming LuaTeX, say so and I can
 fill in the two missing functions sometime this weekend. But they
 should be doable, really.

Someone with more expertise and knowledge about the ConTeXt
internals should be able to point to the relevant functions. I guess
the code that produces the index compression is located in
registers.flush() in strc-reg.lua, but apparently it's not a
function and I don't know if it can be adopted for the float
referencing.

 (And, of course, you may be far more experienced in LuaTeX than I,
 I don't know.)

Probably not. I can read and write simple Lua scripts, but I lack
knowledge about the LuaTeX and ConTeXt internals and the data
structures used. For LuaTeX there is a manual that explains a lot,
but it doesn't help figuring out how ConTeXts float referencing
mechanism works.

Thanks for the work you spend on this. I don't need this function
for the current project (I use the workaround), but I would like to
see this feature in ConTeXt. If you have time and expertise to
implement this, it would be great. Otherwise I'll do the range
referencing manually.


Regards
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 spacing in \unit

2012-09-17 Thread Marco Patzer
2012-09-13 Marco Patzer home...@lavabit.com:

 when \unit is used just with a unit, without a number, the spacing
 at the left is wrong.

Still the same in 2012.09.16 23:18, it doesn't seem that hard to
fix. Maybe just an if-statement to check if the number is provided
and add a space in that case.

So I checked the sources and saw that it might be a feature to
support the syntax with the number not included in the \unit call
(is anyone actually using this syntax?):

3 \unit{micro mol per second}
  \unit{3 micro mol per second}

I guess it's hard to check whether there is a number provided before
the \unit command from inside \unit.

Any ideas? It renders it much less useful if it only works with a
unit *and* a number.


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] Formulas include chapter number

2012-09-17 Thread Marco Patzer
Hi,

the last beta includes the chapter number in formulas, former betas
didn't. Example:

\starttext
\startchapter [title=Foo]
  \startplaceformula
\startformula
  E=mc^2
\stopformula
  \stopplaceformula
\stopchapter
\stoptext

∙ Is this intended?
∙ How to remove the chapter number from the formula?


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] Formulas include chapter number

2012-09-17 Thread Marco Patzer
2012-09-17 Sietse Brouwer sbbrou...@gmail.com:

Hi Sietse,

 It's a bug, I think.
 The keys that control this are way and prefixsegments:
 \setupformulas[way=bychapter, prefixsegments=chapter]
 
 way=bychapter means 'resume numbering at each chapter'
 prefixsegments=chapter means 'precede each formula number with the
 chapter number': chapter.formula
 
 Right now, as soon as I set 'prefixsegments' to 'section' or 'chapter'
 or a number, the prefix segments disappear. Ditto when I set 'way' to
 anything. This suggests that it is a bug. Is it indeed, Hans? I've
 attached a test file for you.
 
 You can use \setupformulas[prefixsegments=] to solve your problem if

Thanks, that fixed it.


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] international documents

2012-09-17 Thread Marco Patzer
2012-09-17 Pavel Dohnal pavel.doh...@twobits.cz:

Hi Pavel

 Problem is that users enter international texts into database and
 some characters are not present in final pdf.
 Here is my minimal example:
 
 %interface=en translate-file=utf-8
 \enableregime[utf]

ConTeXt MkIV uses UTF-8 by default.

 \starttext
 This is in Japan: 日本, 神奈川県藤沢市藤沢75
 \stoptext
 
 Now I run:
 context file.tex
 But japaneese character are missing in final pdf. You can see in
 attached file. Is there a way how to create documents which can be
 writen in any international language?

The font Latin Modern does not contain the Japanese characters. Use
a font that covers the range you need.


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] Ctx: list of commands

2012-09-17 Thread Marco Patzer
2012-09-17 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz:

Hi Lukáš

 1) is there a Ctx command/switch which would generate list of all
 current ConTeXt commands? E.g.

Not that I'm aware of. Wolfgang started to maintain a list of
ConTeXt commands, but I'm not sure if he's still on it:

https://bitbucket.org/wolfs/commands

During the last few months the wiki got plenty of new commands added
that you could use. But I don't think there's an interface to
retrieve information from the wiki in an automated fashion.


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] Bibliography, unicode strings, @ELECTRONIC, sorting and bibtex

2012-09-18 Thread Marco Patzer
Hi,

I have some questions regarding the bibliography.

1)
The style files bibl-ams.tex, bibl-ssa.tex, etc contain strings like
``, ~. This does not make sense to me. The `` ends up like that in
the output and the tilde might interfere with the \asciimode
setting. Wouldn't it be better to use the proper Unicode glyphs
(U+201C, U+00A0, etc.) nowadays? I assume the files are old MkII
files and not being updated since. Example:

\setupbibtex   [database=sample]
\setuppublications [alternative=ssa]
\starttext
  \cite[hh2010a]
  \cite[Eijkhout1991]
  \cite[hh2010]
  \placepublications [criterium=cite]
\stoptext

2)
The @ELECTRONIC type does not work (already mentioned in the wiki).
It does not show up in the references list. I guess no one bothered
adding them and it's up to me to add the corresponding entries.

Maybe someone has already prepared a working file for the APA style?

3)
How to sort the bibliography by author? According to the bib manual
I expected this to work:

\setupbibtex   [database=sample]
\setuppublications [alternative=apa, criterium=cite, sort=author]
\starttext
  \cite[hh2010a]
  \cite[Eijkhout1991]
  \placepublications
\stoptext

4)
\completepublications produces an empty page. Is that intended?

\setupbibtex   [database=sample]
\setuppublications [alternative=ssa, criterium=cite]
\starttext
 \cite[hh2010a]
 \completepublications
\stoptext

5) (side question)
What is BibTeX used for in ConTeXt? As far as I can see, it reads
the .bib database and generates a .bbl file which then is read in by
ConTeXt. Why do we need an external tool for this? Why does ConTeXt
not read in the .bib database and directly save it as a Lua table?


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] Bibliography, unicode strings, @ELECTRONIC, sorting and bibtex

2012-09-18 Thread Marco Patzer
2012-09-18 Schmitz Thomas A. thomas.schm...@uni-bonn.de:

Hi Thomas

 The problem is that users of bibtex in ConTeXt are a minority, and
 users of such precooked styles a tiny minority

With a handful of up-to-date working common citation styles
citations would be much more easy. But I get your point.

 I use bibtex quite often, but wouldn't know how to fix these
 styles and have never used them. So if you're sure about what to
 do, fix them and send Hans a patch.

Frankly, I'm no expert in those things. The bibliographies I created
so far were quick and dirty, I didn't have the time to create proper
styles or repair the shipped ones. I will see what I can do to at
least improve the existing ones after the current project is done.

  Maybe someone has already prepared a working file for the APA
  style?
 
 Possible. I have @ELECTRONIC definitions in my own private style
 files, but have never used APA.

Same here.

  \setuppublications [alternative=apa, criterium=cite, sort=author]
 
 You haven't read carefully enough, it's sorttype=author

This doesn't work, either:

\setupbibtex   [database=sample]
\setuppublications [alternative=apa, criterium=cite, sorttype=author]
\starttext
  \cite[hh2010a]
  \cite[Eijkhout1991]
  \placepublications
\stoptext

  \completepublications produces an empty page. Is that intended?
  
 http://archive.contextgarden.net/message/20110923.091734.6b388a11.en.html

Using criterium=text fixed it.

  What is BibTeX used for in ConTeXt? As far as I can see, it reads
  the .bib database and generates a .bbl file which then is read in by
  ConTeXt. Why do we need an external tool for this? Why does ConTeXt
  not read in the .bib database and directly save it as a Lua table?
 
 Because nobody has coded that part yet? This may not be as easy as
 you make it sound because quite a few heuristics go into parsing
 bibtex files (e.g., look at the way in which bibtex divides names
 into first name, last name, von-part, jr-part).

I'm aware of that. So it basically boils down to the fact that
bibliographies are not popular among ConTeXt users (including Hans)
and therefore much functionality is not properly implemented or
cared for. 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.

If I only had time…


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] Bibliography, unicode strings, @ELECTRONIC, sorting and bibtex

2012-09-18 Thread Marco Patzer
2012-09-18 Schmitz Thomas A. thomas.schm...@uni-bonn.de:

Hi Thomas

 On Sep 18, 2012, at 2:25 PM, Marco Patzer home...@lavabit.com 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 ges...@stud.uni-heidelberg.de:

 [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 eidenb...@arch.ethz.ch:

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. l...@pontex.cz:

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 sbbrou...@gmail.com:

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 sbbrou...@gmail.com:

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 alan.bras...@cea.fr:

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 alan.bras...@cea.fr:

 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 ma...@stien.de:

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
___


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-08 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 wolfgang.schus...@gmail.com 
 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}{image} 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}{image} 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] 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 adit...@umich.edu 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
___


  1   2   3   4   5   6   7   8   >