Re: [NTG-context] Orphan issue with \startitemize

2020-11-26 Thread Marco Patzer
On Thu, 26 Nov 2020 21:11:25 +
Bruce Horrocks  wrote:

> With \dorecurse{34} all of the items move to the second page even
> though only one extra line has been added and there is now quite a
> large gap at the bottom of the first page.
> 
> Is there a setting that controls this a bit more precisely, please?
> (So that \dorecurse{34} and possibly even 35 would still split one
> and three.)

You could adjust the clubpenalty and widowpenalty:

\startsetups [mypenalties]
  %% \setdefaultpenalties
  \setpenalties\widowpenalties {2}{100}
  \setpenalties\clubpenalties  {2}{100}
\stopsetups

\setuplayout [setups=mypenalties]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Subfigures, referencing and resetting counter

2020-11-23 Thread Marco Patzer
On Wed, 18 Nov 2020 20:22:24 +0100
Marco Patzer  wrote:

> I struggle with referencing subfigures.
>
> […]

Any ideas?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Section head placement wrong when the after key is used

2020-11-19 Thread Marco Patzer
On Thu, 19 Nov 2020 16:53:52 +0100
Pablo Rodriguez  wrote:

> On 11/19/20 11:55 AM, Marco Patzer wrote:
> > Hi!
> > [...]
> > What's the reason the section head stays on the previous page when
> > the “after” is used and how to fix this?  
> 
> Hi Marco,
> 
> by default (according to strc-def.mkiv), \section has "after=\blank".
> 
> In some cases, I had used "after={”\blank[samepage, medium]}" to
> prevent similar issues.

In my actual document I already use \blank[halfline]. Changing this
to \blank[halfline, samepage] fixes it.

Thank you very much.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Section head placement wrong when the after key is used

2020-11-19 Thread Marco Patzer
Hi!

In the following example the 2nd section head stays on page one when
the “after” key is used. If the blackrule is commented out the
section head moves to page two as intended.

What's the reason the section head stays on the previous page when
the “after” is used and how to fix this?

\setuphead
  [section]
  [after=\blackrule]  %% works as desired when commenting this one out

\starttext
  \startsection [title=Foo]
\samplefile{knuth}
  \stopsection

  \startsection [title=Bar]
\framed[height=15cm]{}
\samplefile{knuth}
  \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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Subfigures, referencing and resetting counter

2020-11-18 Thread Marco Patzer
Hi!

I struggle with referencing subfigures. Combinations can't be
referenced to my knowledge, that's why I went with another float for
the inner subfigure. Example:


\useMPlibrary[dum]

\definefloat
  [subfigure]
  [subfigures]
  [figure]

\setupcaptions
  [subfigure]
  [numberconversion=characters,
   numberstopper=)]

\setuplabeltext
  [subfigure=]

\definecounter
  [subfigure]
  [way=bytext]

\starttext

\startplacefigure [title=First, reference=first]
  \startfloatcombination [nx=2, ny=1]
\startplacesubfigure
  \externalfigure
\stopplacesubfigure
\startplacesubfigure [reference=fig:firstsub]
  \externalfigure
\stopplacesubfigure
  \stopfloatcombination
\stopplacefigure

\startplacefigure [title=Second, reference=second]
  \startfloatcombination [nx=2, ny=1]
\startplacesubfigure
  \externalfigure
\stopplacesubfigure
\startplacesubfigure [title=beta, reference=fig:secondsub]
  \externalfigure
\stopplacesubfigure
  \stopfloatcombination
\stopplacefigure

See \in{figure}[first],
\in{figure}[fig:firstsub] and
\in{figure}[fig:secondsub].

\stoptext


How to reset the counter for the subfigure to start anew for each
new figure?

The second issue is the referencing of subfigures. The MWE shows
“figure b)” and “figure d)” rather than “figure 1b)” and “figure
2b)”. How to include the outer float counter in the reference?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Input file name containing full stop "."

2020-09-09 Thread Marco Patzer
On Wed, 9 Sep 2020 10:56:09 +0200
Christoph Reller  wrote:

> I am using ConTeXt LMTX Version 2020.09.05 21:18 with an input file
> named, e.g., "test.test.tex". When compiling, ConTeXt generates files
> "test.log", "test.tua", "test.pdf".
> 
> ConTeXt MKIV used to produce files "test.test.log", "test.test.tua",
> "test.test.pdf".

Same issue here. (BTW: That's the main reason I'm still on MkIV.)

  https://mailman.ntg.nl/pipermail/ntg-context/2020/098260.html

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Store images and text in the right margin

2020-07-03 Thread Marco Patzer
On Fri, 3 Jul 2020 08:40:22 +0200
Fabrice Couvreur  wrote:

> Thanks, it works but only for a comment and a picture. Indeed, if I
> add a comment and an image, the first image is placed on the second
> comment. Fabrice
> 
> \starttext
> \startuserdata[margintext]
>  \input ward
> \stopuserdata
> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}

\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=top]}

> \startuserdata[margintext]
>  \input ward
> \stopuserdata
> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}

\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=top]}

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Store images and text in the right margin

2020-07-02 Thread Marco Patzer
On Thu, 2 Jul 2020 17:20:07 +0200
Fabrice Couvreur  wrote:

Try:

> \useMPlibrary[dum]
> 
> \setuppapersize[A4]
> 
> \setuplayout
>   [width=12cm,
>rightmargin=5cm]
> 
> \definemargindata[marginfigure][inright]
> \setupmargindata [marginfigure][command=\vbox,align=middle]

\setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes]

> \startsetups [userdata:margintext]
>   \margindata
> [inright]
> [%style=\smallbodyfont,
>  style={\switchtobodyfont[9pt]},
>  width=\rightmarginwidth,

  stack=yes,

>  align={flushleft,broad}]
> {{\bf Remarque — }\getinlineuserdata}
> \stopsetups

> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth]}

\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Using \defineoverlay for a framed text

2020-06-16 Thread Marco Patzer
On Tue, 16 Jun 2020 14:37:17 +0200
Marco Patzer  wrote:

> On Tue, 16 Jun 2020 14:17:09 +0200
> Willi Egger  wrote:
> 
> > I try to use a Metapost drawing as a background to a framed text. —
> > I can not make it working though…
> > 
> > \startuniqueMPgraphic{Markings}
> > %{Markings:\overlaywidth:\overlayheight} fill OverlayBox enlarged
> > 5mm withcolor blue; \stopuniqueMPgraphic
> > 
> > \defineoverlay[Marks]{\useMPgraphic{Markings}}  
> 
> \defineoverlay[Marks][{\useMPgraphic{Markings}}]

Better:

\defineoverlay[Marks][\useMPgraphic{Markings}]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Using \defineoverlay for a framed text

2020-06-16 Thread Marco Patzer
On Tue, 16 Jun 2020 14:17:09 +0200
Willi Egger  wrote:

> I try to use a Metapost drawing as a background to a framed text. — I
> can not make it working though…
> 
> \startuniqueMPgraphic{Markings}
> %{Markings:\overlaywidth:\overlayheight} fill OverlayBox enlarged 5mm
> withcolor blue; \stopuniqueMPgraphic
> 
> \defineoverlay[Marks]{\useMPgraphic{Markings}}

\defineoverlay[Marks][{\useMPgraphic{Markings}}]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Installing Modules with ConTeXt LMTX

2020-06-01 Thread Marco Patzer
On Mon, 01 Jun 2020 19:58:59 +0200
Sebastian Miele  wrote:

> I want to try the t-letter module. I have a fresh install of ConTeXt
> LMTX from today. The page https://wiki.contextgarden.net/Modules has
> sections "Installation by hand" and "ConTeXt standalone", but no
> section on ConTeXt LMTX.
> 
> The section on ConTeXt standalone mentions a --modules switch to
> first-setup.sh in order to include modules. This cannot work with the
> install.sh from ConTeXt LMTX, as it does not pass any command line
> arguments to mtxrun.

As far as I understand there is no built-in method. You have to
install them manually. Relevant thread:

  https://mailman.ntg.nl/pipermail/ntg-context/2020/097022.html

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mtxrun exit code

2020-05-29 Thread Marco Patzer
On Fri, 29 May 2020 11:20:22 +0200
Hans van der Meer  wrote:

> I am producing a series of files in a shell script with mtxrun
> --autogenerate --script context input Doing exit mtxrun... shows
> there is no exit number to test in the shell

The exit code from mtxrun works here:

printf '%s\n' '\bye' > good.tex && mtxrun --autogenerate --script context 
good.tex; echo $?
0

printf '%s\n' '\by' > bad.tex && mtxrun --autogenerate --script context 
bad.tex; echo $?
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX: different output if dots are used in the file name

2020-05-28 Thread Marco Patzer
On Thu, 28 May 2020 18:18:51 +0200
Hans Hagen  wrote:

> > MkIV (everything's predictable and fine):
> > 10.10.10.tex → 10.10.10.pdf
> > 10.10.11.tex → 10.10.11.pdf
> > 11.10.11.tex → 11.10.11.pdf
> > 
> > LMTX:
> > 10.10.10.tex → 10.10 (not even a PDF suffix)
> > 10.10.11.tex → 10.10 (file 10.10 is over-written)
> > 11.10.11.tex → 11.10 (no suffix)
> > 
> > MkIV is way more predictable and consistent in that regard.  
> I'll look at it but not today ... first I need to play with some
> other (neat) stuff and run tests.

OK, thanks. No hurry. The production projects run on some oldish
2019 MkIVs anyway. I'm trying to get my feet wet with lmtx and run
it on some projects to check how usable and compatible it is.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX: different output if dots are used in the file name

2020-05-28 Thread Marco Patzer
On Thu, 28 May 2020 17:33:19 +0200
Hans Hagen  wrote:

> On 5/28/2020 2:49 PM, Marco Patzer wrote:
> > Hi!
> > 
> > LMTX and MkIV behave differently if dots are used in the file
> > name. Example:
> > 
> >printf '%s\n' '\starttext\null\stoptext' > foo.10.tex && context
> > foo.10.tex
> > 
> > MkIV: → foo.10.pdf
> > LMTX: → foo.pdf
> > 
> > Is this intentional?  
> 
> consider it to be so

That's unfortunate.

1) The editor workflow with simple suffix replacement .tex → .pdf to
   open the corresponding PDF file doesn't work any more with lmtx.
   New logic is needed to find the correct pdf file name.

2) A project (of mine) that uses item numbers as file names
   (containing dots) compile to the same pdf:

   MkIV (everything's predictable and fine):
   10.10.10.tex → 10.10.10.pdf
   10.10.11.tex → 10.10.11.pdf
   11.10.11.tex → 11.10.11.pdf

   LMTX:
   10.10.10.tex → 10.10 (not even a PDF suffix)
   10.10.11.tex → 10.10 (file 10.10 is over-written)
   11.10.11.tex → 11.10 (no suffix)

MkIV is way more predictable and consistent in that regard.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX: different output if dots are used in the file name

2020-05-28 Thread Marco Patzer
On Thu, 28 May 2020 17:33:19 +0200
Hans Hagen  wrote:

> On 5/28/2020 2:49 PM, Marco Patzer wrote:
> > Hi!
> > 
> > LMTX and MkIV behave differently if dots are used in the file
> > name. Example:
> > 
> >printf '%s\n' '\starttext\null\stoptext' > foo.10.tex && context
> > foo.10.tex
> > 
> > MkIV: → foo.10.pdf
> > LMTX: → foo.pdf
> > 
> > Is this intentional?  
> 
> consider it to be so

That's unfortunate.

1) The editor workflow with simple suffix replacement .tex → .pdf to
   open the corresponding PDF file doesn't work any more with lmtx.
   New logic is needed to find the correct pdf file name.

2) A project (of mine) that uses item numbers as file names
   (containing dots) compile to the same pdf:

   MkIV (everything's predictable and fine):
   10.10.10.tex → 10.10.10.pdf
   10.10.11.tex → 10.10.11.pdf
   11.10.11.tex → 11.10.11.pdf

   LMTX:
   10.10.10.tex → 10.10 (not even a PDF suffix)
   10.10.11.tex → 10.10 (file 10.10 is over-written)
   11.10.11.tex → 11.10 (no suffix)

MkIV is way more predictable and consistent in that regard.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] LMTX: different output if dots are used in the file name

