Centering ornaments from `pgfornaments` around a theorem environment?
Here is my minimal code:
documentclass[12pt,letterpaper]{article}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{begin{center}pgfornament{88}end{center}}
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
end{theorem}
end{document}
It produces the following as output:
The black portions mark the width of the page. See how the ornaments are shifted to the right, rather than actually being "centered" on the page width? How can I fix this?
horizontal-alignment amsthm pgfornament
add a comment |
Here is my minimal code:
documentclass[12pt,letterpaper]{article}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{begin{center}pgfornament{88}end{center}}
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
end{theorem}
end{document}
It produces the following as output:
The black portions mark the width of the page. See how the ornaments are shifted to the right, rather than actually being "centered" on the page width? How can I fix this?
horizontal-alignment amsthm pgfornament
add a comment |
Here is my minimal code:
documentclass[12pt,letterpaper]{article}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{begin{center}pgfornament{88}end{center}}
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
end{theorem}
end{document}
It produces the following as output:
The black portions mark the width of the page. See how the ornaments are shifted to the right, rather than actually being "centered" on the page width? How can I fix this?
horizontal-alignment amsthm pgfornament
Here is my minimal code:
documentclass[12pt,letterpaper]{article}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{begin{center}pgfornament{88}end{center}}
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
end{theorem}
end{document}
It produces the following as output:
The black portions mark the width of the page. See how the ornaments are shifted to the right, rather than actually being "centered" on the page width? How can I fix this?
horizontal-alignment amsthm pgfornament
horizontal-alignment amsthm pgfornament
asked Dec 3 '18 at 1:08
user89
1,5222932
1,5222932
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You should add option [width=13cm]
to your used command pgfornament
like
pgfornament[width=13cm]{88}
Without this width the ornament is to long to fit into the textwidth of your text.
You can use
usepackage{showframe}
to visualize the typing area and margins.
With the complete MWE
documentclass[12pt,letterpaper]{article}
usepackage{showframe} % <==============================================
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{begin{center}pgfornament[width=13cm]{88}end{center}} % 88
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence.
end{theorem}
end{document}
you get this result:
Without [width=13cm]
you get the following result (see the ornament line reaching the margin):
add a comment |
Your ornaments are actually stretching beyond the margins, as the overfull vbox warnings your code issues, tell you.
So, you could set things up better with a makebox
also taking care of indent with:
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
The [width=1.1textwidth]
for the ornament is there to deliberately have it a little larger than textwidth (but centered), as it seems to be your intent. But you can set this value as you please, of course.
In full:
documentclass[12pt,letterpaper]{article}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
usepackage{showframe}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}vspace{-1ex}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
end{theorem}
end{document}
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%2f462891%2fcentering-ornaments-from-pgfornaments-around-a-theorem-environment%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You should add option [width=13cm]
to your used command pgfornament
like
pgfornament[width=13cm]{88}
Without this width the ornament is to long to fit into the textwidth of your text.
You can use
usepackage{showframe}
to visualize the typing area and margins.
With the complete MWE
documentclass[12pt,letterpaper]{article}
usepackage{showframe} % <==============================================
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{begin{center}pgfornament[width=13cm]{88}end{center}} % 88
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence.
end{theorem}
end{document}
you get this result:
Without [width=13cm]
you get the following result (see the ornament line reaching the margin):
add a comment |
You should add option [width=13cm]
to your used command pgfornament
like
pgfornament[width=13cm]{88}
Without this width the ornament is to long to fit into the textwidth of your text.
You can use
usepackage{showframe}
to visualize the typing area and margins.
With the complete MWE
documentclass[12pt,letterpaper]{article}
usepackage{showframe} % <==============================================
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{begin{center}pgfornament[width=13cm]{88}end{center}} % 88
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence.
end{theorem}
end{document}
you get this result:
Without [width=13cm]
you get the following result (see the ornament line reaching the margin):
add a comment |
You should add option [width=13cm]
to your used command pgfornament
like
pgfornament[width=13cm]{88}
Without this width the ornament is to long to fit into the textwidth of your text.
You can use
usepackage{showframe}
to visualize the typing area and margins.
With the complete MWE
documentclass[12pt,letterpaper]{article}
usepackage{showframe} % <==============================================
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{begin{center}pgfornament[width=13cm]{88}end{center}} % 88
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence.
end{theorem}
end{document}
you get this result:
Without [width=13cm]
you get the following result (see the ornament line reaching the margin):
You should add option [width=13cm]
to your used command pgfornament
like
pgfornament[width=13cm]{88}
Without this width the ornament is to long to fit into the textwidth of your text.
You can use
usepackage{showframe}
to visualize the typing area and margins.
With the complete MWE
documentclass[12pt,letterpaper]{article}
usepackage{showframe} % <==============================================
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{begin{center}pgfornament[width=13cm]{88}end{center}} % 88
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence. This is a sentence. This is a sentence.
This is a sentence. This is a sentence. This is a sentence. This is a
sentence. This is a sentence.
end{theorem}
end{document}
you get this result:
Without [width=13cm]
you get the following result (see the ornament line reaching the margin):
answered Dec 3 '18 at 1:34
Kurt
35.5k847159
35.5k847159
add a comment |
add a comment |
Your ornaments are actually stretching beyond the margins, as the overfull vbox warnings your code issues, tell you.
So, you could set things up better with a makebox
also taking care of indent with:
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
The [width=1.1textwidth]
for the ornament is there to deliberately have it a little larger than textwidth (but centered), as it seems to be your intent. But you can set this value as you please, of course.
In full:
documentclass[12pt,letterpaper]{article}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
usepackage{showframe}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}vspace{-1ex}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
end{theorem}
end{document}
add a comment |
Your ornaments are actually stretching beyond the margins, as the overfull vbox warnings your code issues, tell you.
So, you could set things up better with a makebox
also taking care of indent with:
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
The [width=1.1textwidth]
for the ornament is there to deliberately have it a little larger than textwidth (but centered), as it seems to be your intent. But you can set this value as you please, of course.
In full:
documentclass[12pt,letterpaper]{article}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
usepackage{showframe}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}vspace{-1ex}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
end{theorem}
end{document}
add a comment |
Your ornaments are actually stretching beyond the margins, as the overfull vbox warnings your code issues, tell you.
So, you could set things up better with a makebox
also taking care of indent with:
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
The [width=1.1textwidth]
for the ornament is there to deliberately have it a little larger than textwidth (but centered), as it seems to be your intent. But you can set this value as you please, of course.
In full:
documentclass[12pt,letterpaper]{article}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
usepackage{showframe}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}vspace{-1ex}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
end{theorem}
end{document}
Your ornaments are actually stretching beyond the margins, as the overfull vbox warnings your code issues, tell you.
So, you could set things up better with a makebox
also taking care of indent with:
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
The [width=1.1textwidth]
for the ornament is there to deliberately have it a little larger than textwidth (but centered), as it seems to be your intent. But you can set this value as you please, of course.
In full:
documentclass[12pt,letterpaper]{article}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsthm}
usepackage{pgfornament}
usepackage{showframe}
newtheorem{thm}{Theorem}
newcommand*{centeredornament}{noindentmakebox[textwidth][c]{pgfornament[width=1.1textwidth]{88}}}
newenvironment{theorem}[1]{centeredornamentbegin{thm}[#1]upshape}{end{thm}vspace{-1ex}centeredornament}
begin{document}
begin{theorem}[This is a sentence. ]
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
end{theorem}
end{document}
edited Dec 3 '18 at 1:54
answered Dec 3 '18 at 1:39
gusbrs
7,0892840
7,0892840
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f462891%2fcentering-ornaments-from-pgfornaments-around-a-theorem-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