ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gerben Wierda <gerben.wierda@rna.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: mkiv versus mkii: whitespace issues
Date: Sun, 15 Mar 2015 15:17:39 +0100	[thread overview]
Message-ID: <29D8E2A4-A3FF-4F3F-AF9C-7E363D1970F9@rna.nl> (raw)
In-Reply-To: <E87707F5-AECF-4EEF-9E9F-91BC6CF2EDA7@gmail.com>

I’m struggling to make a minimal example.It happens in my project, so it is a result of my …/products/prd_book.tex and ../environment/env_cataoia.tex and the test file. I need to give three files, two of which differ between mkii and mkiv because of different font commands and lettrine vs initial

prd_book.tex ===================================
\startproduct prd_book
\project project_cataoia

\starttext
\start
\startstandardmakeup[doublesided=no]
\ss
\hairline \start
\blank[line]
\switchtobodyfont[16pt]\bf
\leftaligned{Chess}%
\blank[line]
\leftaligned{and the Art of}%
\blank[line]
\leftaligned{Enterprise Architecture}%
\stop
\hairline \blank[line]
\leftaligned{Making the right moves to manage Business--IT complexity}%
\hairline \blank[line]\rightaligned{Gerben Wierda}%
\blank[6cm]\start\leftskip=10cm\hairline\stop
\rightaligned{2015}%
\stopstandardmakeup
\startstandardmakeup[doublesided=no,page=no]
~\blank[2in]
\start
\switchtobodyfont[9pt]
Copyright \copyright\ 2015 by Gerben Wierda, The Netherlands\crlf
Image used on cover (and on the inside) \copyright\ iStock.com/Antonio
\blank[4mm]
Published by R\&A, The Netherlands
\blank[4mm]
Typeset with \TeX, using the mkii version of the \SSCONTEXT\ macro package.
\blank[4mm]
Neither the author, nor the publisher, nor the printer, nor the distributor,
nor the seller accept any responsibility or liability for loss or damage
occasioned to any person or property through using the material, instructions,
methods or ideas contained in or distributed with this book, or acting or
refraining from acting as a result of such use. The author, publisher,
printer, distributor, and seller expressly disclaim all implied warranties,
including merchantability of fitness for any particular purpose.
\blank[4mm]
ISBN 978-90-819840-5-8
\blank[4mm]
Contact info: {\sl info@enterprisechess.com}\crlf Web site: {\sl
http://enterprisechess.com}\crlf Suggested hashtag: {\sl \#eachess}
\stop
\stopstandardmakeup
\startstandardmakeup[doublesided=no]
\start
\switchtobodyfont[16pt]
\midaligned{The world is not {\blackboard Q}, it is {\blackboard R}}
\blank[6cm]
\stop
\stopstandardmakeup
\stop
\startfrontmatter
\startbuffer [chapter:quote]
%When teaching a rapidly changing technology, perspective is more important
%than content\crlf
%{\tf Richard~Pattis}
The most erroneous stories are those we think we know best --- and therefore
never scrutinize or question.\crlf
{\tf Stephen Jay Gould}
\stopbuffer
	\noheaderandfooterlines
\start
	\title[h:toc]{Contents}
	\setuppagenumber[number=3]
	\placelist[chapter,chaptertext]
\stop
	\component c_loosely
\stopfrontmatter
\startbodymatter
	\component c_inconvenient
	\component c_goals
	\component c_orthodoxy
	\component c_intermezzo
	\component c_chess
	\component c_model
	\component c_future
	\component c_hurdles
\stopbodymatter
\startappendices
%	\component c_logic
	\component c_cloud
	\component c_current
	\component c_fsatemplate
	\component c_psatemplate
	\component c_bibliography
	\component c_endnotes
	\component c_index
\stopappendices
\stoptext

\stopcomponent
=============================================

env_cataoia.tex mkii =============================
\startenvironment env_cataoia
\project project_cataoia
%
\definedescription [description]
	[location=serried, width=broad, hang=fit, margin=standard,
	headstyle=bold]
\definestartstop [descriptions] [before=\startpacked,
					after=\stoppacked]
%
\def\SSCONTEXT {Con\kern-.15em\TeX t}
%
%
\definepapersize[smallpaperback][width=5in,height=8in]
\setuppapersize[smallpaperback][smallpaperback]
\setuplayout[location=doublesided]
\setuppagenumbering[alternative=doublesided]
\setupsectionblock[frontpart][page=no]
\setupsectionblock[bodypart][page=no]
\setupsectionblock[appendix][page=no]
\setupsectionblock[backpart][page=no]

% Every chapter body text starts with lettrine:
\usemodule[lettrine]
\setuplettrine[Lines=3,
               Hang=.5,
               Oversize=0,
               Raise=0,
               Findent=0pt,
               Nindent=0em,
               Slope=0em,
               Ante=,
               FontHook=,
               TextFont=\sc,
               Image=no]

% Every chapter starts with a quote on the LHS page:
\setuphead
  [chapter]
  [page=,
   before={\setups[chapter:before]},
   after={\setups[chapter:after]}]

\startsetups chapter:before
    \page[left]
    \noheaderandfooterlines
    \startalignment[left,nothyphenated]
        \startnarrower[4*left]
	    \em \getbuffer[chapter:quote]
        \stopnarrower
    \stopalignment
    \resetsetups[quote:text]
    \page[right]
    \noheaderandfooterlines
    \blank[force,2*big]
\stopsetups

\startsetups chapter:after
    \blank[3*big]
\stopsetups

% Mark TODO items in the text
\def\todo#1{{\red --- --- --- TODO: {#1} --- --- ---}}

%
\setuptolerance[horizontal=strict]
\setupcolors[state=start]
\setupcolor[rgb]
%
\setupquote[style=small]

%
\usetypescript[serif,sans,mono] [hanging] [normal]

% Bypassing type-gtamacfonts.tex
\starttypescript [sans,serif] [optima] [texnansi,ec]
\definefontsynonym [Optima-Regular] [\typescriptthree-OptimaRegular]
[encoding=\typescriptthree]
\definefontsynonym [Optima-Italic] [\typescriptthree-OptimaItalic]
[encoding=\typescriptthree]
\definefontsynonym [Optima-Bold] [\typescriptthree-OptimaBold]
[encoding=\typescriptthree]
\definefontsynonym [Optima-BoldItalic] [\typescriptthree-OptimaBoldItalic]
[encoding=\typescriptthree]
\definefontsynonym [Optima-ExtraBlack] [\typescriptthree-OptimaExtraBlack]
[encoding=\typescriptthree]
\stoptypescript
\starttypescript [sans,serif] [optima] [name]
\setups            [font:fallback:\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone] [Optima-Regular]
\definefontsynonym [\typescriptprefix\typescriptone Italic] [Optima-Italic]
\definefontsynonym [\typescriptprefix\typescriptone Bold]       [Optima-Bold]
\definefontsynonym [\typescriptprefix\typescriptone BoldItalic]
[Optima-BoldItalic]
\definefontsynonym [\typescriptprefix\typescriptone Black] [Optima-ExtraBlack]
\stoptypescript
\definetypeface[allsans][rm][serif][optima][default][encoding=texnansi]
\definetypeface[allsans][ss][sans][optima][default][encoding=texnansi]
%\definetypeface[allsans][rm][serif][optima][default][encoding=ec]
%\definetypeface[allsans][ss][sans][optima][default][encoding=ec]
\loadmapfile [gtamacfonts.map]
\setupbodyfont[allsans,10pt]

\setupalign[hanging]
\setupfootnotes[conversion=set 2,way=bypage,align=flushleft]

%

%\def\doalignline#1#2% \\ == newline
% {\ifhmode\hfil\break\fi
%  \begingroup
%  \setlocalhsize % new
%  \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
%  \dowithnextbox
%    {\noindent
%     \hbox to \localhsize
%       {\ifcase\alignstrutmode\or\strut\fi
%         #1\unhbox\nextbox#2}\endgroup}
%    \hbox}

\def\startBookQuote
 {\par\bgroup
  \setupnarrower[before=]\startnarrower\indenting[never]\tfx}
\def\stopBookQuote{\stopnarrower\egroup}
%
\startmode[standalone]
  \setupfootertexts[pagenumber][{\jobname->\filename{\currentcomponent}}]
  \def\maybeendnotes
     {\subsubject{Notes} \placenotes[endnote] \subsubject{Bibliography}
	\switchtobodyfont[9pt]
	\placepublications[criterium=all]}
  \appendtoks \maybeendnotes \to \everystoptext
\stopmode
%
\setupcaption[figure][style=small]
\setupinteraction[state=start]

\definemeasure[CAindent][12pt]
\setupindenting[yes,\measure{CAindent}]
\setupnarrower
  [ left=\measure{CAindent},
    right=\measure{CAindent},
   middle=\measure{CAindent}]
\setupitemize[each][margin=\measure{CAindent},width=\measure{CAindent}]

\defineenumeration[Step][headstyle=slanted,
	location=hanging,width=fit,stopper=:,margin=\measure{CAindent},]
\defineenumeration[Phase][headstyle=slanted,
	location=hanging,width=fit,stopper=:,margin=\measure{CAindent},]
\definedescription[Member][headstyle=bold,
	location=hanging,indenting={yes},margin=\measure{CAindent},width=fit]

\setupnotedefinition[footnote][indenting={yes,medium}]
\setupnotedefinition[endnote][indenting={yes,medium},style={\switchtobodyfont[10pt]}]

\setupbibtex[database=gwierda,sort=author]
\setuppublications[numbering=short,sorttype=bbl,refcommand=short,autohang=yes]
\setupcite[short]

\useURL[masteringarchimateblog][http://masteringarchimate.com]
\useURL[masteringarchimatebook][http://masteringarchimate.com/mastering-archimate-edition-ii/]

\setupinteraction
 [style=,
  color=,
  contrastcolor=]

%\setupbackend[export=yes,xhtml=yes]

\definelist[chaptertext]
\setuplist[chaptertext][margin=1.3em,pagecommand=\gobbleoneargument]
\define[1]\ChapterAbstract{\writetolist[chaptertext]{}{\start\itx#1\stop}}

\stopenvironment
=============================================

test.tex mkii ====================================
\showgrid
\startcomponent c_loosely
\product prd_book
\project project_cataoia

\starttext
\startbuffer [chapter:quote]
In software, the chain isn't as strong as its weakest link; it's as weak as
all the weak links multiplied together\crlf
{\tf Steve McConnell --- Code Complete}\crlf\crlf
Nothing is as dangerous in architecture as dealing with separated problems\crlf
{\tf Alvar Aalto}
\stopbuffer

\chapter[h:loosely]{Prologue:\\Loosely Coupled Spaghetti}
\ChapterAbstract{Starting with an example of how things can go wrong in a
current Business-IT landscape, we notice that these kinds of problems have
existed almost for as long as IT has existed, and that no proposed `silver
bullet' has ever solved them. The goal of the book is introduced.}

\lettrine{S}{\kap{\bf uppose we}} have a system for the approval of loans. The
business logic has been put into a Business Rule Engine (BRE)
system\footnote{If you are not technical and terms like `application server',
`caught exceptions', or `web proxy' in the fragment that follows, do not
immediately get you started, do not worry: there is no need to know what I am
talking about here in a technical sense. You can read this without
understanding any of the technical references. Just skip over them, their
specifics are not important to the story. They are real enough, though.  You
can trust me on that, or ask your engineers.}. Our system has business rules
and for a certain class of prospective customers, an extra check is needed
(thus say the business rules).  This check involves sending a message to a
credit rating institute and waiting for the result. Our system will in those
cases use our Enterprise Service Bus (ESB) to send a message to a server
(which runs a service for this function, hence Service Oriented Architecture
or SOA) which then handles the interaction with the credit rating institute
via a dedicated secure link.  Since we only do this check in a small
percentage of cases, the server handling the requests and replies to the
credit institute is limited in size and our secure link is narrow as well.

\stoptext
\stopcomponent
=============================================

env_cataoia.tex mkiv =============================
\startenvironment env_cataoia
\project project_cataoia
%
\definedescription [description]
	[location=serried, width=broad, hang=fit, margin=standard,
	headstyle=bold]
\definestartstop [descriptions] [before=\startpacked,
					after=\stoppacked]
%
\def\SSCONTEXT {Con\kern-.15em\TeX t}
%
%
\definepapersize[smallpaperback][width=5in,height=8in]
\setuppapersize[smallpaperback][smallpaperback]
\setuplayout[location=doublesided]
\setuppagenumbering[alternative=doublesided]
\setupsectionblock[frontpart][page=no]
\setupsectionblock[bodypart][page=no]
\setupsectionblock[appendix][page=no]
\setupsectionblock[backpart][page=no]

% Every chapter body text starts with lettrine:
\usemodule[oldbibtex]
\setupinitial[font=Normal cp
\measure{initial:n},hoffset=3ex,voffset=2.1\lineheight,n=3,m=1,distance=-3ex]
%\usemodule[lettrine]
%\setuplettrine[Lines=3,
%               Hang=.5,
%               Oversize=0,
%               Raise=0,
%               Findent=0pt,
%               Nindent=0em,
%               Slope=0em,
%               Ante=,
%               FontHook=,
%               TextFont=\sc,
%               Image=no]

% Every chapter starts with a quote on the LHS page:
\setuphead
  [chapter]
  [page=,
   before={\setups[chapter:before]},
   after={\setups[chapter:after]}]

\startsetups chapter:before
    \page[left]
    \noheaderandfooterlines
    \startalignment[left,nothyphenated]
        \startnarrower[4*left]
	    \em \getbuffer[chapter:quote]
        \stopnarrower
    \stopalignment
    \resetsetups[quote:text]
    \page[right]
    \noheaderandfooterlines
    \blank[force,2*big]
\stopsetups

\startsetups chapter:after
    \blank[3*big]
\stopsetups

% Mark TODO items in the text
\def\todo#1{{\red --- --- --- TODO: {#1} --- --- ---}}

%
\setuptolerance[horizontal=strict]
\setupcolors[state=start]
\setupcolor[rgb]
%
\setupquote[style=small]

\starttypescript [sans] [optima]
	\setups[font:fallback:sans]
	\definefontsynonym [Sans]           [file:optima.ttc(Optima Regular)]
	\definefontsynonym [SansItalic]     [file:optima.ttc(Optima Italic)]
	\definefontsynonym [SansBold]       [file:optima.ttc(Optima Bold)]
	\definefontsynonym [SansBoldItalic] [file:optima.ttc(Optima Bold
Italic)]
\stoptypescript

\definetypeface [optima] [ss] [sans] [optima] [default] [features=default]
\definetypeface [optima] [mm] [math] [modern] [default]

\setupbodyfont[optima,10pt]

\setupalign[hanging]

%

%\def\doalignline#1#2% \\ == newline
% {\ifhmode\hfil\break\fi
%  \begingroup
%  \setlocalhsize % new
%  \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
%  \dowithnextbox
%    {\noindent
%     \hbox to \localhsize
%       {\ifcase\alignstrutmode\or\strut\fi
%         #1\unhbox\nextbox#2}\endgroup}
%    \hbox}

\def\startBookQuote
 {\par\bgroup
  \setupnarrower[before=]\startnarrower\indenting[never]\tfx}
\def\stopBookQuote{\stopnarrower\egroup}
%
\startmode[standalone]
  \setupfootertexts[pagenumber][{\jobname->\filename{\currentcomponent}}]
  \def\maybeendnotes
     {\subsubject{Notes} \placenotes[endnote] \subsubject{Bibliography}
	\switchtobodyfont[9pt]
	\placepublications[criterium=all]}
  \appendtoks \maybeendnotes \to \everystoptext
\stopmode
%
\setupcaption[figure][style=small]
\setupinteraction[state=start]

\definemeasure[CAindent][12pt]
\setupindenting[yes,\measure{CAindent}]
\setupnarrower
  [ left=\measure{CAindent},
    right=\measure{CAindent},
   middle=\measure{CAindent}]
\setupitemize[each][margin=\measure{CAindent},width=\measure{CAindent}]

\defineenumeration[Step][headstyle=slanted,
	location=hanging,width=fit,stopper=:,margin=\measure{CAindent},]
\defineenumeration[Phase][headstyle=slanted,
	location=hanging,width=fit,stopper=:,margin=\measure{CAindent},]
\definedescription[Member][headstyle=bold,
	location=hanging,indenting={yes},margin=\measure{CAindent},width=fit]

\setupnotation[footnote][numberconversion=set 2,way=bypage,align=flushleft,indenting={yes,medium}]
\setupnotation[endnote][numberconversion=numbers,indenting={yes,medium},style={\switchtobodyfont[10pt]}]

\setupbibtex[database=gwierda,sort=author]
\setuppublications[numbering=short,sorttype=bbl,refcommand=short,autohang=yes]
\setupcite[short]

\useURL[masteringarchimateblog][http://masteringarchimate.com]
\useURL[masteringarchimatebook][http://masteringarchimate.com/mastering-archimate-edition-ii/]

\setupinteraction
 [style=,
  color=,
  contrastcolor=]

%\setupbackend[export=yes,xhtml=yes]

\definelist[chaptertext]
\setuplist[chaptertext][margin=1.3em,pagecommand=\gobbleoneargument]
\define[1]\ChapterAbstract{\writetolist[chaptertext]{}{\start\itx#1\stop}}

\stopenvironment
=============================================

test.tex mkiv ===================================
\showgrid
\startcomponent c_loosely
\product prd_book
\project project_cataoia

\starttext
\starttext
\startbuffer [chapter:quote]
In software, the chain isn't as strong as its weakest link; it's as weak as
all the weak links multiplied together\crlf
{\tf Steve McConnell --- Code Complete}\crlf\crlf
Nothing is as dangerous in architecture as dealing with separated problems\crlf
{\tf Alvar Aalto}
\stopbuffer

\chapter[h:loosely]{Prologue:\\Loosely Coupled Spaghetti}
\ChapterAbstract{Starting with an example of how things can go wrong in a
current Business-IT landscape, we notice that these kinds of problems have
existed almost for as long as IT has existed, and that no proposed `silver
bullet' has ever solved them. The goal of the book is introduced.}

\placeinitial S{\kap{\bf uppose we}} have a system for the approval of loans. The
business logic has been put into a Business Rule Engine (BRE)
system\footnote{If you are not technical and terms like `application server',
`caught exceptions', or `web proxy' in the fragment that follows, do not
immediately get you started, do not worry: there is no need to know what I am
talking about here in a technical sense. You can read this without
understanding any of the technical references. Just skip over them, their
specifics are not important to the story. They are real enough, though.  You
can trust me on that, or ask your engineers.}. Our system has business rules
and for a certain class of prospective customers, an extra check is needed
(thus say the business rules).  This check involves sending a message to a
credit rating institute and waiting for the result. Our system will in those
cases use our Enterprise Service Bus (ESB) to send a message to a server
(which runs a service for this function, hence Service Oriented Architecture
or SOA) which then handles the interaction with the credit rating institute
via a dedicated secure link.  Since we only do this check in a small
percentage of cases, the server handling the requests and replies to the
credit institute is limited in size and our secure link is narrow as well.

\stoptext
\stopcomponent
=============================================


G

On 14 Mar 2015, at 17:14, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> 
>> Am 14.03.2015 um 15:54 schrieb Gerben Wierda <gerben.wierda@rna.nl>:
>> 
>> I am running into two issues with my mkii-to-mkiv conversion project
>> 
>> - The \chapter command in mkiv uses more whitespace between the header and the first paragraph. How can I influence this?
>> - \startitemize[packed,joinedup] inserts whitespace between the list and the paragraph before it where mkii doesn’t
>> 
>> How can I fix this?
> 
> Do you have a example because I can’t reproduce it.
> 
> \showgrid
> 
> \starttext
> 
> \chapter{\contextmark}
> 
> \input knuth
> 
> \startitemize[packed,joinedup]
> \item One
> \item Two
> \item Three
> \stopitemize
> 
> \stoptext 
> 
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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-03-15 14:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-14 14:54 Gerben Wierda
2015-03-14 16:14 ` Wolfgang Schuster
2015-03-15 14:17   ` Gerben Wierda [this message]
2015-03-15 14:18   ` Gerben Wierda
2015-03-15 14:18   ` Gerben Wierda
2015-03-15 14:57   ` Gerben Wierda
2015-03-15 22:20     ` Wolfgang Schuster
2015-03-15 22:24 ` Wolfgang Schuster
2015-03-16 14:03   ` Gerben Wierda
2015-03-20 13:43     ` Gerben Wierda
2015-03-20 17:33       ` Wolfgang Schuster
2015-03-21 18:49         ` Gerben Wierda
2015-03-22 22:03           ` Wolfgang Schuster

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=29D8E2A4-A3FF-4F3F-AF9C-7E363D1970F9@rna.nl \
    --to=gerben.wierda@rna.nl \
    --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).