ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \definehead behaving differently when in an environment file versus \input'ed
@ 2020-05-02 15:14 ntg
  2020-05-02 15:16 ` ntg
  2020-05-02 16:08 ` Wolfgang Schuster
  0 siblings, 2 replies; 4+ messages in thread
From: ntg @ 2020-05-02 15:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I'm having trouble with \definehead behaving differently depending upon whether I process a file that includes it via a \input statement versus a project structure that calls it via an environment file referenced from a component file.

Overall aim:

I currently produce a small circulation journal in Word that I'm hoping to switch to ConTeXt. Each article is written by a different author and I currently provide a Word template so they can see how their article will eventually look and how long it is, etc. I want to do the same for the ConTeXt version so I have created a template tex file they can simply \input at the top of their article. Processing the single article gives the desired output. So far so good.

When I receive the articles, I want to use the project/product/component structure to allow me to produce an entire issue of the journal in one go. (I would simply comment out the \input line and add \startproject \startcomponent etc lines as necessary from each received article.)

Problem:

I've created a custom chapter heading, but the font size changes depending on whether I'm processing the \input version of the article or the \component version and I don't know why. Obviously, I would like the heading to be the same in each case so that authors see what I see and vice versa.

I've attached a small zip file with a directory structure containing a minimal example. There are two directories: "input_version" and "project" version and the article.pdf files in each show the difference in the heading.

I'm using TeX Live 2020 on a Mac. The console reports: ConTeXt  ver: 2020.03.10 14:44 MKIV beta  fmt: 2020.4.18  int: english/english

--
Bruce Horrocks
Hampshire, UK

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

* Re: \definehead behaving differently when in an environment file versus \input'ed
  2020-05-02 15:14 \definehead behaving differently when in an environment file versus \input'ed ntg
@ 2020-05-02 15:16 ` ntg
  2020-05-02 16:08 ` Wolfgang Schuster
  1 sibling, 0 replies; 4+ messages in thread
From: ntg @ 2020-05-02 15:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

And the attachment (d'oh):

[-- Attachment #2: minimal_example.zip --]
[-- Type: application/zip, Size: 29574 bytes --]

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

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

* Re: \definehead behaving differently when in an environment file versus \input'ed
  2020-05-02 15:14 \definehead behaving differently when in an environment file versus \input'ed ntg
  2020-05-02 15:16 ` ntg
@ 2020-05-02 16:08 ` Wolfgang Schuster
  2020-05-02 21:34   ` ntg
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2020-05-02 16:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users, ntg

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

ntg@scorecrow.com schrieb am 02.05.2020 um 17:14:
> I'm having trouble with \definehead behaving differently depending upon whether I process a file that includes it via a \input statement versus a project structure that calls it via an environment file referenced from a component file.
> 
> Overall aim:
> 
> I currently produce a small circulation journal in Word that I'm hoping to switch to ConTeXt. Each article is written by a different author and I currently provide a Word template so they can see how their article will eventually look and how long it is, etc. I want to do the same for the ConTeXt version so I have created a template tex file they can simply \input at the top of their article. Processing the single article gives the desired output. So far so good.
> 
> When I receive the articles, I want to use the project/product/component structure to allow me to produce an entire issue of the journal in one go. (I would simply comment out the \input line and add \startproject \startcomponent etc lines as necessary from each received article.)
> 
> Problem:
> 
> I've created a custom chapter heading, but the font size changes depending on whether I'm processing the \input version of the article or the \component version and I don't know why. Obviously, I would like the heading to be the same in each case so that authors see what I see and vice versa.

Your simple version sets the bodyfont before \starttext

%%%% begin example
\setupbodyfont[termes,14pt]

\starttext

{\bfc Cheesy double boxed title}

\stoptext
%%%% end example

while your complexer version loads the bodyfont after \starttext 
(\startcomponent acts here as \starttext)

%%%% begin example
\starttext

\setupbodyfont[termes,14pt]

{\bfc Cheesy double boxed title}

\stoptext
%%%% end example

When you use a non standard font size (e.g. 14pt) size switches are 
sometimes ignored even with ConTeXt's fallback mechanism.

To get the correct size for the header you can either use a standard 
font size (14.4pt) or you add the following line before you set the 
global font for your document (ConTeXt does this by itself in most cases 
but it can fail).

     \definebodyfontenvironment [14pt]

I attached a slightly modified version of your project structure to show 
a different way to organize documents. What I would change is to use a 
better section name for each article, e.g. \Article (or \startArticle) 
is better than \MyTitle as first level header in each article.

Wolfgang

[-- Attachment #2: journal.zip --]
[-- Type: application/x-zip-compressed, Size: 1601 bytes --]

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

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

* Re: \definehead behaving differently when in an environment file versus \input'ed
  2020-05-02 16:08 ` Wolfgang Schuster
@ 2020-05-02 21:34   ` ntg
  0 siblings, 0 replies; 4+ messages in thread
From: ntg @ 2020-05-02 21:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> On 2 May 2020, at 17:08, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:

[comprehensive answer snipped]

Thank-you, very helpful.

> I attached a slightly modified version of your project structure to show a different way to organize documents. What I would change is to use a better section name for each article, e.g. \Article (or \startArticle) is better than \MyTitle as first level header in each article.

Agreed - the \MyTitle was just for the example. Your structure is nice though - less complicated than the one I cobbled together looking at the Wiki example.

--
Bruce Horrocks
Hampshire, UK

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

end of thread, other threads:[~2020-05-02 21:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02 15:14 \definehead behaving differently when in an environment file versus \input'ed ntg
2020-05-02 15:16 ` ntg
2020-05-02 16:08 ` Wolfgang Schuster
2020-05-02 21:34   ` ntg

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