ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Remove header after ToC
@ 2017-10-16  3:03 N. Raghavendra
  2017-10-17 10:07 ` N. Raghavendra
  0 siblings, 1 reply; 7+ messages in thread
From: N. Raghavendra @ 2017-10-16  3:03 UTC (permalink / raw)
  To: ntg-context

I am a ConTeXt beginner.  I am having trouble getting rid of the header
after the ToC in a document that I am preparing.  The following is a
simplified version of the document.  I get a header with "2" on the left
edge, and "Chapter ."  on the right edge, on page 2, which is an empty
page after the ToC.  How do I remove the header on this page?

Thanks,
Raghu.

----------------------------------------------------------------------
\starttext

\setuppagenumbering
  [alternative=doublesided]

\setupheadertexts
  []

\setupfootertexts
  []

\setupheadertexts
  [{\getmarking[section]}]
  [\pagenumber]
  [\pagenumber]
  [{Chapter \getmarking[chapternumber].\ \getmarking[chapter]}]

\setuphead
  [chapter]
  [page={yes,header,footer,right},
   header=empty]

\startfrontmatter
  \completecontent
\stopfrontmatter

\startbodymatter
  \startchapter
    [title=A chapter]

    \startsection
      [title=A section]
      Some text
    \stopsection

    \page

    \startsection
      [title=Another section]
      Some text
    \stopsection

  \stopchapter
\stopbodymatter

\stoptext
----------------------------------------------------------------------

--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Remove header after ToC
  2017-10-16  3:03 Remove header after ToC N. Raghavendra
@ 2017-10-17 10:07 ` N. Raghavendra
  2017-10-17 10:34   ` Tomas Hala
  0 siblings, 1 reply; 7+ messages in thread
From: N. Raghavendra @ 2017-10-17 10:07 UTC (permalink / raw)
  To: ntg-context

Any help is appreciated!  Do let me know if some more information is
needed.

Thanks and regards,
Raghu.

----------------------------------------------------------------------

At 2017-10-16T08:33:13+05:30, N. Raghavendra wrote:

> I am a ConTeXt beginner.  I am having trouble getting rid of the header
> after the ToC in a document that I am preparing.  The following is a
> simplified version of the document.  I get a header with "2" on the left
> edge, and "Chapter ."  on the right edge, on page 2, which is an empty
> page after the ToC.  How do I remove the header on this page?
>
> Thanks,
> Raghu.
>
> ----------------------------------------------------------------------
> \starttext
>
> \setuppagenumbering
>   [alternative=doublesided]
>
> \setupheadertexts
>   []
>
> \setupfootertexts
>   []
>
> \setupheadertexts
>   [{\getmarking[section]}]
>   [\pagenumber]
>   [\pagenumber]
>   [{Chapter \getmarking[chapternumber].\ \getmarking[chapter]}]
>
> \setuphead
>   [chapter]
>   [page={yes,header,footer,right},
>    header=empty]
>
> \startfrontmatter
>   \completecontent
> \stopfrontmatter
>
> \startbodymatter
>   \startchapter
>     [title=A chapter]
>
>     \startsection
>       [title=A section]
>       Some text
>     \stopsection
>
>     \page
>
>     \startsection
>       [title=Another section]
>       Some text
>     \stopsection
>
>   \stopchapter
> \stopbodymatter
>
> \stoptext
> ----------------------------------------------------------------------
>
> --
> N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
> Harish-Chandra Research Institute, http://www.hri.res.in/

-- 
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Remove header after ToC
  2017-10-17 10:07 ` N. Raghavendra
@ 2017-10-17 10:34   ` Tomas Hala
  2017-10-17 13:47     ` N. Raghavendra
  0 siblings, 1 reply; 7+ messages in thread
From: Tomas Hala @ 2017-10-17 10:34 UTC (permalink / raw)
  To: ntg-context

Hi Raghu,

I did two changes in your code:

1. Disabling of header=empty.
2. Adding of \page[empty].

Probably, there is better and system solution, 
but this might help you, I guess.

Best wishes,

Tomas

