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
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 ___________________________________________________________________________________
Am 03.07.2013 um 17:13 schrieb Peter Rolf
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
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
Am 04.07.2013 um 08:29 schrieb Procházka Lukáš Ing. - Pontex s. r. o.
@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
... Great, thanks again!
Cheers,
Lukas
On Thu, 04 Jul 2013 08:49:49 +0200, Wolfgang Schuster
Am 04.07.2013 um 08:29 schrieb Procházka Lukáš Ing. - Pontex s. r. o.
: @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
participants (3)
-
Peter Rolf
-
Procházka Lukáš Ing. - Pontex s. r. o.
-
Wolfgang Schuster