ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] How to hide any content?
       [not found] <491693928.2255561.1721896186986.ref@mail.yahoo.com>
@ 2024-07-25  8:29 ` Joel via ntg-context
  2024-07-25  8:41   ` [NTG-context] " Taco Hoekwater
  0 siblings, 1 reply; 7+ messages in thread
From: Joel via ntg-context @ 2024-07-25  8:29 UTC (permalink / raw)
  To: Mailing List for ConTeXt Users; +Cc: Joel


[-- Attachment #1.1: Type: text/plain, Size: 4166 bytes --]

 
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


[-- Attachment #1.2: Type: text/html, Size: 7810 bytes --]

[-- Attachment #2: 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] 7+ messages in thread

* [NTG-context] Re: How to hide any content?
  2024-07-25  8:29 ` [NTG-context] How to hide any content? Joel via ntg-context
@ 2024-07-25  8:41   ` Taco Hoekwater
  2024-07-25  8:52     ` Henning Hraban Ramm
  0 siblings, 1 reply; 7+ messages in thread
From: Taco Hoekwater @ 2024-07-25  8:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On 25 Jul 2024, at 10:29, Joel via ntg-context <ntg-context@ntg.nl> 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)


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

* [NTG-context] Re: How to hide any content?
  2024-07-25  8:41   ` [NTG-context] " Taco Hoekwater
@ 2024-07-25  8:52     ` Henning Hraban Ramm
  2024-07-29 17:49       ` Joel via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2024-07-25  8:52 UTC (permalink / raw)
  To: ntg-context

Am 25.07.24 um 10:41 schrieb Taco Hoekwater:
> 
> 
>> On 25 Jul 2024, at 10:29, Joel via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________

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

* [NTG-context] Re: How to hide any content?
  2024-07-25  8:52     ` Henning Hraban Ramm
@ 2024-07-29 17:49       ` Joel via ntg-context
  2024-07-29 20:17         ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Joel via ntg-context @ 2024-07-29 17:49 UTC (permalink / raw)
  To: ntg-context; +Cc: Joel


[-- Attachment #1.1: Type: text/plain, Size: 2048 bytes --]

 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 <texml@fiee.net> wrote:  
 
 Am 25.07.24 um 10:41 schrieb Taco Hoekwater:
> 
> 
>> On 25 Jul 2024, at 10:29, Joel via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________
  

[-- Attachment #1.2: Type: text/html, Size: 4215 bytes --]

[-- Attachment #2: 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] 7+ messages in thread

* [NTG-context] Re: How to hide any content?
  2024-07-29 17:49       ` Joel via ntg-context
@ 2024-07-29 20:17         ` Hans Hagen via ntg-context
  2024-07-29 23:04           ` Joel via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen via ntg-context @ 2024-07-29 20:17 UTC (permalink / raw)
  To: Joel via ntg-context; +Cc: Hans Hagen

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

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

* [NTG-context] Re: How to hide any content?
  2024-07-29 20:17         ` Hans Hagen via ntg-context
@ 2024-07-29 23:04           ` Joel via ntg-context
  2024-07-30  8:11             ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Joel via ntg-context @ 2024-07-29 23:04 UTC (permalink / raw)
  To: Joel via ntg-context; +Cc: Joel


[-- Attachment #1.1: Type: text/plain, Size: 2943 bytes --]

 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 <ntg-context@ntg.nl> wrote:  
 
 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
-----------------------------------------------------------------

___________________________________________________________________________________
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
___________________________________________________________________________________
  

[-- Attachment #1.2: Type: text/html, Size: 5558 bytes --]

[-- Attachment #2: 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] 7+ messages in thread

* [NTG-context] Re: How to hide any content?
  2024-07-29 23:04           ` Joel via ntg-context
@ 2024-07-30  8:11             ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen via ntg-context @ 2024-07-30  8:11 UTC (permalink / raw)
  To: Joel, mailing list for ConTeXt users; +Cc: Hans Hagen

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

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

end of thread, other threads:[~2024-07-30  8:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <491693928.2255561.1721896186986.ref@mail.yahoo.com>
2024-07-25  8:29 ` [NTG-context] How to hide any content? Joel via ntg-context
2024-07-25  8:41   ` [NTG-context] " Taco Hoekwater
2024-07-25  8:52     ` Henning Hraban Ramm
2024-07-29 17:49       ` Joel via ntg-context
2024-07-29 20:17         ` Hans Hagen via ntg-context
2024-07-29 23:04           ` Joel via ntg-context
2024-07-30  8:11             ` Hans Hagen via ntg-context

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