Re: [NTG-context] Temporary landscape

2010-10-13 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Thank you both for the suggestions. My final code looks like this:

---
\def\PushPaperSize{\edef\PopPaperSize{\setuppapersize[\papersize][\printpapersize]}}

\definehead[subjectLand][subject]
\setuphead[subjectLand][before={\PushPaperSize\page},style=bold]

\setuptyping[Dim][bodyfont=small,style={\ttx\setupinterlinespace}]

\starttext

  \def\T#1#2{
\subjectLand{#1}
\setuppapersize[A4,landscape][A4,landscape]
\typefile[Dim]{../../Statics/Dim/Res/#2.txt}
\typefile[Dim]{../../Statics/Dim/Res/#2.txt} % Just to test (=> more than 
one page)
\typefile[Dim]{../../Statics/Dim/Res/#2.txt} % Just to test (=> more than 
one page)
\page
\PopPaperSize
  }

  \T{A}{ULS-MMax-iDL}

  \T{B}{ULS-MMax-iDL}
  \T{C}{ULS-MMax-iDL}
  \T{D}{ULS-MMax-iDL}

  AAA

\stoptext

---

I'd have one more question about page layout - let's have the following code:

---
\showframe

\starttext
  AAA
  \page
  \setuppapersize[A4,landscape][A4,landscape]
  BBB
  \page
  \setuppapersize[A4,landscape][A4,landscape]
  \setuplayout[topspace=3in] % How to change text height to keep the bottom 
print range?
  CCC
\stoptext
---

In this example, I changed the topsize by 2in, i.e. 3in (new value) - 1in 
(default = previous value). And I want to shorten the textheight by the same 
difference, i.e. by 2in (i.e. to keep the bottom range of print space).

I know that I can set textheight directly - but I don't want to do so, I want 
this value to be computed from the change of the topsize. Is it possible 
somehow?

Moreover, would it be possible by Lua code? Something like this (pseudo)code:

---
\startluacode
  local ts, th = context.topspace, context.textheight
  local dif = 72 -- 72bp = 1in
 -- Or to call a conversion routine, e.g. in2bp(1), if it 
exists?

  ts = ts + dif
  th = th - dif

  context(string.format("\\setuplayout[topspace=%i,textheight=%i]", ts, th))

  -- or: context.setuplayout{topspace=ts, textheight=th}
\stopluacode
---

Best regards,

Lukas


On Wed, 13 Oct 2010 16:03:33 +0200, Aditya Mahajan  wrote:


On Wed, 13 Oct 2010, Hans Hagen wrote:


On 13-10-2010 3:22, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

Hello,

I need to typeset contents of a wide file. This works:

---
\starttext

\setuppapersize[A4,landscape][A4,landscape]
\typefile[Dim]{Cha-MMax-iDL.txt}

\page

% RESTORE ORIGINAL PAGE SETTINGS

AAA

\stoptext


You can wikify this:

\setuplayout
 [location=middle]

\showframe

\def\PushPaperSize
 {\edef\PopPaperSize{\setuppapersize[\papersize][\printpapersize]}}

\starttext
   \setuppapersize[A4][A3]
   test \page
   \PushPaperSize
   \setuppapersize[A4,landscape][A3,landscape]
   test \page
   \PopPaperSize
   test \page
\stoptext


From my to be completed TUGboat article:

\section {Changing paper size within a document}

To get one page (containing a table or a figure) in landscape
mode, you can use \type{\adaptpapersize}. For example,

\starttyping
\definepapersize[main] [A4] [A4]
\definepapersize[extra][A4,landscape]
[A4,landscape]

\setuppapersize[main]
\starttext
 Page 1. Potrait \page
 Page 2. Potrait \page
 \adaptpapersize[extra]
 Page 3. Landscape \page
 Page 4. Potrait \page
\stoptext
\stoptyping

If you have a full page figure that you want to include in a landscape
paper, you can combine \type{\adaptpapersize} with \CONTEXT's postponing
mechanism.

\starttyping
   \startpostponing
 \adaptpapersize[extra]
 \placefigure
   [here]
   [fig:reference]
   {The caption of the figure}
   {\extrenalgraphics[full-page-figure]}
 \page
   \stoppostponing
\stoptyping

The \type{postponing} environment postpones the figure until the next
page. When the new page starts, \type{\adaptpapersize} changes to
landscape mode. The \type{\page} is the end is to make sure even if some
place is remaining on the page, we do not get any text there.

To get more than one page in landscape, you can reuse
\type{\setuppapersize}.
For example,

\starttyping
\definepapersize[main] [A4] [A4]
\definepapersize[extra][A4,landscape]
[A4,landscape]

\setuppapersize[main]
\starttext
 Page 1. Potrait \page
 Page 2. Potrait \page
\setuppapersize[extra]
 Page 3. Landscape \page
 Page 4. Landscape \page
\setuppapersize[main]
 Page 5. Potrait \page
 Page 6. Potrait \page
\stoptext
\stoptyping


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
___


Re: [NTG-context] Temporary landscape

2010-10-13 Thread Aditya Mahajan

On Wed, 13 Oct 2010, Hans Hagen wrote:


On 13-10-2010 3:22, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

Hello,

I need to typeset contents of a wide file. This works:

---
\starttext

\setuppapersize[A4,landscape][A4,landscape]
\typefile[Dim]{Cha-MMax-iDL.txt}

\page

% RESTORE ORIGINAL PAGE SETTINGS

AAA

\stoptext


You can wikify this:

\setuplayout
 [location=middle]

\showframe

\def\PushPaperSize
 {\edef\PopPaperSize{\setuppapersize[\papersize][\printpapersize]}}

\starttext
   \setuppapersize[A4][A3]
   test \page
   \PushPaperSize
   \setuppapersize[A4,landscape][A3,landscape]
   test \page
   \PopPaperSize
   test \page
\stoptext


From my to be completed TUGboat article:

\section {Changing paper size within a document}

To get one page (containing a table or a figure) in landscape
mode, you can use \type{\adaptpapersize}. For example,

\starttyping
\definepapersize[main] [A4] [A4]
\definepapersize[extra][A4,landscape]
   [A4,landscape]

\setuppapersize[main]
\starttext
Page 1. Potrait \page
Page 2. Potrait \page
\adaptpapersize[extra]
Page 3. Landscape \page
Page 4. Potrait \page
\stoptext
\stoptyping

If you have a full page figure that you want to include in a landscape 
paper, you can combine \type{\adaptpapersize} with \CONTEXT's postponing 
mechanism.


\starttyping
  \startpostponing
\adaptpapersize[extra]
\placefigure
  [here]
  [fig:reference]
  {The caption of the figure}
  {\extrenalgraphics[full-page-figure]}
\page
  \stoppostponing
\stoptyping

The \type{postponing} environment postpones the figure until the next 
page. When the new page starts, \type{\adaptpapersize} changes to 
landscape mode. The \type{\page} is the end is to make sure even if some 
place is remaining on the page, we do not get any text there.


To get more than one page in landscape, you can reuse 
\type{\setuppapersize}.

For example,

\starttyping
\definepapersize[main] [A4] [A4]
\definepapersize[extra][A4,landscape]
   [A4,landscape]

\setuppapersize[main]
\starttext
Page 1. Potrait \page
Page 2. Potrait \page
\setuppapersize[extra]
Page 3. Landscape \page
Page 4. Landscape \page
\setuppapersize[main]
Page 5. Potrait \page
Page 6. Potrait \page
\stoptext
\stoptyping


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
___


Re: [NTG-context] Temporary landscape

2010-10-13 Thread Hans Hagen

On 13-10-2010 3:22, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

Hello,

I need to typeset contents of a wide file. This works:

---
\starttext

\setuppapersize[A4,landscape][A4,landscape]
\typefile[Dim]{Cha-MMax-iDL.txt}

\page

% RESTORE ORIGINAL PAGE SETTINGS

AAA

\stoptext


You can wikify this:

\setuplayout
  [location=middle]

\showframe

\def\PushPaperSize
  {\edef\PopPaperSize{\setuppapersize[\papersize][\printpapersize]}}

\starttext
\setuppapersize[A4][A3]
test \page
\PushPaperSize
\setuppapersize[A4,landscape][A3,landscape]
test \page
\PopPaperSize
test \page
\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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
___


[NTG-context] Temporary landscape

2010-10-13 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

I need to typeset contents of a wide file. This works:

---
\starttext

  \setuppapersize[A4,landscape][A4,landscape]
  \typefile[Dim]{Cha-MMax-iDL.txt}

  \page

  % RESTORE ORIGINAL PAGE SETTINGS

  AAA

\stoptext
---

And I'd like to find out how to restore previous page settings.

I guess I could call something like "\setuppapersize[A4][A4]" at the place of 
"RESTORE ORIGINAL PAGE SETTINGS", but I'd rather something independent (now I'd have to 
suppose that previous page is of A4 format).

