Re: [NTG-context] grid snapping problem

2016-12-06 Thread Csikos Bela
>I would like to use grid snapping in my document: main text lines
>should be aligned to grid lines but figure caption text should not.
>
>I have this code:
>
>\setuplayout[grid=yes]
>\showgrid
>
>\setupcaptions[width=fit,align=last,headstyle={\ss\bfx},style={\ss\tfx}]
>
>\starttext
>\subsection{Subsection title}
>\input dawkins
>\input dawkins
>
>%startlinecorrection
>\startbaselinecorrection  \setuplocalinterlinespace[line=2.2ex]
>\placefigure[][]{\input zapf 
>}{\framed[width=0.6\textwidth,height=10ex]{figure}}
>\stopbaselinecorrection
>%stoplinecorrection
>
>\subsection{Subsection title}
>\input dawkins
>\subsection{Subsection title}
>\input dawkins
>\input dawkins
>\stoptext
>
>You can see that the caption is typeset as I wanted: smaller line height
>and it is not aligned to grid lines. But the main text after the figure is not
>aligned to the grid on the same page. How can I correct this?
>On the next page the main text is snapped to the grid again.

Since I haven't got any answer to my question I think the code above contains
some obvious error, but I don't know what. What do I do wrong? Or is it just
not possible to achieve what I want? 

Thank you,

bcsikos

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

2016-12-06 Thread Willi Egger
Apart from the link given you might also read the Metafun manual and parts of 
the Details manual.

Willi
> On 22 Nov 2016, at 14:04, Henri Menke  wrote:
> 
> On 11/21/2016 07:44 PM, Jaroslav Hajtmar wrote:
>> Hello ConTeXist.
>> 
>> Is there any documentation or manual, where I could read some details about 
>> using of overlays and layers in ConTeXt? I see on the Internet and wiki 
>> ConTeXtgarden some examples, but I would be interested in details relating 
>> to the default layers and their names, their order. Are there any 
>> restrictions (number, name, etc.)
> 
> https://github.com/contextgarden/context-mirror/blob/beta/tex/context/base/mkiv/pack-box.mkiv
> 
> Ctrl+F definelayer
> 
> Documentation is provided inline.
> 
>> 
>> Thanx
>> 
>> Jaroslav Hajtmar
>> 
>> 
>> 
>> ___
>> If your question is of interest to others as well, please add an 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
>> ___
>> 
> 
> ___
> If your question is of interest to others as well, please add an 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
> ___

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

2016-12-06 Thread Henri Menke
The following should do the trick.  However, you have to keep \setnostrut and 
\setstrut around the figure because the before and after keys for captions are 
not (yet) implemented.

\setuplayout[grid=yes]
\showgrid

\starttexdefinition caption:text #1
  \setuplocalinterlinespace[line=2.2ex] #1
\stoptexdefinition

\setupcaptions
  [
width=fit,
align=last,
headstyle={\ss\bfx},
style={\ss\tfx},
before={\setnostrut},
textcommand=\getvalue{caption:text},
  ]

\starttext

\startsubsection[title={Subsection title}]
  \input dawkins
  \input dawkins

  \setnostrut
  \startplacefigure
[title={\input zapf }]
\framed[width=0.6\textwidth,height=10ex]{figure}
  \stopplacefigure
  \setstrut

\stopsubsection

\startsubsection[title={Subsection title}]
  \input dawkins
\stopsubsection

\startsubsection[title={Subsection title}]
  \input dawkins
  \input dawkins
\stopsubsection

\stoptext

On 12/06/2016 07:06 PM, Csikos Bela wrote:
>> I would like to use grid snapping in my document: main text lines
>> should be aligned to grid lines but figure caption text should not.
>>
>> I have this code:
>>
>> \setuplayout[grid=yes]
>> \showgrid
>>
>> \setupcaptions[width=fit,align=last,headstyle={\ss\bfx},style={\ss\tfx}]
>>
>> \starttext
>> \subsection{Subsection title}
>> \input dawkins
>> \input dawkins
>>
>> %startlinecorrection
>> \startbaselinecorrection  \setuplocalinterlinespace[line=2.2ex]
>> \placefigure[][]{\input zapf 
>> }{\framed[width=0.6\textwidth,height=10ex]{figure}}
>> \stopbaselinecorrection
>> %stoplinecorrection
>>
>> \subsection{Subsection title}
>> \input dawkins
>> \subsection{Subsection title}
>> \input dawkins
>> \input dawkins
>> \stoptext
>>
>> You can see that the caption is typeset as I wanted: smaller line height
>> and it is not aligned to grid lines. But the main text after the figure is 
>> not
>> aligned to the grid on the same page. How can I correct this?
>> On the next page the main text is snapped to the grid again.
> 
> Since I haven't got any answer to my question I think the code above contains
> some obvious error, but I don't know what. What do I do wrong? Or is it just
> not possible to achieve what I want? 
> 
> Thank you,
> 
> bcsikos
> 
> ___
> If your question is of interest to others as well, please add an 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
> ___
> 

___
If your question is of interest to others as well, please add an 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] hbox after \page[disable]

2016-12-06 Thread Michael Eidenbenz

> Am 05.12.2016 um 22:21 schrieb Hans Hagen :
> 
> On 12/5/2016 9:32 PM, Michael Eidenbenz wrote:
>> Ok I got it.
>> 
>> page[disable] is not taken into account by page[odd] so I changed it in
>> page-brk.mkiv:
>> 
>>  \installpagebreakmethod \v!odd
>>  {\relax\ifconditional\c_page_breaks_enabled
>>   \page
>>   \doifelseoddpage\donothing\page_reset_marks_and_insert_dummy
>>   \else
>>   \resetpagebreak
>>   \fi}
>> 
>> with this my MWE works perfectly.
> 
> isn't that just
> 
> \definepagebreak[mypagebreak][yes,odd,reset]
> 
> and then
> 
> \page[mypagebreak]