%%%%%%%%%%%%%%%%%%
...
\setuphead
  [chapter]
  [page={yes,header,footer,right},
%   header=empty
]

\startfrontmatter
  \completecontent
\page[empty]
\stopfrontmatter

\startbodymatter
  \startchapter
    [title=A chapter]
...
%%%%%%%%%%%%%%%%%%


Tue, Oct 17, 2017 ve 03:37:21PM +0530 N. Raghavendra napsal(a):
# Any help is appreciated!  Do let me know if some more information is
# needed.
# 
# Thanks and regards,
# Raghu.
# 
# ----------------------------------------------------------------------
# 
# At 2017-10-16T08:33:13+05:30, N. Raghavendra wrote:
# 
# > I am a ConTeXt beginner.  I am having trouble getting rid of the header
# > after the ToC in a document that I am preparing.  The following is a
# > simplified version of the document.  I get a header with "2" on the left
# > edge, and "Chapter ."  on the right edge, on page 2, which is an empty
# > page after the ToC.  How do I remove the header on this page?
# >
# > Thanks,
# > Raghu.
# >
# > ----------------------------------------------------------------------
# > \starttext
# >
# > \setuppagenumbering
# >   [alternative=doublesided]
# >
# > \setupheadertexts
# >   []
# >
# > \setupfootertexts
# >   []
# >
# > \setupheadertexts
# >   [{\getmarking[section]}]
# >   [\pagenumber]
# >   [\pagenumber]
# >   [{Chapter \getmarking[chapternumber].\ \getmarking[chapter]}]
# >
# > \setuphead
# >   [chapter]
# >   [page={yes,header,footer,right},
# >    header=empty]
# >
# > \startfrontmatter
# >   \completecontent
# > \stopfrontmatter
# >
# > \startbodymatter
# >   \startchapter
# >     [title=A chapter]
# >
# >     \startsection
# >       [title=A section]
# >       Some text
# >     \stopsection
# >
# >     \page
# >
# >     \startsection
# >       [title=Another section]
# >       Some text
# >     \stopsection
# >
# >   \stopchapter
# > \stopbodymatter
# >
# > \stoptext
# > ----------------------------------------------------------------------
# >
# > --
# > N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
# > Harish-Chandra Research Institute, http://www.hri.res.in/
# 
# -- 
# N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
# Harish-Chandra Research Institute, http://www.hri.res.in/
# ___________________________________________________________________________________
# 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://context.aanhet.net
# archive  : https://bitbucket.org/phg/context-mirror/commits/
# wiki     : http://contextgarden.net
# ___________________________________________________________________________________

                                         Tomáš Hála
--------------------------------------------------------------------
Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28
--------------------------------------------------------------------
http://akela.mendelu.cz/~thala
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Remove header after ToC
  2017-10-17 10:34   ` Tomas Hala
@ 2017-10-17 13:47     ` N. Raghavendra
  2017-10-17 13:59       ` N. Raghavendra
  2017-10-17 14:58       ` Tomas Hala
  0 siblings, 2 replies; 7+ messages in thread
From: N. Raghavendra @ 2017-10-17 13:47 UTC (permalink / raw)
  To: ntg-context

At 2017-10-17T12:34:06+02:00, Tomas Hala wrote:

> I did two changes in your code:
>
> 1. Disabling of header=empty.
> 2. Adding of \page[empty].
>
> Probably, there is better and system solution,
> but this might help you, I guess.

Dear Tomas,

Thank you for your kind help.

The change you made works when the ToC ends on an odd page, as in this
case when it ends on page 1.  However, if the ToC ends on an even page,
say on page 2, the modification you have suggested produces an empty
page with no headers on page 3, and then an empty page with
headers "4 ... Chapter." on page 4; the first chapter starts on page 5.
Enclosed below is an example of such a file.

I don't want the empty pages 3 (without headers) and 4 (with headers),
and I want the first chapter to start on page 3, which is the first
right hand, i.e., odd numbered, page after the end of the ToC.

I think what is required is a command \foo which implements the
following pseudocode:

if the current page is even numbered ; then
  \page [empty]
else
  do nothing
endif

Then, I can use

\startfrontmatter
  \completecontent
  \foo
\stopfrontmatter

Regards,
Raghu.

----------------------------------------------------------------------
\starttext

\setuppagenumbering
  [alternative=doublesided]

\setupheadertexts
  []

\setupfootertexts
  []

\setupheadertexts
  [{\getmarking[section]}]
  [\pagenumber]
  [\pagenumber]
  [{Chapter \getmarking[chapternumber].\ \getmarking[chapter]}]

\setuphead
  [chapter]
  [page={yes,header,footer,right}]

\startfrontmatter
  \completecontent
  \page [empty]
\stopfrontmatter

\startbodymatter
  \dorecurse
    {20}
    {
      \startchapter
        [title=A chapter]

        \startsection
          [title=A section]
          Some text
        \stopsection

        \page

        \startsection
          [title=Another section]
          Some text
        \stopsection

      \stopchapter
    }
\stopbodymatter

\stoptext
----------------------------------------------------------------------

--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Remove header after ToC
  2017-10-17 13:47     ` N. Raghavendra
@ 2017-10-17 13:59       ` N. Raghavendra
  2017-10-17 14:58       ` Tomas Hala
  1 sibling, 0 replies; 7+ messages in thread
From: N. Raghavendra @ 2017-10-17 13:59 UTC (permalink / raw)
  To: ntg-context

At 2017-10-17T19:17:34+05:30, N. Raghavendra wrote:

                         vvvv
> if the current page is even numbered ; then
>   \page [empty]
> else
>   do nothing
> endif

Read "odd" instead of "even" in the place marked vvvv.

Raghu.

-- 
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Remove header after ToC
  2017-10-17 13:47     ` N. Raghavendra
  2017-10-17 13:59       ` N. Raghavendra
@ 2017-10-17 14:58       ` Tomas Hala
  2017-10-17 16:24         ` N. Raghavendra
  1 sibling, 1 reply; 7+ messages in thread
From: Tomas Hala @ 2017-10-17 14:58 UTC (permalink / raw)
  To: ntg-context


Add the following \if command:

\startfrontmatter
  \completecontent
	\ifodd\pageno\page[empty]\else\setupheadertexts[chapter][pagenumber]\fi
\stopfrontmatter

Best wishes,

Tomas


Tue, Oct 17, 2017 ve 07:17:34PM +0530 N. Raghavendra napsal(a):
# At 2017-10-17T12:34:06+02:00, Tomas Hala wrote:
# 
# > I did two changes in your code:
# >
# > 1. Disabling of header=empty.
# > 2. Adding of \page[empty].
# >
# > Probably, there is better and system solution,
# > but this might help you, I guess.
# 
# Dear Tomas,
# 
# Thank you for your kind help.
# 
# The change you made works when the ToC ends on an odd page, as in this
# case when it ends on page 1.  However, if the ToC ends on an even page,
# say on page 2, the modification you have suggested produces an empty
# page with no headers on page 3, and then an empty page with
# headers "4 ... Chapter." on page 4; the first chapter starts on page 5.
# Enclosed below is an example of such a file.
# 
# I don't want the empty pages 3 (without headers) and 4 (with headers),
# and I want the first chapter to start on page 3, which is the first
# right hand, i.e., odd numbered, page after the end of the ToC.
# 
# I think what is required is a command \foo which implements the
# following pseudocode:
# 
# if the current page is even numbered ; then
#   \page [empty]
# else
#   do nothing
# endif
# 
# Then, I can use
# 
# \startfrontmatter
#   \completecontent
#   \foo
# \stopfrontmatter
# 
# Regards,
# Raghu.
# 
# ----------------------------------------------------------------------
# \starttext
# 
# \setuppagenumbering
#   [alternative=doublesided]
# 
# \setupheadertexts
#   []
# 
# \setupfootertexts
#   []
# 
# \setupheadertexts
#   [{\getmarking[section]}]
#   [\pagenumber]
#   [\pagenumber]
#   [{Chapter \getmarking[chapternumber].\ \getmarking[chapter]}]
# 
# \setuphead
#   [chapter]
#   [page={yes,header,footer,right}]
# 
# \startfrontmatter
#   \completecontent
#   \page [empty]
# \stopfrontmatter
# 
# \startbodymatter
#   \dorecurse
#     {20}
#     {
#       \startchapter
#         [title=A chapter]
# 
#         \startsection
#           [title=A section]
#           Some text
#         \stopsection
# 
#         \page
# 
#         \startsection
#           [title=Another section]
#           Some text
#         \stopsection
# 
#       \stopchapter
#     }
# \stopbodymatter
# 
# \stoptext
# ----------------------------------------------------------------------
# 
# --
# N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
# Harish-Chandra Research Institute, http://www.hri.res.in/
# ___________________________________________________________________________________
# 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://context.aanhet.net
# archive  : https://bitbucket.org/phg/context-mirror/commits/
# wiki     : http://contextgarden.net
# ___________________________________________________________________________________

                                         Tomáš Hála
--------------------------------------------------------------------
Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28
--------------------------------------------------------------------
http://akela.mendelu.cz/~thala
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Remove header after ToC
  2017-10-17 14:58       ` Tomas Hala
