Test if tikzmark exists on same page The 2019 Stack Overflow Developer Survey Results Are InTikz - How to overlay Decorations over longtableExporting animation created with animate packageMark (highlight) a paragraph (item…) with a squiggly line for later attentiontikzmarknode lines with hooksRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionLine up nested tikz enviroments or how to get rid of themProblems with nested TikZpicturesDrawing tikz line in the margin for multiple pagesUsing Tikzmark and ArrowsLabelings with Tikzmark

What is the motivation for a law requiring 2 parties to consent for recording a conversation

Is three citations per paragraph excessive for undergraduate research paper?

Have you ever entered Singapore using a different passport or name?

What is the closest word meaning "respect for time / mindful"

Why hard-Brexiteers don't insist on a hard border to prevent illegal immigration after Brexit?

Am I thawing this London Broil safely?

Does a dangling wire really electrocute me if I'm standing in water?

How to support a colleague who finds meetings extremely tiring?

"as much details as you can remember"

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Loose spokes after only a few rides

What is the meaning of the verb "bear" in this context?

Button changing it's text & action. Good or terrible?

How to deal with fear of taking dependencies

Did Section 31 appear in Star Trek: The Next Generation?

Worn-tile Scrabble

If a Druid sees an animal’s corpse, can they wild shape into that animal?

Right tool to dig six foot holes?

Why is the maximum length of OpenWrt’s root password 8 characters?

How to type this arrow in math mode?

Why is the Constellation's nose gear so long?

Did 3000BC Egyptians use meteoric iron weapons?

A poker game description that does not feel gimmicky

What is the most effective way of iterating a std::vector and why?



Test if tikzmark exists on same page



The 2019 Stack Overflow Developer Survey Results Are InTikz - How to overlay Decorations over longtableExporting animation created with animate packageMark (highlight) a paragraph (item…) with a squiggly line for later attentiontikzmarknode lines with hooksRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionLine up nested tikz enviroments or how to get rid of themProblems with nested TikZpicturesDrawing tikz line in the margin for multiple pagesUsing Tikzmark and ArrowsLabelings with Tikzmark










4















Apologies for flooding the site with tikzmark problems ... :)



I know that with iftikzmark I can test if a given tikzmark exists in general. Is there a way to test if a particular tikzmark exists on the same page?



Use case: I'm trying to design macros that I can insert anywhere in a text that would draw a line between them –- a linestart and a linefinish command. However, when the linefinish command happens to fall on a subsequent page, the line gets drawn to where the linestart command was on the previous page. I would rather have it instead "do something else", here, just for purpose of illustration, draw me a black square – or, ideally "point across" the page in the direction to where the other mark is sitting.



In the code below, I've tried to construct what I'm envisioning using iftikzmark but that does not work.



documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
newcountertikzmkstartsetcountertikzmkstart0 %
newcountertikzmkfinishsetcountertikzmkfinish0 %

newcommandlinestart%
stepcountertikzmkfinishiftikzmarkbthetikzmkfinish% tikzmark exists on same page
stepcountertikzmkstarttikzmarknodeathetikzmkstartvphantomxaddtocountertikzmkfinish-1
% tikzmark doesn't exist on page
begintikzpicture draw [line width=4] (0,0) -- (.1,0); endtikzpictureaddtocountertikzmkfinish-1% black square if linefinish on next page

newcommandlinefinish%
iftikzmarkathetikzmkstart% tikzmark exists on same page
stepcountertikzmkfinishtikzmarknodebthetikzmkfinishvphantomxbegintikzpicture[remember picture] draw[overlay] (athetikzmkstart.west) -- (bthetikzmkfinish.west); endtikzpicture
% tikzmark doesn't exist on page
begintikzpicture draw [line width=4] (0,0) -- (.1,0); endtikzpicture

begindocument
Text linestart text text

Text text text
%newpage

Text text linefinish text
enddocument


Any ideas of how else I might accomplish something like this would be very welcome!




Update: Based on @marmot's suggestion to look at this answer, I've now come up with the following. However, I'm stuck with how to make the lines "point across" the page breaks ...