I'm thinking about like enclosing the

  \setuppapersize[A4,landscape][A4,landscape]
  \typefile[Dim]{../../Statics/Dim/Res/Cha-MMax-iDL.txt}

into an environment or something.

Maybe something like \setupenvironment[MyEnv][...] in the preamble and later

  \startenvironment[MyEnv]
\setuppapersize[A4,landscape][A4,landscape]
\typefile[Dim]{../../Statics/Dim/Res/Cha-MMax-iDL.txt}
  \stopenvironment

Is there something like that? (Wiki: 
http://wiki.contextgarden.net/Reference/en/startenvironment is a bit empty.)

Lukas


--
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 244 062 238
Fax: +420 244 461 038;-+
; Ponton (R) "B" - Beam v1.3d/2010-10-13, (C) 2002-2010 Ing. Lukas Prochazka, 
Pontex s. r. o. |
;-+
;
; Sec.Name  P. LC.Name  Cat.   N  Mx.Cen  My.Cen   Con.A  Con.Sig- 
C.Sg-.Per  Re.AAr/A   Re.Sig+ R.Sg+.Per  M. Flags Use
;---
  .000   1Cha-MMax 1   0   0   0   8.947 0  
 -18.000 0  0.000% 0   400.000   1     ?
  .325   1Cha-MMax 1 -0.0003  0.0159   0   8.947 -0.060590  
 -18.000  0.051472  0.575% 3.239   400.000   1    0.810%
  .650   1Cha-MMax 1 -0.0005  0.0636   0   8.947 -0.242535  
 -18.000  0.051472  0.575%13.000   400.000   1     3.25%
  0001.350   1Cha-MMax 1  0.0231  -2.081   0   8.947-3.911  
 -18.000  0.051472  0.575%66.217   400.000   1     21.7%
  0002.050   1Cha-MMax 1  0.0086  -4.221   0   8.947-7.934  
 -18.000  0.051472  0.575%   133.961   400.000   1     44.1%
  0002.750   1Cha-MMax 1  0.0080  -5.799   0   8.947   -10.899  
 -18.000  0.051472  0.575%   183.979   400.000   1     60.6%
  0003.450   1Cha-MMax 1  0.0074  -7.376   0   8.947   -13.864  
 -18.000  0.051472  0.575%   233.997   400.000   1     77.0%
  0004.150   1Cha-MMax 1  0.0069  -8.358   0   8.947   -15.709  
 -18.000  0.051472  0.575%   265.119   400.000   1     87.3%
  0004.850   1Cha-MMax 1  0.0063  -9.339   0   8.947   -17.554  
 -18.000  0.051472  0.575%   296.241   400.000   1     97.5%
  0005.550   1Cha-MMax 1  0.0057  -9.638   0   8.947   -18.115  
 -18.000  0.051472  0.575%   305.712   400.000   1  .C..  100.6%
  0006.250   1Cha-MMax 1  0.0051  -9.937   0   8.947   -18.677  
 -18.000  0.051472  0.575%   315.183   400.000   1  .C..  103.8%
  0006.950   1Cha-MMax 1  0.0046  -9.616   0   8.947   -18.074  
 -18.000  0.051472  0.575%   305.003   400.000   1  .C..  100.4%
  0007.650   1Cha-MMax 1  0.0040  -9.295   0   8.947   -17.471  
 -18.000  0.051472  0.575%   294.823   400.000   1     97.1%
  0008.350   1Cha-MMax 1  0.0034  -8.368   0   8.947   -15.729  
 -18.000  0.051472  0.575%   265.420   400.000   1     87.4%
  0009.050   1Cha-MMax 1  0.0028  -7.441   0   8.947   -13.986  
 -18.000  0.051472  0.575%   236.017   400.000   1     77.7%
  0009.750   1Cha-MMax 1  0.0023  -5.861   0   8.947   -11.017  
 -18.000  0.051472  0.575%   185.903   400.000   1     61.2%
  0010.450   1Cha-MMax 1  0.0017  -4.281   0   8.947-8.047  
 -18.000  0.051472  0.575%   135.788   400.000   1     44.7%
  0011.150   1Cha-MMax 1  0.0011  -2.109   0   8.947-3.964  
 -18.000  0.051472  0.575%66.888   400.000   1     22.0%
  0011.850   1Cha-MMax 1  0.0005  0.0636   0   8.947 -0.243019  
 -18.000  0.051472  0.575%13.089   400.000   1     3.27%
  0012.175   1Cha-MMax 1  0.0003  0.0159   0   8.947 -0.060832  
 -18.000  0.051472  0.575% 3.283   400.000   1    0.821%
  0012.500   1Cha-MMax 1   0   0   0   8.947 0  
 -18.000 0  0.000% 0   400.000   1     ?
;--