Put horizontal lines above and below tabbing and prohibit page breaks between the lines and the tabbing...
I wish to put a horizontal line above tabbing and another one below it in such a way that there are no page breaks between the tabbing contents and the two lines.
Here is what I tried so far:
documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begingroupsetlength{topsep}{0pt}setlength{partopsep}{0pt}raggedrighthrulenopagebreaktabbingnopagebreak%
}{%
nopagebreakendtabbingnopagebreakvspace{-.05baselineskip}nopagebreakhruleparvspace{.07baselineskip}endgroup%
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}
However, the nopagebreak
s seem to have to effect; this example blatantly fails:
Above, there is a page break right after the first rule, which is NOT what we want. If it doesn't fail for you, adapt 46.8 above slightly. The same problem we have for the second line, by means of changing 46.8 to a particular smaller value.
How to forbid page breaks between the two horizontal lines and the tabbing contents? The tabbing conents should be allowed to have page breaks inside by all means. Ideally, the new tabbing environment should also work inside lists (itemize, enumerate, description), though it's not a must.
page-breaking rules line tabbing
add a comment |
I wish to put a horizontal line above tabbing and another one below it in such a way that there are no page breaks between the tabbing contents and the two lines.
Here is what I tried so far:
documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begingroupsetlength{topsep}{0pt}setlength{partopsep}{0pt}raggedrighthrulenopagebreaktabbingnopagebreak%
}{%
nopagebreakendtabbingnopagebreakvspace{-.05baselineskip}nopagebreakhruleparvspace{.07baselineskip}endgroup%
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}
However, the nopagebreak
s seem to have to effect; this example blatantly fails:
Above, there is a page break right after the first rule, which is NOT what we want. If it doesn't fail for you, adapt 46.8 above slightly. The same problem we have for the second line, by means of changing 46.8 to a particular smaller value.
How to forbid page breaks between the two horizontal lines and the tabbing contents? The tabbing conents should be allowed to have page breaks inside by all means. Ideally, the new tabbing environment should also work inside lists (itemize, enumerate, description), though it's not a must.
page-breaking rules line tabbing
add a comment |
I wish to put a horizontal line above tabbing and another one below it in such a way that there are no page breaks between the tabbing contents and the two lines.
Here is what I tried so far:
documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begingroupsetlength{topsep}{0pt}setlength{partopsep}{0pt}raggedrighthrulenopagebreaktabbingnopagebreak%
}{%
nopagebreakendtabbingnopagebreakvspace{-.05baselineskip}nopagebreakhruleparvspace{.07baselineskip}endgroup%
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}
However, the nopagebreak
s seem to have to effect; this example blatantly fails:
Above, there is a page break right after the first rule, which is NOT what we want. If it doesn't fail for you, adapt 46.8 above slightly. The same problem we have for the second line, by means of changing 46.8 to a particular smaller value.
How to forbid page breaks between the two horizontal lines and the tabbing contents? The tabbing conents should be allowed to have page breaks inside by all means. Ideally, the new tabbing environment should also work inside lists (itemize, enumerate, description), though it's not a must.
page-breaking rules line tabbing
I wish to put a horizontal line above tabbing and another one below it in such a way that there are no page breaks between the tabbing contents and the two lines.
Here is what I tried so far:
documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begingroupsetlength{topsep}{0pt}setlength{partopsep}{0pt}raggedrighthrulenopagebreaktabbingnopagebreak%
}{%
nopagebreakendtabbingnopagebreakvspace{-.05baselineskip}nopagebreakhruleparvspace{.07baselineskip}endgroup%
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}
However, the nopagebreak
s seem to have to effect; this example blatantly fails:
Above, there is a page break right after the first rule, which is NOT what we want. If it doesn't fail for you, adapt 46.8 above slightly. The same problem we have for the second line, by means of changing 46.8 to a particular smaller value.
How to forbid page breaks between the two horizontal lines and the tabbing contents? The tabbing conents should be allowed to have page breaks inside by all means. Ideally, the new tabbing environment should also work inside lists (itemize, enumerate, description), though it's not a must.
page-breaking rules line tabbing
page-breaking rules line tabbing
edited Aug 24 '18 at 1:12
user49915
asked Aug 24 '18 at 0:21
user49915user49915
41517
41517
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can wrap the contents of the tabbing
environment into a minipage
to prevent any form of page breaking within.
documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begin{minipage}{linewidth}
setlength{topsep}{0pt}
setlength{partopsep}{0pt}
raggedright
hrule
begin{tabbing}
}{%
end{tabbing}
vspace{-.05baselineskip}
hrule
vspace{.07baselineskip}
end{minipage}%
par
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}
Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.
– user49915
58 secs ago
add a comment |
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%2f447434%2fput-horizontal-lines-above-and-below-tabbing-and-prohibit-page-breaks-between-th%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
You can wrap the contents of the tabbing
environment into a minipage
to prevent any form of page breaking within.
documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begin{minipage}{linewidth}
setlength{topsep}{0pt}
setlength{partopsep}{0pt}
raggedright
hrule
begin{tabbing}
}{%
end{tabbing}
vspace{-.05baselineskip}
hrule
vspace{.07baselineskip}
end{minipage}%
par
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}
Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.
– user49915
58 secs ago
add a comment |
You can wrap the contents of the tabbing
environment into a minipage
to prevent any form of page breaking within.
documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begin{minipage}{linewidth}
setlength{topsep}{0pt}
setlength{partopsep}{0pt}
raggedright
hrule
begin{tabbing}
}{%
end{tabbing}
vspace{-.05baselineskip}
hrule
vspace{.07baselineskip}
end{minipage}%
par
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}
Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.
– user49915
58 secs ago
add a comment |
You can wrap the contents of the tabbing
environment into a minipage
to prevent any form of page breaking within.
documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begin{minipage}{linewidth}
setlength{topsep}{0pt}
setlength{partopsep}{0pt}
raggedright
hrule
begin{tabbing}
}{%
end{tabbing}
vspace{-.05baselineskip}
hrule
vspace{.07baselineskip}
end{minipage}%
par
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}
You can wrap the contents of the tabbing
environment into a minipage
to prevent any form of page breaking within.
documentclass[a4paper]{article}
newenvironment{ruletabbing}{%
begin{minipage}{linewidth}
setlength{topsep}{0pt}
setlength{partopsep}{0pt}
raggedright
hrule
begin{tabbing}
}{%
end{tabbing}
vspace{-.05baselineskip}
hrule
vspace{.07baselineskip}
end{minipage}%
par
}
begin{document}
strut
vspace{46.8baselineskip}\
A page break after this text would be ok.\[.1baselineskip]
begin{ruletabbing}
A page break after this text in tabbing, but not before it, would be ok.\
A page break before this text in tabbing, but not after it, would be ok.
end{ruletabbing}
noindent A page break before this text would be ok.
end{document}
answered 6 mins ago
Henri MenkeHenri Menke
72.7k8160270
72.7k8160270
Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.
– user49915
58 secs ago
add a comment |
Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.
– user49915
58 secs ago
Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.
– user49915
58 secs ago
Preventing all pagebreaking is not what we want; please consider re-reading the example text carefully.
– user49915
58 secs ago
add a comment |
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%2f447434%2fput-horizontal-lines-above-and-below-tabbing-and-prohibit-page-breaks-between-th%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