documentclassarticle
usepackagerefcount
usepackagetikz
usetikzlibrarycalc

newcountertmp
newcommandtikzmark[1]%
tikz[overlay,remember picture] node (#1) ;

newcommandlinestart%
stepcountertmp%
tikzmarkalabelathetmp%
ifnumgetpagerefnumberathetmp=getpagerefnumberbthetmp else
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
fi%



newcommandlinefinish%
tikzmarkblabelbthetmp
ifnumgetpagerefnumberathetmp=getpagerefnumberbthetmp
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
else
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
fi


newcommandSqu[1]linestart#1linefinish

begindocument

Text linestart text text

Text text text

Text text linefinish text

Text linestart text text

Text text text
newpage

Text text linefinish text

enddocument









share|improve this question
























  • The way you write the questions may indicate that you are about to construct a tikzmar version of something like this answer. The basic trick is that you build in the page number.

    – marmot
    Apr 6 at 16:51











  • @marmot Oh, you mean incorporating the pagenumber into the label for the node. Ha, that's clever.

    – jan
    Apr 6 at 16:53











  • Yes, basically. If you also want the line to also run over page breaks, you may need refcount, like in Gonzalo's answer.

    – marmot
    Apr 6 at 16:56






  • 1





    tikzmark already saves the page number on which it is defined (see tex.stackexchange.com/q/79121/86 for a use of this, and look at next page in the documentation). There isn't a current direct interface to that information; it is stored as save@pg@<picture id of the tikzmark> so you could do a test on that. I'm not going to attempt to get the expansions right in a comment, but something like ifnumcsname save@pg@pgfpictureidendcsname=csname save@pg@csname save@pt@tmk@labelendcsnameendcsname

    – Loop Space
    Apr 6 at 17:10











  • @LoopSpace Hmm, that looks fairly complex. Would you be able to explain where I incorporate that?

    – jan
    Apr 6 at 17:14















4















Apologies for flooding the site with tikzmark problems ... :)



I know that with iftikzmark I can test if a given tikzmark exists in general. Is there a way to test if a particular tikzmark exists on the same page?



Use case: I'm trying to design macros that I can insert anywhere in a text that would draw a line between them –- a linestart and a linefinish command. However, when the linefinish command happens to fall on a subsequent page, the line gets drawn to where the linestart command was on the previous page. I would rather have it instead "do something else", here, just for purpose of illustration, draw me a black square – or, ideally "point across" the page in the direction to where the other mark is sitting.



In the code below, I've tried to construct what I'm envisioning using iftikzmark but that does not work.



documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
newcountertikzmkstartsetcountertikzmkstart0 %
newcountertikzmkfinishsetcountertikzmkfinish0 %

newcommandlinestart%
stepcountertikzmkfinishiftikzmarkbthetikzmkfinish% tikzmark exists on same page
stepcountertikzmkstarttikzmarknodeathetikzmkstartvphantomxaddtocountertikzmkfinish-1
% tikzmark doesn't exist on page
begintikzpicture draw [line width=4] (0,0) -- (.1,0); endtikzpictureaddtocountertikzmkfinish-1% black square if linefinish on next page

newcommandlinefinish%
iftikzmarkathetikzmkstart% tikzmark exists on same page
stepcountertikzmkfinishtikzmarknodebthetikzmkfinishvphantomxbegintikzpicture[remember picture] draw[overlay] (athetikzmkstart.west) -- (bthetikzmkfinish.west); endtikzpicture
% tikzmark doesn't exist on page
begintikzpicture draw [line width=4] (0,0) -- (.1,0); endtikzpicture

begindocument
Text linestart text text

Text text text
%newpage

Text text linefinish text
enddocument


Any ideas of how else I might accomplish something like this would be very welcome!




Update: Based on @marmot's suggestion to look at this answer, I've now come up with the following. However, I'm stuck with how to make the lines "point across" the page breaks ...



documentclassarticle
usepackagerefcount
usepackagetikz
usetikzlibrarycalc