2020-05-28 Thread Marco Patzer
Hi!

LMTX and MkIV behave differently if dots are used in the file
name. Example:

  printf '%s\n' '\starttext\null\stoptext' > foo.10.tex && context foo.10.tex

MkIV: → foo.10.pdf
LMTX: → foo.pdf

Is this intentional?

This is LuaMetaTeX, Version 2.06.05
current version: 2020.05.25 23:39

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] LMTX: natural table error namespace 'naturaltablelocal', key ', '

2020-05-28 Thread Marco Patzer
Hi!

With LMTX the following example results in

  setup   > error in line 7, namespace 'naturaltablelocal', key ','
  setup   > error in line 7, namespace 'naturaltablelocal', key ','

The file runs without error in MkIV. Has something changed or is it
a bug?

  \starttext
\bTABLE
  \bTR
\bTD \samplefile{knuth} \eTD
\bTD \samplefile{knuth} \eTD
  \eTR
\eTABLE
  \stoptext


This is LuaMetaTeX, Version 2.06.05
current version: 2020.05.25 23:39

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Styling of included buffers or files

2020-05-17 Thread Marco Patzer
On Sun, 17 May 2020 18:16:13 +0200
"Jan U. Hasecke"  wrote:

> I am currently writing a text where I want to include text snippets
> either by including files or including buffers.
> 
> What is the best way to style all these included buffers?
> 
> I know that I can do something like this:
> 
> \startcolumns
> \getbuffer[Muenchen]
> \stopcolumns
> 
> Or do something with \defineparagraph
> 
> Is it somehow possible to apply styles to all buffers that gets
> included via \getbuffer by defining a special getbuffer-style?

\setupbuffer has before and after keys which can be used. Example:

\setupbuffer
 [before=\blank\blackrule\startnarrower\BufferStyle,
  after=\stopnarrower\blackrule\blank]

%% alternatively define custom buffers
\definebuffer
 [foobar]

\setupblackrules
  [width=1cm,
   height=1pt,
   color=gray]

\definehighlight
  [BufferStyle]
  [style=smallitalic,
   color=blue]

\startbuffer
  \samplefile{knuth}
\stopbuffer

\starttext
  \samplefile{knuth}
  \getbuffer
  \samplefile{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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Retrieving original value of enviroment variable HOME

2020-05-11 Thread Marco Patzer
On Mon, 11 May 2020 12:50:51 +0200
cont...@vivaldi.net wrote:

> so I made a new parallel installation, following exactly instructions 
> here:
> 
>https://wiki.contextgarden.net/Windows_10_64_bit_Installation_2019
> 
> I forced 32b version due to some reasons.
> 
> But I'm still getting the same LuaTeX version:

I had the same issue. You have to add --context=latest:

  https://mailman.ntg.nl/pipermail/ntg-context/2020/097651.html

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] ConTeXt version stuck at 2020.01.30

2020-05-05 Thread Marco Patzer
On Tue, 5 May 2020 20:38:55 +0200
Wolfgang Schuster  wrote:

> Marco Patzer schrieb am 05.05.2020 um 20:26:
> > Hi!
> > 
> > Has something changed regarding the installation/update procedure?
> > ConTeXt seems to be stuck at 2020.01.30 and downloading the newest
> > version results in that very version.
> 
> https://mailman.ntg.nl/pipermail/ntg-context/2020/097651.html

I vaguely remember someone mentioning it on the list at some
point, but failed to find it.

Thanks for the pointer. I'm back on track now.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] ConTeXt version stuck at 2020.01.30

2020-05-05 Thread Marco Patzer
Hi!

Has something changed regarding the installation/update procedure?
ConTeXt seems to be stuck at 2020.01.30 and downloading the newest
version results in that very version.

Steps to reproduce:

  rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .
  sh ./first-setup.sh
  . tex/setuptex
  context --version
  → current version: 2020.01.30 14:13

According to

  https://minimals.contextgarden.net/current/context/

the directory “latest” seems to contain the latest version, rather
than the “beta”. first-setup.sh however uses the “beta” directory.

Has something changed and first-setup.sh hasn't been updated to
reflect that change? Or is something else going on? Adapting
first-setup.sh to mirror from the “latest” directory seems to fetch
the latest version:

  rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .
  sed -s '/\/bin\/mtxrun/s/--context=beta/--context=latest/' first-setup.sh
  sh ./first-setup.sh
  . tex/setuptex
  context --version
  → current version: 2020.04.30 11:10

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mailing list behaviour (was: Spurious newlines at beginning of startstop pair)

2019-11-29 Thread Marco Patzer
On Fri, 29 Nov 2019 12:10:46 +0100
Henning Hraban Ramm  wrote:

> The problem seems to be that traditional mailing lists like this just
> don’t work with modern security standards.
> 
> I didn’t check how secure NTG’s mail server is configured, but
> changing subject and sender of every message is regarded harmful. Not
> doing that would mean that: 
> * I can’t filter mails (visually or rule based) by subject any more.

Sorting can easily be done using other headers , e.g. “List-Id”.

> * A lot of replies would only go to the sender.

Very true.

> * The connection of threads would get lost.

Why? Threads are arranged by the “References” and “In-Reply-To”
headers which are not modified.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Watchmode

2019-11-29 Thread Marco Patzer
On Fri, 29 Nov 2019 11:07:01 +0100
Denis Maier  wrote:

> is there a watchmode for ConTeXt?

I'm not aware of such a feature.

> So that I can it once and ConTeXt will re-typeset a file once
> there are changes?

Idea:

file='somefile.tex'
while true; do
  inotifywait --event modify "$file"
  context --batchmode "$file"
done

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Images run into each other when using side floats

2019-10-30 Thread Marco Patzer
On Wed, 30 Oct 2019 18:48:43 +0100
Wolfgang Schuster  wrote:

> Marco Patzer schrieb am 30.10.2019 um 17:16:
> > On Wed, 30 Oct 2019 11:55:17 -0400 (EDT)
> > Aditya Mahajan  wrote:
> >  
> >> On Wed, 30 Oct 2019, Marco Patzer wrote:
> >>  
> >>> Hi!
> >>>
> >>> Some images run into each other when using floats. The following
> >>> example illustrates this. The second image (or frame) runs into
> >>> the side figure frame. How to prevent this?
> >>>
> >>> \setupfloat [figure] [default=left]
> >>>
> >>> \starttext
> >>>   \samplefile{knuth}
> >>>
> >>>   \startplacefigure [title=Foo]
> >>> \framed [width=5cm, height=5cm]{}
> >>>   \stopplacefigure
> >>>
> >>>   \samplefile{ward} \blank  
> >> Add:
> >>
> >> \dontleavehmode  
> > Thanks for the nudge in the right direction.
> >
> > Is there a way to include the \dontleavehmode in the combinations?  
> No.

Thanks for the answer and the quick help. Then I'll change the
sources.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Images run into each other when using side floats

2019-10-30 Thread Marco Patzer
On Wed, 30 Oct 2019 11:55:17 -0400 (EDT)
Aditya Mahajan  wrote:

> On Wed, 30 Oct 2019, Marco Patzer wrote:
> 
> > Hi!
> >
> > Some images run into each other when using floats. The following
> > example illustrates this. The second image (or frame) runs into the
> > side figure frame. How to prevent this?
> >
> > \setupfloat [figure] [default=left]
> >
> > \starttext
> >  \samplefile{knuth}
> >
> >  \startplacefigure [title=Foo]
> >\framed [width=5cm, height=5cm]{}
> >  \stopplacefigure
> >
> >  \samplefile{ward} \blank  
> Add:
> 
> \dontleavehmode

Thanks for the nudge in the right direction.

Is there a way to include the \dontleavehmode in the combinations?
The frame is actually a combination (removed while creating MWE).
The before key from \setupcombinations doesn't seem to do the right
thing here. If that's possible I can leave the sources as they are.

\setupfloat [figure] [default=left]

\starttext
  \samplefile{knuth}

  \startplacefigure [title=Foo]
\framed [width=5cm, height=5cm]{}
  \stopplacefigure

  \samplefile{ward} \blank

  \dontleavehmode
  \startcombination [1*1]
\startcontent \framed [width=4cm, height=4cm]{} \stopcontent
\startcaption Foo \stopcaption
  \stopcombination

  \samplefile{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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Images run into each other when using side floats

2019-10-30 Thread Marco Patzer
Hi!

Some images run into each other when using floats. The following
example illustrates this. The second image (or frame) runs into the
side figure frame. How to prevent this?

\setupfloat [figure] [default=left]

\starttext
  \samplefile{knuth}

  \startplacefigure [title=Foo]
\framed [width=5cm, height=5cm]{}
  \stopplacefigure

  \samplefile{ward} \blank
  \framed [width=4cm, height=4cm]{}
  \samplefile{knuth}
\stoptext

context 2019.10.29 15:00

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Using \currentreferencenumber triggers “has a hidden number” in log file

2019-07-18 Thread Marco Patzer
Hi,

I use

  \enabletrackers
[structures.referencing.empty]

to catch references by number to sections without a number. The log
file contains “has a hidden number…” in that case. I have a command
that uses \currentreferencenumber which triggers the “has a hidden
number…” warning in the log file. But that command takes care not to
output the contents of that variable. But merely using it in an
\doif\currentreferencenumber is sufficient to trigger the log
message. Example:

\enabletrackers
  [structures.referencing.empty]

\def\foo[#1]{%%
  \doifreferencefoundelse{#1}{%%
\doifelse\currentreferencenumber\emptyreference
{Foo}{Bar}}%%
}

\setuphead
  [section] [number=no]

\starttext
  \startsection [title=Foo, reference=sec:foo]
\samplefile{knuth}
  \stopsection
  \foo[sec:foo]
\stoptext

Then check the log file for “has a hidden number”.

1) How to not trigger the log message when checking
   \currentreferencenumber? Or alternatively

2) Is there a better way to find invisible references?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Spacing after combination

2019-07-16 Thread Marco Patzer
On Tue, 16 Jul 2019 21:09:15 +0200
Wolfgang Schuster  wrote:

> A alternative to using floats is to put the combination in a 
> linecorrection environment, i.e.
> 
> \startlinecorrection
>    \startcombination [2*2]
>    ...
>    \stopcombination
> \stoplinecorrection
> 
> or
> 
> \startlinecorrection[blank]
>    \startcombination [2*2]
>    ...
>    \stopcombination
> \stoplinecorrection

I hadn't thought of this. That's better suited than a float.
However, I'd prefer to not have another environment around the
combinations, but if there's no other way, I'd settle for your
approach. So far that seems to be the best choice.

Thanks for the quick response.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Spacing after combination

2019-07-16 Thread Marco Patzer
Hi!

Is there a way to influence the spacing after a combination is
placed?

\useMPlibrary [dum]

\starttext

\startcombination [2*2]
  \startcontent \externalfigure  \stopcontent
  \startcaption Foo\stopcaption
  \startcontent \externalfigure  \stopcontent
  \startcaption Bar\stopcaption
  \startcontent \externalfigure  \stopcontent
  \startcaption Lorem  \stopcaption
  \startcontent \externalfigure  \stopcontent
  \startcaption Ipsum  \stopcaption
\stopcombination

\samplefile{knuth}

\stoptext

I know I could wrap it in a float and use the float to control the
spacing, but it would be great if I could do without that float.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Distance between two Columns

2019-02-28 Thread Marco Patzer
On Thu, 28 Feb 2019 10:43:48 +
Ursula Hermann  wrote:

> I have the following example. I would like to have two columns that
> are in the distance small.

I'm not sure if I understand you correctly. You want to change the
distance between the columns? That can be done with:

  \setupcolumns
[distance=2cm]

