ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Kate F <kate@elide.org>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Preventing double title pages for nested content
Date: Thu, 21 May 2015 23:33:52 +0100	[thread overview]
Message-ID: <CAA36g0WsYrgfzZbbCXCEKW2H8Wyf9Bh9w6AezWR+89JQ1KbyPQ@mail.gmail.com> (raw)
In-Reply-To: <3C3ED483-2216-4522-9546-6FDDEE92FB43@gmail.com>

On 21 May 2015 at 23:06, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
>
>> Am 21.05.2015 um 23:44 schrieb Kate F <kate@elide.org>:
>>
>> On 21 May 2015 at 22:09, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
>>>
>>> Am 21.05.2015 um 14:33 schrieb Kate F <kate@elide.org>:
>>>
>>> On 21 May 2015 at 09:06, Wolfgang Schuster <schuster.wolfgang@gmail.com>
>>> wrote:
>>>
>>>
>>> Am 21.05.2015 um 00:36 schrieb Kate F <kate@elide.org>:
>>>
>>> Hi,
>>>
>>> There's been a misunderstanding here.
>>>
>>> You're showing a structure which is a two-deep hierarchy (Libraries
>>> containing Manpages). That's not what the structure in my example is,
>>> and you're showing something which I think is different to what I'm
>>> asking for. (Or I just can't see how to apply the technique you're
>>> illustrating)
>>>
>>>
>>> You have to add just another level to my example, nothing more.
>>>
>>> The structure for my example is Volumes which contain either Libraries
>>> *or* Manpages, and a Library contains Manpages. I'll draw out the tree
>>> from my example again:
>>> (this is the same as in my first email for this thread, but I'm
>>> repeating it here for clarity)
>>>
>>> \starttext
>>>  \placecontent[list={Volume,Library,Manpage}]
>>>
>>>  \startVolume[title=Section 1: Programs]
>>>      \dorecurse{3}{\startManpage[title=progxyz(1)] \input lorem
>>> \stopManpage}
>>>  \stopVolume
>>>
>>>  \startVolume[title=Section 2: Syscalls]
>>>      \dorecurse{3}{\startManpage[title=syscallxyz(1)] \input lorem
>>> \stopManpage}
>>>  \stopVolume
>>>
>>>  \startVolume[title=Section 3: Libraries]
>>>      \startLibrary[title=libjpeg]
>>>          \dorecurse{3}{\startManpage[title=jpegapi_a(3)] \input
>>> lorem \stopManpage}
>>>      \stopLibrary
>>>      \startLibrary[title=libpng]
>>>          \dorecurse{3}{\startManpage[title=pngapi_a(3)] \input
>>> lorem \stopManpage}
>>>      \stopLibrary
>>>      \startLibrary[title=libbmp]
>>>          \dorecurse{3}{\startManpage[title=bmpapi_a(3)] \input
>>> lorem \stopManpage}
>>>      \stopLibrary
>>>  \stopVolume
>>>
>>>  \startVolume[title=Section 4: Drivers]
>>>      \dorecurse{3}{\startManpage[title=drvxyz(1)] \input lorem
>>> \stopManpage}
>>>  \stopVolume
>>>
>>>  \startVolume[title=Section 7mk: Makefiles]
>>>      \dorecurse{3}{\startManpage[title=xyz.mk(1)] \input lorem
>>> \stopManpage}
>>>  \stopVolume
>>> \stoptext
>>>
>>> Please look at Volume 3; you can see it contains some Libraries
>>> (libjpeg, libpng, libbmp). The other Volumes do not contain Libraries;
>>> they just contain Manpages directly. So the ToC is:
>>>
>>> Volume 1: "Programs"       <-- I want a title page for this
>>>  ... manpages for (1)
>>> Volume 2: "Syscalls"       <-- I want a title page for this
>>>  ... manpages for (2)
>>> Volume 3: "Libraries"   <-- no title page for this!! Because this
>>> Volume contains Libraries
>>>  Library "libjpeg"       <-- I want a title page for this
>>>      ... manpages for (3) libjpeg
>>>  Library "libpng"       <-- I want a title page for this
>>>      ... manpages for (3) libpng
>>> Library "libbmp"       <-- I want a title page for this
>>>      ... manpages for (3) libbmp
>>> Volume 4: "Drivers"       <-- I want a title page for this
>>>  ... manpages for (4)
>>> Volume 7: "Makefiles"       <-- I want a title page for this
>>>  ... manpages for (7)
>>>
>>> As I said in my original email, this grouping into libraries only
>>> applies to Volume 3.
>>>
>>> The effect I'm trying to achieve is to have a single title page before
>>> each set of manpages. So I want a title page for "Programs",
>>> "Syscalls", "libjpeg", "libpng", "libbmp", "Drivers", and "Makefiles".
>>> But I do not want a title page for Volume 3 itself, "Libraries"
>>> because that would be immediately followed by the title page for
>>> libjpeg, and my aim is to avoid having two consecutive title pages. I
>>> have indicated these with arrows above.
>>>
>>> I hope that's clear. Sorry for repeating myself…
>>>
>>>
>>>
>>> Sorry for resending nearly the same example for another time but it still
>>> does what you asked for.
>>>
>>>
>>> But it doesn't...
>>>
>>> You have a page for Volume 3 (which is made blank due to your
>>> \ifnum\structurelistsize=0):
>>>
>>>
>>> You’re wrong, the test for \structurelistsize has nothing to do with the
>>> empty page.
>>>
>>> Volume 3: "Libraries"   <-- no title page for this!!
>>>
>>>
>>> Instead, I'm trying to find how to not have this produce a page (or
>>> some other way to achieve the same effect).
>>>
>>> And you have no title pages for these:
>>>
>>> Volume contains Libraries
>>>  Library "libjpeg"       <-- I want a title page for this
>>>      ... manpages for (3) libjpeg
>>>  Library "libpng"       <-- I want a title page for this
>>>      ... manpages for (3) libpng
>>> Library "libbmp"       <-- I want a title page for this
>>>
>>>
>>> These weren’t needed for the example
>>
>> They were the whole point of what I was asking for help with.
>
>
> \definehead [Volume]  [part]
> \definehead [Library] [chapter]
> \definehead [Manpage] [section]
>
> \setuphead
>   [Volume]
>   [placehead=empty,
>        after=\directsetup{libraryentries}]
>
> \setuphead
>   [Library]
>   [  page=,
>   placehead=empty,
>    before=\directsetup{Library:before},
>     after=\directsetup{Library:after}]
>
> \startsetups[Library:before]
>         \ifconditional\libraryentries
>                 \page
>         \else
>                 \settrue\libraryentries
>         \fi
> \stopsetups
>
> \startsetups[Library:after]
>         \startframed[frame=off,width=\textwidth,height=\dimexpr\textheight-\strutdp\relax,align={middle,lohi}]
>                 \placeheadtext[Library]
>         \stopframed
>         \page
> \stopsetups
>
> \newconditional\libraryentries \settrue\libraryentries
>
> \startsetups[libraryentries]
>         \determinelistcharacteristics[Library]
>         \ifnum\structurelistsize=0
>                 \startframed[frame=off,width=\textwidth,height=\dimexpr\textheight-\strutdp\relax,align={middle,lohi}]
>                         \placeheadtext[Volume]
>                 \stopframed
>         \else
>                 \setfalse\libraryentries
>         \fi
> \stopsetups
>
> %\showframe[text][text]
>
> \starttext
>
> \placelist[Volume,Library,Manpage]
>
> \startVolume[title=Section 1: Programs]
>   \dorecurse{3}{\startManpage[title=progxyz(1)] \input lorem \stopManpage}
> \stopVolume
>
> \startVolume[title=Section 2: Syscalls]
>   \dorecurse{3}
>     {\startManpage[title=syscallxyz(1)]
>      \input lorem
>      \stopManpage}
> \stopVolume
>
> \startVolume[title=Section 3: Libraries]
>   \startLibrary[title=libjpeg]
>     \dorecurse{3}
>       {\startManpage[title=jpegapi_a(3)]
>        \input lorem
>        \stopManpage}
>   \stopLibrary
>   \startLibrary[title=libpng]
>     \dorecurse{3}
>       {\startManpage[title=pngapi_a(3)]
>            \input lorem
>        \stopManpage}
>   \stopLibrary
>   \startLibrary[title=libbmp]
>     \dorecurse{3}
>       {\startManpage[title=bmpapi_a(3)]
>        \input lorem
>        \stopManpage}
>   \stopLibrary
> \stopVolume
>
> \startVolume[title=Section 4: Drivers]
>   \dorecurse{3}{\startManpage[title=drvxyz(1)] \input lorem \stopManpage}
> \stopVolume
>
> \startVolume[title=Section 7mk: Makefiles]
>   \dorecurse{3}{\startManpage[title=xyz.mk(1)] \input lorem \stopManpage}
> \stopVolume
>
> \stoptext
>
> Wolfgang

Yes! That's exactly what I was trying to achieve. Thank you.

Your code there is full of things I didn't know about, or didn't think
to use, but having just added some things to see what's going on, I
think I understand how it works. It's a very different implementation
than I had imagined!

-- 
Kate
___________________________________________________________________________________
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:[~2015-05-21 22:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19 22:34 Kate F
2015-05-19 22:51 ` Wolfgang Schuster
2015-05-19 23:26   ` Kate F
2015-05-20 21:19     ` Wolfgang Schuster
2015-05-20 22:36       ` Kate F
2015-05-21  8:06         ` Wolfgang Schuster
2015-05-21 12:33           ` Kate F
2015-05-21 21:09             ` Wolfgang Schuster
2015-05-21 21:44               ` Kate F
2015-05-21 22:06                 ` Wolfgang Schuster
2015-05-21 22:33                   ` Kate F [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=CAA36g0WsYrgfzZbbCXCEKW2H8Wyf9Bh9w6AezWR+89JQ1KbyPQ@mail.gmail.com \
    --to=kate@elide.org \
    --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).