newcountertmp
newcommandtikzmark[1]%
tikz[overlay,remember picture] node (#1) ;

newcommandlinestart%
stepcountertmp%
tikzmarkalabelathetmp%
ifnumgetpagerefnumberathetmp=getpagerefnumberbthetmp else
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
fi%



newcommandlinefinish%
tikzmarkblabelbthetmp
ifnumgetpagerefnumberathetmp=getpagerefnumberbthetmp
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
else
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
fi


newcommandSqu[1]linestart#1linefinish

begindocument

Text linestart text text

Text text text

Text text linefinish text

Text linestart text text

Text text text
newpage

Text text linefinish text

enddocument









share|improve this question
























  • The way you write the questions may indicate that you are about to construct a tikzmar version of something like this answer. The basic trick is that you build in the page number.

    – marmot
    Apr 6 at 16:51











  • @marmot Oh, you mean incorporating the pagenumber into the label for the node. Ha, that's clever.

    – jan
    Apr 6 at 16:53











  • Yes, basically. If you also want the line to also run over page breaks, you may need refcount, like in Gonzalo's answer.

    – marmot
    Apr 6 at 16:56






  • 1





    tikzmark already saves the page number on which it is defined (see tex.stackexchange.com/q/79121/86 for a use of this, and look at next page in the documentation). There isn't a current direct interface to that information; it is stored as save@pg@<picture id of the tikzmark> so you could do a test on that. I'm not going to attempt to get the expansions right in a comment, but something like ifnumcsname save@pg@pgfpictureidendcsname=csname save@pg@csname save@pt@tmk@labelendcsnameendcsname

    – Loop Space
    Apr 6 at 17:10











  • @LoopSpace Hmm, that looks fairly complex. Would you be able to explain where I incorporate that?

    – jan
    Apr 6 at 17:14













4












4








4








Apologies for flooding the site with tikzmark problems ... :)



I know that with iftikzmark I can test if a given tikzmark exists in general. Is there a way to test if a particular tikzmark exists on the same page?



Use case: I'm trying to design macros that I can insert anywhere in a text that would draw a line between them –- a linestart and a linefinish command. However, when the linefinish command happens to fall on a subsequent page, the line gets drawn to where the linestart command was on the previous page. I would rather have it instead "do something else", here, just for purpose of illustration, draw me a black square – or, ideally "point across" the page in the direction to where the other mark is sitting.



In the code below, I've tried to construct what I'm envisioning using iftikzmark but that does not work.



documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
newcountertikzmkstartsetcountertikzmkstart0 %
newcountertikzmkfinishsetcountertikzmkfinish0 %

newcommandlinestart%
stepcountertikzmkfinishiftikzmarkbthetikzmkfinish% tikzmark exists on same page
stepcountertikzmkstarttikzmarknodeathetikzmkstartvphantomxaddtocountertikzmkfinish-1
% tikzmark doesn't exist on page
begintikzpicture draw [line width=4] (0,0) -- (.1,0); endtikzpictureaddtocountertikzmkfinish-1% black square if linefinish on next page

newcommandlinefinish%
iftikzmarkathetikzmkstart% tikzmark exists on same page
stepcountertikzmkfinishtikzmarknodebthetikzmkfinishvphantomxbegintikzpicture[remember picture] draw[overlay] (athetikzmkstart.west) -- (bthetikzmkfinish.west); endtikzpicture
% tikzmark doesn't exist on page
begintikzpicture draw [line width=4] (0,0) -- (.1,0); endtikzpicture

begindocument
Text linestart text text

Text text text
%newpage

Text text linefinish text
enddocument


Any ideas of how else I might accomplish something like this would be very welcome!




Update: Based on @marmot's suggestion to look at this answer, I've now come up with the following. However, I'm stuck with how to make the lines "point across" the page breaks ...



documentclassarticle
usepackagerefcount
usepackagetikz
usetikzlibrarycalc