> So I have tried:
> 
> \setuppapersize[A5]
> \startcolumns
> \defineframed
>[tightframed][width=5cm,width.1\textwidth,align=right]

1. Usually you don't define stuff in the main text. That's what the
   setup area (before \starttext) if for.
2. width is specified twice
3. width.1\textwidth is not valid, an = sign is missing

> \tightframed{Small}
> \column
> \tightframed{A really really long line that is split at 5cm}

\stopcolumns is missing.

Furthermore, \start/stoptext is missing. That results in the
monospaced font. I'd write your example as follows:

\setuppapersize
  [A5]

\defineframed
  [tightframed]
  [width=5cm,
   %% width=.1\textwidth,
   align=right]

\setupcolumns
  [distance=.5cm]

\starttext

\startcolumns
  \tightframed{Small}
\column
  \tightframed{A really really long line that is split at 5cm}
\stopcolumns

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Frame

2019-02-21 Thread Marco Patzer
On Thu, 21 Feb 2019 18:24:29 +0100
Wolfgang Schuster  wrote:

> > \startprettyblock
> >\noindentation  
> 
> You don’t need \noindentation when you add “next” to the indenting
> options.

That's even better (meaning cleaner source). I didn't know that
option.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Pretty printer for matlab

2019-02-21 Thread Marco Patzer
On Thu, 21 Feb 2019 15:10:27 +0100
Otared Kavian  wrote:

> Thanks for pointing to that module, which I didn't know because I
> never use vim… I just tested it and seems fine, but I would need to
> modify some of the keywords of Matlab in order to adapt them to
> Scilab. However I didn't find where those keywords are defined in the
> vim module.

They're not defined in the vim module. The vim module is just a way
to use vim's syntax highlighting in context. The syntax should be
defined in the vim files .vim in the vim directory, e.g.
/usr/share/vim/vim81/syntax/.vim if I'm not mistaken.

Have you tried using “syntax=scilab”?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Pretty printer for matlab

2019-02-21 Thread Marco Patzer
On Thu, 21 Feb 2019 14:25:03 +0100
Otared Kavian  wrote:

> Is there a pretty printer file to typeset Matlab codes?

How about Aditya's vim module? It supports Matlab:

\usemodule [vim]
\definevimtyping [matlab] [syntax=matlab]
\starttext
\startmatlab
  …
\stopmatlab
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Frame

2019-02-21 Thread Marco Patzer
On Thu, 21 Feb 2019 10:50:21 +
Ursula Hermann  wrote:

> Here is my example:
> 
> \setuppapersize[A5]
> \setupcolors[state=start]

This is the default, no need to start the colours any longer.

> {\framed
>[width=10cm,
>background=color,backgroundcolor=darkblue,
>foreground=color,foregroundcolor=white,
>align={flushleft}]
> {The Earth, as a habitat for animal life, is in old age and has a
> fatal illness. Several, in fact.\par \setupindenting[yes, small]
> It would be happening whether humans had ever evolved or not.
> 
> \externalfigure[cow.pdf][width=1cm]}
> 
> \setupwhitespace[small]
> \starttext
> Below, we have two separate columns; but up here, for the nonce, we
> have but the one.
> 
> \startcolumns[n=2]  % Two columns, please
> Text, text, text \dots
> all in the first column
> \column
> Words, words, words \dots
>all in the second column.
> And look ye here! Even more words!
> \stopcolumns
> \stoptext
> Why can‘t I see the cow?

You're missing

  \setupexternalfigures
[location=default]

Without setting the location context doesn't check the system
directories for the sample images.

Furthermore, you're typesetting before \starttext. That's why your
font is monospaced.

And I try to separate content from style. That's why I move all
style information before \starttext and after \starttext comes only
content and markup (if possible). Nothing wrong with mixing it, but
it's easier to read and easier to change the layout after the fact.
I'd write your example as follows.

\setuppapersize
  [A5]

\setupexternalfigures
  [location=default]

\setupindenting
  [yes, small]

\setupwhitespace
  [small]

\defineframedtext
  [prettyblock]
  [width=10cm,
   indenting={yes, small},
   background=color, backgroundcolor=darkblue,
   foreground=color, foregroundcolor=white,
   offset=2mm,
   align=flushleft]

\starttext

\startprettyblock
  \noindentation
  The Earth, as a habitat for animal life, is in old age and has a fatal
  illness. Several, in fact.

  It would be happening whether humans had ever evolved or not.

  \externalfigure[cow][width=1cm]
\stopprettyblock

Below, we have two separate columns; but up here, for the nonce, we have but
the one.

\startcolumns [n=2]
  Text, text, text \dots
  all in the first column
\column
  Words, words, words \dots
  all in the second column.
  And look ye here! Even more words!
\stopcolumns

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Frame

2019-02-19 Thread Marco Patzer
On Tue, 19 Feb 2019 13:01:35 +
Ursula Hermann  wrote:

> I have:
> \framed
>   [height=3em,
>width=.5\textwidth,
>foregroundcolor=red,
>framecolor=blue,
>rulethickness=2pt,
>background=color,
>backgroundcolor=green]
> \starttext
> {Ich bin da.\par Du auch}
> \stoptext

Move the \starttext to the beginning:

\starttext
\framed
  [height=3em,
   width=.5\textwidth,
   foregroundcolor=red,
   framecolor=blue,
   rulethickness=2pt,
   background=color,
   backgroundcolor=green]
{Ich bin da.\par Du auch}
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Frame with Color

2019-02-18 Thread Marco Patzer
On Mon, 18 Feb 2019 12:26:45 +
Ursula Hermann  wrote:

> \framed
>   [background=color,backgroundcolor=red,
>foreground=color,foregroundcolor=white

   foreground=color,foregroundcolor=white,

>   frame=off]
>   {\bf Wichtig}

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] degrade module

2019-02-18 Thread Marco Patzer
On Sun, 17 Feb 2019 12:14:14 +0100
Peter Münster  wrote:

> On Fri, Feb 15 2019, Marco Patzer wrote:
> 
> > - It's 99% Peter's code, he's the maintainer of the module and
> >   probably he should just fix his code.  
> 
> Done.
> 
> 
> > - My modification contains an ugly hack that just renames all files
> >   to pdf, regardless of the actual file type because I have no clue
> >   how to do that properly.  
> 
> I've included your hack, because I don't have any better idea...

ok

> > That code shouldn't make it into the distribution.  
> 
> Why not? Just because of the hack?

Yes. I didn't put much thought into it and assumed there is a better
solution.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] degrade module

2019-02-15 Thread Marco Patzer
On Fri, 15 Feb 2019 11:48:51 +0100
Lutz Haseloff  wrote:

> Your Module with wrapper finally works for me as expected.

Great to hear it's finally working.

> Will it find its way into the distribution as an  enhanced degrade
> module?

Probably not, for the following reasons:

- It's 99% Peter's code, he's the maintainer of the module and
  probably he should just fix his code.

- My modification contains an ugly hack that just renames all files
  to pdf, regardless of the actual file type because I have no clue
  how to do that properly. That code shouldn't make it into the
  distribution.

- I'm not fluent in Lua and am therefore not the right person to
  maintain a Lua module.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] degrade module

2019-02-15 Thread Marco Patzer
On Fri, 15 Feb 2019 10:22:48 +0100
Lutz Haseloff  wrote:

> but both scripts trow the same error on windows and linux-armhf:
> 
> grph-downsample.lua:32: bad argument #2 to 'format' (number has no
> integer representation)

It works here on linux-armhf. No Lua error. Maybe the file got
mangled during transmission.

I've uploaded a modified version to github, maybe try that one:

  https://github.com/mpfusion/context-downsample

It includes a wrapper so you can call it like any other module
(\usemodule[downsample]). It's still Peter's code, but with small
modifications, so it degrades jpg as well as png images at the same
time. It's a quick hack, but works here, also on armhf.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] degrade module

2019-02-14 Thread Marco Patzer
On Fri, 15 Feb 2019 07:56:31 +0100
Lutz Haseloff  wrote:

> First i tried the grph-downsample.lua script.
> Unfortunately i get an error message
> grph-downsample.lua:31: bad argument #2 to 'format' (number has no
> integer representation) See attached log file.

I remember that error. The script worked up to a particular context
version. I believe a Lua upgrade broke it. The version attached
should work.

Marco
if not modules then modules = { } end modules ['t-downsample'] = {
  version   = 1.001,
  comment   = "companion to grph-inc.mkiv",
  author= "Peter Münster",
  copyright = "PRAGMA ADE / ConTeXt Development Team",
  license   = "see context related readme files"
}

local format = string.format
-- figures.cachepaths.path = "cache" -- should be setup-option
local function sample_down(oldname, newname, resolution)
	local request = figures.current().request
	local width = request.width
	local height = request.height
	if resolution == "" or (not width and not height) then
		print(format("Nothing to do: %s, %s, %s", oldname, newname, resolution))
		return
	end
	local inch = 72.27
	local image = img.scan{filename = oldname}
	local xy = image.xsize / image.ysize
	if not width then
		width = height * xy / 65536
	end
	if not height then
		height = width / xy / 65536
	end
	local xsize = resolution * width / inch
	local ysize = resolution * height / inch
	if xsize < image.xsize or ysize < image.ysize then
		local s = format("gm convert -strip -resize %dx%d %s %s",
		xsize, ysize, oldname, newname)
		print("Conversion: " .. s)
		os.execute(s)
	else
		print(format("Nothing to do: %s, %s, %s", oldname, newname, resolution))
		print(format("xsize = %d, ysize = %d", xsize, ysize))
	end
end

local formats = {"png", "jpg", "gif"}

for _, s in ipairs(formats) do
	figures.converters[s] = figures.converters[s] or {}
	figures.converters[s]["lowres." .. s] = sample_down
end
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] degrade module

2019-02-14 Thread Marco Patzer
On Thu, 14 Feb 2019 20:49:43 +0100
Lutz Haseloff  wrote:

> I wanted to use the degrade module with recent ConTeXt and LuaTeX.
> The minimal example from the degrade manual gives an error.
> See the attached log.
> Is there any chance to get the module working again?

I never used the degrade module. Instead I use the downsample.lua
script which works fine with a current beta. Maybe give it a try.

Apparently it's not on the wiki and if I remember correctly I got it
off the mailing list. Let me know if you can't find 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] State of the reference manual contextref.pdf

2019-02-11 Thread Marco Patzer
On Mon, 11 Feb 2019 09:11:53 +0100
Taco Hoekwater  wrote:

> Hi,
> 
> > On 11 Feb 2019, at 07:43, Hans Hagen  wrote:
> > 
> >   
> >> The wiki should reflect that, at least the old repo information
> >> (foundry.supelec.fr) should go. The manual can stay. But before
> >> removing the info on the wiki someone needs to confirm there's no
> >> repo any longer.  
> 
> Yes, the repo is gone.

Thanks for confirming. In case someone needs the sources, I uploaded
them to github (if no one objects). But I doubt I'll find the time
to keep it updated.

  https://github.com/mpfusion/context-contextman

> The page at https://wiki.contextgarden.net/Manuals feels a bit
> out-of-date anyway, but I removed the reference to supelec.fr
> right now.

While you're at it. This one points to supelec, too:

  https://wiki.contextgarden.net/Improving_the_manuals

> Clearly more work is needed on how to present the ConTeXt
> documentation, and that is something that we are still working on.

Never-ending story. But at least we should remove obviously
wrong/outdated information. If my wiki login still works and have
the permission, I can have a go myself some time this week.

> > Sure, so best coordinate this with taco who is cleaning up /
> > upgrading the wiki andhas a shadow to play with running. Actually
> > some more input on / help with that is welcome.  
> 
> And there is a mailing list to go with it:
> 
>   https://lists.contextgarden.net/mailman/listinfo/wiki

I didn't know there's a list for the wiki. Signed up.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] State of the reference manual contextref.pdf

2019-02-10 Thread Marco Patzer
On Sun, 10 Feb 2019 17:43:09 +0100
Hans Hagen  wrote:

> that effort was changed in cooking up smaller independent manuals ...

