ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Spacing between Chapter title and first paragraph sometimes changes
@ 2025-01-13 17:09 Keith McKay
  2025-01-13 18:08 ` [NTG-context] " Hans Hagen via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Keith McKay @ 2025-01-13 17:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

H,

I'm typesetting a memoir for a friend and I've come across a strange 
problem which I'm trying to solve. The memoir will be A5 format and has 
quite a few chapters which are less than a page long. I noticed that for 
some chapters the distance between the the chapter head and the first 
paragraph were not aligned in double page view. You can see this quite 
clearly in the attached screenshot.

I was given a docx file consisting of 80 chapters and and appendices 
which I converted to individual xhtml files. The resulting xhtml files 
are very simple and the format is as follows:

<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<link rel="stylesheet" href="../styles/style001.css" type="text/css" />

<title></title>

</head>

<body>

<h2 id="heading_id_no>Chapter Number</h2>

<p>Some text</p>

<p>Some text</p>

<p>And so on...</p>

</body>

</html>

In some of the xhtml files I have added <div>...</div> for layout 
purposes and also inserted images.

I use xmlsetups to typeset the tags as follows:

\startxmlsetups xml:html

\xmlflush{#1}

\stopxmlsetups

\startxmlsetups xml:body

\xmlflush{#1}

\stopxmlsetups

\startxmlsetups xml:h2

\page

\chapter{\xmlflush{#1}}

\stopxmlsetups

\startxmlsetups xml:p
\xmlflush{#1}\par
\stopxmlsetups

along with a few others for divs, images and some other tags.

For the chapters setup I use:

\setuphead[chapter][page=no,

     number=no,

     header=empty,

     align=middle,

     after={\blank[3cm]}]

I would expect that using this \setuphead, there should be a gap of 
three cm between the head text and the first paragraph, however in a few 
chapters this does not happen and an extra blank line is either added or 
subtracted to the gap.

I'm obviously missing something simple and struggling to find a solution 
to correct this problem so I would be grateful for any hints on how to 
go about it.

Best Wishes

Keith McKay




[-- Attachment #2: Screenshot 2025-01-13 at 15.26.47.png --]
[-- Type: image/png, Size: 34952 bytes --]

[-- Attachment #3: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Spacing between Chapter title and first paragraph sometimes changes
  2025-01-13 17:09 [NTG-context] Spacing between Chapter title and first paragraph sometimes changes Keith McKay
@ 2025-01-13 18:08 ` Hans Hagen via ntg-context
  2025-01-13 19:52   ` Keith McKay
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen via ntg-context @ 2025-01-13 18:08 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 1/13/2025 6:09 PM, Keith McKay wrote:
> H,
> 
> I'm typesetting a memoir for a friend and I've come across a strange 
> problem which I'm trying to solve. The memoir will be A5 format and has 
> quite a few chapters which are less than a page long. I noticed that for 
> some chapters the distance between the the chapter head and the first 
> paragraph were not aligned in double page view. You can see this quite 
> clearly in the attached screenshot.
> 
> I was given a docx file consisting of 80 chapters and and appendices 
> which I converted to individual xhtml files. The resulting xhtml files 
> are very simple and the format is as follows:
> 
> <?xml version="1.0" encoding="utf-8"?>
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> 
>      "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> 
> <html xmlns="http://www.w3.org/1999/xhtml">
> 
> <head>
> 
> <link rel="stylesheet" href="../styles/style001.css" type="text/css" />
> 
> <title></title>
> 
> </head>
> 
> <body>
> 
> <h2 id="heading_id_no>Chapter Number</h2>
> 
> <p>Some text</p>
> 
> <p>Some text</p>
> 
> <p>And so on...</p>
> 
> </body>
> 
> </html>
> 
> In some of the xhtml files I have added <div>...</div> for layout 
> purposes and also inserted images.
> 
> I use xmlsetups to typeset the tags as follows:
> 
> \startxmlsetups xml:html
> 
> \xmlflush{#1}
> 
> \stopxmlsetups
> 
> \startxmlsetups xml:body
> 
> \xmlflush{#1}
> 
> \stopxmlsetups
> 
> \startxmlsetups xml:h2
> 
> \page
> 
> \chapter{\xmlflush{#1}}
> 
> \stopxmlsetups
> 
> \startxmlsetups xml:p
> \xmlflush{#1}\par
> \stopxmlsetups
> 
> along with a few others for divs, images and some other tags.
> 
> For the chapters setup I use:
> 
> \setuphead[chapter][page=no,
> 
>      number=no,
> 
>      header=empty,
> 
>      align=middle,
> 
>      after={\blank[3cm]}]
> 
> I would expect that using this \setuphead, there should be a gap of 
> three cm between the head text and the first paragraph, however in a few 
> chapters this does not happen and an extra blank line is either added or 
> subtracted to the gap.
> 
> I'm obviously missing something simple and struggling to find a solution 
> to correct this problem so I would be grateful for any hints on how to 
> go about it.

hard to guess ... so how do these h2's look compared to each other

maybe use

     \chapter{\xmltext{#1}}


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Spacing between Chapter title and first paragraph sometimes changes
  2025-01-13 18:08 ` [NTG-context] " Hans Hagen via ntg-context