newcountertmp
newcommandtikzmark[1]%
tikz[overlay,remember picture] node (#1) ;

newcommandlinestart%
stepcountertmp%
tikzmarkalabelathetmp%
ifnumgetpagerefnumberathetmp=getpagerefnumberbthetmp else
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
fi%



newcommandlinefinish%
tikzmarkblabelbthetmp
ifnumgetpagerefnumberathetmp=getpagerefnumberbthetmp
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
else
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
fi


newcommandSqu[1]linestart#1linefinish

begindocument

Text linestart text text

Text text text

Text text linefinish text

Text linestart text text

Text text text
newpage

Text text linefinish text

enddocument









share|improve this question
















Apologies for flooding the site with tikzmark problems ... :)



I know that with iftikzmark I can test if a given tikzmark exists in general. Is there a way to test if a particular tikzmark exists on the same page?



Use case: I'm trying to design macros that I can insert anywhere in a text that would draw a line between them –- a linestart and a linefinish command. However, when the linefinish command happens to fall on a subsequent page, the line gets drawn to where the linestart command was on the previous page. I would rather have it instead "do something else", here, just for purpose of illustration, draw me a black square – or, ideally "point across" the page in the direction to where the other mark is sitting.



In the code below, I've tried to construct what I'm envisioning using iftikzmark but that does not work.



documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
newcountertikzmkstartsetcountertikzmkstart0 %
newcountertikzmkfinishsetcountertikzmkfinish0 %

newcommandlinestart%
stepcountertikzmkfinishiftikzmarkbthetikzmkfinish% tikzmark exists on same page
stepcountertikzmkstarttikzmarknodeathetikzmkstartvphantomxaddtocountertikzmkfinish-1
% tikzmark doesn't exist on page
begintikzpicture draw [line width=4] (0,0) -- (.1,0); endtikzpictureaddtocountertikzmkfinish-1% black square if linefinish on next page

newcommandlinefinish%
iftikzmarkathetikzmkstart% tikzmark exists on same page
stepcountertikzmkfinishtikzmarknodebthetikzmkfinishvphantomxbegintikzpicture[remember picture] draw[overlay] (athetikzmkstart.west) -- (bthetikzmkfinish.west); endtikzpicture
% tikzmark doesn't exist on page
begintikzpicture draw [line width=4] (0,0) -- (.1,0); endtikzpicture

begindocument
Text linestart text text

Text text text
%newpage

Text text linefinish text
enddocument


Any ideas of how else I might accomplish something like this would be very welcome!




Update: Based on @marmot's suggestion to look at this answer, I've now come up with the following. However, I'm stuck with how to make the lines "point across" the page breaks ...



documentclassarticle
usepackagerefcount
usepackagetikz
usetikzlibrarycalc

