Creating a specific theorem style












0















I was wondering how to create a theorem environment similar to the following example: enter image description here



Specifically, the environment should resemble the box that contains "Claim -- The function g is linear".



This comes from a document written by Evan Chen, who has his style files uploaded here. I have tried to mimic what I believed to be the relevant code (as there's a lot of stuff there that isn't related to this), to no avail. I have attached my attempt below, but it may be better to ignore it.



usepackage{amsmath}
usepackage{amsthm}
usepackage{mdframed}
usepackage{thmtools}
usepackage{tikz}
usepackage{xcolor}
usepackage[framemethod=TikZ]{mdframed}
mdfdefinestyle{mdgreenbox}{%
linewidth=0.5pt,
skipabove=12pt,
frametitleaboveskip=5pt,
frametitlebelowskip=0pt,
skipbelow=2pt,
frametitlefont=bfseries,
innertopmargin=4pt,
innerbottommargin=8pt,
nobreak=true,
backgroundcolor=SpringGreen!15,
rightline=false,
leftline=false,
topline=false,
bottomline=false,
linecolor=green,
}
declaretheoremstyle[
headfont=bfseriescolor{OliveGreen},
mdframed={style=mdgreenbox},
headpunct={\[3pt]},
postheadspace={0pt},
]{thmgreenbox}
declaretheorem[style=thmgreenbox]{thrm1}


This returns an error, one for xcolor not recognizing the colors, and the following.



