ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Procházka Lukáš Ing. - Pontex s. r. o." <LPr@pontex.cz>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: Temporary landscape
Date: Wed, 13 Oct 2010 17:12:08 +0200	[thread overview]
Message-ID: <op.vkisiiretpjj8f@lpr> (raw)
In-Reply-To: <alpine.LNX.2.01.1010131001590.6337@ybpnyubfg.ybpnyqbznva>

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 <adityam@umich.edu> 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
___________________________________________________________________________________


      reply	other threads:[~2010-10-13 15:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13 13:22 Procházka Lukáš Ing. - Pontex s. r. o.
2010-10-13 13:50 ` Hans Hagen
2010-10-13 14:03   ` Aditya Mahajan
2010-10-13 15:12     ` Procházka Lukáš Ing. - Pontex s. r. o. [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.vkisiiretpjj8f@lpr \
    --to=lpr@pontex.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).