Which I personally like. It provides more in depth knowledge.

> that ref manual still applies to much (encodings and fonts have
> changed of course)

I know about the state of the manual. The question is, if it's
frozen and abandoned and the source repo closed down or if it has
moved elsewhere. But as it seems it's no longer updated.

The wiki should reflect that, at least the old repo information
(foundry.supelec.fr) should go. The manual can stay. But before
removing the info on the wiki someone needs to confirm there's no
repo any longer.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] State of the reference manual contextref.pdf

2019-02-10 Thread Marco Patzer
Hi!

I'm wondering about the state of the reference manual
contextref.pdf. The wiki states

  “ConTeXt reference manual. This is the most comprehensive and
   up-to-date general manual[…]” Date: September 27, 2013

There used to be SVN access on
foundry.supelec.fr/projects/contextman, but apparently it's
permanently down. Where is the manual hosted at the moment? The wiki
still points to foundry.supelec.fr:

  https://wiki.contextgarden.net/Improving_the_manuals

Some years ago there was a discussion about moving it to github. But
I doubt that has ever taken place.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Automatic thousands separation in \unit

2019-02-09 Thread Marco Patzer
On Tue, 5 Feb 2019 12:22:29 +0100
Marco Patzer  wrote:

> Is there a way to hook the \spaceddigits into \unit somehow?

I tried to add \spaceddigits to the \unit command, but it didn't
work. If someone has an idea how to do that, I'd greatly appreciate.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bad names

2019-02-09 Thread Marco Patzer
On Fri, 8 Feb 2019 23:26:21 +0100
Hans Hagen  wrote:

> On 2/8/2019 10:22 PM, Marco Patzer wrote:
> 
> > What is a bad name for context? Does it have any consequences if
> > badly named files are used? Just being curious.  
> Bad names are names that can result i a miss when looked up on a case 
> sensitive system. When you have a workflow where images come from
> e.g. graphic designers don't be surprised to get names with
> inconsistent casing, one of more spaces in a row, multiple suffixes
> (or wrong ones)

That's so true. I'm not surprised about anything when dealing with
people. People are really bad at being precise and consistent. You
can wish they were, but they just aren't.

> ... now when images are referred to e.g.
> from xml files that also come from someplace it can get pretty hard
> to find where something goes miss. So, here we always normalize
> (az09-).

So every file name containing something else than lowercase, digits
and a dash is “bad” (and dots obviously)? Doesn't seem to be true:

  a.1.png  %% bad name

Names are read from a database in this case, in case you're
wondering.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Bad names

2019-02-08 Thread Marco Patzer
Hi!

I was wondering what context considers a “bad” file name and what consequences
that might have. From workflows-mkiv.pdf:

  “Bad names are reported and suitable action can be taken”

Indeed, every run context tells me how many files are badly named:

  mkiv lua stats  > graphics processing time: 0.021 seconds including tex, 14 
processed images, 14 unique asked, 7 bad names

A small test:

\starttext
  \externalfigure [a]   %% good
  \externalfigure [a.png]   %% good
  \externalfigure [a.b.png] %% good
  \externalfigure [a.1.png] %% bad
  \externalfigure [a-1.png] %% good
  \externalfigure [a-.1.png]%% bad
  \externalfigure [a-b.1.png]   %% bad
  \externalfigure [a-1.b.png]   %% good
  \externalfigure [A]   %% good
  \externalfigure [A.B] %% good
  \externalfigure [A.b] %% bad
  \externalfigure [A.B.png] %% bad
  \externalfigure [A.png]   %% bad
  \externalfigure [a.c-b.b.png] %% bad

  %% bad names are reported in red
  \usemodule [s-figures-names]
\stoptext

I note that “A.png” and “a.1.png” are bad file names and “a-1.b.png” and
“a-1.png” are good file names. What's the idea behind that logic? “A.png” and
“a.1.png” seem perfectly fine file names to me.

The files are included without issues, regardless of context's opinion about
the name.

What is a bad name for context? Does it have any consequences if badly named
files are used? Just being curious.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost graphic in setupbackground

2019-02-08 Thread Marco Patzer
On Fri, 8 Feb 2019 12:36:16 +0100
"Jan U. Hasecke"  wrote:

> \definelayer[kreisbackground][width=70mm,height=70mm]

\definelayer[kreisbackground][width=70mm,height=70mm, state=repeat]

start: layer appears only on the current page
stop : layer doesn't show up
repeat   : layer prints on all pages
next : layer appears on the following page
continue : layer appears on all pages except the first

> \setupbackgrounds[paper][background=kreisbackground, state=start]

\setupbackgrounds[paper][background=kreisbackground]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] context --ansi creates empty log file

2019-02-08 Thread Marco Patzer
Hi!

Is it expected behaviour that --ansi creates an empty log file?
Example:

%% foo.tex
\startext\null\stoptext

# context foo
# wc -c foo.log
7501 foo.log

# context --ansi foo
# wc -c foo.log
1 foo.log

ctx 2019.01.28 16:58

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Automatic thousands separation in \unit

2019-02-05 Thread Marco Patzer
On Thu, 31 Jan 2019 13:43:13 +0100
Otared Kavian  wrote:

Sorry for the late response.