newcountertmp
newcommandtikzmark[1]%
tikz[overlay,remember picture] node (#1) ;

newcommandlinestart%
stepcountertmp%
tikzmarkalabelathetmp%
ifnumgetpagerefnumberathetmp=getpagerefnumberbthetmp else
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
fi%



newcommandlinefinish%
tikzmarkblabelbthetmp
ifnumgetpagerefnumberathetmp=getpagerefnumberbthetmp
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
else
begintikzpicture[overlay, remember picture]
draw [thick]
(a.west) -- (b.west);
endtikzpicture%
fi


newcommandSqu[1]linestart#1linefinish

begindocument

Text linestart text text

Text text text

Text text linefinish text

Text linestart text text

Text text text
newpage

Text text linefinish text

enddocument






tikz-pgf macros tikzmark






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 6 at 18:01







jan

















asked Apr 6 at 16:43









janjan

1,0681519




1,0681519












  • The way you write the questions may indicate that you are about to construct a tikzmar version of something like this answer. The basic trick is that you build in the page number.

    – marmot
    Apr 6 at 16:51











  • @marmot Oh, you mean incorporating the pagenumber into the label for the node. Ha, that's clever.

    – jan
    Apr 6 at 16:53











  • Yes, basically. If you also want the line to also run over page breaks, you may need refcount, like in Gonzalo's answer.

    – marmot
    Apr 6 at 16:56






  • 1





    tikzmark already saves the page number on which it is defined (see tex.stackexchange.com/q/79121/86 for a use of this, and look at next page in the documentation). There isn't a current direct interface to that information; it is stored as save@pg@<picture id of the tikzmark> so you could do a test on that. I'm not going to attempt to get the expansions right in a comment, but something like ifnumcsname save@pg@pgfpictureidendcsname=csname save@pg@csname save@pt@tmk@labelendcsnameendcsname

    – Loop Space
    Apr 6 at 17:10











  • @LoopSpace Hmm, that looks fairly complex. Would you be able to explain where I incorporate that?

    – jan
    Apr 6 at 17:14

















  • The way you write the questions may indicate that you are about to construct a tikzmar version of something like this answer. The basic trick is that you build in the page number.

    – marmot
    Apr 6 at 16:51











  • @marmot Oh, you mean incorporating the pagenumber into the label for the node. Ha, that's clever.

    – jan
    Apr 6 at 16:53











  • Yes, basically. If you also want the line to also run over page breaks, you may need refcount, like in Gonzalo's answer.

    – marmot
    Apr 6 at 16:56






  • 1





    tikzmark already saves the page number on which it is defined (see tex.stackexchange.com/q/79121/86 for a use of this, and look at next page in the documentation). There isn't a current direct interface to that information; it is stored as save@pg@<picture id of the tikzmark> so you could do a test on that. I'm not going to attempt to get the expansions right in a comment, but something like ifnumcsname save@pg@pgfpictureidendcsname=csname save@pg@csname save@pt@tmk@labelendcsnameendcsname

    – Loop Space
    Apr 6 at 17:10











  • @LoopSpace Hmm, that looks fairly complex. Would you be able to explain where I incorporate that?

    – jan
    Apr 6 at 17:14
















The way you write the questions may indicate that you are about to construct a tikzmar version of something like this answer. The basic trick is that you build in the page number.

– marmot
Apr 6 at 16:51





The way you write the questions may indicate that you are about to construct a tikzmar version of something like this answer. The basic trick is that you build in the page number.

– marmot
Apr 6 at 16:51













@marmot Oh, you mean incorporating the pagenumber into the label for the node. Ha, that's clever.

– jan
Apr 6 at 16:53





@marmot Oh, you mean incorporating the pagenumber into the label for the node. Ha, that's clever.

– jan
Apr 6 at 16:53













Yes, basically. If you also want the line to also run over page breaks, you may need refcount, like in Gonzalo's answer.

– marmot
Apr 6 at 16:56





Yes, basically. If you also want the line to also run over page breaks, you may need refcount, like in Gonzalo's answer.

– marmot
Apr 6 at 16:56




1




1





tikzmark already saves the page number on which it is defined (see tex.stackexchange.com/q/79121/86 for a use of this, and look at next page in the documentation). There isn't a current direct interface to that information; it is stored as save@pg@<picture id of the tikzmark> so you could do a test on that. I'm not going to attempt to get the expansions right in a comment, but something like ifnumcsname save@pg@pgfpictureidendcsname=csname save@pg@csname save@pt@tmk@labelendcsnameendcsname

– Loop Space
Apr 6 at 17:10





tikzmark already saves the page number on which it is defined (see tex.stackexchange.com/q/79121/86 for a use of this, and look at next page in the documentation). There isn't a current direct interface to that information; it is stored as save@pg@<picture id of the tikzmark> so you could do a test on that. I'm not going to attempt to get the expansions right in a comment, but something like ifnumcsname save@pg@pgfpictureidendcsname=csname save@pg@csname save@pt@tmk@labelendcsnameendcsname

– Loop Space
Apr 6 at 17:10













@LoopSpace Hmm, that looks fairly complex. Would you be able to explain where I incorporate that?

– jan
Apr 6 at 17:14





@LoopSpace Hmm, that looks fairly complex. Would you be able to explain where I incorporate that?

– jan
Apr 6 at 17:14










1 Answer
1






active

oldest

votes


















7














I can see the point of having a iftikzmarkonpage conditional, so I've added it to the tikzmark package (download tikzmark.dtx and run tex tikzmark.dtx to get the latest version). This introduces a new conditional, iftikzmarkoncurrentpage<tikzmark name>. That copes with the issue about the lines being drawn on both pages when needed.



documentclassarticle
usepackage[a6paper]geometry
%urlhttps://tex.stackexchange.com/q/483547/86
usepackagetikz
usepackagetikzpagenodes
usetikzlibrarytikzmark
newcountertikzmarklinessetcountertikzmarklines0 %

tikzset
tikzmark prefix=prefix-,
tikzmark suffix=-suffix


newcommandlinestart%
stepcountertikzmarklines%
tikzmarkathetikzmarklines%
iftikzmarkoncurrentpagebthetikzmarklines%
else
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=4] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%
fi


