Re: [NTG-context] Bad linebreak in figure caption

2021-12-03 Thread Marco Patzer via ntg-context
On Fri, 3 Dec 2021 09:14:59 +0100
Taco Hoekwater  wrote:

> Captions have their own alignment setting:
> 
>  \setupcaption[figure][align={verytolerant,stretch}]

Thanks. Wikified:

  https://wiki.contextgarden.net/Command/setuptolerance

Is there a good reason why captions (as well as e.g. framed texts)
don't honour the global tolerance setting?

Marco
___
If your question is of interest to others as well, please add an 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 linebreak in figure caption

2021-12-02 Thread Marco Patzer via ntg-context
On Mon, 29 Nov 2021 16:44:07 +0100
Marco Patzer via ntg-context  wrote:

> Why does ConTeXt not break the line between "unnecessary" and "FOO"?

Any ideas how to fix this?

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

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


[NTG-context] Defining new float types fails in LMTX

2021-11-30 Thread Marco Patzer via ntg-context
Hi!

Apologies for spamming this list with my all the floaty stuff.
There's an issue with defining new floats in LMTX in combination
with bottom placement.

The following works in MkIV, but throws an error in LMTX:

  I'm ignoring this; it doesn't match any \if.
  mtx-context | fatal error: return code: 256

\setupfloat [figure]
  [default=bottom]  %% fails
  %% [default=top]  %% works

\definefloat
  [foo] [foos]
  [figure]

\starttext
  \startplacefigure [title=Foo]
\framed{Foo}
  \stopplacefigure

  \startplacefoo [title=Bar]
\framed{Bar}
  \stopplacefoo
\stoptext

Marco

LMTX 2021.11.26 11: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] Parameter order in float location matters

2021-11-30 Thread Marco Patzer via ntg-context
On Tue, 30 Nov 2021 14:05:23 +0100
Henning Hraban Ramm via ntg-context  wrote:

> Maybe you could define your own float type for the cases without
> caption?

I've done that for other options, too, I guess no-caption-floats get
a dedicated float type as well now. It's more robust than relying on
typing the correct parameter order each time.

BTW: creating new float types fails in LMTX, I'll post an MWE in
a new thread shortly.

Marco
___
If your question is of interest to others as well, please add an 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] location=outer causes bad page break in LMTX

2021-11-30 Thread Marco Patzer via ntg-context
Hi!

In the following example “Lorem ipsum” sits on an otherwise empty
page in LMTX. Output is as expected with MkIV. Has the interface
changed or may it be a bug in LMTX?

\starttext
\null\godown [15.5cm]

\samplefile{knuth}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
\startplacefigure [location=outer]
  \externalfigure
\stopplacefigure

\samplefile{knuth}
\stoptext

Marco

LMTX 2021.11.26 11: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] Parameter order in float location matters

2021-11-30 Thread Marco Patzer via ntg-context
On Tue, 30 Nov 2021 13:06:00 +0100
Henning Hraban Ramm via ntg-context  wrote:

> Well, in {bottom,top,here} it’s the order that TeX should try.

“location“ sets the location of the caption as well as the position
of the entire float. If you want to influence one, you'll also have
to specify the other, AFAIK. Which is a bit unfortunate since the
placement belongs in an environment and not the running text (it's a
style decision after all).

Take the following example:

\setupfloats [figure] [default=top]

\setupfloats [table]  [default=bottom]
%% \setupfloats [table]  [default=top]

\starttext
  \samplefile{knuth}

  \startplacefigure %% [location=top]  %% default
\externalfigure
  \stopplacefigure

  %% Goal here: turn off the caption, not influence the default placement
  %% needs to be adapted when the global style changes
  %% \startplacefigure [location=none] %% fails, messes up the placement
  \startplacefigure [location={top, none}] %% works
\externalfigure
  \stopplacefigure

  %% Goal here: turn off the caption, not influence the default placement
  %% needs to be adapted when the global style is changed to “top”
  \startplacetable [location={bottom, none}]
\externalfigure
  \stopplacetable
\stoptext

As far as I know there's no way to only turn off captions, so one
has to know the default placement value (which might be buried in an
environment file) and specify it again together with the “none”
option.

If you (or someone else) knows a way to disable the caption without
influencing the placement, I'm all ears.

Marco
___
If your question is of interest to others as well, please add an 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] Parameter order in float location matters

2021-11-30 Thread Marco Patzer via ntg-context
Hi!