@ 2017-10-17 16:24         ` N. Raghavendra
  0 siblings, 0 replies; 7+ messages in thread
From: N. Raghavendra @ 2017-10-17 16:24 UTC (permalink / raw)
  To: ntg-context

At 2017-10-17T16:58:22+02:00, Tomas Hala wrote:

> Add the following \if command:
>
> \startfrontmatter
>   \completecontent
>   \ifodd\pageno\page[empty]\else\setupheadertexts[chapter][pagenumber]\fi
> \stopfrontmatter

Thanks, that should work.  However, searching through setup-en.pdf, I
found the conditional `\doifelseoddpage {CMD} {CMD}', which is precisely
what I needed.  Enclosed below is an example which is formatted as I
wanted.

1. I use `header=empty' in \setuphead [chapter], for otherwise I get a
   header on the pages where a chapter begins.

2. I use \setupheadertexts twice, first before the beginning of the
   front matter, and then before the beginning of the body matter, with
   settings appropriate for the respective block.

3. I use `\marking [chapter] {Contents}' before \completecontent, for
   otherwise I get no chapter name in the header for the ToC.

4. I use `\doifelseoddpage {\page [empty]} {}' after \completecontent,
   to do what you had suggested.

Thanks again for the help.

Regards,
Raghu.

----------------------------------------------------------------------
\starttext

\setuphead
  [chapter]
  [page={yes,header,footer,right},
   header=empty]

\setupheadertexts
  []

\setupfootertexts
  []

\setupheadertexts
  [{\getmarking [chapter]}]
  [\pagenumber]
  [\pagenumber]
  [{\getmarking [chapter]}]

\startfrontmatter
  \marking [chapter] {Contents}
  \completecontent
  \doifelseoddpage {\page [empty]} {}
\stopfrontmatter

\setupheadertexts
  [{\getmarking [sectionnumber].\ \getmarking [section]}]
  [\pagenumber]
  [\pagenumber]
  [{Chapter \getmarking [chapternumber].\ \getmarking [chapter]}]

\startbodymatter
  \dorecurse
    {20}
    {
      \startchapter
        [title=A chapter]

        \startsection
          [title=A section]
          Some text
        \stopsection

        \page

        \startsection
          [title=A section]
          Some text
        \stopsection

        \page

        \startsection
          [title=A section]
          Some text
        \stopsection

      \stopchapter
    }
  \stopbodymatter

\stoptext

--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2017-10-17 16:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16  3:03 Remove header after ToC N. Raghavendra
2017-10-17 10:07 ` N. Raghavendra
2017-10-17 10:34   ` Tomas Hala
2017-10-17 13:47     ` N. Raghavendra
2017-10-17 13:59       ` N. Raghavendra
2017-10-17 14:58       ` Tomas Hala
2017-10-17 16:24         ` N. Raghavendra

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