newcommandlinefinish%
tikzmarkbthetikzmarklines%
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=1] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%


begindocument
Text linestart text text

Text text text

Text text linefinish text

newpage

Text text text

Text linestart text text

Text text text
newpage

Text text text

Text text linefinish text
enddocument


lines between pages






share|improve this answer

























  • That looks like it does what I'm after :) thank you ... and if you incorporate a conditional into the package, even better :) Although ... didn't Gonzalo's answer solve that? Why would his solution be bad?

    – jan
    Apr 6 at 18:28











  • Please feel free to revert my edit. +1

    – marmot
    Apr 6 at 18:29











  • @marmot, I like the gifs ;)

    – jan
    Apr 6 at 18:30






  • 1





    @jan convert -density 300 -delay 144 -loop 0 -alpha remove multipage.pdf animated.gif, see tex.stackexchange.com/a/136919/121799.

    – marmot
    Apr 6 at 18:31






  • 1





    @jan You can use tikz-pagenodes, which has the current page text area node. And I think you are doing it right because in their present form the questions and answers are useful for many, which they are not if you do some highly specialized things. (Will be off now.)

    – marmot
    Apr 6 at 18:37











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483547%2ftest-if-tikzmark-exists-on-same-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









7














I can see the point of having a iftikzmarkonpage conditional, so I've added it to the tikzmark package (download tikzmark.dtx and run tex tikzmark.dtx to get the latest version). This introduces a new conditional, iftikzmarkoncurrentpage<tikzmark name>. That copes with the issue about the lines being drawn on both pages when needed.



documentclassarticle
usepackage[a6paper]geometry
%urlhttps://tex.stackexchange.com/q/483547/86
usepackagetikz
usepackagetikzpagenodes
usetikzlibrarytikzmark
newcountertikzmarklinessetcountertikzmarklines0 %

tikzset
tikzmark prefix=prefix-,
tikzmark suffix=-suffix


newcommandlinestart%
stepcountertikzmarklines%
tikzmarkathetikzmarklines%
iftikzmarkoncurrentpagebthetikzmarklines%
else
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=4] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%
fi


newcommandlinefinish%
tikzmarkbthetikzmarklines%
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=1] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%


begindocument
Text linestart text text

Text text text

Text text linefinish text

newpage

Text text text

Text linestart text text

Text text text
newpage

Text text text

Text text linefinish text
enddocument


lines between pages






share|improve this answer

























  • That looks like it does what I'm after :) thank you ... and if you incorporate a conditional into the package, even better :) Although ... didn't Gonzalo's answer solve that? Why would his solution be bad?

    – jan
    Apr 6 at 18:28











  • Please feel free to revert my edit. +1

    – marmot
    Apr 6 at 18:29











  • @marmot, I like the gifs ;)

    – jan
    Apr 6 at 18:30






  • 1





    @jan convert -density 300 -delay 144 -loop 0 -alpha remove multipage.pdf animated.gif, see tex.stackexchange.com/a/136919/121799.

    – marmot
    Apr 6 at 18:31






  • 1





    @jan You can use tikz-pagenodes, which has the current page text area node. And I think you are doing it right because in their present form the questions and answers are useful for many, which they are not if you do some highly specialized things. (Will be off now.)

    – marmot
    Apr 6 at 18:37















7