Today I discovered that the parameter order in float location matters:

\starttext
  \samplefile{knuth}

  \startplacefigure [location={top,none}]  %% works: float is at the top
\externalfigure
  \stopplacefigure

  \startplacefigure [location={none,top}]  %% top is ignored here
\externalfigure
  \stopplacefigure
\stoptext

Not sure if that's how it's supposed to be. In any case, I didn't
expect 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
___


[NTG-context] Bad linebreak in figure caption

2021-11-29 Thread Marco Patzer via ntg-context
Hi!

The caption "FOO" runs into the right figure's caption:

\setuplayout [width=18.4cm]
\setuptolerance [verytolerant, stretch]  %% even with stretch

\starttext
  \startplacefigure
\startfloatcombination
  \startplacefigure [title=Unexpectedly unnecessary FOO-BAR whatever]
\framed[width=.4\textwidth]{}
  \stopplacefigure
  \startplacefigure [title={Lorem ipsum dolor siit amet}]
\framed[width=.4\textwidth]{}
  \stopplacefigure
\stopfloatcombination
  \stopplacefigure
\stoptext

Why does ConTeXt not break the line between "unnecessary" and "FOO"?
How to kindly persuade it to do so?

Marco

LMTX 2021.11.26 11: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] Influence location of luametatex-cache

2021-11-29 Thread Marco Patzer via ntg-context
On Mon, 29 Nov 2021 12:07:51 +0100
Henning Hraban Ramm via ntg-context  wrote:

> > How to influence the location of the cache directory?  
> 
> Try to set TEXMFCACHE

That's it. Thanks Peter and Henning.

Marco
___
If your question is of interest to others as well, please add an 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] Influence location of luametatex-cache

2021-11-29 Thread Marco Patzer via ntg-context
Hi!

when LMTX is installed in a read-only location (e.g. /opt) it
creates a directory "luametatex-cache" in $HOME.

How to influence the location of the cache directory?

Marco
___
If your question is of interest to others as well, please add an 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 counting groupsuffix for subfigures

2021-11-24 Thread Marco Patzer via ntg-context
Hi!

I'd like to use subfigure numbering for floats. This works:

\useMPlibrary [dum]
\starttext

\startplacefigure [location=none]
  \startfloatcombination [nx=2]
\startplacefigure [title=Left, reference=ref:left, group=one, groupsuffix=a]
  \externalfigure
\stopplacefigure
\startplacefigure [title=Right, reference=ref:right, group=one, 
groupsuffix=b]
  \externalfigure
\stopplacefigure
  \stopfloatcombination
\stopplacefigure

See \in{image}[ref:right] (right) and \in{image}[ref:left] (left).
\stoptext

The output is correct, but the usage is verbose. I'd like to replace
the manual groupsuffix numbering with something automatic. ConTeXt
uses automatic numbering in many places so it seems strange to
number the subfigures manually.

I have tried using counters and labels, but something is always
messed up and I couldn't get it to work.

How to achieve automatic subfigure numbering without specifying the
groupsuffix manually?

Marco

LMTX 2021.11.22 22:27
___
If your question is of interest to others as well, please add an 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] Errors in source files return success

2021-11-18 Thread Marco Patzer via ntg-context
Hi!

ConTeXt can detect issues in the sources and report them on the
console with the argument --errors or with \enabledirectives
[logs.errors]. The return value is still “0” (=success) even with
errors present.

Right now I use a script that parses the log file and lets me know
if a run has issues. However, it would be great if context could
return a non-zero value if errors are present. I've found that

  \enabledirectives
[logs.errors=missing characters]

returns “1” if characters are missing. Lovely!

Undefined control sequences always return 1 (a TeX thing I believe
and not related to the macro package). But undefined control
sequences don't show up on the console as the other errors do if
general output (except errors) is silenced e.g. with

  context --silent --noconsole --nostatistics --errors 

The question is, what other directives can be enabled that make
context return a failure? Is there a way to return failure if *any*
error is encountered or do they need to be enabled each
individually? And is there a way to show hard TeX errors as
undefined control sequences as a “possible issue” if output is
silenced?

MWE:

%% enables logging of errors same as --errors AFAIK
\enabledirectives
  [logs.errors]

%% makes context return 1 on missing chars, great!
%% \enabledirectives
%%   [logs.errors=missing characters]

\starttext

%% missing characters
풜

%% missing figure
\externalfigure [foo]