hmm. 
I can't see that [yes, odd, reset] implements the conditional I need to 
override page[odd]. (see code comments below)
but I guess the real problem occurs because I have to inject this in  
\everyafteroutput.


\newtoks \EvenPage

\appendtoks
\the\EvenPage
\global\EvenPage\emptytoks
\page[odd]   % will be overridden by page[disable] 
\to\everyafteroutput

\unexpanded\def\Figure#1{%
\appendtoks
\page[even]
#1
\page
\page[disable] %disable the next \page[odd] because else it will insert
\to\EvenPage}


> 
>> But will this break other things?
>> I dont really know what I'm doing just hacking.
>> 
>> Michael
>> 
>> -
>> 
>> \enabletrackers
>> [visualizers.hbox]
>> 
>> \useMPlibrary[dum]
>> 
>> \setuppagenumbering
>> [alternative=doublesided]
>> 
>> \definelayout[odd][width=10cm]
>> \definelayout[even][width=15cm]
>> 
>> \newtoks \EvenPage
>> 
>> \appendtoks
>> \the\EvenPage
>> \global\EvenPage\emptytoks
>> \page[odd]
>> \to\everyafteroutput
>> 
>> \unexpanded\def\Figure#1{%
>> \appendtoks
>> \page[even]
>> #1
>> \page
>> \page[disable] %disable the next \page[odd]
>> \to\EvenPage}
>> 
>> \showframe
>> 
>> \starttext
>> 
>> \dorecurse{4}{\input{tufte}\par}
>> 
>> \Figure{\externalfigure[dummy][factor=fit]}
>> \dorecurse{4}{\input{knuth}\par}
>> \Figure{\externalfigure[dummy][height=\textheight]}  %
>> \dorecurse{8}{\input{ward}\par}
>> \stoptext
>> 
>> 
>>> Am 04.12.2016 um 21:14 schrieb Michael Eidenbenz :
>>> 
>>> Dear Hans,
>>> 
>>> thank you for your answer, but it doesnt solve the issue.
>>> (or I dont understand what you mean)
>>> 
>>> the argument in the macro is acually (not in the MWE) a xtable filled with 
>>> \externalfigures.
>>> so I would like to avoid floats as it makes things more complicated and 
>>> slower.
>>> 
>>> I tried finding the \page[disable] definition in the code but could not 
>>> find it.
>>> 
>>> any further suggestions how I can solve this issue?
>>> 
>>> thanks Michael
>>> 
>>> 
>>> 
 Am 04.12.2016 um 18:13 schrieb Hans Hagen :
 
 On 12/4/2016 2:12 PM, Michael Eidenbenz wrote:
> I have a doublesided layout.
> On the right side i place the text, figures (if i have any) go on the 
> left side.
> the MWE below works quite nice.
> 
> But if i want the figure to be full height, two pages are skipped.
> This is becaus the hbox right below of the figure.
> I think it is placed during the \page[disable] pass.
> 
> What can I do to avoid this hbox?
 
 \def\Figure#1{\placefigure[location={page,none}]{}{#1}}
 
 
> Thanks Michael
> 
> 
> \enabletrackers
> [visualizers.hbox]
> 
> \useMPlibrary[dum]
> 
> \setuppagenumbering
> [alternative=doublesided]
> 
> \definelayout[odd][width=10cm]
> \definelayout[even][width=15cm]
> 
> \newtoks \EvenPage
> 
> \appendtoks
> \the\EvenPage
> \global\EvenPage\emptytoks
> \page[odd]
> \to\everyafteroutput
> 
> \unexpanded\def\Figure#1{%
> \appendtoks
> \page[even]
> #1
> \page[disable]
> \to\EvenPage}
> 
> \showframe
> 
> \starttext
> 
> \dorecurse{4}{\input{tufte}\par}\page
> \Figure{\externalfigure[dummy][factor=fit]}
> \dorecurse{4}{\input{knuth}\par}\page
> \Figure{\externalfigure[dummy][height=\textheight]}  %
> \dorecurse{8}{\input{ward}\par}
> \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
> ___
> 
 
 
 --
 
 -
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
 -
 

[NTG-context] interlinespace for \setuplist

2016-12-06 Thread Pablo Rodriguez
Hans,

I have the following sample:

\setuppapersize[A5]
\setupinterlinespace[line=4em]
\startsetups[interlinesp:section]
\setupinterlinespace[line=3em]
\stopsetups
\startsetups[interlinesp:subsection]
\setupinterlinespace[line=2.8em]
\stopsetups
\setuplist[section][style=\scb, setups=interlinesp:section]
\setuplist[subsection]
[style=\itx, alternative=d, pagenumber=no, headnumber=no,
setups=interlinesp:subsection]
\starttext
\completecontent
\section{Zweites Hauptstück. Von der Deduction der reinen
Verstandesbegriffe}\dorecurse{5}{\subsection{Erster Abschnitt. Von
den Principien einer transscendentalen Deduction überhaupt}}
\stoptext

I’m afraid interlinespace for \setuplist cannot be set even using setups
(no matter which alternative \setuplist uses).

As you did with \setupnote, would it be possible to implement a
interlinespace key in \setuplist?

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an 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
___