[NTG-context] unwanted head behavior

2016-04-04 Thread Zhichu Chen









Dear Hans and Wolfgang,

The following code generates a pdf that I cannot understand.

1. Although "placehead" is set to "no," the \part macro still makes an empty 
line.
2. The first \chapter does not open a new page, but if we switch the first 
\title
and the first \chapter, the result seems to be all right.

Is there a simple fix?

Thanks in advance.

==
\setuphead
  [part,chapter,title,section]
  [continue=yes,page=yes,number=no]

\setuphead[part][placehead=no]


\showframe

\starttext

\input ward\page

\part{TITLE}\input ward\par
\title{Title}
\chapter{Title}
\chapter{Title}
\title{Title}
\chapter{Title}

\stoptext
==

ConTeXt minimal information:

zhichu  ~  context -version

mtx-context | ConTeXt Process Management 0.63
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2016.03.26 13:51
 zhichu  ~  luatex -version
This is LuaTeX, Version beta-0.90.0 (TeX Live 2016)

Execute  'luatex --credits'  for credits and version details.

There is NO warranty. Redistribution of this software is covered by
the terms of the GNU General Public License, version 2 or (at your option)
any later version. For more information about these matters, see the file
named COPYING and the LuaTeX source.

LuaTeX is Copyright 2016 Taco Hoekwater and the LuaTeX Team.

 zhichu  ~ 

--
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888



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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] duplex printing and doublesided

2016-04-04 Thread Pablo Rodriguez
On 04/04/2016 11:35 AM, Wolfgang Schuster wrote:
>> Pablo Rodriguez 2. April 2016 um 20:29
>>
>> Wolfgang, this was my original sample:
>>
>> \setuppagenumbering[alternative=doublesided]
>> \setupinteractionscreen[option=portrait]
>> \starttext
>> No duplex printing.
>> \page[right]
>> In this document.
>> \stoptext
>>
>> The doublesided alternative disables duplex printing.
>>
>> Hans wrote about portrait and landscape as directives. I guess they
>> should be invoked with \enabledirective, but I don’t know how.
>
> No, the option key for \setupinteractionscreen is correct but there are
> a few problems.

Many thanks for your reply, Wolfgang.

> 1. When you have a doublesided document the “portrait” option loads the
> values of the doublesided option.

I’m afraid I must be missing something. If I remove the first line from
the sample above, I don’t get the third page.

> 2. Since you can set only one argument for the option key context has to
> set a values for the PDF document which means you can set the zoom value and
> dupley print option at the same time. A better solution would be to assign 
> each
> option only a certain function and allow one to set
> \setupinteractionscreen[option={doublesided,portrait}].

I’d say this is redundant. "portrait" is duplex printing flipping the
long side.

The issue comes from having one key for five values and also from mixing
viewing options with printer options (the PDF spec shelters them in the
viewer preferences dictionary).

In this case, doublesided sets layout "TwoColumnRight" (which is a
display setup) disabling also duplex and fixed printing (which are
printing setups).

As I proposed before (but Hans is busy with other issues), there should
be four different keys in \setupinteraction (when not moving them to a
new \setupprinting command):

duplex  page portrait landscape

fixed   (no value is required)

copies  number

pdfpapersizeyes no

I’d love to contribute the patch myself, but Lua is totally unknown to
me. I have tried to adapt lpdf-mis.lua, but this is beyond my knowledge.

So I will have to wait until the new keys are implemented :-(.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] How to get the current section level?

2016-04-04 Thread Procházka Lukáš Ing .

... That's it, thank you!

Lukas


On Mon, 04 Apr 2016 11:30:15 +0200, Wolfgang Schuster 
 wrote:


Lukáš Procházka 
3. April 2016 um 22:02
Hello,

is there a (Lua) way how to get the current section level?

\startsetups[headinformation]
 \starttabulate
 \NC Name  \EQ \currenthead  \NC\NR
 \NC Level \EQ \currentheadlevel \NC\NR
 \stoptabulate
\stopsetups

\setuphead[chapter,section,subsection,subsubsection][after=\directsetup{headinformation}]

\starttext

\chapter{Chapter}
\section{Section}
\subsubsection{Subsubsection}

\stoptext

Wolfgang




--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] deprecated startMPenvironment

2016-04-04 Thread Wolfgang Schuster

Meer, Hans van der 
4. April 2016 um 11:48


On 04 Apr 2016, at 00:12, Hans Hagen > wrote:


On 4/3/2016 4:07 PM, Meer, Hans van der wrote:

Previously I could do the following

\starttext
\startMPenvironment[+]\switchtobodyfont[small]\stopMPenvironment
\startMPpage
% metafont code
\stopMPpage
\stoptext
\endinput

