Re: [NTG-context] background color, was: CMYK Color profile

2019-05-31 Thread Benjamin Koppe
Here's the example. It's basically the code from DIN Lang Folder in the
Wiki plus a setupbackgrounds command. It works with `page` but fails to
work with `paper`:




%% This is a template for a Din lang Folder.
%% The folded page of such a flyer is shorter (97mm) than the other
pages (100mm)

%% This measure shows how much shorter the folded page is.
\definemeasure
[shortfold]
[3mm]

%% The bleed measure is necessary if you have colored page backgrounds
%% or images in the bleed.
%% Different print shops need different bleeds.
\definemeasure
[bleed]
[1mm]

%% This is the pagesize of the final PDF.
%% The bleed size is added two times to width and height.
\definepapersize
[A4-flyer]
[width=\dimexpr297mm+2\measured{bleed}\relax,
 height=\dimexpr210mm+2\measured{bleed}\relax]

%% The size of a normal page.
\definepapersize
[flyer-page]
[width=100mm,
 height=210mm]

%% The size of the folded page.
\definepapersize
[flyer-page-small]
[width=\dimexpr100mm-\measure{shortfold}\relax,
 height=210mm]

%% Imposition: With the following two commands we arrange the six pages
%% on the final PDF print sheet.

%% The flyerpages are imposed on the printed sheet.
\setuppapersize
[flyer-page]
[A4-flyer]

%% The pages are arranged as a tryptichon.
\setuparranging
[TRYPTICHON]

%% Because of the shorter folded page and the bleed the pages has
%% to be shifted horizontally on the printed sheet.
%% The values are calculated here.
\definepageshift
[flyer]
[horizontal]
[\dimexpr\measure{bleed}-\measured{shortfold}\relax,
\measure{bleed},
 \measure{bleed},
 \dimexpr2\measured{shortfold}+\measured{bleed}\relax,
 \measure{bleed},
\dimexpr\measure{bleed}-\measured{shortfold}\relax
]


%% The vertical pageshift is simple.
\definepageshift
[flyer]
[vertical]
[\measure{bleed}]

\setuppageshift
[paper]
[flyer]

%% We define some measures to construct the page layout.
\definemeasure
[small]
[3mm]

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

%% Each page has a slightly different page layout.
%% The named layouts (1. bracket) inherit values from other layouts
%% which are assigned in the second bracket.
\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=2\measured{big},
 backspace=2\measured{small},
 width=\dimexpr\paperwidth-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]

%% We assign the layouts to the pages.
\definelayout [1] [first]
\definelayout [2] [second]
\definelayout [3] [thirdandfourth]
\definelayout [4] [thirdandfourth]
\definelayout [5] [fifthandsixth]
\definelayout [6] [fifthandsixth]


%% Some setups
\setupmakeup [doublesided=no]
\setuptolerance [verytolerant]


%% We want to see page and layout borders.
%% COMMENT THIS OUT BEFORE YOU PRINT!
\showframe

\setupbackgrounds[paper][background=color,backgroundcolor=blue]

\starttext
\starttitle[title={First page}]
\input lorem
  \stoptitle
  \starttitle[title={Second page}]
\input lorem

  \stoptitle
  \starttitle[title={Third page}]
\input lorem

  \stoptitle

  \starttitle[title={Fourth page}]
\setuppapersize [flyer-page-small] [A4-flyer]
\input lorem

  \stoptitle
  \starttitle[title={Fifth page}]
\input lorem

  \stoptitle

  \starttitle[title={Sixth page}]
  \setuppapersize [flyer-page] [A4-flyer]
\input lorem

  \stoptitle

\stoptext

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

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


Re: [NTG-context] background color, was: CMYK Color profile

2019-05-31 Thread Wolfgang Schuster

Benjamin Koppe schrieb am 31.05.2019 um 21:23:

Hi Jan,

yes, I've read these texts once and they played a role in thinking 
about getting into ConTEXt.


Thank you for your answer, now I have something to investigate.

Another follow up question on background colors:

I try to setup the background color by

\setupbackgrounds[page][backgroundcolor=blue]

\setupbackgrounds [paper] [background=color,backgroundcolor=blue]

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

2019-05-31 Thread Benjamin Koppe
makes sense what you write, but as I am not sure about the whole issue, I won't 
bet. ;)



