Add a vertical bar to specific pages using TikZ Announcing the arrival of Valued Associate...
Is there any significance to the prison numbers of the Beagle Boys starting with 176-?
Why weren't discrete x86 CPUs ever used in game hardware?
latest version of QGIS fails to edit attribute table of GeoJSON file
Nose gear failure in single prop aircraft: belly landing or nose landing?
The test team as an enemy of development? And how can this be avoided?
newbie Q : How to read an output file in one command line
Why complex landing gears are used instead of simple, reliable and light weight muscle wire or shape memory alloys?
As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?
Why is a lens darker than other ones when applying the same settings?
Sally's older brother
Noise in Eigenvalues plot
My mentor says to set image to Fine instead of RAW — how is this different from JPG?
Did John Wesley plagiarize Matthew Henry...?
Marquee sign letters
malloc in main() or malloc in another function: allocating memory for a struct and its members
Is this Half dragon Quaggoth Balanced
Weaponising the Grasp-at-a-Distance spell
Is there a verb for listening stealthily?
How to make triangles with rounded sides and corners? (squircle with 3 sides)
Are there any irrational/transcendental numbers for which the distribution of decimal digits is not uniform?
2018 MacBook Pro won't let me install macOS High Sierra 10.13 from USB installer
Centre cell contents vertically
Statistical analysis applied to methods coming out of Machine Learning
Is this Kuo-toa homebrew race balanced?
Add a vertical bar to specific pages using TikZ
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How to draw bar chart using tikz?Changing parameters of specific bar in a bar chart using tikzDrawing labeled intervals with specific patterns using TikZAdd single bar to a stacked bar plotAdd axis label to bar chart using tikzFlow chart using Tikz- spanning multiple pagesAdd dots to specific points in “timeline”A splitted lstlisting environment between pages ignores some of tikz effectsVertical bar as verbatimDrawing bar graphs using foreach
I use a template that creates a document with two pages. The first page has a vertical bar and the second page has a horizontal bar. I would like to extend this template in order to add an arbitrary number of pages with a vertical bar after the first page.

I came up with the following approach using atbegshi:
documentclass[a4paper]{article}
usepackage[margin=1.0cm,noheadfoot]{geometry}
usepackage{atbegshi,tikz,lipsum}
pagestyle{empty}
AtBeginShipout{ifnumvalue{page}>0%
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(5.0cm,-paperheight);%
end{tikzpicture}%
fi}
begin{document}
% Dummy code for first template page with vertical bar
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(5.0cm,-paperheight);%
end{tikzpicture}%
vspace*{fill}
begin{center}
LARGE{Template page with vertical bar}
end{center}
vspace*{fill}
%clearpage
% Additional pages with sidebar and dummy text
newgeometry{left=6.0cm,right=1.0cm,top=1.0cm,bottom=1.0cm,noheadfoot}
begin{center}
LARGE{Additional pages with vertical bar}
end{center}
lipsum[1-20]
restoregeometry
%clearpage
% Dummy code for last template page with horizontal bar
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(paperwidth,-6.0cm);%
end{tikzpicture}%
vspace*{fill}
begin{center}
LARGE{Template pages with horizontal bar}
end{center}
vspace*{fill}
end{document}
The original template also uses TikZ for creating the bars. There are two problems with my approach. Due to the simple condition ifnumvalue{page}>0, the vertical bar is also applied to the page with horizontal bar. Also, an empty page is added to the end of the document.
My preferred solution would be a switch to turn the vertical bar on and off similar to newgeometry{...} and restoregeometry. This could be used to define a new environment. A simple boolean does not seem to work.
Is there a way to implement such a switch or a better approach to this problem?
tikz-pgf atbegshi
add a comment |
I use a template that creates a document with two pages. The first page has a vertical bar and the second page has a horizontal bar. I would like to extend this template in order to add an arbitrary number of pages with a vertical bar after the first page.