%% \end occurred inside a group at level 1
%% ### semi simple group … entered at line
\startalignment [middle]
  foo

%% missing references
See \in{section}[sec:none].

%% undefined control sequence
%% \undefined

\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] Space before/after combinations + centring

2021-11-17 Thread Marco Patzer via ntg-context
On Wed, 17 Nov 2021 20:17:52 +0100
Wolfgang Schuster  wrote:

> 2. There are no changes to adjust the vertical before and after a
> combination environment.

That's unfortunate.

> Local patches can also be tricky because ConTeXt tries to freeze
> the definitions of many user level commands which means they can't
> be redefined when you use a strict overload mode (look at the
> lowlevel security manual for this feature).

An overload like mine is probably exactly what the strict overload
mode is supposed to protect against.

> The most reliable way to center you combination blocks is to put
> them either in a float or put a framedtext environment around it.

The project comprises several hundred source files. That's why I
stayed away from rewriting the sources in the first place. I'll try
to bulk-change the sources.

Thanks for your explanations.

Marco
___
If your question is of interest to others as well, please add an 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] Space before/after combinations + centring

2021-11-17 Thread Marco Patzer via ntg-context
Hi!

I'm in the process of converting some projects to LMTX. Combinations
lacking “”before” and “after” keys (that place content before/after
the *entire* combination, rather than the individual cell pairs), I
came up with the following ugliness – which worked for longer than
it deserved:

\unprotect

\unexpanded\def\startcombination
  {\blank[halfline]%%
   \startalignment[middle]%%
   \dontleavehmode
   \bgroup
   \pack_combinations_push
   \dodoubleempty\pack_combinations_start}

\unexpanded\def\stopcombination
  {\bgroup\normalexpanded{\egroup{}\ntimes{{}{}}\c_pack_combinations_y}% brr
   \dostoptagged
   \egroup
   \pack_combinations_pop
   \egroup
   \stopalignment
   \goodbreak\blank[halfline]}

\protect

\starttext
  \startcombination [2*2]
\startcontent foo \stopcontent \startcaption 1 \stopcaption
\startcontent bar \stopcontent \startcaption 2 \stopcaption
  \stopcombination
\stoptext

I added vertical spacing and mid-aligned the content without having
to change the sources, that was the idea. However, this fails in
LMTX:

  Undefined control sequence \pack_combinations_start

Does LMTX offer finer control over the combinations or do I have to
rewrite the sources files (to either use floats or surround the
combinations with the required commands)?

Marco

LMTX: current version: 2021.11.16 22:36
___
If your question is of interest to others as well, please add an 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] Ampersand in \unprotect fails in LMTX

2021-07-09 Thread Marco Patzer
On Fri, 9 Jul 2021 14:29:20 +0200
Hans Hagen  wrote:

> > As \& works for MkIV as well as LMTX, there's an easy workaround.
> > But maybe this isn't intended behaviour and needs checking.
> intended ... author passes different through the system in lmtx
> (better)

Apparently not only author. Also title, subtitle, …

> \starttext
>
> \unprotect
>\setupinteraction
>  [\c!author=\detokenize{Foo & Bar}]
> \protect

That works as well.

> but why unprotect and not just
> 
> \setupinteraction
>[author={Foo & Bar}]

That's just an MWE to demonstrate the problem. The actual code is
part of a module (therefore it's \unprotect'ed).

> of course \& also works ok.

I'll convert to \&. Thanks for the quick reply.

Marco
___
If your question is of interest to others as well, please add an 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] Ampersand in \unprotect fails in LMTX

2021-07-09 Thread Marco Patzer
Hi!

the following example compiles with MkIV but fails in LMTX:

\unprotect
  \setupinteraction
[\c!author={Foo & Bar}] %% {Foo \& Bar} works for MkIV and LMTX
\protect

\starttext\null\stoptext

LMTX:

  1 \unprotect
  2   \setupinteraction
  3 [\c!author={Foo & Bar}]
  4 >>  \protect
  5
  6 \starttext\null\stoptext
  7
  I can't figure out why you would want to use a tab mark here. If some right 
brace
  up above has ended a previous alignment prematurely, you're probably due for 
more
  error messages.
  mtx-context | fatal error: return code: 256

As \& works for MkIV as well as LMTX, there's an easy workaround.
But maybe this isn't intended behaviour and needs checking.

ConTeXt  ver: 2021.07.06 18:49 LMTX

Marco
___
If your question is of interest to others as well, please add an 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