> Can this give what you wish?
> 
> \define[2]\myunit{\spaceddigits{#1}\unit{#2}}
> \starttext 
> \myunit{123456789}{volt}
> \stoptext

That's a way to solve it, yes. But I'd prefer it to be integrated
into the \unit command. It looks cleaner and I don't have to modify
the sources to use a different command.

Is there a way to hook the \spaceddigits into \unit somehow?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Automatic thousands separation in \unit

2019-01-31 Thread Marco Patzer
Hi!

I'm wondering if there's a way to have automatic thousands separation in the
\unit command? \spaceddigits does that, but it doesn't work inside \unit. And
using both would be quite verbose to write. Example:

\starttext
  %% no thousands separation
  \unit{123456789 volt}

  %% manual thousands separation works
  \unit{123,456,789 volt}

  %% automatic thousands separation, but not using \unit
  \let\spaceddigitsseparator,
  \spaceddigits{123456789}\,V

  %% fails, no output
  \unit{\spaceddigits{123456789} volt}
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Itemize lists run into floats - how to add additional spacing

2018-12-19 Thread Marco Patzer
On Wed, 19 Dec 2018 18:29:33 +0100
Hans Hagen  wrote:

> \setupfloat
>[figure]
>[default=left,margin=1cm]

Thanks for the eye-opener. I realised I applied the margin on the item
group instead of the float. Sometimes it's the simple things…

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Itemize lists run into floats - how to add additional spacing

2018-12-19 Thread Marco Patzer
Hi!

The bullet of itemize lists runs into the boxes and caption of
floats. How to add spacing so the bullet doesn't touch the float?

Example:

\setupexternalfigures
  [location=default]

\setupfloat
  [figure]
  [default=left]

\setupitemize
  [packed, autointro]

\starttext
\startitemize
  \startitem
Foo
\startplacefigure [title=Lorem ipsum dolor sit amet consectetur]
   \externalfigure [hacker]
\stopplacefigure
Bar
  \stopitem
  \dorecurse{15}{%%
\startitem Foobar \stopitem
  }
\stopitemize
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Multiple image conversions

2018-12-16 Thread Marco Patzer
Hi!

I wonder if/how it's possible to specify multiple image conversions. Example:

\startluacode
  local format = string.format
  local function degradejpg(oldname, newname)
local s = format("gm convert -strip -quality 75%% -resize '300x300>' %s 
%s", oldname, newname)
os.execute(s)
  end
  local function degradepng(oldname, newname)
local s = format("gm convert -strip -resize '500x500>' %s %s", oldname, 
newname)
os.execute(s)
  end
  figures.converters.jpg["degrade.jpg"] = degradejpg
  figures.converters.png["degrade.png"] = degradepng
\stopluacode

\setupexternalfigures
  [location=default,
   %% conversion=degrade.png, %% how to use both?
   conversion=degrade.jpg]

\starttext
  \externalfigure [hacker]
  \externalfigure [mill]
\stoptext

I'd like to avoid specifying the filetype-specific conversion with each
\externalfigure command:

  %% this works, but it clutters the document and one has to check the
  %% file type each time
  \externalfigure [mill] [conversion=degrade.png]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Ending strings with non-break space in lang-txt.lua

2018-12-06 Thread Marco Patzer
On Thu, 6 Dec 2018 09:34:57 +0100
Hans Hagen  wrote:

> > Also, how about:
> > 
> > \at{\labeltext{atpage}}[#1]  
> 
> indeed, that is the command to use

Don't get too hung up on that command. That was just a quick way to
demonstrate the point and create an MWE.

> can you experiment with this
> 
> \unexpanded\def\leftofreferencecontent
>{\removeunwantedspaces
> \nobreakspace
> \ignorespaces}

This fixes the MWE, but it doesn't prevent all "unfortunate" line
breaks caused by the spaces. At least it doesn't if \labeltext is
used separately to obtain the translated strings.

Currently I use (in one of my modules):

  \def\foo{\labeltext\v!atpage\currentreferencepage}

This works (as by your suggestion):

  \def\foo{\labeltext\v!atpage
\removeunwantedspaces\nobreakspace\ignorespaces
\currentreferencepage}

Which basically replaces the space with a non-break space after the
fact.

So I wonder if it's not a better solution to fix the initial
definitions. But I might be mistaken or I'm overlooking something
where this might cause issues.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Ending strings with non-break space in lang-txt.lua

2018-12-05 Thread Marco Patzer
Hi!

I've got a few unfortunate line breaks in my documents. In particular, breaks
are introduced in between the string “page” and the number:

  See figure 1 at page
  2.

The reason is that many strings in lang-txt.lua end in a space, rather than a
non-break space:

  ["atpage"]={
   ["labels"]={
…
["en"]="at page ",
…

I fixed this by defining

  \setuplabeltext
[en]
[atpage=at page\nbsp]

So I wonder: Does it ever make sense to have a regular space at the end of
those commands? I just skimmed through the file and most, if not all, strings
ending in a space would actually benefit from having it replaced by a
non-break space IMO.

Example:

\def\pageref#1%%
  {\in{figure}[#1] \labeltext{atpage}\at[#1]}

\starttext
  \hsize 3cm
  See \pageref{foo}.

  \page \startplacefigure [reference=foo] \stopplacefigure
\stoptext

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text running of the page with default=top float parameter

2018-12-05 Thread Marco Patzer
On Wed, 5 Dec 2018 13:44:53 +0100
Marco Patzer  wrote:

> I've got a problem with text running off the page. The culprit is
> the "default=top" float parameter. Is this expected behaviour?
> 
> Slightly OT bonus question: What does the “default=auto” parameter
> do? I added that years ago and have not found documentation what it
> actually does. I actually have set "default=auto, top, bottom".

I just wanted to add that the issue persists with either

  default=auto
  default=top
  default=bottom
  and possibly others as well

So the issue is more with default=outer messing up the calculation,
I assume.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Text running of the page with default=top float paremeter

2018-12-05 Thread Marco Patzer
Hi!

I've got a problem with text running off the page. The culprit is
the "default=top" float parameter. Is this expected behaviour?

Slightly OT bonus question: What does the “default=auto” parameter
do? I added that years ago and have not found documentation what it
actually does. I actually have set "default=auto, top, bottom".

MWE:

\definefloat
  [smallfigure]
  [smallfigures]
  [figure]

\setupfloat
  [smallfigure]
  [default=outer]

\setupfloat
  [figure]
  [default=top] %% commenting this fixes the issue

\showframe
\starttext

\startplacefigure
  \externalfigure
\stopplacefigure

\startplacesmallfigure
  \externalfigure
\stopplacesmallfigure

\dorecurse{4}{\samplefile{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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Language dependency in environment-project file

2018-11-29 Thread Marco Patzer
On Thu, 29 Nov 2018 20:30:53 +0100
Wolfgang Schuster  wrote:

> Below is a improved version of the token method which works with the
> new beta.
> 
> \startenvironment [*]
> 
> \definetokenlist [english] % optional because \starttokenlist
> \definetokenlist [swedish] % checks if the token lists exists
> 
> \starttokenlist [english]
>    \setupitemgroup [itemize] [i]
> \stoptokenlist
> 
> \starttokenlist [swedish]
>    \setupitemgroup [itemize] [a]
> \stoptokenlist
> 
> \startsetups [document:start]
> 
> \doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}
> 
>    \startmodeset
>      [*en] {\gettokenlist[english]}
>      [*sv] {\gettokenlist[swedish]}
>    \stopmodeset
> 
> \stopsetups
> 
> \stopenvironment

So that's basically a glorified \appendtoks … \to\… using the
usual context syntax? Very neat.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Language dependency in environment-project file

2018-11-28 Thread Marco Patzer
On Wed, 28 Nov 2018 09:20:49 +0100
Hans Hagen  wrote:

> An alternative is to use system modes:
> 
> \mainlanguage[nl]
> 
> % \startmode[*en]
> % \setupitemize[n]
> % \stopmode
> 
> % \startmode[*nl]
> % \setupitemize[a]
> % \stopmode
> 
> % \startmode[*de]
> % \setupitemize[i]
> % \stopmode
> 
> \startmodeset
>  [*en] {
>  \setupitemize[n]
>  }
>  [*nl] {
>  \setupitemize[a]
>  }
>  [*de] {
>  \setupitemize[i]
>  }
> \stopmodeset

I do use modes and modesets in this project, but mainly in the
components. In the environment files it's a bit more tricky because
the language is unknown at this point and the system modes trigger
the wrong language. But Wolfgang already provided a solution, which
works fine.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \everystarttext in components

2018-11-28 Thread Marco Patzer
On Wed, 28 Nov 2018 09:12:45 +0100
Hans Hagen  wrote:

> On 11/27/2018 9:40 PM, Marco Patzer wrote:
> > On Tue, 27 Nov 2018 18:42:51 +0100
> > Wolfgang Schuster  wrote:
> >   
> >>> Has that changed over the course of the last year or always been
> >>> that way?  
> >>
> >> This was always the case.  
> > 
> > OK, I'm wondering why I set it up that way back then. I'm sure I
> > tested it. But I don't remember.  
> with nested files (components etc) you can end up with
> 
> \starttext
>\starttext
>   \starttext
> 
> and it's the outer one that counts, so appending after that one is
> seen, won't help you

I (falsely) assumed it gets triggered on *every* \starttext, not just
the outer one.

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Language dependency in environment-project file

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 22:41:25 +0100
Wolfgang Schuster  wrote:

> > With named setups I need to specify a name for each occurrence and
> > gather them at the end. This is not as clean. Is it possible e.g. to
> > add something to an already existing setup instead of creating a new
> > one every time?  
> 
> No, this is only possible with a token list.

Works perfectly.

Your first solution is technically better since it works even if the
language is changed mid document (something not used in this
project). However, the second solution is cleaner. I'll make up my mind.

Thanks for the quick help.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Language dependency in environment-project file

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 22:05:27 +0100
Wolfgang Schuster  wrote:

> > But even your solution doesn't work here. Did you try it in the
> > example project file?  
> 
> \startenvironment [*]
> 
> \startsetups [itemgroup:en]
>    \setupitemgroup [itemize] [i]
> \stopsetups
> 
> \startsetups [itemgroup:sv]
>    \setupitemgroup [itemize] [a]
> \stopsetups
> 
> \setuplanguage
>    [en]
>    [setups=itemgroup:en]
> 
> \setuplanguage
>    [sv]
>    [setups=itemgroup:sv]
> 
> \appendtoks
> \doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}
> \to \everysetupdocument
> 
> \stopenvironment

That works, thanks.

One more question: I used to use modes, since I could just

  \startmode[*en]
…
  \stopmode

any number of times. There are many language dependent settings in
the environment files.

With named setups I need to specify a name for each occurrence and
gather them at the end. This is not as clean. Is it possible e.g. to
add something to an already existing setup instead of creating a new
one every 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Language dependency in environment-project file

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 21:41:52 +0100
Wolfgang Schuster  wrote:

> > A nudge in the right direction appreciated.  
> 
> \appendtoks
>    \mainlanguage[\documentvariable{language}]%
> %\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}%
> \to \everysetupdocument

That's basically what I've done in my project file (te-proj.tex). At
least the code is supposed to do exactly that.

But even your solution doesn't work here. Did you try it in the
example project file?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \everystarttext in components

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 18:42:51 +0100
Wolfgang Schuster  wrote:

> > Has that changed over the course of the last year or always been
> > that way?  
> 
> This was always the case.

OK, I'm wondering why I set it up that way back then. I'm sure I
tested it. But I don't remember.

> > ... it's not a godo idea to use that hook to add content
> > I'm not adding content, it was just for the MWE. I'll post another
> > thread about what I intend to achieve.  
> 
> When you use \startdocument you can use
> 
> \startsetups [document:start]
> ...
> \stopsetups
> 
> to insert code at the begin of the document.

I tried that, to no avail. I posted my actual issue including MWE as
a new thread.

Thanks for the quick response Hans and 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Language dependency in environment-project file

2018-11-27 Thread Marco Patzer
Hi,

I do have a project structure with environment, project and component files.
The language of the individual documents is defined in the components using

  \setupdocument
[language=sv]

The environment needs to adjust language-dependent settings. However, when the
environment file is read, the language is not specified, yet. In the past I've
used

  \appendtoks
…
  \to\everystarttext

and I belive it has worked that way. In any case, right now it doesn't. I have
attached a not-so-minimal example project.

How to set this up correctly? If possible I'd like to keep the language in the
document settings as shown above.

A nudge in the right direction appreciated.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \everystarttext in components

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 18:21:45 +0100
Hans Hagen  wrote:

> > MWE:
> > 
> > \startcomponent *
> >\appendtoks Foobar \to\everystarttext
> >\startdocument\null\stopdocument
> > \stopcomponent
> > 
> > If the first and last line is commented out, it prints “Foobar”,
> > when compiled as a component it doesn't.  
> it kicks in when context things a text starts (so earler in this
> case)

Has that changed over the course of the last year or always been
that way?

> ... it's not a godo idea to use that hook to add content

I'm not adding content, it was just for the MWE. I'll post another
thread about what I intend to achieve.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] \everystarttext in components

2018-11-27 Thread Marco Patzer
Hi!

I've got an issue with my documents after updating context (to
2018.11.18 14:07). I believe it has something to do with
\everystarttext. But I'm still digging.

Question: Is it intended behaviour that \everystarttext doesn't work
in components?

MWE:

\startcomponent *
  \appendtoks Foobar \to\everystarttext
  \startdocument\null\stopdocument
\stopcomponent

If the first and last line is commented out, it prints “Foobar”,
when compiled as a component it doesn't.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Addressing glyphs in Lua

2018-10-10 Thread Marco Patzer
On Wed, 10 Oct 2018 10:26:14 +0200
Hans Hagen  wrote:

> On 10/10/2018 8:46 AM, Marco Patzer wrote:
> > On Tue, 9 Oct 2018 23:36:32 +0200
> > Hans Hagen  wrote:
> >   
> >> On 10/9/2018 10:40 PM, Marco Patzer wrote:  
> >>> Hi!
> >>>
> >>> I have two questions regarding addressing glyphs in Lua:
> >>>
> >>> 1) How to address glyphs in slots as e.g. U+F0029?
> >>> 2) How to address glyphs by name?
> >>>
> >>> Use:
> >>>
> >>> \startluacode
> >>> fonts.handlers.otf.addfeature {
> >>>   name = "foo",
> >>>   type = "substitution",
> >>>   data  = { [0xF0029] = 0xF0030 }, -- ← doesn't work
> >>> }
> >>> \stopluacode  
> >> this is a mnwe .. make a mwe with at least a font  
> > 
> > Sorry, here it is:
> > 
> > \startluacode
> >fonts.handlers.otf.addfeature {
> >  name = "phone",
> >  type = "substitution",
> >  data  = { [0x260E] = 0xF003A }, --  doens't work
> >}
> > \stopluacode
> > 
> > \definefontfeature [phone] [phone=yes]
> > 
> > \definefallbackfamily [mainface] [serif] [MarVoSym] [range=0x260E,
> > features=phone] \definefontfamily [mainface] [serif] [TeX Gyre
> > Pagella] \setupbodyfont[mainface]
> > 
> > \starttext
> >substitution: \utfchar{"260E} %% black telephone
> >\blank direct:
> >\resolvedglyphdirect {name:marvosym}{n:Mobilefone} %% works
> > \stoptext
> > 
> > %% glyph name and slot taken from
> > %%
> > %% \usemodule [fnt-10]
> > %% \starttext
> > %%   \ShowCompleteFont{name:marvosym}{10pt}{1}
> > %% \stoptext
> >   
> >> ... anyway, glyph names should normally work (given that they are
> >> sane ones, because in context we strip some)  
> > 
> > The question is how to input the name in the Lua code (here:
> > “Mobilefone”). And it seems like substitutions don't work beyond
> > 0x.  
> (1) use glyph names, so Telefon here
> (2) enable node mode
> (3) force a nocheck
> 
> (in a next beta i'll also support the P lookup for 
> feature extensions)
> 
> \startluacode
> fonts.handlers.otf.addfeature {
>  name= "phone",
>  type= "substitution",
>  nocheck = true,
>  data= { [0x260E] = "Telefon" },
> }
> \stopluacode
> 
> \definefontfeature [phone] [mode=node,phone=yes]
> 
> \definefallbackfamily [mainface] [serif] [MarVoSym] [range=0x260E, 
> features=phone]
> \definefontfamily [mainface] [serif] [TeX Gyre Pagella]
> \setupbodyfont[mainface]
> 
> \starttext
>substitution: \utfchar{"260E}  %% black
> telephone \blank direct:
>\resolvedglyphdirect {name:marvosym}{n:Mobilefone} %% works
>\resolvedglyphdirect {name:marvosym}{n:PF003A} %% works
>\resolvedglyphdirect {name:marvosym}{n:Telefon}%% works
> \stoptext

Thanks, that works.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Addressing glyphs in Lua

2018-10-10 Thread Marco Patzer
On Tue, 9 Oct 2018 23:36:32 +0200
Hans Hagen  wrote:

> On 10/9/2018 10:40 PM, Marco Patzer wrote:
> > Hi!
> > 
> > I have two questions regarding addressing glyphs in Lua:
> > 
> > 1) How to address glyphs in slots as e.g. U+F0029?
> > 2) How to address glyphs by name?
> > 
> > Use:
> > 
> > \startluacode
> >fonts.handlers.otf.addfeature {
> >  name = "foo",
> >  type = "substitution",
> >  data  = { [0xF0029] = 0xF0030 }, -- ← doesn't work
> >}
> > \stopluacode  
> this is a mnwe .. make a mwe with at least a font

Sorry, here it is:

\startluacode
  fonts.handlers.otf.addfeature {
name = "phone",
type = "substitution",
data  = { [0x260E] = 0xF003A }, --  doens't work
  }
\stopluacode

\definefontfeature [phone] [phone=yes]

\definefallbackfamily [mainface] [serif] [MarVoSym] [range=0x260E,
features=phone] \definefontfamily [mainface] [serif] [TeX Gyre
Pagella] \setupbodyfont[mainface]

\starttext
  substitution: \utfchar{"260E} %% black telephone
  \blank direct:
  \resolvedglyphdirect {name:marvosym}{n:Mobilefone} %% works
\stoptext

%% glyph name and slot taken from
%%
%% \usemodule [fnt-10]
%% \starttext
%%   \ShowCompleteFont{name:marvosym}{10pt}{1}
%% \stoptext

> ... anyway, glyph names should normally work (given that they are
> sane ones, because in context we strip some)

The question is how to input the name in the Lua code (here:
“Mobilefone”). And it seems like substitutions don't work beyond
0x.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Addressing glyphs in Lua

2018-10-09 Thread Marco Patzer
Hi!

I have two questions regarding addressing glyphs in Lua:

1) How to address glyphs in slots as e.g. U+F0029?
2) How to address glyphs by name?

Use:

\startluacode
  fonts.handlers.otf.addfeature {
name = "foo",
type = "substitution",
data  = { [0xF0029] = 0xF0030 }, -- ← doesn't work
  }
\stopluacode

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating flyers with ConTeXt

2018-09-26 Thread Marco Patzer
On Tue, 25 Sep 2018 12:57:54 +0200
"Jan U. Hasecke"  wrote:

> \definemeasure
>   [bleed]
>   [3mm]
> 
> I used this value to generalize the A4-flyer dimensions.
> 
> \definepapersize
>   [A4-flyer]
>   [width=\dimexpr297mm+2\measured{bleed}\relax,
>height=\dimexpr210mm+2\measured{bleed}\relax]

That looks good. Note that the value 297 needs to be changed if
“shortfold” is changed. Which is unlikely because it's based on an
A4 paper size. Still, keep that in mind.

> But horizontal pageshift is beyond my grasp.
> 
> I can't see how to generalize the values.

I looked into it and this is what I came up with:

\definepageshift
  [flyer]
  [horizontal]
  [\dimexpr\measure{bleed}/2-\measure{shortfold}\relax,
   \dimexpr\measure{bleed}/2\relax,
   \dimexpr\measure{bleed}/2\relax,
   \dimexpr\measure{bleed}/2+2\measured{shortfold}\relax,
   \dimexpr\measure{bleed}/2\relax,
   \dimexpr\measure{bleed}/2-\measure{shortfold}\relax]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating flyers with ConTeXt

2018-09-25 Thread Marco Patzer
On Mon, 24 Sep 2018 22:25:52 +0200
"Jan U. Hasecke"  wrote:

> On 21.09.18 16:56, Marco Patzer wrote:
> 
> > A while ago I made a corporate flyer with context using the
> > TRYPTICHON method. Printing required 3mm bleed.  
> 
> Thanks a lot for this template. This is exactly what I need.
> 
> I try to understand it in order to adapt it to the requirements of my
> print shop which only needs a bleed of 1mm.
> 
> I hope that I understand it right:
> 
> Page 1,2,3 and 6 are 100mm

correct

> Page 4 and 5 are 97mm as these are the pages that are folded to the
> inside.
> 
> The measure "shortfold" (3mm) reduces the 100mm page to 97mm. Right?

correct

> The pageshift thing is beyond my horizon so I won't comment on this.

Without the pageshift, the pages don't touch because of different
page sizes. Just comment out \setuppageshift and check the result.

> You adjust the backspace of the pages with multiples of the measure
> "big". Right?

Multiples of measure “small”, but yes. That's general page layout,
nothing to do with unequal pages or bleed.

> As you can see in my example I use layers on page 2-4 to have bleeding
> images on the top of the page. This works more or less.
> 
> But as you can see there are blank white spaces between the images of
> page 2-4. Maybe I can adjust this by using absolut measures like 100mm
> or 97mm in the layers.

Your dimensions were wrong, try:

\setlayer[topic1]
  [x=-1mm, y=-1mm]
  {\externalfigure[../bilder/topic1.png][width=101mm]}

> I have to adjust the layout of pages 2-4 so that the text starts below
> the images.

For background images layers are probably the right tool. For the
other images I used \startplacefigure … \stopplacefigure. Then
context takes care of the rest.

> An now here is my question. Is there a value I can simply change to
> have a pdf with only 1mm bleed?

No, I used the fact that bleed = shortfold = 3mm. The was of course
not very generic. You should create a new variable:

\definemeasure
  [bleed]
  [1mm]

Then set

\definepageshift
  [flyer]
  [vertical]
  [\measure{bleed}]

And adjust the horizontal page shift accordingly. That part is a bit
messy in my example. The variables are wrong, but the result was
correct. If it's a one-off thing, you could just use absolute
values:

\definepageshift
  [flyer]
  [horizontal]
  [-2mm, 1mm, 1mm, 6.8mm, 1mm, -2mm]

In general it shouldn't be too hard to create two variables, “bleed”
and “shortfold” and make the rest dependent on those two. But this
didn't work for page shift when I tried. Probably because I didn't
really grasp how pageshift works.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating flyers with ConTeXt

2018-09-21 Thread Marco Patzer
On Fri, 21 Sep 2018 15:27:02 +0200
"Jan U. Hasecke"  wrote:

> consulting the wiki I found
> http://context.aanhet.net/svn/contextman/context-reference/en/co-pagedesign.pdf
> and the command \setuparranging [TRYPTICHON]. So I think that I should
> be able to make a pdf for a flyer and print it with an online printer.
> 
> But as I am still very new to ConTeXt, I need a kickstart doing it.

A while ago I made a corporate flyer with context using the
TRYPTICHON method. Printing required 3mm bleed.

> Has anybody made a template for a leaflet flyer.

I created a context module for the flyer, so it was easy to add
content and support different languages. However, this is a very
specific module including corporate design and nothing generally
usable.

I trimmed the specific parts and attached a working file producing a
flyer. I left a few bits of the page design in the file.

Marco
%% The page shift of page #6 needs to be adjusted if the value is changed, no
%% clue why.
%% A4-flyer pagesize needs to be adjusted as well
\definemeasure
	[shortfold]
	[3mm]

\definepapersize
	[A4-flyer]
	[width=303mm,
	 height=216mm]

\definepapersize
	[flyer-page]
	[width=100mm,
	 height=210mm]

\definepapersize
  [flyer-page-small]
	[width=\dimexpr100mm-\measure{shortfold}\relax,
	 height=210mm]

\setuppapersize
	[flyer-page]
	[A4-flyer]

\setuparranging
	[TRYPTICHON]

%% The page shift of page #6 needs to be adjusted if shortfold is adjusted, no
%% clue why.
\definepageshift
	[flyer]
	[horizontal]
	[\zeropoint,
	 \measure{shortfold},
	 \measure{shortfold},
	 3\measured{shortfold},
	 \measure{shortfold},
	 \zeropoint]

\definepageshift
	[flyer]
	[vertical]
	[\measure{shortfold}]

\setuppageshift
	[paper]
	[flyer]

\definemeasure
	[small]
	[3mm]

\definemeasure
	[big]
	[\measure{small}*2]

\definelayout
	[first]
	[page]
	[page=flyer-page,
	 topspace=2\measured{big},
	 backspace=2\measured{small},
	 width=\dimexpr\paperwidth-4\measured{small}\relax,
	 height=\dimexpr\paperheight-4\measured{big}\relax]

\definelayout
	[second]
	[first]
	[topspace=4\measured{big},
	 backspace=2\measured{big},
	 width=\dimexpr\paperwidth-3\measured{big}\relax,
	 height=\dimexpr\paperheight-4\measured{big}-2\measured{big}\relax]

\definelayout
	[thirdandfourth]
	[second]
	[backspace=\measure{big},
	 width=\dimexpr\paperwidth-2\measured{big}\relax]

\definelayout
	[fifthandsixth]
	[first]
	[backspace=\measure{big},
	 width=\dimexpr\paperwidth-2\measured{big}\relax]

\definelayout [1] [first]
\definelayout [2] [second]
\definelayout [3] [thirdandfourth]
\definelayout [4] [thirdandfourth]
\definelayout [5] [fifthandsixth]
\definelayout [6] [fifthandsixth]

\defineoverlay
	[pagedecoration]
	[\useMPgraphic{pagedecoration}]

\setupbackgrounds
	[page]
	[background=pagedecoration,
	 backgroundcolor=lightblue]

\startuseMPgraphic{pagedecoration}
	distanceSmall := 3mm;
	distanceBig   := distanceSmall;
	bleed := 3mm;

	if PageNumber==1:

		path pageOne;
		pageOne := (0, -bleed) -- (PaperWidth + bleed, -bleed) -- (PaperWidth + bleed, distanceBig)
			-- (2.5distanceBig, distanceBig){left} .. {up}(distanceSmall, 2.5distanceBig)
			-- (distanceSmall, PaperHeight +  bleed) -- (0, PaperHeight + bleed) -- cycle;
		fill pageOne withcolor "lightblue";
		setbounds currentpicture to OverlayBox;

	elseif PageNumber==2:

		path pageTwo;
		pageTwo := (-bleed, -bleed) -- (PaperWidth, -bleed)
			-- (PaperWidth, distanceBig)
			-- (2.5distanceBig, distanceBig){left} .. {up}(distanceBig, 2.5distanceBig)
			-- (distanceBig, PaperHeight + bleed) -- (-bleed, PaperHeight + bleed) -- cycle;
		fill pageTwo withcolor "lightblue";
		setbounds currentpicture to OverlayBox;

	elseif PageNumber==3:

		path pageThree;
		pageThree := (0, -bleed) -- (PaperWidth, -bleed)
			-- (PaperWidth, distanceBig)
			-- (0, distanceBig) -- cycle;
		fill pageThree withcolor "lightblue";
		setbounds currentpicture to OverlayBox;

	elseif PageNumber==4:

	elseif PageNumber==5:

		path pageFive;
		pageFive := (-bleed, -bleed) -- (PaperWidth, -bleed)
			-- (PaperWidth, distanceBig)
			-- (-bleed, distanceBig) -- cycle;
		fill pageFive withcolor "lightblue";
		setbounds currentpicture to OverlayBox;

	elseif PageNumber==6:

		path pageSix;
		pageSix := (distanceSmall, -bleed) -- (PaperWidth, -bleed)
			-- (PaperWidth, PaperHeight-distanceBig)
			-- (2.5distanceBig, PaperHeight-distanceBig){left}
			.. {down}(distanceSmall, PaperHeight-2.5distanceBig) -- cycle;
		fill pageSix withcolor "lightblue";
		setbounds currentpicture to OverlayBox;

	fi
\stopuseMPgraphic

\starttext
	\input knuth \page
	\input knuth \page
	\input knuth \page
	\setuppapersize [flyer-page-small] [A4-flyer]
	\input knuth \page
	\input knuth \page
	\setuppapersize [flyer-page] [A4-flyer]
	\input knuth
\stoptext
___
If your question is of interest to others as well, ple

Re: [NTG-context] Printer requires vectorised contour path for cut contour

2018-09-10 Thread Marco Patzer
On Thu, 6 Sep 2018 17:00:38 +0200
Wolfgang Schuster  wrote:

> > I created a non-rectangular shaped document. The printer requires a
> > cut contour in a particular colour, no problem so far. However, he
> > complained about a missing “single continuous closed vectorised
> > contour path”. The one I provided is an area, not a contour path.
> >
> > I created the path as follows:
> >
> > \starttext
> >\startMPcode
> >  draw origin -- (50mm, 0mm) -- (60mm, 20mm) -- (10mm, 20mm) --
> > origin; \stopMPcode
> > \stoptext
> >
> > Any clue how to create such a vectorised contour path?  
> 
> Use cycle to close the path.
> 
> \starttext
>    \startMPcode
>      draw origin -- (50mm, 0mm) -- (60mm, 20mm) -- (10mm, 20mm) --
> cycle ; \stopMPcode
> \stoptext

That's it. The printer confirmed it's working now. 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Printer requires vectorised contour path for cut contour

2018-09-06 Thread Marco Patzer
Hi!

I created a non-rectangular shaped document. The printer requires a cut
contour in a particular colour, no problem so far. However, he complained
about a missing “single continuous closed vectorised contour path”. The one I
provided is an area, not a contour path.

I created the path as follows:

\starttext
  \startMPcode
draw origin -- (50mm, 0mm) -- (60mm, 20mm) -- (10mm, 20mm) -- origin;
  \stopMPcode
\stoptext

Any clue how to create such a vectorised contour path?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Shading and transparency

2018-07-12 Thread Marco Patzer
On Thu, 12 Jul 2018 22:59:05 +0200
Hans Hagen  wrote:

> hm, I'm puzzled as a shade doesn't go between colors + transparent
> but from one color to another (in the same color space) and
> transparency is just a different mechanism
> 
> maybe it was some side effect of chosen values / vectors that gave
> the combined impression (which is why i want to see the pdf made by
> context that you use as reference)

I just checked some older projects and the older versions. I used a
mix between

- linear_shade…
- withshading("linear"…
- withshademethod "linear" …

depending on the age of the project. And I fail to find a project
using transparent shading where the transparency is done in context.
I could not get it working now on the older versions. Maybe you're
right and it has never worked the way I thought it had. Sorry for
the noise.

> \setupbackgrounds [page] [background=color, backgroundcolor=lightgray]
> 
> \starttext
> 
> \startuseMPgraphic{test}
>  graycolor white; white := 1 ;
>  fill OverlayBox
>  withshademethod "linear"
>  withshadedirection shadedup
>  withshadefactor 1.5
>  withshadecolors (.85white,white)
>% withtransparency (multiplytransparent,.7)
>  withtransparency (normaltransparent,.7)
> \stopuseMPgraphic
> 
> \defineoverlay[test][\useMPgraphic{test}]
> 
> \framed
>[align=middle,background={foreground,test}]
>{\samplefile{sapolsky}}
> 
> \stoptext

That's basically shading to the background colour, which gives the
impression of transparency. I've been using that. Works most of the
time. But it's not the same. See the attached file and compare.

I guess I'll keep using the external file overlay then.

> > Just run the first example with an old context version. The file
> > gradient-t from my last mail was created using inkscape as I don't
> > want a single project to depend on two different context versions.  
> you're kidding ... i have no old context on my machine

Silly me :)

Marco


0nC.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Shading and transparency

2018-07-12 Thread Marco Patzer
On Thu, 12 Jul 2018 11:21:45 +0200
Hans Hagen  wrote:

> > For the old implementation (pre 2016-ish) I had a working solution
> > because shading to transparent colours just worked (at least in my
> > case of a simple transparent shade, nothing fancy), but not so any
> > longer. With the new implementation I couldn't get it working. But
> > we discussed that at some point in the past. I believe the gist of
> > it was “shade-to-transparent is gone”.  
> 
> i'm not ssure what shade to transparency means

I mean a shade from a colour (e.g. black) to transparent. For
instance this used to work pre 2016:

\setupbackgrounds [page] [background=color, backgroundcolor=lightgray]
\definecolor [trans] [a=multiply, t=1, s=1]
\starttext
\startMPcode
  path p; p:=fullsquare xyscaled (5cm, 5cm);
  fill p
withshading("linear", ulcorner p, llcorner p)
withfromshadecolor \MPcolor{white}
withtoshadecolor   \MPcolor{trans};
\stopMPcode
\stoptext

The shade goes from white to transparent (here lightgray, that's the
page colour). I assume you have an older context laying around to
run the example above.

> ... shades can be transparent currently

Yes, but the *whole* shade is made transparent. Currently I don't
know a way to shade from e.g. black to transparent (no colour). The
colour involved in the shading can't have transparency, or if they
do one has to use \MPcoloronly to get rid of the transparency part.

So the above old syntax roughly translated to the current
implementation:

\setupbackgrounds [page] [background=color, backgroundcolor=lightgray]
\definecolor [trans] [a=multiply, t=1, s=1]
\starttext
\startMPcode
  path p; p:=fullsquare xyscaled (5cm, 5cm);
fill p
  withshademethod "linear"
  withshadevector (3, 0)
  %% since "trans" contains transparency, one has to use
\MPcoloronly withshadecolors (white, \MPcoloronly{trans})
  withtransparency (.5, .5)
  %% withtransparency \MPtransparency{trans}
  ;
  \stopMPcode
\stoptext

> .. so how did that old file (uncompressed pdf) look like then

Just run the first example with an old context version. The file
gradient-t from my last mail was created using inkscape as I don't
want a single project to depend on two different context versions.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Shading and transparency

2018-07-11 Thread Marco Patzer
On Wed, 11 Jul 2018 23:11:31 +0200
Hans Hagen  wrote:

> > Is there a method that does not require an external file or
> > pre-processing? Using the external file works. Just wondering if
> > there's a better - more integrated - way.  
> i guess that with some experimenting you can come close but the
> external file that you use uses masks (actually we do support masks
> in external figures) and multiple shades over something in the page
> stream

For the old implementation (pre 2016-ish) I had a working solution
because shading to transparent colours just worked (at least in my
case of a simple transparent shade, nothing fancy), but not so any
longer. With the new implementation I couldn't get it working. But
we discussed that at some point in the past. I believe the gist of
it was “shade-to-transparent is gone”.

> stuff i'd only look into  when i have to (in principle one
> can make all kind of fancy mechanisms but does it pay off ... seldom)

If there's no easy solution, it's alright. If have a workaround. No
need to waste time on exotic features (as long as masks in external
figures keep working). Still, if you happen to know a trick to pull
that off in ConTeXt, let me know.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Shading and transparency

2018-07-11 Thread Marco Patzer
Hi!

It's shadings and transparency again.

For most things transparency is not required since the background
colour (white) can be used instead, to achieve the same effect
(thanks Hans for the reimplementation/cleanup a while ago). For one
use case I worked around this by including an external file and
overlay the external file (see attached example).

Background: In the actual documents the transparent overlays overlay
images to have the edges fade into the page background (only the
centre is of interest).

Is there a method that does not require an external file or
pre-processing? Using the external file works. Just wondering if
there's a better - more integrated - way.

Marco
\definecolor [transparent] [a=multiply, t=1, s=1]

\startuseMPgraphic{trans}
  fill OverlayBox
withshademethod "linear" withshadevector (3, 0)
%% (white, "transparent") doesn't work here
withshadecolors (white, white) withtransparency (0, .7);
\stopuseMPgraphic

%% to illustrate the effect, actual background is white
\setupbackgrounds [page] [background=color, backgroundcolor=lightgray]

\defineoverlay [gradient-mp]  [\useMPgraphic{trans}]
%% requires external file gradient-t.pdf
\defineoverlay [gradient-img] [{\externalfigure[gradient-t][width=\overlaywidth,height=\overlayheight]}]

\starttext
  using external image:
  \startframedtext [background={foreground, gradient-img}]
\input knuth
  \stopframedtext
  metapost:
  \startframedtext [background={foreground, gradient-mp}]
\input knuth
  \stopframedtext
\stoptext


5Z7.pdf
Description: Adobe PDF document


gradient-t.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Scale image in MetaPost, maintaining aspect ratio

2018-07-08 Thread Marco Patzer
On Sun, 8 Jul 2018 10:39:52 +0200
Hans Hagen  wrote:

> On 7/8/2018 1:45 AM, Marco Patzer wrote:
> > On Sat, 7 Jul 2018 14:27:38 -0600
> > Alan Braslau  wrote:
> >   
> >> For "historic" reasons,
> >>  draw externalfigure "cow" scaled 5cm ;
> >> normalizes the figure to a square. This will not be changed as it
> >> is a very old feature of MetaFun.
> >>
> >> The solution is
> >>  draw rawtextext("\externalfigure[cow]") xsized 5cm ;
> >> where one can use xsized, ysized or xysized (taking a pair).  
> > 
> > That works indeed. Thanks.  
> draw figure "" ...

That's what I was looking for. 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Scale image in MetaPost, maintaining aspect ratio

2018-07-07 Thread Marco Patzer
On Sat, 7 Jul 2018 14:27:38 -0600
Alan Braslau  wrote:

> For "historic" reasons,
> draw externalfigure "cow" scaled 5cm ;
> normalizes the figure to a square. This will not be changed as it is a
> very old feature of MetaFun.
> 
> The solution is
> draw rawtextext("\externalfigure[cow]") xsized 5cm ;
> where one can use xsized, ysized or xysized (taking a pair).

That works indeed. 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Scale image in MetaPost, maintaining aspect ratio

2018-07-07 Thread Marco Patzer
On Sat, 7 Jul 2018 22:27:51 +0200
Hans Hagen  wrote:

> On 7/7/2018 8:58 PM, Marco Patzer wrote:
> > Hi!
> > 
> > How to scale an image in MetaPost, maintaining the aspect ratio
> > (without specifying the height explicitly)?
> > 
> > Example:
> > 
> > \setupexternalfigures [location=default]
> > \starttext
> >\externalfigure [cow][width=5cm]
> > 
> >\startMPcode
> >  draw externalfigure "cow" scaled 5cm;
> >\stopMPcode
> > \stoptext
> it's all in the metafun manual

No doubts about that. It's more a matter of knowing what to search
for.

> xsized 5cm

I tried it, same result - square image:

  draw externalfigure "cow" xsized 5cm;

As Alan mentioned including the image with textext() works. Not as
elegant, but it gets the job done.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Scale image in MetaPost, maintaining aspect ratio

2018-07-07 Thread Marco Patzer
Hi!

How to scale an image in MetaPost, maintaining the aspect ratio
(without specifying the height explicitly)?

Example:

\setupexternalfigures [location=default]
\starttext
  \externalfigure [cow][width=5cm]

  \startMPcode
draw externalfigure "cow" scaled 5cm;
  \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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] 6-sided letter fold (TRYPTICHON) with unequal page size

