ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Section in golden ratio?
@ 2013-07-03 14:10 Procházka Lukáš Ing. - Pontex s. r. o.
  2013-07-03 15:13 ` Peter Rolf
  0 siblings, 1 reply; 6+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2013-07-03 14:10 UTC (permalink / raw)
  To: ConTeXt

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]

Hello,

I'm trying to setup section to be placed vertically in the golden ratio of the page, i.e. cca 2 "units" above the section and 3 "units" bellow.

How to achieve this?

My code so far is:

----
\setuplayout[page]

\define\bef{\page\hbox to\textheight\bgroup\vfill\vfill\fi}
\define\aft{\vfill\vfill\vfill\egroup}

\setuphead[section]
   [before=\bef,after=\aft,
    %commandbefore=\cbef,commandafter=\caft,
    alternative=middle,
   ]

\starttext
   \section{AAA}
\stoptext
----

The position is quite OK, but there is error "Too many }'s ..." during compilation...

What's the problem?

Best regards,

Lukas


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

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: t2.mkiv --]
[-- Type: application/octet-stream, Size: 290 bytes --]

\setuplayout[page]

\define\bef{\page\hbox to\textheight\bgroup\vfill\vfill\fi}
\define\aft{\vfill\vfill\vfill\egroup}

\setuphead[section]
  [before=\bef,after=\aft,
   %commandbefore=\cbef,commandafter=\caft,
   alternative=middle,
  ]

\starttext
  \section{AAA}
\stoptext

[-- Attachment #3: t2.pdf --]
[-- Type: application/pdf, Size: 4519 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Section in golden ratio?
  2013-07-03 14:10 Section in golden ratio? Procházka Lukáš Ing. - Pontex s. r. o.
@ 2013-07-03 15:13 ` Peter Rolf
  2013-07-03 21:29   ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Rolf @ 2013-07-03 15:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users, LPr

Am 03.07.2013 16:10, schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
> Hello,
> 
> I'm trying to setup section to be placed vertically in the golden ratio
> of the page, i.e. cca 2 "units" above the section and 3 "units" bellow.
> 
> How to achieve this?
> 
> My code so far is:
> 
> ----
> \setuplayout[page]
> 
> \define\bef{\page\hbox to\textheight\bgroup\vfill\vfill\fi}

- use a \vbox (you need vertical mode here) instead of a \hbox
- remove the '\fi' (leftover from a test?)

Peter

> \define\aft{\vfill\vfill\vfill\egroup}
> 
> \setuphead[section]
>   [before=\bef,after=\aft,
>    %commandbefore=\cbef,commandafter=\caft,
>    alternative=middle,
>   ]
> 
> \starttext
>   \section{AAA}
> \stoptext
> ----
> 
> The position is quite OK, but there is error "Too many }'s ..." during
> compilation...
> 
> What's the problem?
> 
> Best regards,
> 
> Lukas
> 
> 
> 
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Section in golden ratio?
  2013-07-03 15:13 ` Peter Rolf
@ 2013-07-03 21:29   ` Wolfgang Schuster
  2013-07-04  6:29     ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2013-07-03 21:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 03.07.2013 um 17:13 schrieb Peter Rolf <indiego@gmx.net>:

> Am 03.07.2013 16:10, schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
>> Hello,
>> 
>> I'm trying to setup section to be placed vertically in the golden ratio
>> of the page, i.e. cca 2 "units" above the section and 3 "units" bellow.
>> 
>> How to achieve this?
>> 
>> My code so far is:
>> 
>> ----
>> \setuplayout[page]
>> 
>> \define\bef{\page\hbox to\textheight\bgroup\vfill\vfill\fi}
> 
> - use a \vbox (you need vertical mode here) instead of a \hbox

The makeup environment creates a big \vbox for its content.

\setuplayout[page]

\definemakeup[section][text]

\setupmakeup
  [section]
  [top=\vfill\vfill,bottom=\vfill\vfill\vfill]

\setuphead[section]
 [before=\startsectionmakeup,
  after=\stopsectionmakeup,
  alternative=middle]

\setuplabeltext[section=Section ]

\starttext
\section{AAA}
\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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Section in golden ratio?
  2013-07-03 21:29   ` Wolfgang Schuster
@ 2013-07-04  6:29     ` Procházka Lukáš Ing. - Pontex s. r. o.
  2013-07-04  6:49       ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2013-07-04  6:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]

Hello,

thanks Peter and Wolfgang for their answers.

Both following codes work:

---- P.
\setuplayout[page]

\define\bef{\page\vbox to\textheight\bgroup\vfill\vfill}
\define\aft{\vfill\vfill\vfill\egroup}

\setuphead[section]
   [before=\bef,after=\aft,
    %commandbefore=\cbef,commandafter=\caft,
    alternative=middle,
   ]

\starttext
   \section{AAA}
