Hello, We have a document where a gap occurs in a columnset under certain conditions. It seems to be a confluence of: - 2 sections, each with 2-column columnsets - \page[empty] between them - the 2nd section has a tighter interline space The problem is that on the first page of the second section, a two-line gap appears where gridlines 50 and 51 are. It may be a coincidence, but 50 is also the number of lines per page in the first section. We've found that "coincidence" to be true even with different page and font sizes. Can anyone tell us a way to get rid of the gap? We've tried things like \setupcolumnsetlines[columnsetbibliography][1][1][-1] \setupcolumnsetlines[columnsetbibliography][1][2][-1] with various values for the last parameter, but nothing helps. Below is a small, self-contained sample. Thanks for any help you can give. Lars Version information: This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012) (format=cont-en 2012.11.14) 13 SEP 2013 11:38 ConTeXt ver: 2012.05.30 11:26 MKII fmt: 2012.11.14 int: english/english \showgrid \setupinterlinespace[line=12pt] \setuplayout[grid=yes] \definecolumnset[columnsetIntroduction0][n=2] \setupcolumnset[columnsetIntroduction0][distance=5mm,balance=yes] \definecolumnset[columnsetbibliography][n=2] \setupcolumnset[columnsetbibliography][distance=5mm,balance=yes] \starttext \section{Introduction} \startcolumnset[columnsetIntroduction0] % The important thing here is how many columns of text we have. \dorecurse {7} { \input knuth } \stopcolumnset \page[yes] % Always finish the current page % If we haven't ended up on an odd page, generate an empty one. \ifodd \pageno \else \page[empty] \fi \section{Bibliography} \setupinterlinespace[line=9.3pt] \startcolumnset[columnsetbibliography] \dorecurse {140} { \input knuth\par } \stopcolumnset \stoptext
It should also be mentioned that we need the second section to have a tighter line spacing than the first, but despite the \setupinterlinespace[line=9.3pt] command, and despite the red grid lines being tighter, the text itself seems to have the same interline spacing as in the first section. How do we actually change the interline spacing? Thanks again. Lars On 9/13/2013 4:07 PM, Lars Huttar wrote:
Hello, We have a document where a gap occurs in a columnset under certain conditions. It seems to be a confluence of:
- 2 sections, each with 2-column columnsets - \page[empty] between them - the 2nd section has a tighter interline space
The problem is that on the first page of the second section, a two-line gap appears where gridlines 50 and 51 are.
It may be a coincidence, but 50 is also the number of lines per page in the first section. We've found that "coincidence" to be true even with different page and font sizes.
Can anyone tell us a way to get rid of the gap? We've tried things like \setupcolumnsetlines[columnsetbibliography][1][1][-1] \setupcolumnsetlines[columnsetbibliography][1][2][-1] with various values for the last parameter, but nothing helps.
Below is a small, self-contained sample.
Thanks for any help you can give. Lars
Version information: This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012) (format=cont-en 2012.11.14) 13 SEP 2013 11:38 ConTeXt ver: 2012.05.30 11:26 MKII fmt: 2012.11.14 int: english/english
\showgrid \setupinterlinespace[line=12pt] \setuplayout[grid=yes]
\definecolumnset[columnsetIntroduction0][n=2] \setupcolumnset[columnsetIntroduction0][distance=5mm,balance=yes]
\definecolumnset[columnsetbibliography][n=2] \setupcolumnset[columnsetbibliography][distance=5mm,balance=yes]
\starttext
\section{Introduction}
\startcolumnset[columnsetIntroduction0] % The important thing here is how many columns of text we have. \dorecurse {7} { \input knuth } \stopcolumnset
\page[yes] % Always finish the current page % If we haven't ended up on an odd page, generate an empty one. \ifodd \pageno \else \page[empty] \fi
\section{Bibliography} \setupinterlinespace[line=9.3pt]
\startcolumnset[columnsetbibliography] \dorecurse {140} { \input knuth\par } \stopcolumnset
\stoptext
FYI, I have posted this question on http://tex.stackexchange.com/questions/133586/bug-unwanted-gap-in-2nd-column... Marco and phg were able to reproduce the problem, including in the latest versions. I don't plan to keep posting in both places, but wanted to leave a pointer from this thread to the other one. Regards, Lars On 9/13/2013 4:07 PM, Lars Huttar wrote:
Hello, We have a document where a gap occurs in a columnset under certain conditions.
I was advised to report the bug back to this list, with an even more minimized example. Here it is below. This bug occurs in both mkiv and mkii, in the latest versions (current beta). |\setupinterlinespace[line=12pt] \definecolumnset[columnset1][n=2] \setupcolumnset[columnset1][distance=5mm,balance=yes] \starttext \section{Introduction} \startcolumnset[columnset1] \dorecurse {7} { \input knuth } \stopcolumnset \section{Bibliography} \setupinterlinespace[line=9.3pt] \startcolumnset[columnset1] \dorecurse {10} { \input knuth } \stopcolumnset \stoptext Note the gap across both columns on p. 3, about 3/4 of the way down. Any suggestions for a workaround would be appreciated. Lars | On 9/16/2013 2:29 PM, Lars Huttar wrote:
FYI, I have posted this question on http://tex.stackexchange.com/questions/133586/bug-unwanted-gap-in-2nd-column... Marco and phg were able to reproduce the problem, including in the latest versions. I don't plan to keep posting in both places, but wanted to leave a pointer from this thread to the other one.
Regards, Lars
On Mon, 16 Sep 2013, Lars Huttar wrote:
I was advised to report the bug back to this list, with an even more minimized example. Here it is below. This bug occurs in both mkiv and mkii, in the latest versions (current beta).
|\setupinterlinespace[line=12pt]
\definecolumnset[columnset1][n=2] \setupcolumnset[columnset1][distance=5mm,balance=yes]
\starttext
\section{Introduction} \startcolumnset[columnset1] \dorecurse {7} { \input knuth } \stopcolumnset
\section{Bibliography} \setupinterlinespace[line=9.3pt] \startcolumnset[columnset1] \dorecurse {10} { \input knuth } \stopcolumnset
\stoptext
Note the gap across both columns on p. 3, about 3/4 of the way down. Any suggestions for a workaround would be appreciated.
Any particular reason you are using columnsets rather than \startcolumns or \startmixedcolumns. Columnsets are for specialized layout requirements, and in my experience, mixing columnsets with text that is not in columnsets is a bit tricky. \startsetups normal \setupinterlinespace[line=12pt] \stopsetups \startsetups tight \setupinterlinespace[line=9.3pt] \stopsetups \setupmixedcolumns[distance=5mm, balance=yes] \starttext \section{Introduction} \startmixedcolumns[setups=normal] \dorecurse {7} { \input knuth } \stopmixedcolumns \section{Bibliography} \startmixedcolumns[setups=tight] \dorecurse {10} { \input knuth } \stopmixedcolumns Aditya (not sure why the interlinespacing is not working)
On 9/16/2013 11:29 PM, Lars Huttar wrote:
I was advised to report the bug back to this list, with an even more minimized example. Here it is below. This bug occurs in both mkiv and mkii, in the latest versions (current beta).
|\setupinterlinespace[line=12pt]
\definecolumnset[columnset1][n=2] \setupcolumnset[columnset1][distance=5mm,balance=yes]
\starttext
\section{Introduction} \startcolumnset[columnset1] \dorecurse {7} { \input knuth } \stopcolumnset
\section{Bibliography} \setupinterlinespace[line=9.3pt] \startcolumnset[columnset1] \dorecurse {10} { \input knuth } \stopcolumnset
\stoptext
Note the gap across both columns on p. 3, about 3/4 of the way down. Any suggestions for a workaround would be appreciated.
Just wondering ... do you think that the first pages look ok? You mess with the interlinespace in a way that will make the outcome never look okay. Also, columnsets assume that the interlinespace is sane. \setbox0\hbox{Tg}\the\htdp0,\the\baselineskip gives 10.59601pt,9.3pt so, any line that has a character with ascender and descender will enforce a larger than 9.3pt distance + lineskip and mess up any prediction cq. heuristics Hans -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Aditya wrote:
Any particular reason you are using columnsets rather than \startcolumns or \startmixedcolumns. Columnsets are for specialized layout requirements, and in my experience, mixing columnsets with text that is not in columnsets is a bit tricky.
Thanks for suggesting a potential workaround. We do have pretty specialized layout requirements, including figures (some of which are hangarounds within columns, and some are outside of columnsets but on the same page) and page-width-centered section headings that are outside of columnsets. I suspect that we tried \startcolumns and couldn't get it to work, but I will definitely try again I can't find \startmixedcolumns on the contextgarden wiki nor in the ConTeXt manual. There are references to it on this mailing list, as a "rewrite of the old columns mechanism". I'm reluctant to entrust a big production project to undocumented features, but at this point, if it works, we'll probably go with it. I wonder if it's available in mkii as well as in mkiv?
\startsetups normal \setupinterlinespace[line=12pt] \stopsetups
\startsetups tight \setupinterlinespace[line=9.3pt] \stopsetups \setupmixedcolumns[distance=5mm, balance=yes]
\starttext \section{Introduction} \startmixedcolumns[setups=normal] \dorecurse {7} { \input knuth } \stopmixedcolumns
\section{Bibliography}
\startmixedcolumns[setups=tight] \dorecurse {10} { \input knuth } \stopmixedcolumns
Aditya (not sure why the interlinespacing is not working)
At http://tex.stackexchange.com/questions/133586/bug-unwanted-gap-in-2nd-column..., phg wrote "If you want lines to adhere to a tighter line spacing you will have to set a smaller font size, (the default one is 12pt I think) e.g. |\setupbodyfont [7pt]| gets you the desired baseline skip and decent leading. Doesn’t make the gap disappear, though." I had left font settings out of the minimal example, since they aren't necessary to exercise the bug. Thanks again, Lars
On 9/17/2013 5:02 PM, Lars Huttar wrote:
Aditya wrote:
Any particular reason you are using columnsets rather than \startcolumns or \startmixedcolumns. Columnsets are for specialized layout requirements, and in my experience, mixing columnsets with text that is not in columnsets is a bit tricky.
Thanks for suggesting a potential workaround.
We do have pretty specialized layout requirements, including figures (some of which are hangarounds within columns, and some are outside of columnsets but on the same page) and page-width-centered section headings that are outside of columnsets. I suspect that we tried \startcolumns and couldn't get it to work, but I will definitely try again
ok, but then, an interlinespace is normally around 1.2 times the bodyfontsize
I can't find \startmixedcolumns on the contextgarden wiki nor in the ConTeXt manual. There are references to it on this mailing list, as a "rewrite of the old columns mechanism". I'm reluctant to entrust a big production project to undocumented features, but at this point, if it works, we'll probably go with it. I wonder if it's available in mkii as well as in mkiv?
not in mkii, but it will be the main mkiv continuous multicolumn mode (we keep the old columns around for a while) and in due time I will make a new columnset implementation (must have some snippets of code somewhere but never found time)
\startsetups normal \setupinterlinespace[line=12pt] \stopsetups
\startsetups tight \setupinterlinespace[line=9.3pt] \stopsetups \setupmixedcolumns[distance=5mm, balance=yes]
\starttext \section{Introduction} \startmixedcolumns[setups=normal] \dorecurse {7} { \input knuth } \stopmixedcolumns
\section{Bibliography}
\startmixedcolumns[setups=tight] \dorecurse {10} { \input knuth } \stopmixedcolumns
Aditya (not sure why the interlinespacing is not working)
At http://tex.stackexchange.com/questions/133586/bug-unwanted-gap-in-2nd-column..., phg wrote "If you want lines to adhere to a tighter line spacing you will have to set a smaller font size, (the default one is 12pt I think) e.g. |\setupbodyfont [7pt]| gets you the desired baseline skip and decent leading. Doesn’t make the gap disappear, though." I had left font settings out of the minimal example, since they aren't necessary to exercise the bug.
Thanks again, Lars
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans wrote,
Just wondering ... do you think that the first pages look ok?
Thanks for your response. By "look ok", are you referring to the closeness of the lines of text? It does seem kind of close, but within acceptable limits, depending on other constraints; however I'm not really the one to make aesthetic decisions about the document. I'm just trying to implement what the customer wants. Also, the minimal example is stripped down to minimally exercise the unexplained behavior, so it doesn't reflect the fact that in our actual document, we reduce the font size in places where we reduce the interlinespace. In that sense, maybe a less minimal example would serve the purpose better. I'll work on that, now that I know the font size may be an integral part of the problem.
You mess with the interlinespace in a way that will make the outcome never look okay.
I'd like to know more what that means, but I think it's elaborated on below when you talk about baselineskip.
Also, columnsets assume that the interlinespace is sane.
Can you point me to documentation on the constraints that define what kind of interlinespace is sane? Also, given the goal that "For using ConTeXt, no TeX programming skills and no technical background are needed. Some basic knowledge of typography and document design will enable you to use the full power of ConTeXt" (http://wiki.contextgarden.net/What_is_ConTeXt), does/could ConTeXt issue an error when its assumptions are violated?
\setbox0\hbox{Tg}\the\htdp0,\the\baselineskip
gives
10.59601pt,9.3pt
so, any line that has a character with ascender and descender will enforce a larger than 9.3pt distance + lineskip and mess up any prediction cq. heuristics
I can't find any reference defining \htdp0, but I'm guessing it means the height+depth (where depth means how far descenders extend below the baseline) of the "Tg" box. I'm also confused as to why you're adding 9.3pt + lineskip, when in my limited understanding of TeX, I understood lineskip to be *part* of the distance between baselines, rather than an additional distance. But maybe that's not important to the main issue. I'm trying to formulate a rule for knowing whether "interlinespace is sane". Is it that interlinespace needs to be more than or equal to the maximum of (height + depth + lineskip) of any line in the text? Thanks again for your help. Lars
On 9/17/2013 8:57 PM, Lars Huttar wrote:
Can you point me to documentation on the constraints that define what kind of interlinespace is sane?
the default is 2.8ex which is pretty safe, then there is the ht/dp ratio which in some cases has to be adapted to fonts esp when they are non-typical
Also, given the goal that "For using ConTeXt, no TeX programming skills and no technical background are needed. Some basic knowledge of typography and document design will enable you to use the full power of ConTeXt" (http://wiki.contextgarden.net/What_is_ConTeXt), does/could ConTeXt issue an error when its assumptions are violated?
well, adapting interlinespace is already beyond basic ... if you have specifications from someplace else they are supposed to be experts (ok, in many case we get weird specs too, but i always tend to ignore those)
\setbox0\hbox{Tg}\the\htdp0,\the\baselineskip
gives
10.59601pt,9.3pt
so, any line that has a character with ascender and descender will enforce a larger than 9.3pt distance + lineskip and mess up any prediction cq. heuristics
I can't find any reference defining \htdp0, but I'm guessing it means the height+depth (where depth means how far descenders extend below the baseline) of the "Tg" box.
indeed, \htdp is a convenient macro, you could also add two dimensions or use a \dimexpr which is more work
I'm also confused as to why you're adding 9.3pt + lineskip, when in my limited understanding of TeX, I understood lineskip to be *part* of the distance between baselines, rather than an additional distance. But maybe that's not important to the main issue.
\starttext \showstruts \strut test \par \strut test \showstruts \strut \ruledhbox{$\sqrt{test}$} \par \strut test \stoptext \lineskip (1pt by default) kicks in when the line distance minus baselineskip exceeds \lineskiplimit (0pt by default)
I'm trying to formulate a rule for knowing whether "interlinespace is sane". Is it that interlinespace needs to be more than or equal to the maximum of (height + depth + lineskip) of any line in the text?
\setbox0\hbox{()} \the\htdp0 is the minumum and you'd better add one point at least bodyfont/baseline : 10/12 12/14.4 etc are ok Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Regarding "sane" interlinespace, Hans wrote,
ok, but then, an interlinespace is normally around 1.2 times the bodyfontsize
OK. That's helpful. But notice that in the following example, the interline space that causes the problem is in the *first* section (where htdp is 12pt and baselineskip is also 12pt!), while the gap shows up in the *second* section, whose interlinespace is 2.8ex: \def\printHtdp{\setbox0\hbox{()} \the\htdp0,\the\baselineskip} \definecolumnset[columnset1][n=2] \setupcolumnset[columnset1][distance=5mm,balance=yes] \starttext \section{Introduction} \setupinterlinespace[line=12pt] \startcolumnset[columnset1] \printHtdp \dorecurse {7} { \input knuth } \stopcolumnset \section{Bibliography} \tfxx \setupinterlinespace[line=2.8ex] %or use 11pt \startcolumnset[columnset1] \printHtdp \dorecurse {10} { \input knuth } \stopcolumnset \stoptext Since the problem can appear a ways after the cause, that makes it an especially hard problem to track down, especially for someone who is unaware of the nature of the problem. But even now that we're aware of what the problem (hopefully) is, we've not been able to fix it in our real-life document. We sprinkled in many places the code to show htdp and baselineskip (\printHtdp). E.g. in the early sections that would putatively cause the problem, our htdp/baselineskip in 8.60252pt,10.5pt. That's a ratio of more than 1.2. We have eliminated all the places we could find where the htdp/baselineskip ratio was less than 1.2, even where there was no text. But the gap persists. We have a large and complex document, so there might conceivably be places where a larger htdp than expected is hiding. Are there any tools for automatically going through a document and reporting places where not-sane interlinespace occurs? Thanks, Lars
On 9/18/2013 11:47 PM, Lars Huttar wrote:
Regarding "sane" interlinespace, Hans wrote,
ok, but then, an interlinespace is normally around 1.2 times the bodyfontsize
OK. That's helpful.
But notice that in the following example, the interline space that causes the problem is in the *first* section (where htdp is 12pt and baselineskip is also 12pt!), while the gap shows up in the *second* section, whose interlinespace is 2.8ex:
Columnsets are rather special and mostly meant for magazine like documents, where content can span columns, images are explicitly placed on the grid, etc. For that reason columnset soperate on a rather strict grid that gets setup based in the lineheight and although content can be larger, the grid dictates what happens. Balancing is semi automatic and nearly always demands some tweaks. Using columnsets for a large document that has to flow automatically is therefore debatable. Regular multi columns or in mkiv mixed-columns are a better choice then. You need to keep in mind that tex has no concept of columns so it is faked by using a virtual page nofcolumns * text height. Anyway, as columnsets are supposed to cooperate with grid mode, any messing with the lineheight will interfere. Normally a document has a consistent lineheight everywhere. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans wrote,
Columnsets are rather special and mostly meant for magazine like documents, where content can span columns, images are explicitly placed on the grid, etc. For that reason columnset soperate on a rather strict grid that gets setup based in the lineheight and although content can be larger, the grid dictates what happens. Balancing is semi automatic and nearly always demands some tweaks.
In our use of columnsets, we do have content that can span columns (but we keep it outside of columnsets). We also have images within columns that are placed in the flow of text via hangarounds. We manually tweak our column lengths on each page (e.g. \setupcolumnsetlines[columnset10][1][1][42]), in order to avoid the worst of the widows and orphans. As you say, balancing requires manual tweaks too, but it's not that big a burden, since we're already doing \setupcolumnsetlines for many pages.
Using columnsets for a large document that has to flow automatically is therefore debatable. Regular multi columns or in mkiv mixed-columns are a better choice then.
We have tried to port our code to mkiv, but have so far found been unsuccessful. (But are trying again now, having found new success with TL2013 mkii.) Also, we've been unable to find any statement that mkiv is out of beta status. Moreover, much of the documentation still seems to be oriented toward mkii. So it's hard to justify much of a time investment in porting production work to mkiv yet. Can you comment on the official status of mkiv? Regarding mixed-columns: I understand it's a rewrite of the old "columns" model. My impression is that "columns" didn't support manual tweaking of column lengths (like \setupcolumnsetlines). Does mixed-columns support such a thing? That would be a critical question for us, as it wouldn't be an option for us to spend time porting to mkiv and using mixed-columns, if it doesn't allow us to tweak the height of each column on each page. Thanks again for your help and advice. Lars
On 9/19/2013 4:25 PM, Lars Huttar wrote:
Hans wrote,
Columnsets are rather special and mostly meant for magazine like documents, where content can span columns, images are explicitly placed on the grid, etc. For that reason columnset soperate on a rather strict grid that gets setup based in the lineheight and although content can be larger, the grid dictates what happens. Balancing is semi automatic and nearly always demands some tweaks.
In our use of columnsets, we do have content that can span columns (but we keep it outside of columnsets). We also have images within columns that are placed in the flow of text via hangarounds. We manually tweak our column lengths on each page (e.g. \setupcolumnsetlines[columnset10][1][1][42]), in order to avoid the worst of the widows and orphans. As you say, balancing requires manual tweaks too, but it's not that big a burden, since we're already doing \setupcolumnsetlines for many pages.
Using columnsets for a large document that has to flow automatically is therefore debatable. Regular multi columns or in mkiv mixed-columns are a better choice then.
We have tried to port our code to mkiv, but have so far found been unsuccessful. (But are trying again now, having found new success with TL2013 mkii.) Also, we've been unable to find any statement that mkiv is out of beta status. Moreover, much of the documentation still seems to be oriented toward mkii. So it's hard to justify much of a time investment in porting production work to mkiv yet. Can you comment on the official status of mkiv?
just as we had betas for mkii, we have betas for mkiv .. mkii is already frozen for years (apart from very few fixes) i'm pretty sure that most context users use mkiv and here i only run mkii in old workflows that already have been running for years (and will continue to do so as long as no fundamental update is needed) most mkii functionality is present in mkiv (of course some old font stuff is obsolete) although there are a few mechanism that due to extensions are controlled with different keys (mostly keys like 'alternative') unless impossible (or messy) i try to keep mkii command compatibility but mkiv has already many more commands and mechanisms than mkii, so most in manuals still applies official status: use mkiv as that's where it all happens
Regarding mixed-columns: I understand it's a rewrite of the old "columns" model. My impression is that "columns" didn't support manual tweaking of column lengths (like \setupcolumnsetlines). Does mixed-columns support such a thing? That would be a critical question for us, as it wouldn't be an option for us to spend time porting to mkiv and using mixed-columns, if it doesn't allow us to tweak the height of each column on each page.
i can probably add some height-per-column option but it also depends on what height is supposed to do but it's unlikely to happen the next few weeks a mkiv columnsets implementation .. well, it depends on time and motivation (most of such mechanisms i don't use myself so i need good reasons to spend time on them, unless i'm looking for a challenge on a rainy day) but ... \column works quite ok in mixed columns
Thanks again for your help and advice.
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Aditya Mahajan
-
Hans Hagen
-
Lars Huttar