Automatic newpage before every theorem
Using amsthm
package, is there an elegant way to automatically get a newpage
before every theorem?
Edit: MWE featuring Christian Hupfer's suggestion
documentclass{article}
usepackage{amsthm}
newtheorem{thm}{Theorem}
% makeatletter
% g@addto@macro{thm}{clearpage}
% makeatother
begin{document}
begin{thm}
There are infinitely many prime numbers.
end{thm}
% newpage
begin{thm}
$sqrt{2}$ is irrational.
end{thm}
end{document}
theorems amsthm
add a comment |
Using amsthm
package, is there an elegant way to automatically get a newpage
before every theorem?
Edit: MWE featuring Christian Hupfer's suggestion
documentclass{article}
usepackage{amsthm}
newtheorem{thm}{Theorem}
% makeatletter
% g@addto@macro{thm}{clearpage}
% makeatother
begin{document}
begin{thm}
There are infinitely many prime numbers.
end{thm}
% newpage
begin{thm}
$sqrt{2}$ is irrational.
end{thm}
end{document}
theorems amsthm
assuming your theorem environment is calledtheorem
,makeatletterg@addto@macro{theorem}{clearpage}makeatother
should work... however, this is untested -- as usual, provide a compilable document, please
– user31729
Feb 10 at 15:19
that doesn't work very well, I get "Theorem x.y" in one page and the body of the theorem (i.e. the stuff betweenbegin{thm}
andend{thm
) in the next.
– noibe
Feb 10 at 15:24
1
It was a guess only. Again: Providing a document is the better way to help us to help you
– user31729
Feb 10 at 15:25
add a comment |
Using amsthm
package, is there an elegant way to automatically get a newpage
before every theorem?
Edit: MWE featuring Christian Hupfer's suggestion
documentclass{article}
usepackage{amsthm}
newtheorem{thm}{Theorem}
% makeatletter
% g@addto@macro{thm}{clearpage}
% makeatother
begin{document}
begin{thm}
There are infinitely many prime numbers.
end{thm}
% newpage
begin{thm}
$sqrt{2}$ is irrational.
end{thm}
end{document}
theorems amsthm
Using amsthm
package, is there an elegant way to automatically get a newpage
before every theorem?
Edit: MWE featuring Christian Hupfer's suggestion
documentclass{article}
usepackage{amsthm}
newtheorem{thm}{Theorem}
% makeatletter
% g@addto@macro{thm}{clearpage}
% makeatother
begin{document}
begin{thm}
There are infinitely many prime numbers.
end{thm}
% newpage
begin{thm}
$sqrt{2}$ is irrational.
end{thm}
end{document}
theorems amsthm
theorems amsthm
edited Feb 10 at 15:32
noibe
asked Feb 10 at 15:16
noibenoibe
512113
512113
assuming your theorem environment is calledtheorem
,makeatletterg@addto@macro{theorem}{clearpage}makeatother
should work... however, this is untested -- as usual, provide a compilable document, please
– user31729
Feb 10 at 15:19
that doesn't work very well, I get "Theorem x.y" in one page and the body of the theorem (i.e. the stuff betweenbegin{thm}
andend{thm
) in the next.
– noibe
Feb 10 at 15:24
1
It was a guess only. Again: Providing a document is the better way to help us to help you
– user31729
Feb 10 at 15:25
add a comment |
assuming your theorem environment is calledtheorem
,makeatletterg@addto@macro{theorem}{clearpage}makeatother
should work... however, this is untested -- as usual, provide a compilable document, please
– user31729
Feb 10 at 15:19
that doesn't work very well, I get "Theorem x.y" in one page and the body of the theorem (i.e. the stuff betweenbegin{thm}
andend{thm
) in the next.
– noibe
Feb 10 at 15:24
1
It was a guess only. Again: Providing a document is the better way to help us to help you
– user31729
Feb 10 at 15:25
assuming your theorem environment is called
theorem
, makeatletterg@addto@macro{theorem}{clearpage}makeatother
should work... however, this is untested -- as usual, provide a compilable document, please– user31729
Feb 10 at 15:19
assuming your theorem environment is called
theorem
, makeatletterg@addto@macro{theorem}{clearpage}makeatother
should work... however, this is untested -- as usual, provide a compilable document, please– user31729
Feb 10 at 15:19
that doesn't work very well, I get "Theorem x.y" in one page and the body of the theorem (i.e. the stuff between
begin{thm}
and end{thm
) in the next.– noibe
Feb 10 at 15:24
that doesn't work very well, I get "Theorem x.y" in one page and the body of the theorem (i.e. the stuff between
begin{thm}
and end{thm
) in the next.– noibe
Feb 10 at 15:24
1
1
It was a guess only. Again: Providing a document is the better way to help us to help you
– user31729
Feb 10 at 15:25
It was a guess only. Again: Providing a document is the better way to help us to help you
– user31729
Feb 10 at 15:25
add a comment |
1 Answer
1
active
oldest
votes
Since the definition of thm
as done by amsthm
is a little bit tricky, I suggest to use
AtBeginEnvironment{thm}{clearpage}
This is safe and will add the clear page before the theorem headline (and not disrupting the display)
documentclass{article}
usepackage{blindtext}
usepackage{amsthm}
usepackage{etoolbox}
newtheorem{thm}{Theorem}
AtBeginEnvironment{thm}{%
clearpage%
}
begin{document}
blindtext
begin{thm}
There are infinitely many prime numbers.
end{thm}
begin{thm}
$sqrt{2}$ is irrational.
end{thm}
end{document}
I know this isn't related to the original question, but what is the difference betweenclearpage
andnewpage
?
– noibe
Feb 10 at 15:42
2
@noibe: Aclearpage
will always issue a new page and emitting all pending floats before, i.e. the will be flushed to the previous page, then the page break occurs. Anewpage
for example will not eject a new page in case of being specified in a column setup, it will end the local column only then. In most casesclearpage
is the right approach... For instance, I can hardly remember setups where I needednewpage
– user31729
Feb 10 at 15:46
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%2f474191%2fautomatic-newpage-before-every-theorem%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
Since the definition of thm
as done by amsthm
is a little bit tricky, I suggest to use
AtBeginEnvironment{thm}{clearpage}
This is safe and will add the clear page before the theorem headline (and not disrupting the display)
documentclass{article}
usepackage{blindtext}
usepackage{amsthm}
usepackage{etoolbox}
newtheorem{thm}{Theorem}
AtBeginEnvironment{thm}{%
clearpage%
}
begin{document}
blindtext
begin{thm}
There are infinitely many prime numbers.
end{thm}
begin{thm}
$sqrt{2}$ is irrational.
end{thm}
end{document}
I know this isn't related to the original question, but what is the difference betweenclearpage
andnewpage
?
– noibe
Feb 10 at 15:42
2
@noibe: Aclearpage
will always issue a new page and emitting all pending floats before, i.e. the will be flushed to the previous page, then the page break occurs. Anewpage
for example will not eject a new page in case of being specified in a column setup, it will end the local column only then. In most casesclearpage
is the right approach... For instance, I can hardly remember setups where I needednewpage
– user31729
Feb 10 at 15:46
add a comment |
Since the definition of thm
as done by amsthm
is a little bit tricky, I suggest to use
AtBeginEnvironment{thm}{clearpage}
This is safe and will add the clear page before the theorem headline (and not disrupting the display)
documentclass{article}
usepackage{blindtext}
usepackage{amsthm}
usepackage{etoolbox}
newtheorem{thm}{Theorem}
AtBeginEnvironment{thm}{%
clearpage%
}
begin{document}
blindtext
begin{thm}
There are infinitely many prime numbers.
end{thm}
begin{thm}
$sqrt{2}$ is irrational.
end{thm}
end{document}
I know this isn't related to the original question, but what is the difference betweenclearpage
andnewpage
?
– noibe
Feb 10 at 15:42
2
@noibe: Aclearpage
will always issue a new page and emitting all pending floats before, i.e. the will be flushed to the previous page, then the page break occurs. Anewpage
for example will not eject a new page in case of being specified in a column setup, it will end the local column only then. In most casesclearpage
is the right approach... For instance, I can hardly remember setups where I needednewpage
– user31729
Feb 10 at 15:46
add a comment |
Since the definition of thm
as done by amsthm
is a little bit tricky, I suggest to use
AtBeginEnvironment{thm}{clearpage}
This is safe and will add the clear page before the theorem headline (and not disrupting the display)
documentclass{article}
usepackage{blindtext}
usepackage{amsthm}
usepackage{etoolbox}
newtheorem{thm}{Theorem}
AtBeginEnvironment{thm}{%
clearpage%
}
begin{document}
blindtext
begin{thm}
There are infinitely many prime numbers.
end{thm}
begin{thm}
$sqrt{2}$ is irrational.
end{thm}
end{document}
Since the definition of thm
as done by amsthm
is a little bit tricky, I suggest to use
AtBeginEnvironment{thm}{clearpage}
This is safe and will add the clear page before the theorem headline (and not disrupting the display)
documentclass{article}
usepackage{blindtext}
usepackage{amsthm}
usepackage{etoolbox}
newtheorem{thm}{Theorem}
AtBeginEnvironment{thm}{%
clearpage%
}
begin{document}
blindtext
begin{thm}
There are infinitely many prime numbers.
end{thm}
begin{thm}
$sqrt{2}$ is irrational.
end{thm}
end{document}
answered Feb 10 at 15:36
user31729
I know this isn't related to the original question, but what is the difference betweenclearpage
andnewpage
?
– noibe
Feb 10 at 15:42
2
@noibe: Aclearpage
will always issue a new page and emitting all pending floats before, i.e. the will be flushed to the previous page, then the page break occurs. Anewpage
for example will not eject a new page in case of being specified in a column setup, it will end the local column only then. In most casesclearpage
is the right approach... For instance, I can hardly remember setups where I needednewpage
– user31729
Feb 10 at 15:46
add a comment |
I know this isn't related to the original question, but what is the difference betweenclearpage
andnewpage
?
– noibe
Feb 10 at 15:42
2
@noibe: Aclearpage
will always issue a new page and emitting all pending floats before, i.e. the will be flushed to the previous page, then the page break occurs. Anewpage
for example will not eject a new page in case of being specified in a column setup, it will end the local column only then. In most casesclearpage
is the right approach... For instance, I can hardly remember setups where I needednewpage
– user31729
Feb 10 at 15:46
I know this isn't related to the original question, but what is the difference between
clearpage
and newpage
?– noibe
Feb 10 at 15:42
I know this isn't related to the original question, but what is the difference between
clearpage
and newpage
?– noibe
Feb 10 at 15:42
2
2
@noibe: A
clearpage
will always issue a new page and emitting all pending floats before, i.e. the will be flushed to the previous page, then the page break occurs. A newpage
for example will not eject a new page in case of being specified in a column setup, it will end the local column only then. In most cases clearpage
is the right approach... For instance, I can hardly remember setups where I needed newpage
– user31729
Feb 10 at 15:46
@noibe: A
clearpage
will always issue a new page and emitting all pending floats before, i.e. the will be flushed to the previous page, then the page break occurs. A newpage
for example will not eject a new page in case of being specified in a column setup, it will end the local column only then. In most cases clearpage
is the right approach... For instance, I can hardly remember setups where I needed newpage
– user31729
Feb 10 at 15:46
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%2f474191%2fautomatic-newpage-before-every-theorem%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
assuming your theorem environment is called
theorem
,makeatletterg@addto@macro{theorem}{clearpage}makeatother
should work... however, this is untested -- as usual, provide a compilable document, please– user31729
Feb 10 at 15:19
that doesn't work very well, I get "Theorem x.y" in one page and the body of the theorem (i.e. the stuff between
begin{thm}
andend{thm
) in the next.– noibe
Feb 10 at 15:24
1
It was a guess only. Again: Providing a document is the better way to help us to help you
– user31729
Feb 10 at 15:25