TikZ picture parsing coordinates for scope environment
I am combining code from few questions to obtain changing logo-picture in position of footer. Answers involved are those:
Place a TikZ picture on every page, How to use pageref{foo} as a number?
and maybe some more.
Using informations in those I produced code, simplified for posting here (original picture is bit more messy, but there should be everything).
Trouble is within line with shifting scope, where I refer to page offsets (as they are defined in previously mentioned questions), but failing in code compilation. I expect, that its because I am giving wrong data type to scope shift operation.
How can I fix that?
Here I present simplified (not compilable!) code:
documentclass[12pt]{book}
usepackage[usenames,dvipsnames,x11names]{xcolor}
usepackage{lastpage}
usepackage{refcount}
setrefcountdefault{1}
usepackage[all]{background}
usepackage{lipsum}
usepackage{tikz}
usetikzlibrary{arrows,calc,snakes,shapes}
newcommand{nuclei}[1]{%
shade[ball color=white] (#1) circle (.4);
}
newcommand{nucleus}{%
nuclei{0.1,0.3}
nuclei{0,0}
}
%electron{xwidth,ywidth,rotation angle}
newcommand{electron}[3]{%
draw[rotate = #3](0,0) ellipse (#1 and #2)[color=blue];
shade[ball color=Black] (0,#2)[rotate=#3] circle (.2);
}
usepackage{changepage}
strictpagecheck
newcommand*{VOffset}{2cm}% vertical offset
newcommand*{HOffset}{1.7cm}% horizontal offset
newcommand{MyTikzLogo}{% For a logo drawn with TikZ
begin{tikzpicture}[remember picture,overlay,scale=0.2]
checkoddpage
ifoddpage
begin{scope}[shift=(HOffset,-paperheight+VOffset)]
begin{scope}[rotate=360*thepage/getpagerefnumber{LastPage}]
nucleus
end{scope}
electron{1.2}{1.4}{260+(360*thepage/getpagerefnumber{LastPage})}
end{scope}
else
begin{scope}[shift=(paperwidth-HOffset,-paperheight+VOffset)]
begin{scope}[rotate=360*thepage/getpagerefnumber{LastPage}]
nucleus
end{scope}
electron{1.2}{1.4}{260+(360*thepage/getpagerefnumber{LastPage})}
end{scope}
fi
end{tikzpicture}
}
SetBgContents{MyTikzLogo}% Set tikz picture
SetBgPosition{current page.north west}% Select location
begin{document}
section*{Lorem Ipsum}
lipsum[1-25]
end{document}
tikz-pgf header-footer
add a comment |
I am combining code from few questions to obtain changing logo-picture in position of footer. Answers involved are those:
Place a TikZ picture on every page, How to use pageref{foo} as a number?
and maybe some more.
Using informations in those I produced code, simplified for posting here (original picture is bit more messy, but there should be everything).
Trouble is within line with shifting scope, where I refer to page offsets (as they are defined in previously mentioned questions), but failing in code compilation. I expect, that its because I am giving wrong data type to scope shift operation.
How can I fix that?
Here I present simplified (not compilable!) code:
documentclass[12pt]{book}
usepackage[usenames,dvipsnames,x11names]{xcolor}
usepackage{lastpage}
usepackage{refcount}
setrefcountdefault{1}
usepackage[all]{background}
usepackage{lipsum}
usepackage{tikz}
usetikzlibrary{arrows,calc,snakes,shapes}
newcommand{nuclei}[1]{%
shade[ball color=white] (#1) circle (.4);
}
newcommand{nucleus}{%
nuclei{0.1,0.3}
nuclei{0,0}
}
%electron{xwidth,ywidth,rotation angle}
newcommand{electron}[3]{%
draw[rotate = #3](0,0) ellipse (#1 and #2)[color=blue];
shade[ball color=Black] (0,#2)[rotate=#3] circle (.2);
}
usepackage{changepage}
strictpagecheck
newcommand*{VOffset}{2cm}% vertical offset
newcommand*{HOffset}{1.7cm}% horizontal offset
newcommand{MyTikzLogo}{% For a logo drawn with TikZ
begin{tikzpicture}[remember picture,overlay,scale=0.2]
checkoddpage
ifoddpage
begin{scope}[shift=(HOffset,-paperheight+VOffset)]
begin{scope}[rotate=360*thepage/getpagerefnumber{LastPage}]
nucleus
end{scope}
electron{1.2}{1.4}{260+(360*thepage/getpagerefnumber{LastPage})}
end{scope}
else
begin{scope}[shift=(paperwidth-HOffset,-paperheight+VOffset)]
begin{scope}[rotate=360*thepage/getpagerefnumber{LastPage}]
nucleus
end{scope}
electron{1.2}{1.4}{260+(360*thepage/getpagerefnumber{LastPage})}
end{scope}
fi
end{tikzpicture}
}
SetBgContents{MyTikzLogo}% Set tikz picture
SetBgPosition{current page.north west}% Select location
begin{document}
section*{Lorem Ipsum}
lipsum[1-25]
end{document}
tikz-pgf header-footer
1
Sorry, what do you hope to achieve by posting a non-compilable code? Most likely the issue is that you are nestingtikzpictures, but it is hard to test because one cannot compile your code.
– marmot
9 hours ago
@marmot Thank you for your reply. I try to wait if someone else would be interested to look into it. Otherwise I take your suggestion, edit code to be at least compilable and create new question, changed appropriately and learn from my failings. Regards, Delanii
– Tomáš Kruliš
9 hours ago
add a comment |
I am combining code from few questions to obtain changing logo-picture in position of footer. Answers involved are those:
Place a TikZ picture on every page, How to use pageref{foo} as a number?
and maybe some more.
Using informations in those I produced code, simplified for posting here (original picture is bit more messy, but there should be everything).
Trouble is within line with shifting scope, where I refer to page offsets (as they are defined in previously mentioned questions), but failing in code compilation. I expect, that its because I am giving wrong data type to scope shift operation.
How can I fix that?
Here I present simplified (not compilable!) code:
documentclass[12pt]{book}
usepackage[usenames,dvipsnames,x11names]{xcolor}
usepackage{lastpage}
usepackage{refcount}
setrefcountdefault{1}
usepackage[all]{background}
usepackage{lipsum}
usepackage{tikz}
usetikzlibrary{arrows,calc,snakes,shapes}
newcommand{nuclei}[1]{%
shade[ball color=white] (#1) circle (.4);
}
newcommand{nucleus}{%
nuclei{0.1,0.3}
nuclei{0,0}
}
%electron{xwidth,ywidth,rotation angle}
newcommand{electron}[3]{%
draw[rotate = #3](0,0) ellipse (#1 and #2)[color=blue];
shade[ball color=Black] (0,#2)[rotate=#3] circle (.2);
}
usepackage{changepage}
strictpagecheck
newcommand*{VOffset}{2cm}% vertical offset
newcommand*{HOffset}{1.7cm}% horizontal offset
newcommand{MyTikzLogo}{% For a logo drawn with TikZ
begin{tikzpicture}[remember picture,overlay,scale=0.2]
checkoddpage
ifoddpage
begin{scope}[shift=(HOffset,-paperheight+VOffset)]
begin{scope}[rotate=360*thepage/getpagerefnumber{LastPage}]
nucleus
end{scope}
electron{1.2}{1.4}{260+(360*thepage/getpagerefnumber{LastPage})}
end{scope}
else
begin{scope}[shift=(paperwidth-HOffset,-paperheight+VOffset)]
begin{scope}[rotate=360*thepage/getpagerefnumber{LastPage}]
nucleus
end{scope}
electron{1.2}{1.4}{260+(360*thepage/getpagerefnumber{LastPage})}
end{scope}
fi
end{tikzpicture}
}
SetBgContents{MyTikzLogo}% Set tikz picture
SetBgPosition{current page.north west}% Select location
begin{document}
section*{Lorem Ipsum}
lipsum[1-25]
end{document}
tikz-pgf header-footer
I am combining code from few questions to obtain changing logo-picture in position of footer. Answers involved are those:
Place a TikZ picture on every page, How to use pageref{foo} as a number?
and maybe some more.
Using informations in those I produced code, simplified for posting here (original picture is bit more messy, but there should be everything).
Trouble is within line with shifting scope, where I refer to page offsets (as they are defined in previously mentioned questions), but failing in code compilation. I expect, that its because I am giving wrong data type to scope shift operation.
How can I fix that?
Here I present simplified (not compilable!) code:
documentclass[12pt]{book}
usepackage[usenames,dvipsnames,x11names]{xcolor}
usepackage{lastpage}
usepackage{refcount}
setrefcountdefault{1}
usepackage[all]{background}
usepackage{lipsum}
usepackage{tikz}
usetikzlibrary{arrows,calc,snakes,shapes}
newcommand{nuclei}[1]{%
shade[ball color=white] (#1) circle (.4);
}
newcommand{nucleus}{%
nuclei{0.1,0.3}
nuclei{0,0}
}
%electron{xwidth,ywidth,rotation angle}
newcommand{electron}[3]{%
draw[rotate = #3](0,0) ellipse (#1 and #2)[color=blue];
shade[ball color=Black] (0,#2)[rotate=#3] circle (.2);
}
usepackage{changepage}
strictpagecheck
newcommand*{VOffset}{2cm}% vertical offset
newcommand*{HOffset}{1.7cm}% horizontal offset
newcommand{MyTikzLogo}{% For a logo drawn with TikZ
begin{tikzpicture}[remember picture,overlay,scale=0.2]
checkoddpage
ifoddpage
begin{scope}[shift=(HOffset,-paperheight+VOffset)]
begin{scope}[rotate=360*thepage/getpagerefnumber{LastPage}]
nucleus
end{scope}
electron{1.2}{1.4}{260+(360*thepage/getpagerefnumber{LastPage})}
end{scope}
else
begin{scope}[shift=(paperwidth-HOffset,-paperheight+VOffset)]
begin{scope}[rotate=360*thepage/getpagerefnumber{LastPage}]
nucleus
end{scope}
electron{1.2}{1.4}{260+(360*thepage/getpagerefnumber{LastPage})}
end{scope}
fi
end{tikzpicture}
}
SetBgContents{MyTikzLogo}% Set tikz picture
SetBgPosition{current page.north west}% Select location
begin{document}
section*{Lorem Ipsum}
lipsum[1-25]
end{document}
tikz-pgf header-footer
tikz-pgf header-footer
asked 10 hours ago
Tomáš KrulišTomáš Kruliš
177
177
1
Sorry, what do you hope to achieve by posting a non-compilable code? Most likely the issue is that you are nestingtikzpictures, but it is hard to test because one cannot compile your code.
– marmot
9 hours ago
@marmot Thank you for your reply. I try to wait if someone else would be interested to look into it. Otherwise I take your suggestion, edit code to be at least compilable and create new question, changed appropriately and learn from my failings. Regards, Delanii
– Tomáš Kruliš
9 hours ago
add a comment |
1
Sorry, what do you hope to achieve by posting a non-compilable code? Most likely the issue is that you are nestingtikzpictures, but it is hard to test because one cannot compile your code.
– marmot
9 hours ago
@marmot Thank you for your reply. I try to wait if someone else would be interested to look into it. Otherwise I take your suggestion, edit code to be at least compilable and create new question, changed appropriately and learn from my failings. Regards, Delanii
– Tomáš Kruliš
9 hours ago
1
1
Sorry, what do you hope to achieve by posting a non-compilable code? Most likely the issue is that you are nesting
tikzpictures, but it is hard to test because one cannot compile your code.– marmot
9 hours ago
Sorry, what do you hope to achieve by posting a non-compilable code? Most likely the issue is that you are nesting
tikzpictures, but it is hard to test because one cannot compile your code.– marmot
9 hours ago
@marmot Thank you for your reply. I try to wait if someone else would be interested to look into it. Otherwise I take your suggestion, edit code to be at least compilable and create new question, changed appropriately and learn from my failings. Regards, Delanii
– Tomáš Kruliš
9 hours ago
@marmot Thank you for your reply. I try to wait if someone else would be interested to look into it. Otherwise I take your suggestion, edit code to be at least compilable and create new question, changed appropriately and learn from my failings. Regards, Delanii
– Tomáš Kruliš
9 hours ago
add a comment |
0
active
oldest
votes
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482993%2ftikz-picture-parsing-coordinates-for-scope-environment%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482993%2ftikz-picture-parsing-coordinates-for-scope-environment%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Sorry, what do you hope to achieve by posting a non-compilable code? Most likely the issue is that you are nesting
tikzpictures, but it is hard to test because one cannot compile your code.– marmot
9 hours ago
@marmot Thank you for your reply. I try to wait if someone else would be interested to look into it. Otherwise I take your suggestion, edit code to be at least compilable and create new question, changed appropriately and learn from my failings. Regards, Delanii
– Tomáš Kruliš
9 hours ago