This is called by context --run --once etc. producing the figure and 
in this case modifying the font to a smaller size. Note, the context 
call occurs on the fly inside a \directlua{{os.execute(..)}. You may 
find this complicated, but it works for me and I would rather like 
not having to change may things all over the place.


Now I learn from the ConTeXtgarden that startMPenvironment is 
deprecated and that I should use defineMPinstance and 
setupMPinstance instead.

Thus I tried

\defineMPinstance[mp:local][metafun][setups=mp:smallfont,textcolor=red]
\startsetups mp:smallfont
\switchtobodyfont[small]
\stopsetups
\startMPpage  and also \startMPpage[mp:local]
% metafont code
\stopMPpage
\stoptext
\endinput

But nothing happens. How do I get the effect earlier obtained with 
startMPenvironment without having to rely an a deprecated macro?


the bodyfont environment was needed because we had to communicate to 
the external mp run what the intended settings were
in mkiv the run is internal so the mp text generator adapts to the 
current settings and there is no need to pass anything




Indeed, I can see the effect of mp functioning inside mkiv. But there 
is still something I do not understand.


I get small italic text doing this:

\startMPenvironment[+]
\switchtobodyfont[small]
\it
\stopMPenvironment


But italic only doing:

%\startMPenvironment[+]
\switchtobodyfont[small]
\it
%\stopMPenvironment


How is that possible?

Please send complete examples and not only snippets.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] deprecated startMPenvironment

2016-04-04 Thread Meer, Hans van der


On 04 Apr 2016, at 00:12, Hans Hagen > 
wrote:

On 4/3/2016 4:07 PM, Meer, Hans van der wrote:
Previously I could do the following

\starttext
\startMPenvironment[+]\switchtobodyfont[small]\stopMPenvironment
\startMPpage
% metafont code
\stopMPpage
\stoptext
\endinput

This is called by context --run --once etc. producing the figure and in this 
case modifying the font to a smaller size. Note, the context call occurs on the 
fly inside a \directlua{{os.execute(..)}. You may find this complicated, but it 
works for me and I would rather like not having to change may things all over 
the place.

Now I learn from the ConTeXtgarden that startMPenvironment is deprecated and 
that I should use defineMPinstance and setupMPinstance instead.
Thus I tried

\defineMPinstance[mp:local][metafun][setups=mp:smallfont,textcolor=red]
\startsetups mp:smallfont
\switchtobodyfont[small]
\stopsetups
\startMPpage  and also \startMPpage[mp:local]
% metafont code
\stopMPpage
\stoptext
\endinput

But nothing happens. How do I get the effect earlier obtained with 
startMPenvironment without having to rely an a deprecated macro?

the bodyfont environment was needed because we had to communicate to the 
external mp run what the intended settings were
in mkiv the run is internal so the mp text generator adapts to the current 
settings and there is no need to pass anything


Indeed, I can see the effect of mp functioning inside mkiv. But there is still 
something I do not understand.

I get small italic text doing this:

\startMPenvironment[+]
\switchtobodyfont[small]
\it
\stopMPenvironment

But italic only doing:

%\startMPenvironment[+]
\switchtobodyfont[small]
\it
%\stopMPenvironment

How is that possible?

Hans van der Meer

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] duplex printing and doublesided

2016-04-04 Thread Wolfgang Schuster

Pablo Rodriguez 
2. April 2016 um 20:29

Wolfgang, this was my original sample:

\setuppagenumbering[alternative=doublesided]
\setupinteractionscreen[option=portrait]
\starttext
No duplex printing.
\page[right]
In this document.
\stoptext

The doublesided alternative disables duplex printing.

Hans wrote about portrait and landscape as directives. I guess they
should be invoked with \enabledirective, but I don’t know how.
No, the option key for \setupinteractionscreen is correct but there are 
a few problems.


1. When you have a doublesided document the “portrait” option loads the 
values

   of the doublesided option.

2. Since you can set only one argument for the option key context has to 
set a values
   for the PDF document which means you can set the zoom value and 
dupley print
   option at the same time. A better solution would be to assign each 
option only a certain
   function and allow one to set 
\setupinteractionscreen[option={doublesided,portrait}].


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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] How to get the current section level?

2016-04-04 Thread Wolfgang Schuster

Lukáš Procházka 
3. April 2016 um 22:02
Hello,

is there a (Lua) way how to get the current section level?

\startsetups[headinformation]
\starttabulate
\NC Name  \EQ \currenthead  \NC\NR
\NC Level \EQ \currentheadlevel \NC\NR
\stoptabulate
\stopsetups

\setuphead[chapter,section,subsection,subsubsection][after=\directsetup{headinformation}]

\starttext

\chapter{Chapter}
\section{Section}
\subsubsection{Subsubsection}

\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___