I can see the point of having a iftikzmarkonpage conditional, so I've added it to the tikzmark package (download tikzmark.dtx and run tex tikzmark.dtx to get the latest version). This introduces a new conditional, iftikzmarkoncurrentpage<tikzmark name>. That copes with the issue about the lines being drawn on both pages when needed.



documentclassarticle
usepackage[a6paper]geometry
%urlhttps://tex.stackexchange.com/q/483547/86
usepackagetikz
usepackagetikzpagenodes
usetikzlibrarytikzmark
newcountertikzmarklinessetcountertikzmarklines0 %

tikzset
tikzmark prefix=prefix-,
tikzmark suffix=-suffix


newcommandlinestart%
stepcountertikzmarklines%
tikzmarkathetikzmarklines%
iftikzmarkoncurrentpagebthetikzmarklines%
else
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=4] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%
fi


newcommandlinefinish%
tikzmarkbthetikzmarklines%
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=1] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%


begindocument
Text linestart text text

Text text text

Text text linefinish text

newpage

Text text text

Text linestart text text

Text text text
newpage

Text text text

Text text linefinish text
enddocument


lines between pages






share|improve this answer

























  • That looks like it does what I'm after :) thank you ... and if you incorporate a conditional into the package, even better :) Although ... didn't Gonzalo's answer solve that? Why would his solution be bad?

    – jan
    Apr 6 at 18:28











  • Please feel free to revert my edit. +1

    – marmot
    Apr 6 at 18:29











  • @marmot, I like the gifs ;)

    – jan
    Apr 6 at 18:30






  • 1





    @jan convert -density 300 -delay 144 -loop 0 -alpha remove multipage.pdf animated.gif, see tex.stackexchange.com/a/136919/121799.

    – marmot
    Apr 6 at 18:31






  • 1





    @jan You can use tikz-pagenodes, which has the current page text area node. And I think you are doing it right because in their present form the questions and answers are useful for many, which they are not if you do some highly specialized things. (Will be off now.)

    – marmot
    Apr 6 at 18:37













7












7








7







I can see the point of having a iftikzmarkonpage conditional, so I've added it to the tikzmark package (download tikzmark.dtx and run tex tikzmark.dtx to get the latest version). This introduces a new conditional, iftikzmarkoncurrentpage<tikzmark name>. That copes with the issue about the lines being drawn on both pages when needed.



documentclassarticle
usepackage[a6paper]geometry
%urlhttps://tex.stackexchange.com/q/483547/86
usepackagetikz
usepackagetikzpagenodes
usetikzlibrarytikzmark
newcountertikzmarklinessetcountertikzmarklines0 %

tikzset
tikzmark prefix=prefix-,
tikzmark suffix=-suffix


newcommandlinestart%
stepcountertikzmarklines%
tikzmarkathetikzmarklines%
iftikzmarkoncurrentpagebthetikzmarklines%
else
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=4] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%
fi


newcommandlinefinish%
tikzmarkbthetikzmarklines%
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=1] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%


begindocument
Text linestart text text

Text text text

Text text linefinish text

newpage

Text text text

Text linestart text text

Text text text
newpage

Text text text

Text text linefinish text
enddocument


lines between pages






share|improve this answer















I can see the point of having a iftikzmarkonpage conditional, so I've added it to the tikzmark package (download tikzmark.dtx and run tex tikzmark.dtx to get the latest version). This introduces a new conditional, iftikzmarkoncurrentpage<tikzmark name>. That copes with the issue about the lines being drawn on both pages when needed.



documentclassarticle
usepackage[a6paper]geometry
%urlhttps://tex.stackexchange.com/q/483547/86
usepackagetikz
usepackagetikzpagenodes
usetikzlibrarytikzmark
newcountertikzmarklinessetcountertikzmarklines0 %

tikzset
tikzmark prefix=prefix-,
tikzmark suffix=-suffix


newcommandlinestart%
stepcountertikzmarklines%
tikzmarkathetikzmarklines%
iftikzmarkoncurrentpagebthetikzmarklines%
else
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=4] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%
fi


