How to hide any content?
I have a strange issue with some macros that are creating extraspaces between paragraphs. Note these macros shouldn’t create anycontent, as they define content that will be sent to registers andcontent that is used for page references. Its more like invisibledata, perhaps the word is “metadata” and other parts of thedocument need to know it and refer to it, but nothing should berendered there. As best as I canunderstand, when ConTeXt sees one of these macros, it creates avertical space after the paragraph, draws nothing, then createsanother vertical space after that, before drawing the next paragraph,so the result is something close to three lines of space. Whenappearing after a section title, its also as if there is an emptyline, then blank space, then the first paragraph of content appears. Sample of what the rendered document looks like: ----- Section Title .<--if the macro is placed here, a huge empty space after thesection title is there .<-- I’m using these dots to represent empty lines Loremipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua. Ut enim ad minimveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip exea commodo consequat. Duis aute irure dolor in reprehenderit involuptate velit esse cillum dolore eu fugiat nulla pariatur.Excepteur sint occaecat cupidatat non proident, sunt in culpa quiofficia deserunt mollit anim id est laborum.\mymacro{}<--even ifthe macro is placed here, still in the paragraph, it creates a break . .<--the macro appears here, there is an empty space above and before . Loremipsum odor amet, consectetuer adipiscing elit. Imperdiet suspendisseporttitor tempus arcu turpis cras posuere varius. Volutpat posueresemper nunc metus fermentum egestas? Aenean diam nisl tortor fuscefacilisis hendrerit dolor penatibus. Lectus interdum platea rhoncusat leo; ut mi duis. Nisi vehicula morbi curabitur mus urna sodalessuspendisse sodales. Viverra inceptos sem aenean ultricies congueligula condimentum maecenas. Convallis in elementum risus nec tacitibibendum faucibus ac nascetur. Nulla ligula auctor placerat dignissiminceptos. Felis nulla quam viverra augue maximus hendrerit ipsum. . <--where the macro doesn’t appear, the spacing between paragraphs isfine (here, no macro, so one line of empty space, not three) Loremipsum odor amet, consectetuer adipiscing elit. Turpis himenaeosconubia neque fringilla neque class. Elementum per fermentum nostraullamcorper lacinia tortor pellentesque facilisis. Himenaeos sociosqutellus aptent rhoncus dignissim himenaeos aliquam? Nisi sagittiseuismod tincidunt penatibus eget tristique? Sed nam elit sapientellus mus libero. Consectetur nascetur nec metus pretium hacmolestie. Convallis lacinia quam efficitur convallis; metus purusaliquet. ----- I’ve analyzed themacros carefully, even rebuilt them. Yet, no matter my attempts torecreate and rewrite the code from scratch, they always create thisvertical space. They shouldn’t create any content, nor should anyevidence of their existence be visible to readers. I’ve tried formonths to find a way to hide these macros, rewriting the code itselfmany times, as I can’t see any reason why its creating anything atall, and also trying to find ways to hide the “blank” contentthat gets rendered: \starteffect[hidden]\mymacro{}\stopeffect \color[white]{\mymacro} \setbox\scratchbox=\vbox{\mymacro} \startnointerference\mymacro\stopnointerference \inmargin{\mymacro} Thesesolutions either entirely don’t remove the extra page break, orlead to the actual content within breaking: for instance, if there’san \index{} entry inside the macro, its page number won’t renderproperly in the end-of-document index. Or if there’s a \reference,other code attempting to display the page number just shows “page,??”. Isthere a way to completely hide content, such that nothing at all isrendered on the page and nothing occupies extra blank space, but thatdoesn’t brak indexes, cross-references, registers, etc.? --Joel
On 25 Jul 2024, at 10:29, Joel via ntg-context
wrote: I have a strange issue with some macros that are creating extra spaces between paragraphs. Note these macros shouldn’t create any content, as they define content that will be sent to registers and content that is used for page references. Its more like invisible data, perhaps the word is “metadata” and other parts of the document need to know it and refer to it, but nothing should be rendered there.
You will have to post a true minimal example including the correct definition of one of your macros. Best wishes, Taco — Taco Hoekwater E: taco@bittext.nl genderfluid (all pronouns)
Am 25.07.24 um 10:41 schrieb Taco Hoekwater:
On 25 Jul 2024, at 10:29, Joel via ntg-context
wrote: I have a strange issue with some macros that are creating extra spaces between paragraphs. Note these macros shouldn’t create any content, as they define content that will be sent to registers and content that is used for page references. Its more like invisible data, perhaps the word is “metadata” and other parts of the document need to know it and refer to it, but nothing should be rendered there.
You will have to post a true minimal example including the correct definition of one of your macros.
Besides that, try a % at the end of each line of your macro and a comma after each setting. Hraban
Okay, it took me a while, but I finally found what I believe is a minimum working example:
\starttext
\chapter{test}\starteffect[hidden]\footnote{here is footnote text}\stopeffect
\input knuth
\input knuth
\stoptext
In this case, something that should not be displayed (the footnote mark), is not displayed, but it still creates an extra vertical space. If you highlight the text, you can see there is a blank text space created there.
Throwing % signs everywhere doesn't help at all:
\starttext%
%
\chapter{test}\starteffect[hidden]\footnote{here is footnote text}\stopeffect%
\input knuth %
%
\input knuth
%
\stoptext%
On Thursday, July 25, 2024 at 02:57:29 AM MDT, Henning Hraban Ramm
On 25 Jul 2024, at 10:29, Joel via ntg-context
wrote: I have a strange issue with some macros that are creating extra spaces between paragraphs. Note these macros shouldn’t create any content, as they define content that will be sent to registers and content that is used for page references. Its more like invisible data, perhaps the word is “metadata” and other parts of the document need to know it and refer to it, but nothing should be rendered there.
You will have to post a true minimal example including the correct definition of one of your macros.
Besides that, try a % at the end of each line of your macro and a comma after each setting. Hraban ___________________________________________________________________________________ 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 ___________________________________________________________________________________
On 7/29/2024 7:49 PM, Joel via ntg-context wrote:
Okay, it took me a while, but I finally found what I believe is a minimum working example:
\starttext
\chapter{test}\starteffect[hidden]\footnote{here is footnote text}\stopeffect \input knuth
\input knuth
\stoptext
In this case, something that should not be displayed (the footnote mark), is not displayed, but it still creates an extra vertical space. If you highlight the text, you can see there is a blank text space created there.
Throwing % signs everywhere doesn't help at all:
\starttext% % \chapter{test}\starteffect[hidden]\footnote{here is footnote text}\stopeffect% \input knuth % % \input knuth % \stoptext% you anyway have to put such a note reference inside the title otherwise you create an insert node that for sure will mess up spacing
here's a trick .. i suppose that we can have a setting that supresses notes completely \setupnotes [location=none] \setupnotations [state=stop] \starttext \chapter{test\footnote{here is footnote text}} \input knuth \input knuth \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
By meaning it is a minimum working example, it demonstrates the problem, but not in all situations I use. Basically at the start of a chapter or section, I have tons of metadata. This is information in \index{} (and some custom index like \dateis that generates a time line), information placed in registers, some information loaded from an entire passage sometimes \include passage.tex (though not displayed, cuz it contains indexes, registers, etc.), and its always leaving this gap after the section title. I've used \starteffect[hidden] as one attempt to hide it, but it only makes it basically invisible, but still present. How to make it invisible and take up no space? Or can I hide all that information inside some part of the section title?
On Monday, July 29, 2024 at 02:22:09 PM MDT, Hans Hagen via ntg-context
Okay, it took me a while, but I finally found what I believe is a minimum working example:
\starttext
\chapter{test}\starteffect[hidden]\footnote{here is footnote text}\stopeffect \input knuth
\input knuth
\stoptext
In this case, something that should not be displayed (the footnote mark), is not displayed, but it still creates an extra vertical space. If you highlight the text, you can see there is a blank text space created there.
Throwing % signs everywhere doesn't help at all:
\starttext% % \chapter{test}\starteffect[hidden]\footnote{here is footnote text}\stopeffect% \input knuth % % \input knuth % \stoptext% you anyway have to put such a note reference inside the title otherwise you create an insert node that for sure will mess up spacing
here's a trick .. i suppose that we can have a setting that supresses notes completely \setupnotes [location=none] \setupnotations [state=stop] \starttext \chapter{test\footnote{here is footnote text}} \input knuth \input knuth \stoptext ----------------------------------------------------------------- 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 ___________________________________________________________________________________
On 7/30/2024 1:04 AM, Joel wrote:
By meaning it is a minimum working example, it demonstrates the problem, but not in all situations I use. Basically at the start of a chapter or section, I have tons of metadata. This is information in \index{} (and some custom index like \dateis that generates a time line), information placed in registers, some information loaded from an entire passage sometimes \include passage.tex (though not displayed, cuz it contains indexes, registers, etc.), and its always leaving this gap after the section title. I've used \starteffect[hidden] as one attempt to hide it, but it only makes it basically invisible, but still present. How to make it invisible and take up no space? Or can I hide all that information inside some part of the section title? \startchapter[title=foo]
\index{xxx} whatever in this case there is no gap, and usign some 'effect' then actually can be the reason for messing up spacing (as it goes into horizontal mode) in the case of an index, just keep the command and don't place the register, no need to use effect as \index is not visible there anyway) in the case of a footnote, just use the trick i mentioned and put the footnote in the title, not on a line of its own Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (4)
-
Hans Hagen
-
Henning Hraban Ramm
-
Joel
-
Taco Hoekwater