\stoptext
----

---- W.
\setuplayout[page]

\definemakeup[section]%[text]
\setupmakeup[section][top=\vfill\vfill,bottom=\vfill\vfill\vfill]

\setuphead[section]
  [before=\startsectionmakeup,
   after=\stopsectionmakeup,
   alternative=middle,
  ]

%\setuplabeltext[section=Section ]

\starttext
   \section{AAA}
\stoptext
----

@Peter: There were some typos, of course, due to testing; fixed here.

@Wolfgang: What does option "[text]" in your original "\definemakeup[section][text]" mean? Not much wiser from wiki.

To both:

How to make the label written into one line instead of its number be above the section name, i.e.

"
1 AAA
"

instead of

"
  1
AAA
"

Best regards,

Lukas


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

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: t2.mkiv --]
[-- Type: application/octet-stream, Size: 287 bytes --]

\setuplayout[page]

\define\bef{\page\vbox to\textheight\bgroup\vfill\vfill}
\define\aft{\vfill\vfill\vfill\egroup}

\setuphead[section]
  [before=\bef,after=\aft,
   %commandbefore=\cbef,commandafter=\caft,
   alternative=middle,
  ]

\starttext
  \section{AAA}
\stoptext

[-- Attachment #3: t2.pdf --]
[-- Type: application/pdf, Size: 4628 bytes --]

[-- Attachment #4: t3.mkiv --]
[-- Type: application/octet-stream, Size: 310 bytes --]

\setuplayout[page]

\definemakeup[section]%[text]
\setupmakeup[section][top=\vfill\vfill,bottom=\vfill\vfill\vfill]

\setuphead[section]
 [before=\startsectionmakeup,
  after=\stopsectionmakeup,
  alternative=middle,
 ]

%\setuplabeltext[section=Section ]

\starttext
  \section{AAA}
\stoptext

[-- Attachment #5: t3.pdf --]
[-- Type: application/pdf, Size: 4628 bytes --]

[-- Attachment #6: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Section in golden ratio?
  2013-07-04  6:29     ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2013-07-04  6:49       ` Wolfgang Schuster
  2013-07-04  6:52         ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2013-07-04  6:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 04.07.2013 um 08:29 schrieb Procházka Lukáš Ing. - Pontex s. r. o. <LPr@pontex.cz>:

> @Wolfgang: What does option "[text]" in your original "\definemakeup[section][text]" mean? Not much wiser from wiki.

ConTeXt has two predefine makeup environments, a) \startdstandardakeup and b) \starttextmakeup.

Environment a) was created with \definemaekup[standard] and b) with \definemaekup[text].

When you write \definemaekup[section][text] you create the new environment \startsectionmakeup
which inherits the default values from \starttextmakeup.

> How to make the label written into one line instead of its number be above the section name, i.e.
> 
> "
> 1 AAA
> "
> 
> instead of
> 
> "
> 1
> AAA
> "

The happened because you use “alternative=middle” in \setuphead which produces this layout,
when you want only a centered text use “align=middle” instead.

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Section in golden ratio?
  2013-07-04  6:49       ` Wolfgang Schuster
@ 2013-07-04  6:52         ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 0 replies; 6+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2013-07-04  6:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

... Great, thanks again!

Cheers,

Lukas


On Thu, 04 Jul 2013 08:49:49 +0200, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

>
> Am 04.07.2013 um 08:29 schrieb Procházka Lukáš Ing. - Pontex s. r. o. <LPr@pontex.cz>:
>
>> @Wolfgang: What does option "[text]" in your original "\definemakeup[section][text]" mean? Not much wiser from wiki.
>
> ConTeXt has two predefine makeup environments, a) \startdstandardakeup and b) \starttextmakeup.
>
> Environment a) was created with \definemaekup[standard] and b) with \definemaekup[text].
>
> When you write \definemaekup[section][text] you create the new environment \startsectionmakeup
> which inherits the default values from \starttextmakeup.
>
>> How to make the label written into one line instead of its number be above the section name, i.e.
>>
>> "
>> 1 AAA
>> "
>>
>> instead of
>>
>> "
>> 1
>> AAA
>> "
>
> The happened because you use “alternative=middle” in \setuphead which produces this layout,
> when you want only a centered text use “align=middle” instead.
>
> Wolfgang


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

Tel: +420 244 062 238
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-04  6:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-03 14:10 Section in golden ratio? Procházka Lukáš Ing. - Pontex s. r. o.
2013-07-03 15:13 ` Peter Rolf
2013-07-03 21:29   ` Wolfgang Schuster
2013-07-04  6:29     ` Procházka Lukáš Ing. - Pontex s. r. o.
2013-07-04  6:49       ` Wolfgang Schuster
2013-07-04  6:52         ` Procházka Lukáš Ing. - Pontex s. r. o.

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).