2021-07-08 Thread Marco Patzer
On Thu, 8 Jul 2021 10:34:32 +0200
Hans Hagen  wrote:

> Now, to the issue of names like 10.11.12.13 ... here .13 is the
> suffix, like it or not, so in principle we then get
> 
> 10.11.12.log
> 10.11.12.tuc
> 10.11.12.pdf

It's not that I use files without (.tex, .mkiv, ...) suffixes, but
your 10.11.12.13 example is processed by MkIV without problems:

10.11.12.pdf
10.11.12.tua
10.11.12.log

LMTX, however doesn't like it:

10.11.pdf
10.11.tua
10.log


> if not then indeed there is some issue.

According to my tests LMTX doesn't work like you describe it should.

> Now, although it's quite some 
> work, one can think of seeing .13 as part of the filename, in which
> case the lookupe becomes
> 
> 10.11.12.13.tex

Just to make it clear: I don't use files without .tex/.mkvi/etc.
suffix. So I don't expect 10.11.12.13 to work, but 10.11.12.tex
should in fact work as far as I understand.

Marco
___
If your question is of interest to others as well, please add an 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

2021-07-07 Thread Marco Patzer
On Wed, 7 Jul 2021 12:25:29 -0600
Alan Braslau  wrote:

Thank you for your reply.

> Windows, I believe, does not take kindly to filenames containing
> multiple dots.

Disclaimer: I don't use Windows, I know nothing about Windows. But I
downloaded a Windows 10 VM and fired it up, installed LMTX, created
a file (in the default editor):

  # file name: 10.10.10.tex
  \starttext
  foo
  \stoptext

Then I ran

install.bat
setpath.bat

# LMTX
context 10.10.10.tex
  → 10.10.pdf
  → 10.log

# MkIV
context --luatex 10.10.10.tex
  → 10.10.10.pdf
  → 10.10.10.log

So I can't confirm your findings. MkIV works exactly the same on a
vanilla Windows 10 VM than it does on a Unix system and produces
correct output files with multiple dots. No issues there.

> Therefore, Hans never uses such filenames and does not expect them,
> either, so I am not surprised that this yields unpredictable results.
> 
> An unfortunate side-effect of dealing with Windows.

My short test above seems to suggest that it's not an OS issue since
Unix and Windows behave exactly the same. MkIV (which seems to work
fine on Windows) as well as the LMTX issue. But maybe I did
something wrong there, in that case please let me know.

And Hans said “I'll look at it” a while back, so I just wanted to
send a reminder.

Since it worked in MkIV it looks like a regression. I mean it used
to work. Several of my projects rely on source files with multiple
dots. I know it's not common to have multiple dots, but I hope
there's chance it might be fixed.

But maybe Hans can chime in and clarify.

Marco
___
If your question is of interest to others as well, please add an 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

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

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

I've checked again with 2021.07.06 18:49 LMTX

  10.10.10.tex → 10.10.pdf + 10.log
  10.10.11.tex → 10.10.pdf (file 10.10.pdf and 10.log are over-written)
  11.10.11.tex → 11.10.pdf

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

A gentle reminder.

As by my tests, something has changed in the last months, but the
behaviour is still weird (e.g. log files differ from pdf file or
10.10.10.tex results in 10.10.pdf).

Is there a chance you can look at that at some point?

Marco
___
If your question is of interest to others as well, please add an 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] midi

2021-02-03 Thread Marco Patzer
On Wed, 3 Feb 2021 22:15:59 -0500
Fabrice L  wrote:

> I usually do images ; if you or the list ever want to see more, the
> site https://art-aleatoire.com <https://art-aleatoire.com/> is to
> show my work, and all you can see there is made by me using 100%
> MetaFun

That is some impressive work! Well executed and very creative.

Thanks for posting that link.

Marco
___
If your question is of interest to others as well, please add an 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] Continued chapter numbers

2021-01-07 Thread Marco Patzer
On Thu, 7 Jan 2021 00:02:20 +0100
Wolfgang Schuster  wrote:

> > \definestructureresetset is the same as \defineresetset. I assume
> > that \definestructureresetset is the preferred way. But both will
> > work.  
> 
> No, \defineresetset is the main command and \definestructureresetset
> is a alias for backwards compatibility.

Thanks for the info. I updated the wiki.

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

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


Re: [NTG-context] Continued chapter numbers

2021-01-06 Thread Marco Patzer
On Thu, 7 Jan 2021 07:09:46 +1100
jbf  wrote:

> I had searched everywhere on the wiki and in the manuals for
> something like this, based on 'reset' but could not find it.

AFAIK it's not mentioned in the manuals. But a variant is on the
wiki “Independent Section Numbering”:

  https://wiki.contextgarden.net/Titles

  \definestructureresetset
[default][1,1,0][1] %% reset part, chapter, but not section

  \setuphead
[sectionresetset=default]

\definestructureresetset is the same as \defineresetset. I assume
that \definestructureresetset is the preferred way. But both will
work.

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

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


Re: [NTG-context] Continued chapter numbers

2021-01-06 Thread Marco Patzer
On Wed, 6 Jan 2021 20:24:07 +1100
jbf  wrote:

> I need chapter numbers to continue sequentially across several parts.
> At the moment, when Part 2 begins, it begins with Chapter 1 once
> more, while it should be (in continued sequence) Chapter 4.

\defineresetset
  [jbfreset] [] [0]

\setuphead
  [chapter]
  [sectionresetset=jbfreset]

Marco
___
If your question is of interest to others as well, please add an 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] Part label and chapter numbers

2021-01-04 Thread Marco Patzer
On Tue, 5 Jan 2021 08:32:33 +1100
jbf  wrote:

> and apologies if you didn't think I provided an MWE.

The idea is that people can just copy-paste the code into an editor
and keep tweaking. It doesn't have to produce the correct output,
but it should compile. If you add an MWE you're more likely to get a
response.

> Of the three issues below, only the first is not resolved, meaning
> that part=Section\nobreakspace does not make any difference, or put
> another way, at least it stops things from throwing an error, but the
> result I get is not 'Section 1. My title' but simply '1. My  title'.

Here's what an MWE with the code I posted looks like:

\setuphead
  [part]
  [placehead=yes,
   bodypartlabel=part]

\setuplabeltext
  [part=Section\nobreakspace]

\setuplabeltext
  [chapter=Chapter\nobreakspace]

\setuphead
  [chapter]
  [conversion=Words]

\setuphead
  [chapter]
  [sectionsegments=chapter]

\setuphead
  [section]
  [sectionsegments=chapter:section]

\starttext
  \startpart [title=Mypart]
\startchapter [title=Some Chapter]
  \startsection [title=Some Section]
\samplefile{knuth}
  \stopsection
\stopchapter
  \stoppart
\stoptext

And the string “Section 1 Mypart” shows up there.

> Below is exactly what I have in my preamble. Note that I have also 
> included \setuphead [section] which is the true 'section' level below 
> 'chapter'. Is it possible that this causes some confusion? 
> Unfortunately, the author still wants 'Part' to be actually named as 
> 'Section'!
> 
> \setuphead
>    [part]
>    [
>    placehead=yes,
>    page=no,
>    bodypartlabel=part
> ]

First, there a bunch of (U+00A0) NO-BREAK SPACEs in your code. I
don't know if that's added by your mail client or if that's actually
in your code. If it's also in the code: Context doesn't like it. The
NO-BREAK SPACEs have to go.

Second, you have a space (new line) after “bodypartlabel=part”. Add
a comma, percent sign or move the closing bracket after the word
“part”.

Marco
___
If your question is of interest to others as well, please add an 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] Part label and chapter numbers

2021-01-04 Thread Marco Patzer
On Mon, 4 Jan 2021 13:22:55 +1100
jbf  wrote:

> Issue 1:
> 
> Parts need to be called 'Section' (Section 1, section 2 etc.).

\setuphead
  [part]
  [placehead=yes,
   bodypartlabel=part]

\setuplabeltext
  [part=Section\nobreakspace]

> Issue 2:
> 
> While the above 'sections' are numbered in arabic numbers, Chapters
> are meant to be in words.

\setuplabeltext
  [chapter=Chapter\nobreakspace]

\setuphead
  [chapter]
  [conversion=Words]

> Issue 3 might already be solved once I resolve Issue 2!
> 
> But given that I have parts, the chapters at the moment come out as 
> Chapter 1.1... Chapter 2.1 etc. and I simply want Chapter One,
> Chapter Two and so on

\setuphead
  [chapter]
  [sectionsegments=chapter]

\setuphead
  [section]
  [sectionsegments=chapter:section]

> Any thoughts?

An MWE would have been nice to have.

Marco
___
If your question is of interest to others as well, please add an 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] 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
___

  1   2   3   4   5   6   7   8   9   10   >