2018-06-28 Thread Marco Patzer
On Wed, 27 Jun 2018 20:40:52 +0200
Pablo Rodriguez  wrote:

> On 06/27/2018 07:54 PM, Wolfgang Schuster wrote:
> > This isn’t possible because the imposition mechanism puts the
> > finished pages in boxes with the same size.  
> 
> Wolfgang,
> 
> isn’t it a case for \definepageshift and \setuppageshift?

That works, indeed.

Thank you (and Wolfgang) for the suggestion.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] 6-sided letter fold (TRYPTICHON) with unequal page size

2018-06-27 Thread Marco Patzer
On Wed, 27 Jun 2018 18:42:40 +0200
Henning Hraban Ramm  wrote:

> I'd not try that with pages and imposition, but just use two A4 pages
> and place my content on them - using layers or maybe column sets.
> http://wiki.contextgarden.net/Layers
> http://wiki.contextgarden.net/Columns#Column_Sets

Sure, thought about that, too. But since there is a solution that
seems to be built for this very purpose, I thought before rolling my
own and duplicating the work, I'd just use it. And it almost works.

As I haven't been using the arranging mechanism, and therefore don't
know it (and its quirks), I thought there might be a simple fix. If
it's not, then I'll use layers.

Thanks for your input.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] 6-sided letter fold (TRYPTICHON) with unequal page size