Am 31. Mai 2019 09:40:06 MESZ schrieb Hans Hagen :
>On 5/31/2019 7:56 AM, Jan U. Hasecke wrote:
>
>> There are some limitations in ConTeXt concerning colors as embedded
>> images are not converted, so RGB images are converted only by the
>print
>> shop during printing, which can lead to strange results. I think the
>> only way to control the output is to convert all images to CMYK by
>hand.
>> By doing this you can modify them to get the best results.
>afaik in principle a profile could map rgb onto cmyk
>
>Hans
>
>
>-
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
>-
>___
>If your question is of interest to others as well, please add an 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
>___

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
If your question is of interest to others as well, please add an 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] background color, was: CMYK Color profile

2019-05-31 Thread Benjamin Koppe
Hi Jan,

yes, I've read these texts once and they played a role in thinking about 
getting into ConTEXt.

Thank you for your answer, now I have something to investigate.

Another follow up question on background colors:

I try to setup the background color by

 \setupbackgrounds[page][backgroundcolor=blue]

This works for the actual flyer, but the bleed remains white.

I also tried replacing 'page' with 'paper', but then the whole document has 
white background...

I saw your Hostsharing flyers do also have colors/graphics reaching the edge of 
the flyer, so I figure you ran into the same problem once.

Thanks a lot
De Benny

Am 31. Mai 2019 07:56:02 MESZ schrieb "Jan U. Hasecke" 
:
>Am 30.05.19 um 23:34 schrieb Benjamin Koppe:
>> Hello everyone,
>> 
>> I'm about creating a DIN Lang Folder brochure with ConTEXt. I got
>> everything set up the way I'd like it to. Now that I'm done with the
>> work, I've been told the output pdf should have a CMYK Color profile
>> embedded for the on demand printing service to be able to deal with
>the
>> file...
>> 
>> I am unsure what steps I have to take to make my output pdf compliant
>> with CMYK. I don't even know how I could verify it does indeed have
>> CMYK. Evince doesn't seem to show that info...
>> 
>> So if anybdy of you could give me some hints, that's be wonderful.
>> 
>> Cheers
>> De Benny
>
>Hi Benny,
>
>if you can read German you might find some hints in my articles about
>creating din lang folders
>https://www.hasecke.eu/post/werbemittel-mit-context-gestalten/
>
>On colors read the second part:
>https://www.hasecke.eu/post/wie-wir-bei-hostsharing-mit-context-arbeiten/
>
>Search the mailing list for color profile questions because I had to
>ask
>often to make my things work. ;-)
>
>The wiki contains some hints, too.
>
>
>What you can do is to create a mode like this:
>
>\startmode[fogra39]
>
>\doiffileelse{CoatedFOGRA39.icc}{}{\farbprofilnichtgefunden}
>% This will be printed in log if context does not find the profile for
>% some reason
>
>\definecolor  [hs-logoblau]   [c=1.000, m=0.735, y=0.279, k=0.160]
>
>\definecolor  [hs-dunkelblau] [c=0.844, m=0.544, y=0.070, k=0.000]
>
>\definecolor  [hs-hellblau]   [c=0.468, m=0.220, y=0.086, k=0.002]
>
>\definecolor  [hs-orange] [c=0.127, m=0.832, y=1.000, k=0.042]
>
>\setupcolors[cmyk=yes,rgb=no,]
>
>\setupbackend[
>   format=PDF/X-3:2003,
>   intent={Coated FOGRA39 (ISO 12647-2:2004)},
>   ]
>
>\stopmode
>
>If you call context with --mode=fogra39 you will get these color
>definitions and the defined pdf format with the right profile (intent).
>
>If you download additional icc profiles (eg. the fogra one is missing
>in
>the context distribution) put them here:
>context/tex/texmf-local/colors/icc
>
>In this folder they won't be overwritten by an update.
>
>There are some limitations in ConTeXt concerning colors as embedded
>images are not converted, so RGB images are converted only by the print
>shop during printing, which can lead to strange results. I think the
>only way to control the output is to convert all images to CMYK by
>hand.
>By doing this you can modify them to get the best results.
>
>I hope that helps
>juh
>
>___
>If your question is of interest to others as well, please add an 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
>___

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
If your question is of interest to others as well, please add an 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] chapter-number prefixes on figure, etc, numbers, even in unnumbered section appearing in TOC

2019-05-31 Thread Sanjoy Mahajan
Dear List,

The following, it seems, is a recurring question, which I had hoped to
solve by digging in the test suite
 -- but no luck.

The problem is to have figures, list items, problems, etc. numbered with
a chapter prefix (e.g. Figure 7.18) even in unnumbered sections that
appear in the TOC.

1. Using \subject as the section command, the figure number is correctly
prefixed, but the section itself doesn't appear in the TOC.

2. Using \section, the figure number is also correctly prefixed, and the
section appears in the TOC, but the section gets numbered (e.g. Section
2.7).