I came up with the following approach using atbegshi:
documentclass[a4paper]{article}
usepackage[margin=1.0cm,noheadfoot]{geometry}
usepackage{atbegshi,tikz,lipsum}
pagestyle{empty}
AtBeginShipout{ifnumvalue{page}>0%
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(5.0cm,-paperheight);%
end{tikzpicture}%
fi}
begin{document}
% Dummy code for first template page with vertical bar
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(5.0cm,-paperheight);%
end{tikzpicture}%
vspace*{fill}
begin{center}
LARGE{Template page with vertical bar}
end{center}
vspace*{fill}
%clearpage
% Additional pages with sidebar and dummy text
newgeometry{left=6.0cm,right=1.0cm,top=1.0cm,bottom=1.0cm,noheadfoot}
begin{center}
LARGE{Additional pages with vertical bar}
end{center}
lipsum[1-20]
restoregeometry
%clearpage
% Dummy code for last template page with horizontal bar
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(paperwidth,-6.0cm);%
end{tikzpicture}%
vspace*{fill}
begin{center}
LARGE{Template pages with horizontal bar}
end{center}
vspace*{fill}
end{document}
The original template also uses TikZ for creating the bars. There are two problems with my approach. Due to the simple condition ifnumvalue{page}>0, the vertical bar is also applied to the page with horizontal bar. Also, an empty page is added to the end of the document.
My preferred solution would be a switch to turn the vertical bar on and off similar to newgeometry{...} and restoregeometry. This could be used to define a new environment. A simple boolean does not seem to work.
Is there a way to implement such a switch or a better approach to this problem?
tikz-pgf atbegshi
add a comment |
I use a template that creates a document with two pages. The first page has a vertical bar and the second page has a horizontal bar. I would like to extend this template in order to add an arbitrary number of pages with a vertical bar after the first page.

I came up with the following approach using atbegshi:
documentclass[a4paper]{article}
usepackage[margin=1.0cm,noheadfoot]{geometry}
usepackage{atbegshi,tikz,lipsum}
pagestyle{empty}
AtBeginShipout{ifnumvalue{page}>0%
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(5.0cm,-paperheight);%
end{tikzpicture}%
fi}
begin{document}
% Dummy code for first template page with vertical bar
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(5.0cm,-paperheight);%
end{tikzpicture}%
vspace*{fill}
begin{center}
LARGE{Template page with vertical bar}
end{center}
vspace*{fill}
%clearpage
% Additional pages with sidebar and dummy text
newgeometry{left=6.0cm,right=1.0cm,top=1.0cm,bottom=1.0cm,noheadfoot}
begin{center}
LARGE{Additional pages with vertical bar}
end{center}
lipsum[1-20]
restoregeometry
%clearpage
% Dummy code for last template page with horizontal bar
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(paperwidth,-6.0cm);%
end{tikzpicture}%
vspace*{fill}
begin{center}
LARGE{Template pages with horizontal bar}
end{center}
vspace*{fill}
end{document}
The original template also uses TikZ for creating the bars. There are two problems with my approach. Due to the simple condition ifnumvalue{page}>0, the vertical bar is also applied to the page with horizontal bar. Also, an empty page is added to the end of the document.
My preferred solution would be a switch to turn the vertical bar on and off similar to newgeometry{...} and restoregeometry. This could be used to define a new environment. A simple boolean does not seem to work.
Is there a way to implement such a switch or a better approach to this problem?
tikz-pgf atbegshi
I use a template that creates a document with two pages. The first page has a vertical bar and the second page has a horizontal bar. I would like to extend this template in order to add an arbitrary number of pages with a vertical bar after the first page.

I came up with the following approach using atbegshi:
documentclass[a4paper]{article}
usepackage[margin=1.0cm,noheadfoot]{geometry}
usepackage{atbegshi,tikz,lipsum}
pagestyle{empty}
AtBeginShipout{ifnumvalue{page}>0%
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(5.0cm,-paperheight);%
end{tikzpicture}%
fi}
begin{document}
% Dummy code for first template page with vertical bar
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(5.0cm,-paperheight);%
end{tikzpicture}%
vspace*{fill}
begin{center}
LARGE{Template page with vertical bar}
end{center}
vspace*{fill}
%clearpage
% Additional pages with sidebar and dummy text
newgeometry{left=6.0cm,right=1.0cm,top=1.0cm,bottom=1.0cm,noheadfoot}
begin{center}
LARGE{Additional pages with vertical bar}
end{center}
lipsum[1-20]
restoregeometry
%clearpage
% Dummy code for last template page with horizontal bar
begin{tikzpicture}[remember picture,overlay]%
fill[gray] (current page.north west) rectangle %
++(paperwidth,-6.0cm);%
end{tikzpicture}%
vspace*{fill}
begin{center}
LARGE{Template pages with horizontal bar}
end{center}
vspace*{fill}
end{document}
The original template also uses TikZ for creating the bars. There are two problems with my approach. Due to the simple condition ifnumvalue{page}>0, the vertical bar is also applied to the page with horizontal bar. Also, an empty page is added to the end of the document.
My preferred solution would be a switch to turn the vertical bar on and off similar to newgeometry{...} and restoregeometry. This could be used to define a new environment. A simple boolean does not seem to work.
Is there a way to implement such a switch or a better approach to this problem?
tikz-pgf atbegshi
tikz-pgf atbegshi
asked 27 secs ago
JotWeJotWe
858
858
add a comment |
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%2f485957%2fadd-a-vertical-bar-to-specific-pages-using-tikz%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%2f485957%2fadd-a-vertical-bar-to-specific-pages-using-tikz%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