@ 2025-01-13 19:52   ` Keith McKay
  2025-01-13 20:31     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Keith McKay @ 2025-01-13 19:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks for your reply Hans.
The h2's all have the same format except that the id attribute changes 
for each h2, which is to be expected.
I tried
     \chapter{xmltext{#1}}
as you suggested, and still the same problem.
I've created a new tex file, which only contains the problematic files 
and compiled it. Still the same problem. I also removed the id attribute 
from the h2's, since I don't use that for typesetting and still the same 
effect. So I think I'll leave it tonight and start from scratch tomorrow 
and have a look through some other books I've typeset. I'll let you know 
how I get on.
Thanks for your suggestions.
Best Wishes
Keith McKay


On 13/01/2025 18:08, Hans Hagen via ntg-context wrote:
> On 1/13/2025 6:09 PM, Keith McKay wrote:
>> H,
>>
>> I'm typesetting a memoir for a friend and I've come across a strange 
>> problem which I'm trying to solve. The memoir will be A5 format and 
>> has quite a few chapters which are less than a page long. I noticed 
>> that for some chapters the distance between the the chapter head and 
>> the first paragraph were not aligned in double page view. You can see 
>> this quite clearly in the attached screenshot.
>>
>> I was given a docx file consisting of 80 chapters and and appendices 
>> which I converted to individual xhtml files. The resulting xhtml 
>> files are very simple and the format is as follows:
>>
>> <?xml version="1.0" encoding="utf-8"?>
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
>>
>>      "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
>>
>> <html xmlns="http://www.w3.org/1999/xhtml">
>>
>> <head>
>>
>> <link rel="stylesheet" href="../styles/style001.css" type="text/css" />
>>
>> <title></title>
>>
>> </head>
>>
>> <body>
>>
>> <h2 id="heading_id_no>Chapter Number</h2>
>>
>> <p>Some text</p>
>>
>> <p>Some text</p>
>>
>> <p>And so on...</p>
>>
>> </body>
>>
>> </html>
>>
>> In some of the xhtml files I have added <div>...</div> for layout 
>> purposes and also inserted images.
>>
>> I use xmlsetups to typeset the tags as follows:
>>
>> \startxmlsetups xml:html
>>
>> \xmlflush{#1}
>>
>> \stopxmlsetups
>>
>> \startxmlsetups xml:body
>>
>> \xmlflush{#1}
>>
>> \stopxmlsetups
>>
>> \startxmlsetups xml:h2
>>
>> \page
>>
>> \chapter{\xmlflush{#1}}
>>
>> \stopxmlsetups
>>
>> \startxmlsetups xml:p
>> \xmlflush{#1}\par
>> \stopxmlsetups
>>
>> along with a few others for divs, images and some other tags.
>>
>> For the chapters setup I use:
>>
>> \setuphead[chapter][page=no,
>>
>>      number=no,
>>
>>      header=empty,
>>
>>      align=middle,
>>
>>      after={\blank[3cm]}]
>>
>> I would expect that using this \setuphead, there should be a gap of 
>> three cm between the head text and the first paragraph, however in a 
>> few chapters this does not happen and an extra blank line is either 
>> added or subtracted to the gap.
>>
>> I'm obviously missing something simple and struggling to find a 
>> solution to correct this problem so I would be grateful for any hints 
>> on how to go about it.
>
> hard to guess ... so how do these h2's look compared to each other
>
> maybe use
>
>     \chapter{\xmltext{#1}}
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________ 
>
> If your question is of interest to others as well, please add an entry 
> to the Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net 
> (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________ 
>

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Spacing between Chapter title and first paragraph sometimes changes
  2025-01-13 19:52   ` Keith McKay
@ 2025-01-13 20:31     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2025-01-13 20:31 UTC (permalink / raw)
  To: ntg-context

On 1/13/2025 8:52 PM, Keith McKay wrote:
> Thanks for your reply Hans.
> The h2's all have the same format except that the id attribute changes 
> for each h2, which is to be expected.
> I tried
>      \chapter{xmltext{#1}}
> as you suggested, and still the same problem.
> I've created a new tex file, which only contains the problematic files 
> and compiled it. Still the same problem. I also removed the id attribute 
> from the h2's, since I don't use that for typesetting and still the same 
> effect. So I think I'll leave it tonight and start from scratch tomorrow 
> and have a look through some other books I've typeset. I'll let you know 
> how I get on.
> Thanks for your suggestions.

strip down the xml to a few chapters (titles plus a few lines of text 
per chapter) and send the lot to me and i'll have a look

Hans

ps \showmakeup[line,glue] might give a clue

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2025-01-13 20:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-13 17:09 [NTG-context] Spacing between Chapter title and first paragraph sometimes changes Keith McKay
2025-01-13 18:08 ` [NTG-context] " Hans Hagen via ntg-context
2025-01-13 19:52   ` Keith McKay
2025-01-13 20:31     ` Hans Hagen

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