2018-06-27 Thread Marco Patzer
On Tue, 19 Jun 2018 22:15:31 +0200
Marco Patzer  wrote:

> I try getting a 6-sided letterfold with unequal page size to work.
>
> […]
>
> How to adapt for the changed page size without an overlapping page 4
> and a page with clearance to the adjacent 6th page? Suggestions
> welcome!

Any clues, someone?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] 6-sided letter fold (TRYPTICHON) with unequal page size

2018-06-19 Thread Marco Patzer
Hi,

I try getting a 6-sided letterfold with unequal page size to work.
This is how it's supposed to look like:

  
https://www.saxoprint.co.uk/blog/wp-content/uploads/2013/06/roll-fold-leaflets-02-01.png

This is easy with the arranging option TRYPTICHON. *But* the page
sizes are not equal and manually adjusting them shifts them not the
way they're supposed to. Page 4 and 5 need to be a bit less wide to
be able to fold neatly.

  Page width 1,2,3,6: 10cm
  Page width 4,5:  9.7cm

How to adapt for the changed page size without an overlapping page 4
and a page with clearance to the adjacent 6th page? Suggestions
welcome!

Here the example you've all been waiting for:

%% 6-sided letter fold
%% 
https://www.saxoprint.co.uk/blog/wp-content/uploads/2013/06/roll-fold-leaflets-02-01.png

\definepapersize
  [flyer]
  [width=10cm, height=21cm]

\definepapersize
  [flyer-small]
  [width=9.7cm, height=21cm]

\setuppapersize
  [flyer]
  [A4, landscape]

\setuplayout [page]
\setuparranging [TRYPTICHON]