l.17        mdfdefinestyle
{mdgreenbox}{%
The package mdframed has already been loaded with options:

There has now been an attempt to load it with options
[framemethod=TikZ]
Adding the global options:
,framemethod=TikZ
to your documentclass declaration may fix this.
Try typing <return> to proceed.

Package thmtools Info: Key `mdframed' (with value `style=mdgreenbox')
(thmtools) is not a known style key.
(thmtools) Will pass this to every declaretheorem
(thmtools) that uses `style=thmgreenbox' on input line 39.
Package thmtools Info: Automatically pulling in `thmdef-mdframed' on input line 40.
(/usr/local/texlive/2017/texmf-dist/tex/latex/thmtools/thmdef-mdframed.sty
Package: thmdef-mdframed 2014/04/21 v66
)
c@thrm1=count282
(/compile/output.aux)
openout1 = `output.aux'.


I am looking for a way to mimic the environment more than to fix my methods.



Thank you in advance!










share|improve this question


















  • 1





    Have a look at tcolorbox.

    – JouleV
    23 mins ago











  • The obvious and immediate issues with your code are that you load the package mdframed twice (and with conflicting options, which causes an error): You have usepackage{mdframed} and then a bit later usepackage[framemethod=TikZ]{mdframed}. You should probably remove the first of those calls. The colours are not recognised because you loaded xcolor without an additional option to provide more colours, you probably want to load it as usepackage[dvipsnames]{xcolor} or usepackage[svgnames]{xcolor} for SpringGreen to work.

    – moewe
    14 mins ago













  • Other than that I agree with JouleV that tcolorbox is worth a look. It does a similar job as mdframed but offers a lot more options (at least that's what I think). tcolorbox is also still being actively maintained, whereas mdframed development has stalled in recent years (that need not necessarily be a bad thing, but it could mean that you are on your own when you find bugs or want a new feature). See also tex.stackexchange.com/q/135871/35864

    – moewe
    12 mins ago


















0















I was wondering how to create a theorem environment similar to the following example: enter image description here



Specifically, the environment should resemble the box that contains "Claim -- The function g is linear".



This comes from a document written by Evan Chen, who has his style files uploaded here. I have tried to mimic what I believed to be the relevant code (as there's a lot of stuff there that isn't related to this), to no avail. I have attached my attempt below, but it may be better to ignore it.



usepackage{amsmath}
usepackage{amsthm}
usepackage{mdframed}
usepackage{thmtools}
usepackage{tikz}
usepackage{xcolor}
usepackage[framemethod=TikZ]{mdframed}
mdfdefinestyle{mdgreenbox}{%
linewidth=0.5pt,
skipabove=12pt,
frametitleaboveskip=5pt,
frametitlebelowskip=0pt,
skipbelow=2pt,
frametitlefont=bfseries,
innertopmargin=4pt,
innerbottommargin=8pt,
nobreak=true,
backgroundcolor=SpringGreen!15,
rightline=false,
leftline=false,
topline=false,
bottomline=false,
linecolor=green,
}
declaretheoremstyle[
headfont=bfseriescolor{OliveGreen},
mdframed={style=mdgreenbox},
headpunct={\[3pt]},
postheadspace={0pt},
]{thmgreenbox}
declaretheorem[style=thmgreenbox]{thrm1}


This returns an error, one for xcolor not recognizing the colors, and the following.



l.17        mdfdefinestyle
{mdgreenbox}{%
The package mdframed has already been loaded with options:

There has now been an attempt to load it with options
[framemethod=TikZ]
Adding the global options:
,framemethod=TikZ
to your documentclass declaration may fix this.
Try typing <return> to proceed.

Package thmtools Info: Key `mdframed' (with value `style=mdgreenbox')
(thmtools) is not a known style key.
(thmtools) Will pass this to every declaretheorem
(thmtools) that uses `style=thmgreenbox' on input line 39.
Package thmtools Info: Automatically pulling in `thmdef-mdframed' on input line 40.
(/usr/local/texlive/2017/texmf-dist/tex/latex/thmtools/thmdef-mdframed.sty
Package: thmdef-mdframed 2014/04/21 v66
)
c@thrm1=count282
(/compile/output.aux)
openout1 = `output.aux'.


I am looking for a way to mimic the environment more than to fix my methods.



Thank you in advance!










share|improve this question


















  • 1





    Have a look at tcolorbox.

    – JouleV
    23 mins ago











  • The obvious and immediate issues with your code are that you load the package mdframed twice (and with conflicting options, which causes an error): You have usepackage{mdframed} and then a bit later usepackage[framemethod=TikZ]{mdframed}. You should probably remove the first of those calls. The colours are not recognised because you loaded xcolor without an additional option to provide more colours, you probably want to load it as usepackage[dvipsnames]{xcolor} or usepackage[svgnames]{xcolor} for SpringGreen to work.

    – moewe
    14 mins ago













  • Other than that I agree with JouleV that tcolorbox is worth a look. It does a similar job as mdframed but offers a lot more options (at least that's what I think). tcolorbox is also still being actively maintained, whereas mdframed development has stalled in recent years (that need not necessarily be a bad thing, but it could mean that you are on your own when you find bugs or want a new feature). See also tex.stackexchange.com/q/135871/35864

    – moewe
    12 mins ago
















0












0








0


1






I was wondering how to create a theorem environment similar to the following example: enter image description here



Specifically, the environment should resemble the box that contains "Claim -- The function g is linear".



This comes from a document written by Evan Chen, who has his style files uploaded here. I have tried to mimic what I believed to be the relevant code (as there's a lot of stuff there that isn't related to this), to no avail. I have attached my attempt below, but it may be better to ignore it.



usepackage{amsmath}
usepackage{amsthm}
usepackage{mdframed}
usepackage{thmtools}
usepackage{tikz}
usepackage{xcolor}
usepackage[framemethod=TikZ]{mdframed}
mdfdefinestyle{mdgreenbox}{%
linewidth=0.5pt,
skipabove=12pt,
frametitleaboveskip=5pt,
frametitlebelowskip=0pt,
skipbelow=2pt,
frametitlefont=bfseries,
innertopmargin=4pt,
innerbottommargin=8pt,
nobreak=true,
backgroundcolor=SpringGreen!15,
rightline=false,
leftline=false,
topline=false,
bottomline=false,
linecolor=green,
}
declaretheoremstyle[
headfont=bfseriescolor{OliveGreen},
mdframed={style=mdgreenbox},
headpunct={\[3pt]},
postheadspace={0pt},
]{thmgreenbox}
declaretheorem[style=thmgreenbox]{thrm1}


This returns an error, one for xcolor not recognizing the colors, and the following.



l.17        mdfdefinestyle
{mdgreenbox}{%
The package mdframed has already been loaded with options:

There has now been an attempt to load it with options
[framemethod=TikZ]
Adding the global options:
,framemethod=TikZ
to your documentclass declaration may fix this.
Try typing <return> to proceed.

Package thmtools Info: Key `mdframed' (with value `style=mdgreenbox')
(thmtools) is not a known style key.
(thmtools) Will pass this to every declaretheorem
(thmtools) that uses `style=thmgreenbox' on input line 39.
Package thmtools Info: Automatically pulling in `thmdef-mdframed' on input line 40.
(/usr/local/texlive/2017/texmf-dist/tex/latex/thmtools/thmdef-mdframed.sty
Package: thmdef-mdframed 2014/04/21 v66
)
c@thrm1=count282
(/compile/output.aux)
openout1 = `output.aux'.


I am looking for a way to mimic the environment more than to fix my methods.



Thank you in advance!










share|improve this question














I was wondering how to create a theorem environment similar to the following example: enter image description here



Specifically, the environment should resemble the box that contains "Claim -- The function g is linear".



This comes from a document written by Evan Chen, who has his style files uploaded here. I have tried to mimic what I believed to be the relevant code (as there's a lot of stuff there that isn't related to this), to no avail. I have attached my attempt below, but it may be better to ignore it.



usepackage{amsmath}
usepackage{amsthm}
usepackage{mdframed}
usepackage{thmtools}
usepackage{tikz}
usepackage{xcolor}
usepackage[framemethod=TikZ]{mdframed}
mdfdefinestyle{mdgreenbox}{%
linewidth=0.5pt,
skipabove=12pt,
frametitleaboveskip=5pt,
frametitlebelowskip=0pt,
skipbelow=2pt,
frametitlefont=bfseries,
innertopmargin=4pt,
innerbottommargin=8pt,
nobreak=true,
backgroundcolor=SpringGreen!15,
rightline=false,
leftline=false,
topline=false,
bottomline=false,
linecolor=green,
}
declaretheoremstyle[
headfont=bfseriescolor{OliveGreen},
mdframed={style=mdgreenbox},
headpunct={\[3pt]},
postheadspace={0pt},
]{thmgreenbox}
declaretheorem[style=thmgreenbox]{thrm1}


This returns an error, one for xcolor not recognizing the colors, and the following.



l.17        mdfdefinestyle
{mdgreenbox}{%
The package mdframed has already been loaded with options:

There has now been an attempt to load it with options
[framemethod=TikZ]
Adding the global options:
,framemethod=TikZ
to your documentclass declaration may fix this.
Try typing <return> to proceed.

Package thmtools Info: Key `mdframed' (with value `style=mdgreenbox')
(thmtools) is not a known style key.
(thmtools) Will pass this to every declaretheorem
(thmtools) that uses `style=thmgreenbox' on input line 39.
Package thmtools Info: Automatically pulling in `thmdef-mdframed' on input line 40.
(/usr/local/texlive/2017/texmf-dist/tex/latex/thmtools/thmdef-mdframed.sty
Package: thmdef-mdframed 2014/04/21 v66
)
c@thrm1=count282
(/compile/output.aux)
openout1 = `output.aux'.


I am looking for a way to mimic the environment more than to fix my methods.



Thank you in advance!







theorems mdframed






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 25 mins ago









zylitoLzylitoL

255




255








  • 1





    Have a look at tcolorbox.

    – JouleV
    23 mins ago











  • The obvious and immediate issues with your code are that you load the package mdframed twice (and with conflicting options, which causes an error): You have usepackage{mdframed} and then a bit later usepackage[framemethod=TikZ]{mdframed}. You should probably remove the first of those calls. The colours are not recognised because you loaded xcolor without an additional option to provide more colours, you probably want to load it as usepackage[dvipsnames]{xcolor} or usepackage[svgnames]{xcolor} for SpringGreen to work.

    – moewe
    14 mins ago













  • Other than that I agree with JouleV that tcolorbox is worth a look. It does a similar job as mdframed but offers a lot more options (at least that's what I think). tcolorbox is also still being actively maintained, whereas mdframed development has stalled in recent years (that need not necessarily be a bad thing, but it could mean that you are on your own when you find bugs or want a new feature). See also tex.stackexchange.com/q/135871/35864

    – moewe
    12 mins ago
















  • 1





    Have a look at tcolorbox.

    – JouleV
    23 mins ago











  • The obvious and immediate issues with your code are that you load the package mdframed twice (and with conflicting options, which causes an error): You have usepackage{mdframed} and then a bit later usepackage[framemethod=TikZ]{mdframed}. You should probably remove the first of those calls. The colours are not recognised because you loaded xcolor without an additional option to provide more colours, you probably want to load it as usepackage[dvipsnames]{xcolor} or usepackage[svgnames]{xcolor} for SpringGreen to work.

    – moewe
    14 mins ago













  • Other than that I agree with JouleV that tcolorbox is worth a look. It does a similar job as mdframed but offers a lot more options (at least that's what I think). tcolorbox is also still being actively maintained, whereas mdframed development has stalled in recent years (that need not necessarily be a bad thing, but it could mean that you are on your own when you find bugs or want a new feature). See also tex.stackexchange.com/q/135871/35864

    – moewe
    12 mins ago










1




1





Have a look at tcolorbox.

– JouleV
23 mins ago





Have a look at tcolorbox.

– JouleV
23 mins ago













The obvious and immediate issues with your code are that you load the package mdframed twice (and with conflicting options, which causes an error): You have usepackage{mdframed} and then a bit later usepackage[framemethod=TikZ]{mdframed}. You should probably remove the first of those calls. The colours are not recognised because you loaded xcolor without an additional option to provide more colours, you probably want to load it as usepackage[dvipsnames]{xcolor} or usepackage[svgnames]{xcolor} for SpringGreen to work.

– moewe
14 mins ago







The obvious and immediate issues with your code are that you load the package mdframed twice (and with conflicting options, which causes an error): You have usepackage{mdframed} and then a bit later usepackage[framemethod=TikZ]{mdframed}. You should probably remove the first of those calls. The colours are not recognised because you loaded xcolor without an additional option to provide more colours, you probably want to load it as usepackage[dvipsnames]{xcolor} or usepackage[svgnames]{xcolor} for SpringGreen to work.

– moewe
14 mins ago















Other than that I agree with JouleV that tcolorbox is worth a look. It does a similar job as mdframed but offers a lot more options (at least that's what I think). tcolorbox is also still being actively maintained, whereas mdframed development has stalled in recent years (that need not necessarily be a bad thing, but it could mean that you are on your own when you find bugs or want a new feature). See also tex.stackexchange.com/q/135871/35864

– moewe
12 mins ago







Other than that I agree with JouleV that tcolorbox is worth a look. It does a similar job as mdframed but offers a lot more options (at least that's what I think). tcolorbox is also still being actively maintained, whereas mdframed development has stalled in recent years (that need not necessarily be a bad thing, but it could mean that you are on your own when you find bugs or want a new feature). See also tex.stackexchange.com/q/135871/35864

– moewe
12 mins ago












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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f475946%2fcreating-a-specific-theorem-style%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
















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f475946%2fcreating-a-specific-theorem-style%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)