newcommandlinefinish%
tikzmarkbthetikzmarklines%
begintikzpicture[remember picture,overlay,next page=below]%
clip (current page text area.south west) rectangle (current page text area.north east);
draw[line width=1] (pic cs:athetikzmarklines) -- (pic cs:bthetikzmarklines);
endtikzpicture%


begindocument
Text linestart text text

Text text text

Text text linefinish text

newpage

Text text text

Text linestart text text

Text text text
newpage

Text text text

Text text linefinish text
enddocument


lines between pages







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 6 at 20:37

























answered Apr 6 at 18:23









Loop SpaceLoop Space

113k30309610




113k30309610












  • That looks like it does what I'm after :) thank you ... and if you incorporate a conditional into the package, even better :) Although ... didn't Gonzalo's answer solve that? Why would his solution be bad?

    – jan
    Apr 6 at 18:28











  • Please feel free to revert my edit. +1

    – marmot
    Apr 6 at 18:29











  • @marmot, I like the gifs ;)

    – jan
    Apr 6 at 18:30






  • 1





    @jan convert -density 300 -delay 144 -loop 0 -alpha remove multipage.pdf animated.gif, see tex.stackexchange.com/a/136919/121799.

    – marmot
    Apr 6 at 18:31






  • 1





    @jan You can use tikz-pagenodes, which has the current page text area node. And I think you are doing it right because in their present form the questions and answers are useful for many, which they are not if you do some highly specialized things. (Will be off now.)

    – marmot
    Apr 6 at 18:37

















  • That looks like it does what I'm after :) thank you ... and if you incorporate a conditional into the package, even better :) Although ... didn't Gonzalo's answer solve that? Why would his solution be bad?

    – jan
    Apr 6 at 18:28











  • Please feel free to revert my edit. +1

    – marmot
    Apr 6 at 18:29











  • @marmot, I like the gifs ;)

    – jan
    Apr 6 at 18:30






  • 1





    @jan convert -density 300 -delay 144 -loop 0 -alpha remove multipage.pdf animated.gif, see tex.stackexchange.com/a/136919/121799.

    – marmot
    Apr 6 at 18:31






  • 1





    @jan You can use tikz-pagenodes, which has the current page text area node. And I think you are doing it right because in their present form the questions and answers are useful for many, which they are not if you do some highly specialized things. (Will be off now.)

    – marmot
    Apr 6 at 18:37
















That looks like it does what I'm after :) thank you ... and if you incorporate a conditional into the package, even better :) Although ... didn't Gonzalo's answer solve that? Why would his solution be bad?

– jan
Apr 6 at 18:28





That looks like it does what I'm after :) thank you ... and if you incorporate a conditional into the package, even better :) Although ... didn't Gonzalo's answer solve that? Why would his solution be bad?

– jan
Apr 6 at 18:28













Please feel free to revert my edit. +1

– marmot
Apr 6 at 18:29





Please feel free to revert my edit. +1

– marmot
Apr 6 at 18:29













@marmot, I like the gifs ;)

– jan
Apr 6 at 18:30





@marmot, I like the gifs ;)

– jan
Apr 6 at 18:30




1




1





@jan convert -density 300 -delay 144 -loop 0 -alpha remove multipage.pdf animated.gif, see tex.stackexchange.com/a/136919/121799.

– marmot
Apr 6 at 18:31





@jan convert -density 300 -delay 144 -loop 0 -alpha remove multipage.pdf animated.gif, see tex.stackexchange.com/a/136919/121799.

– marmot
Apr 6 at 18:31




1




1





@jan You can use tikz-pagenodes, which has the current page text area node. And I think you are doing it right because in their present form the questions and answers are useful for many, which they are not if you do some highly specialized things. (Will be off now.)

– marmot
Apr 6 at 18:37





@jan You can use tikz-pagenodes, which has the current page text area node. And I think you are doing it right because in their present form the questions and answers are useful for many, which they are not if you do some highly specialized things. (Will be off now.)

– marmot
Apr 6 at 18:37

















draft saved

draft discarded
















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483547%2ftest-if-tikzmark-exists-on-same-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020