\starttext
\showframe

10cm:\blank \rightaligned{\blackrule[width=10cm]}\vfill{\tfd\currentpage}

\page
10cm:\blank[5mm] \blackrule[width=10cm]\vfill{\tfd\currentpage}

\page
10cm:\blank[8mm] \blackrule[width=10cm]\vfill{\tfd\currentpage}

\page
%% shifts page to the left, why?
\setuppapersize [flyer-small] [A4, landscape]
9.7cm:\blank[11mm] 
\rightaligned{\blackrule[width=9.7cm]}\vfill{\tfd\currentpage}

\page
\setuppapersize [flyer-small] [A4, landscape]
9.7cm:\blank[14mm] \blackrule[width=9.7cm]\vfill{\tfd\currentpage}

\page
\setuppapersize [flyer] [A4, landscape]
10cm:\blank[10mm] \blackrule[width=10cm]\vfill{\tfd\currentpage}

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] hairline & rules

2018-06-16 Thread Marco Patzer
On Fri, 15 Jun 2018 00:20:23 -0700
"jdh"  wrote:

> I want to use a colored hairline, but can't get it working and can't
> find anything to explain any options or parameters.
> 
> I've tried
> 
>   \setuptextrules[rulecolor=red,color=red]
>   \hairline
>   or
>   \hairline[color=red]

\setupblackrules
  [height=1pt,
   color=blue,
   width=\textwidth]

\starttext
  \blackrule
  \blackrule [color=red, height=1ex, width=5cm]
\stoptext

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

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] 'lua.registercode' bug in latest beta

2017-11-26 Thread Marco Patzer
On Tue, 7 Nov 2017 11:59:51 +0800
Li Yanrui (李延瑞) <liyanrui...@gmail.com> wrote:

> Using '\ctxloadluafile'  can get an error:
> 
> ```
> ..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad
> argument #1 to 'gmatch' (string expected, got nil)
> ```
> 
> It seems to be caused by 'if options ~= ""' in `lua.registercode'.
> That empyt string should be 'nil'?

I can confirm the issue, MWE:

\usemodule [letter]
\starttext
\null
\stoptext

throws:

open source > level 4, order 5, name 
'/tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi'

lua error   > lua error on line 30 in file 
/tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:

...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument #1 
to 'gmatch' (string expected, got nil)
stack traceback:
[C]: in function 'gmatch'
...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: in 
function 'registercode'
[ctxlua]:1: in main chunk

20 %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 %C GNU General Public License for more details.
22 %C
23 %C You should have received a copy of the GNU General Public License
24 %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
25 
26 \unprotect
27 
28 % Lua functions for the core and also for the frontend modules
29 
30 >>  \ctxloadluafile{s-cor-00}

context: 2017.11.22 13:35

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Two hyphens do not replaced on em—dash when dejavu,14pt

2017-03-31 Thread Marco Patzer
On Fri, 31 Mar 2017 11:46:00 +0300
Kostirya <kosti...@gmail.com> wrote:

> Two hyphens do not replaced on em—dash when dejavu,14pt

Use the tlig font feature

  \definefontfeature
[tlig]
[default]
[tlig=yes]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Documentation for the letter module

2017-03-21 Thread Marco Patzer
Hi!

Where can the current documentation for the letter module be found?
I seems like it's not included in the distribution (why is it
missing?) and

  http://bitbucket.org/wolfs/correspondence/downloads/correspondence.pdf

is (out)dated: 2010-08-27

Furthermore, the latest updates on
http://bitbucket.org/wolfs/correspondence/ are from 2012-02-02 and
the module seems to have been updated¹ since (2015-08-24).

Marco

¹ 
https://modules.contextgarden.net/cgi-bin/module.cgi/ruid=5489253982/action=view/id=38
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Calculating with \measure

2017-03-19 Thread Marco Patzer
On Sun, 19 Mar 2017 18:18:48 +0100
Wolfgang Schuster <schuster.wolfg...@gmail.com> wrote:

> > Is it possible to calculate with \measure or do I have to resort to
> > dimens? Example:
> >
> > \definemeasure [mymeasure] [4cm]
> > \newdimen\mydim \mydim4cm
> >
> > \starttext
> > \framed[width=4cm]{Foobar}
> > \framed[width=\measure{mymeasure}]{Foobar}
> > \framed[width=2\mydim]{Foobar}
> > \framed[width=2\measure{mymeasure}]{Foobar}
> > \stoptext  
> You can use \measured

That's what I was looking for.

> or just create more named lengths.
> 
> \definemeasure [onemeasure] [4cm]
> \definemeasure [twomeasure] [\measure{onemeasure}*2]
> %\definemeasure [twomeasure] [2\measured{onemeasure}]

That's exactly what I initially did. After I ended up with

  \measure{Small}
  \measure{TwoSmall}
  \measure{ThreeSmall}
  \measure{FourSmall}
  \measure{Big}
  \measure{TwoBig}
  \measure{ThreeBig}
  \measure{FourBig}

I deleted the whole mess and went with \dimen.

Thanks for the quick response.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Calculating with \measure

2017-03-19 Thread Marco Patzer
Hi!

Is it possible to calculate with \measure or do I have to resort to
dimens? Example:

\definemeasure [mymeasure] [4cm]
\newdimen\mydim \mydim4cm

\starttext
  \framed[width=4cm]{Foobar}
  \framed[width=\measure{mymeasure}]{Foobar}
  \framed[width=2\mydim]{Foobar}
  \framed[width=2\measure{mymeasure}]{Foobar}
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] The requested font has no files for the 'tf' alternative

2017-03-15 Thread Marco Patzer
On Wed, 15 Mar 2017 19:26:06 +0100
Wolfgang Schuster <schuster.wolfg...@gmail.com> wrote:

> > Pablo Rodriguez <mailto:oi...@gmx.es>
> > 15. März 2017 um 19:10via Postbox 
> > <https://www.postbox-inc.com/?utm_source=email_medium=sumlink_campaign=reach>
> >
> > How about removing the directory tex/texmf-cache/luatex-cache/?
> >
> > I had some problems with fonts and removing it was the way of
> > solving them.  
> You can remove the font cache with
> 
>  mtxrun --script cache --fonts --erase
> 
> and the complete cache with
> 
>  mtxrun --script cache --erase

I don't know if those commands would have helped. Since it doesn't
store any personal information I purged my context installation and
did a reinstall. Now all fonts work.

> The font cache is regenerated with
> 
>  mtxrun --script fonts --reload

I tried that (without clearing the cache) before, but to no avail.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] The requested font has no files for the 'tf' alternative

2017-03-15 Thread Marco Patzer
On Tue, 14 Mar 2017 23:44:29 +0100
Marco Patzer <li...@homerow.info> wrote:

> Your example works for me. But it's still unclear what I'm doing
> wrong. According to your explanation this should work:
> 
>   \definefontfamily
> [mainface]
> [rm]
> [Caecilia LT Std]
> [tf=Caecilia LT Std Roman]
> 
> However, it shows:
> 
>   selectfont > The requested font 'Caecilia LT Std' has no files for
> the 'tf' alternative, Latin Modern is used instead.
> 
> It appears that ConTeXt somehow can't find the font.

Thanks to Wolfgang's assistance I figured that the syntax in my OP
was correct and the issue is with my installation. It works for me
in a virgin installation, but throws the abovementioned error in my
current installation.

I don't know what borked my installation and why it only affected
some fonts and not others.

So sorry for the noise and thanks for quick responses.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] The requested font has no files for the 'tf' alternative

2017-03-14 Thread Marco Patzer
On Tue, 14 Mar 2017 21:39:34 +0100
Wolfgang Schuster <schuster.wolfg...@gmail.com> wrote:

> [...]

Thanks for the explanation, Wolfgang.

> Each font of your collection has its individual name, e.g. the
> regular style has the name “Caecilia LT Std Roman” but all styles use
> the same name for the family (i.e. “Caecilia LT Std”) which is used
> by \definefontfamily.

That makes sense.

> When you now used a individual name instead of the family name for 
> \definefontfamily you should get a message in log for the correct
> name, e.g. the following example
> 
>  \definefontfamily[mainface][rm][TeX Gyre Pagella Regular]
> 
>  \setupbodyfont[mainface]
> 
>  \starttext
>  Font test!
>  \stoptext
> 
> shows this in the log
> 
>  selectfont > The name 'texgyrepagellaregular' is not a proper 
> family name, use 'texgyrepagella' instead.
>  selectfont > The requested font 'TeX Gyre Pagella Regular' has
> no files for the 'tf' alternative, Latin Modern is used instead.
> 
> which tells you to use “texgyrepagella” for the \definefontfamily
> command.

Your example works for me. But it's still unclear what I'm doing
wrong. According to your explanation this should work:

  \definefontfamily
[mainface]
[rm]
[Caecilia LT Std]
[tf=Caecilia LT Std Roman]

However, it shows:

  selectfont > The requested font 'Caecilia LT Std' has no files for the 'tf' 
alternative, Latin Modern is used instead.

It appears that ConTeXt somehow can't find the font.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] The requested font has no files for the 'tf' alternative

2017-03-14 Thread Marco Patzer
On Mon, 13 Mar 2017 22:10:56 +0100
Pablo Rodriguez <oi...@gmx.es> wrote:

> On 03/13/2017 09:55 PM, Marco Patzer wrote:
> > On Fri, 10 Mar 2017 17:12:36 +0100 Pablo Rodriguez wrote:  
> >> [...]
> >>   \definefontfamily[mainface][rm][Caecilia LT Std-Roman]  
> > 
> > This also shows:
> > 
> > selectfont > The requested font 'Caecilia LT Std-Roman' has no files
> > for the 'tf' alternative, Latin Modern is used instead.
> >   
> >> What it works is a different font name. And I guess that Roman
> >> isn’t part of the font name, but this is the style.  
> > 
> > otfinfo -i CaeciliaLTStd-Roman.otf | grep name
> > Full name:   CaeciliaLTStd-Roman
> > PostScript name: CaeciliaLTStd-Roman
> > Mac font menu name:  Caecilia LT Std Roman  
> 
> \definefontfamily[mainface][rm][CaeciliaLTStd-Roman]
> 
> I guess the full name should work. But I’m only guessing.

Sadly it does not.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] The requested font has no files for the 'tf' alternative

2017-03-13 Thread Marco Patzer
On Fri, 10 Mar 2017 17:12:36 +0100
Pablo Rodriguez <oi...@gmx.es> wrote:

> On 03/09/2017 10:33 AM, Marco Patzer wrote:
> > \definefontfamily
> >   [mainface]
> >   [rm]
> >   [Caecilia LT Std Roman]
> >   %% doesn't work, either
> >   %% [tf=file:CaeciliaLTStd-Roman.otf]
> > [...]
> >   %% \definedfont [name:CaeciliaLTStd-Roman] %% this works  
> 
> Hi Marco,
> 
> how about the following?
> 
>\definefontfamily[mainface][rm][Caecilia LT Std-Roman]

This also shows:

selectfont > The requested font 'Caecilia LT Std-Roman' has no files for the 
'tf' alternative, Latin Modern is used instead.

> What it works is a different font name. And I guess that Roman isn’t
> part of the font name, but this is the style.

otfinfo -i CaeciliaLTStd-Roman.otf | grep name
Full name:   CaeciliaLTStd-Roman
PostScript name: CaeciliaLTStd-Roman
Mac font menu name:  Caecilia LT Std Roman

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] The requested font has no files for the 'tf' alternative

2017-03-10 Thread Marco Patzer
On Fri, 10 Mar 2017 08:13:59 +0800
Vladimir Lomov <lomov...@gmail.com> wrote:

> Some time ago I faced the same problem: I tried to use one of
> Microsoft font but it didn't work, the only thing I saw in log was
> the same message. I solved the problem by deleting "font cache"
>   luatex-cache/context/HASH/fonts
> and generating it again
>   mtxrun --script fonts --reload --force

Thanks for the response. The same result with the rebuilt cache.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

  1   2   3   4   5   6   7   8   9   10   >