Re: [NTG-context] Size of the last shipped page by Lua?

2016-09-07 Thread Hans Hagen

On 9/7/2016 9:39 PM, josephcan...@gmail.com wrote:


There are dimensions related to this :

local paper_width = tex.getdimen('paperwidth')

local paper_height = tex.getdimen('paperheight')

There is also :

tex.pageheight
tex.pagewidth


don't mess with these and don't rely on them


Not sure these are always same. Hope this helps,


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

Re: [NTG-context] Size of the last shipped page by Lua?

2016-09-07 Thread josephcanedo
Hi,

There are dimensions related to this :

local paper_width = tex.getdimen('paperwidth')
local paper_height = tex.getdimen('paperheight')

There is also :

tex.pageheight
tex.pagewidth 

Not sure these are always same. Hope this helps,

Regards,

Joseph Canedo

De : Procházka Lukáš Ing.___
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
___

[NTG-context] Placement of numbers in numbered equations on the left

2016-09-07 Thread Otared Kavian
Hi Hans,

Thank you for having fixed the issue with numbered equations in math aligned 
environment, noticed and reported by Mikael Sundqvist. 
However the problem is solved only when the numbers are on the right: when the 
numbers are on the left, there is still a discrepancy between the location of 
numbers in equations numbered in an aligned environment and those which are by 
themselves.
Please have a look at the attached PDF which is the result of the following 
example (using ConTeXt  ver: 2016.09.06 19:11 MKIV beta).
Best regards: OK

%%% begin math-align.tex
\starttext
\placeformula
\startformula
\startalign
\NC \exp(t_1)\exp(t_2)\NC = x_1x_2=\exp(\log(x_1x_2))\NR
\NC \NC =\exp(\log x_1+\log x_2) = \exp(t_1+t_2).\NR[eq:explag1]
\stopalign
\stopformula

\placeformula
\startformula
1+1=2
\stopformula

\setupformulas[location=left]
with \type{\setupformulas[location=left]}

\placeformula
\startformula
\startalign
\NC \exp(t_1)\exp(t_2)\NC = x_1x_2=\exp(\log(x_1x_2))\NR
\NC \NC =\exp(\log x_1+\log x_2) = \exp(t_1+t_2).\NR[eq:explag1]
\stopalign
\stopformula

\placeformula
\startformula
2+3=5
\stopformula
\stoptext
%%% end math-align.tex



math-align.pdf
Description: Adobe PDF document



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

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

[NTG-context] Size of the last shipped page by Lua?

2016-09-07 Thread Procházka Lukáš Ing .

Hello,

is there a way to detect by Lua what is the size (width and height) of the last 
shipped page?

Especially I'm interested in the situation when page via \start/\stopTEXpage 
has been shipped, like:


\startluacode
  LastPageSize = function()
-- What to come here?
return w, h
  end
\stopluacode

\starttext
  \startluacode
 local w, h = LastPageSize()

 context("w="..w .. ", h=" ..h) -- Should give "w=210mm, h=297mm" (or other 
units)
  \stopluacode

  \startTEXpage[with=10cm,height=15cm]
  \stopTEXpage

  \startluacode
 local w, h = LastPageSize()

 context("w="..w .. ", h=" ..h) -- Should give "w=100mm, h=150mm" (or other 
units)
  \stopluacode
\stoptext


This would be very useful when I need to insert a page of size of the last page 
to move to odd page when A4 and A3 pages are mixed, to allow simple duplex 
printing on the printer.

So - how about 'LastPageSize()' function?

Best regards,

Lukas


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

Tel: +420 241 096 751 (+420 720 951 172)
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] Indentation after margin float with caption

2016-09-07 Thread Aditya Mahajan

On Tue, 6 Sep 2016, Mikael P. Sundqvist wrote:


\unprotect
\def\page_one_place_float_auto
{\page_one_place_float_otherwise\nonoindentation}
\def\page_one_place_float_bottom
{\page_one_place_float_otherwise\nonoindentation}
\def\page_one_place_float_margin
{\page_margin_blocks_process_float\nonoindentation}
\def\page_one_place_float_leftmargin
{\page_one_place_float_side_indeed\page_sides_process_float_leftmargin\nonoindentation}
\def\page_one_place_float_rightmargin{\page_one_place_float_side_indeed\page_sides_process_float_rightmargin\nonoindentation}
\protect


Actually, this should be:


\unprotect
\def\page_one_place_float_auto 
{\page_one_place_float_otherwise\useindentnextparameter\floatparameter}
\def\page_one_place_float_bottom 
{\page_one_place_float_otherwise\useindentnextparameter\floatparameter}
\def\page_one_place_float_margin 
{\page_margin_blocks_process_float\useindentnextparameter\floatparameter}
\def\page_one_place_float_leftmargin 
{\page_one_place_float_side_indeed\page_sides_process_float_leftmargin\useindentnextparameter\floatparameter}

\def\page_one_place_float_rightmargin{\page_one_place_float_side_indeed\page_sides_process_float_rightmargin\useindentnextparameter\floatparameter}
\protect

so that indentation is not forced, rather depends on indentnext key.

Aditya
___
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
___