ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* right and left alignment in header w/ linebreak sign
@ 2011-07-17 15:48 Peter Schorsch
  2011-07-17 16:37 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Schorsch @ 2011-07-17 15:48 UTC (permalink / raw)
  To: ntg-context

Hi,

I am trying to have the header text aligned at the outer border of
margin. 

At the moment I have 

	\setupheadertexts[margin][][\rightaligned{\CurrentChapter}][\leftaligned{\CurrentChapter}][]

and in the text

	\chapter{A very, very long long heading}

and it works like I expect it. But as soon I have a linebreak in the
heading (via \\) I get following error message:

	structure       > sectioning > chapter @ level 2 : 0.1 -> A
	very,\\very long long title ! Extra }, or forgotten \endgroup.

	system          > tex > error on line 1 in file
	context-test-struktur3.tex: Extra }, or forgotten  ...

As soon I remove the alignment in the header also the chapter with the
linebreak sign works - but of course I get then a wrong alignment.

How can I make that the header works with the correct alignment and
linebreaks in the heading? (header should be still without linebreaks)

Thanks in advance!


Complete example:
-------------8<----------------------------

% define margins
\definelayout[WithMarginnotes][location={duplex},grid=no,topspace=3cm,height=24cm,backspace=3cm,cutspace=0cm,leftmargin=1cm,leftmargindistance=0.4cm,width=12.1cm,rightmargindistance=0.4cm,rightmargin=3.5cm]
\setuplayout[WithMarginnotes]
\setuppagenumbering[alternative=doublesided,location=]
\showframe

% define header
\define\CurrentChapter%
	{\doiftextelse {\getmarking[chapternumber]}%
		{\getmarking[chapternumber].~\getmarking[chapter]}%
		{\getmarking[chapter]}%
	}
\setupheadertexts[margin][][\rightaligned{\CurrentChapter}][\leftaligned{\CurrentChapter}][]%

%
\starttext
\completecontent[criterium=all]
\chapter{A very,\\very long long heading}
\chapter{A very, very long long heading}
\chapter{End}
\stoptext
___________________________________________________________________________________
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] 2+ messages in thread

* Re: right and left alignment in header w/ linebreak sign
  2011-07-17 15:48 right and left alignment in header w/ linebreak sign Peter Schorsch
@ 2011-07-17 16:37 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2011-07-17 16:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 17.07.2011 um 17:48 schrieb Peter Schorsch:

> % define header
> \define\CurrentChapter%
> 	{\doiftextelse {\getmarking[chapternumber]}%
> 		{\getmarking[chapternumber].~\getmarking[chapter]}%
> 		{\getmarking[chapter]}%
> 	}

\appendtoks\def\\{ }\to\simplifiedcommands

\define\CurrentChapter
  {\bgroup\simplifycommands
   \doiftextelse{\getmarking[chapternumber]}
     {\getmarking[chapternumber].~\getmarking[chapter]}
     {\getmarking[chapter]}%
   \egroup}

or use

\startchapter[title={…\\…},marking={…}]
…
\stopchapter

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] 2+ messages in thread

end of thread, other threads:[~2011-07-17 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-17 15:48 right and left alignment in header w/ linebreak sign Peter Schorsch
2011-07-17 16:37 ` Wolfgang Schuster

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