In one of the earlier threads, which are "Prefix for figure number lost
in unnumbered subsection"
, "Unnumbered
subject in TOC, numbered exercises in text"
, and
"incrementnumber vs. prefixsegments"
, Hans suggested
looking in the test suite for fine control of the prefix segments.

I have done that, and the best MNWE that I can come up with is a
modification of doc/context/tests/mkiv/sections/figures-001.tex in the
test suite (see code below), but it also fails:

* When incrementnumber=list (as in the code), the TOC lists that
section, but the figure 5 doesn't get a chapter-number prefix.

* When incrementnumber=no (recreating \subject), the TOC is not correct,
but figure 5 gets its prefix.

* And wWhen incrementnumber-yes (recreating \section), the TOC lists
that section, but the section gets a number.

Is there a modification to what I tried that gets all the aspects right
(TOC entry, unnumbered, chapter prefix on figures, etc. within)?

-Sanjoy

The code:

\setupcaption[figure][way=bytext,prefixset=1:2]
\definehead[unnumberedsection][section]
\setuphead [unnumberedsection][incrementnumber=list]

\starttext
\placelist[chapter,section,unnumberedsection]

\chapter{One}
\placefigure{one}{1}

\section{Two}
\placefigure{two}{2}

\chapter{Three}
\placefigure{three}{3}
\placefigure{four}{4}

\unnumberedsection{Four}

\placefigure{five}{5}

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

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


[NTG-context] grid+formulas: bug or expected behavior?

2019-05-31 Thread Luca Donetti
Dear all,
I'm typesetting a document with grid layout and some formulas, like in the
minimal example below:


\setuplayout[grid=yes]
\showgrid

\starttext
\input knuth
%\blank
\startformula
  a = b + c
\stopformula
\input knuth
\stoptext


I don't have any specific need for the alignment of the formula with
respect to the grid, but I expect the text below the formula to be on the
grid. However, I've not been able to achieve that with any of the layout
options described in the latest "details.pdf" manual: in all cases I've
tried the text below the formula doesn't "sit" on the grid.

While I do not understand this behavior, I've thought that it could be the
intended one, because this is what happens in chapter 4 of the "details"
manual. Then, I noticed that in older versions of the same manual (for
example the one included in texlive 2017) the behavior shown in chapter 4
is the one I expect: the text after formulas is aligned to the grid. So I'm
a bit puzzled: should the text after formulas be aligned to the grid or
not? Is this a (known?) bug or intended behavior?

If this is the expected behavior, I can live with that because by trial and
error I found a workaround. If I employ a \blank command before the formula
(as in the commented line in the above example), the text after the formula
is "correctly" aligned.

Thank you in advance.

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

2019-05-31 Thread Saša Janiška
David Nebauer  writes:

> https://github.com/Witiko/markdown is forked from
> https://github.com/jgm/lunamark. Github user "jgm" is John MacFarlane,
> the creator of pandoc, and pandoc itself is hosted on github under
> "jgm" as well: https://github.com/jgm/pandoc.
>
> So, it seems a good bet that https://github.com/Witiko/markdown
> supports pandoc markdown.

Well John MacFarlane is [here](https://commonmark.org/) as well. ;)


Sincerely,
Gour

-- 
While contemplating the objects of the senses, a person
develops attachment for them, and from such attachment lust
develops, and from lust anger arises.

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

2019-05-31 Thread Hans Hagen

On 5/31/2019 7:56 AM, Jan U. Hasecke wrote:


There are some limitations in ConTeXt concerning colors as embedded
images are not converted, so RGB images are converted only by the print
shop during printing, which can lead to strange results. I think the
only way to control the output is to convert all images to CMYK by hand.
By doing this you can modify them to get the best results.

afaik in principle a profile could map rgb onto cmyk

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an 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] Wiki update

2019-05-31 Thread Hans Hagen

On 5/30/2019 9:34 PM, Otared Kavian wrote:

On 30 May 2019, at 12:07, Taco Hoekwater  wrote:
[…]

For example,

  section

outputs a table with the formal calling convention(s) for the \section command. 
Multiple tables actually, as it also outputs the alternative calls with 
different arguments, and it outputs the definition of the internal \*section* 
command, of which \section is an instance. (The parents of instances are 
printed in a slanted font).


This is absolutely magic and extremely useful! Thank you, Wolfgang, Taco and 
Hans!

I wonder whether the magic behind the scenes would allow some day to say
\syntax[section]
within a ConTeXT document… :-)


\usemodule[setups-basics]
\loadsetups[i-context]

\starttext

\basicsetup{section:instance}

\shortsetup{section:instance}

\showsetup {section:instance}

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an 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
___