Create a box using the tcolorbox package or any other? (image)Position image next to a text within an adjustbox created in a newenvironmentSplit beamer and alignmenttoo much space between two environment create with tcolorboxIndentation in tcolorbox packageCreate a color box?Create a box using tcolorbox package?tcolorbox / out of the boxNeed help in creating tcolorbox (like the one in manual)How to set different length for different borderline of a box using tcolorbox?Tcolorbox: breakable inlined boxBox Title rounded corners in Tcolorbox
What is this nut?
Why, in the US, are politicians tried by other politicians?
Did the US embassy in Kyiv resist hanging Trump's picture while Yovanovitch was ambassador?
Peaceable Bishops on an 8x8 grid
Cheap and safe way to dim 100+ 60W Incandescent bulbs
Music engraving - note with two accidentals - natural (♮) and sharp (♯)
Cooking with sugar makes pan very difficult to clean
Because things smell, is everything evaporating?
Regarding New Zealand Tourist Visa validity
What are the maximum hit points of an NPC?
Universal example of Lie algebra
What will happen to a ball kept on a frictionless inclined plane?
Draw the Ionising Radiation Hazard Symbol
Why are file URLs marked as not secure while HTTPS URLs are marked as secure in browsers?
Rudin Exercise 2.7
Did the Apollo missions fly "over the top" of the Van Allen radiation belts?
What is the largest piece of space debris volumetrically?
Employer wants me to do something explicitly illegal
A New Math Operation?
How to deal with an employee who is requesting a demotion?
How can I see Explorer.exe's frames per second?
Why would Earth be long-term unsuitable for an advanced alien species that's already colonized it?
What is a recently obsolete computer storage device that would be significantly difficult to extract data from?
Rotational Mechanics: Is Angular Acceleration Possible without any External Torque?
Create a box using the tcolorbox package or any other? (image)
Position image next to a text within an adjustbox created in a newenvironmentSplit beamer and alignmenttoo much space between two environment create with tcolorboxIndentation in tcolorbox packageCreate a color box?Create a box using tcolorbox package?tcolorbox / out of the boxNeed help in creating tcolorbox (like the one in manual)How to set different length for different borderline of a box using tcolorbox?Tcolorbox: breakable inlined boxBox Title rounded corners in Tcolorbox
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I would like to make a box like the figure below. Can you assist me with text code using tcolorbox?
Thanks
tables color packages tcolorbox box
add a comment
|
I would like to make a box like the figure below. Can you assist me with text code using tcolorbox?
Thanks
tables color packages tcolorbox box
Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help.
– Stefan Pinnow
Oct 16 at 18:37
Why does the inverted relation have an i and the non inverted one does not?
– Schrödinger's cat
Oct 17 at 0:56
add a comment
|
I would like to make a box like the figure below. Can you assist me with text code using tcolorbox?
Thanks
tables color packages tcolorbox box
I would like to make a box like the figure below. Can you assist me with text code using tcolorbox?
Thanks
tables color packages tcolorbox box
tables color packages tcolorbox box
edited Oct 16 at 19:43
Sveinung
16k2 gold badges40 silver badges65 bronze badges
16k2 gold badges40 silver badges65 bronze badges
asked Oct 16 at 17:54
phymathphymath
1534 bronze badges
1534 bronze badges
Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help.
– Stefan Pinnow
Oct 16 at 18:37
Why does the inverted relation have an i and the non inverted one does not?
– Schrödinger's cat
Oct 17 at 0:56
add a comment
|
Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help.
– Stefan Pinnow
Oct 16 at 18:37
Why does the inverted relation have an i and the non inverted one does not?
– Schrödinger's cat
Oct 17 at 0:56
Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help.
– Stefan Pinnow
Oct 16 at 18:37
Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help.
– Stefan Pinnow
Oct 16 at 18:37
Why does the inverted relation have an i and the non inverted one does not?
– Schrödinger's cat
Oct 17 at 0:56
Why does the inverted relation have an i and the non inverted one does not?
– Schrödinger's cat
Oct 17 at 0:56
add a comment
|
5 Answers
5
active
oldest
votes
I offer a solution based on the xcoffin
package, not to compete with the other excellent solutions proposed, but to show the advantages of a great package.
Many questions posted in this forum relates with the positioning of various elements as graphics, tables, text, etc. on a page, in specific places and in relation with one another.
In many cases against TeX wishes.
Over time I was able to replace geometry
, rotate
, titlepage
, and similar packages with xcoffin
, to design book covers, title-pages, posters, chapter styles, etc. thus avoiding conflicts and specially avoiding the dreadful time checking a full upgrade to discover that old projects not longer produce the same output or simply did not run at all.
To me the lesser number of packages, the better.
xcoffin
provides only a handful of commands with intuitive meaning (at least for me) and does not require remembering dozens of keyvals or options. Excellent manual, by the way.
I also appreciate the fact that in the case of the one-time jobs mentioned earlier, the resulting code is very simple since there not need to contemplate multiple alternatives for the input and it is mostly auto-documented. Even if a book title changes over the course of a project, the corrections are straightforward.
Of course previously you need to produce the material, perhaps using amsmath
, xcolor
, tabularx
, graphicx
, ... and then fill the coffin with it.
Afterward you fit the coffins in the page using as origin the current text insertion point, or in relative positions among themselves, as could be the case of an image and a margin explanatory note. Then you typeset the result at the insertion point or in any other place of the page of your liking (a plus) since the resulting coffin it is not a float.
In this particular case only four coffins are required: the Output which will collect the others, a green rectangle, a side rule, and the inside text, as shown in the code. Both the rectangle and the rule adapts theirs height to the text content.
I also include a macro, to be moved to the preamble, to reduce the clutter of the document. For the fun of it, and supposing that several Definitions will be included in the document, I added a counter and applied the macro five times.
documentclassarticle
usepackagexcolor
usepackageamsmath
usepackagexcoffins,calc
begindocument
%% Create and Set Coffins
NewCoffinOutput %Coffin to hold the others
NewCoffinDefinition % Definition definition ...
NewCoffinBackFrame % Background: green rectangle
NewCoffinSideRule %lateral left border
SetHorizontalCoffinOutput % It will provide the reference point to join the others
SetVerticalCoffinDefinitionlinewidth%
textbfDefinition. $gamma^5$ is defined to be the matrix given by:%
[gamma^5=frac124epsilon_abcdgamma^abcd ]%
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% now your document
We need some more meaningless test to for a multiline paragraph, because these form a basis for the space of all complex $4times4$ matrices.
%% Typeset Definition
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
%%%%%%%%%%%%%%%%% macro def, to be moved to the preamble, use as SetDefinitionyour-text
newcounterdefcounter
newcommandSetDefinition[1]%
SetHorizontalCoffinOutput % It will be the reference point join the others
SetVerticalCoffinDefinitionlinewidthtextbfDefinition stepcounterdefcounterRomandefcounter. #1 %added counter
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% Typeset ooutput
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
%%%%%%%%%%%%%%%%%%%%% end macro
SetDefinition$gamma^1$ is defined to be the matrix given by:[gamma^1=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^2$ is defined to be the matrix given by:[gamma^2=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^3$ is defined to be the matrix given by:[gamma^3=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^4$ is defined to be the matrix given by:[gamma^4=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^5$ is defined to be the matrix given above.\ % a short Definition
enddocument
add a comment
|
The following might give you an idea on how to start:
documentclassarticle
usepackage[most]tcolorbox
newtcolorboxmybox
enhanced,
boxrule=0pt,frame hidden,
borderline west=4pt0ptgreen!75!black,
colback=green!10!white,
sharp corners
begindocument
beginmybox
textbfDefinition My definition text here
endmybox
enddocument
add a comment
|
A very light weight solution is to use a tabular. Not as sexy as tcolorbox
and other TikZ based solution, but it compiles fast. The simplest is to use a p
-column as wide as the linewidth
.
First I define a new column type
N
and calculate its width tolinewidth
minus twotabcolsep
. Then the table fits between the margins and will adapt if you change margins.Since we need some space above an below the "box", I have set the table inside a
center
-environment to ensure that the table is fixed between the margins, and vertical space on par with other environments.Thereafter, I define the width and colour of the left vertical bar. I put the redefinition inside the centring environment, which limits the scope of the redefinitions to this taular. Without, all table rules will be green and 3 pt thick!
I have since yesterday slightly optimised the code. It is possible to define a new environment, and move most of the code to such definition. This may be useful if you have lot of boxes.
documentclassarticle
usepackageamsmath
usepackage[table]xcolor
usepackagearray
newcolumntypeN@
begindocument
We need som more meaningless test to for a multiline paragraph, because these form a basis for the space of all compex $4times4$ matrices.
begincenter
setlengthextrarowheight4pt
setlengtharrayrulewidth3pt
arrayrulecolorgreen!50!black
begintabularN
cellcolorgreen!15
textbfDefinition: $lambda^5$ is defined to be the matrix given by:
medskip
[lambda^5=dfrac114 epsilon_abcdgamma^abcd ]
endtabular
endcenter
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
enddocument
add a comment
|
I have used mdframed
instead of tcolorbox
(they are similar package but tcolorbox
is mor complete than mdframed
). You can see that you have the same result. Here there is my proposal where I have used for theorem, definition, examples, the specific package amsthm
with the possibility to create a book: see the specific class of the document documentclass[12pt]book
. For to increase the tickness vertical green line you can to change the value linewidth=2.5pt
.
This example sets the text in italic:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
Another code sets the text in roman adding theoremstyledefinition
. See this MWE:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
theoremstyledefinition
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
add a comment
|
In case that you do not use tcolorbox
or tikz for anything else, is a bit overkill use it for a simple box. What I see is AMS theorem-like environment with the definition
style in a green box with a vertical rule beside, so I made defined the definition
command that make just that. Note that macros cannot have paragraph breaks, so, if you need will that, define a new environment instead of a macro.
The advantage of use the amsthm
package just to write "definition" in bold is that you can just remove the asterisk of line 7 to have numbered definitions that you can reference by the usual label
-- ref
method.
documentclassarticle
usepackagexcolor
usepackageamsthm
usepackagelipsum
theoremstyledefinition
newtheorem*defiDefinition
defdefinition#1parmedskipnoindentcolorgreen!50!blackvrule width 3pt%
colorboxgreen!30!gray!15parbox[c]dimexprlinewidth-3pt-2fboxsep-2fboxrule
begindefi#1enddefiparmedskip
begindocument
lipsum[1][1-4]
definition$gamma^5$ is defined to be the matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd ]
lipsum[2][1-5]
enddocument
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/4.0/"u003ecc by-sa 4.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%2f512501%2fcreate-a-box-using-the-tcolorbox-package-or-any-other-image%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
I offer a solution based on the xcoffin
package, not to compete with the other excellent solutions proposed, but to show the advantages of a great package.
Many questions posted in this forum relates with the positioning of various elements as graphics, tables, text, etc. on a page, in specific places and in relation with one another.
In many cases against TeX wishes.
Over time I was able to replace geometry
, rotate
, titlepage
, and similar packages with xcoffin
, to design book covers, title-pages, posters, chapter styles, etc. thus avoiding conflicts and specially avoiding the dreadful time checking a full upgrade to discover that old projects not longer produce the same output or simply did not run at all.
To me the lesser number of packages, the better.
xcoffin
provides only a handful of commands with intuitive meaning (at least for me) and does not require remembering dozens of keyvals or options. Excellent manual, by the way.
I also appreciate the fact that in the case of the one-time jobs mentioned earlier, the resulting code is very simple since there not need to contemplate multiple alternatives for the input and it is mostly auto-documented. Even if a book title changes over the course of a project, the corrections are straightforward.
Of course previously you need to produce the material, perhaps using amsmath
, xcolor
, tabularx
, graphicx
, ... and then fill the coffin with it.
Afterward you fit the coffins in the page using as origin the current text insertion point, or in relative positions among themselves, as could be the case of an image and a margin explanatory note. Then you typeset the result at the insertion point or in any other place of the page of your liking (a plus) since the resulting coffin it is not a float.
In this particular case only four coffins are required: the Output which will collect the others, a green rectangle, a side rule, and the inside text, as shown in the code. Both the rectangle and the rule adapts theirs height to the text content.
I also include a macro, to be moved to the preamble, to reduce the clutter of the document. For the fun of it, and supposing that several Definitions will be included in the document, I added a counter and applied the macro five times.
documentclassarticle
usepackagexcolor
usepackageamsmath
usepackagexcoffins,calc
begindocument
%% Create and Set Coffins
NewCoffinOutput %Coffin to hold the others
NewCoffinDefinition % Definition definition ...
NewCoffinBackFrame % Background: green rectangle
NewCoffinSideRule %lateral left border
SetHorizontalCoffinOutput % It will provide the reference point to join the others
SetVerticalCoffinDefinitionlinewidth%
textbfDefinition. $gamma^5$ is defined to be the matrix given by:%
[gamma^5=frac124epsilon_abcdgamma^abcd ]%
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% now your document
We need some more meaningless test to for a multiline paragraph, because these form a basis for the space of all complex $4times4$ matrices.
%% Typeset Definition
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
%%%%%%%%%%%%%%%%% macro def, to be moved to the preamble, use as SetDefinitionyour-text
newcounterdefcounter
newcommandSetDefinition[1]%
SetHorizontalCoffinOutput % It will be the reference point join the others
SetVerticalCoffinDefinitionlinewidthtextbfDefinition stepcounterdefcounterRomandefcounter. #1 %added counter
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% Typeset ooutput
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
%%%%%%%%%%%%%%%%%%%%% end macro
SetDefinition$gamma^1$ is defined to be the matrix given by:[gamma^1=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^2$ is defined to be the matrix given by:[gamma^2=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^3$ is defined to be the matrix given by:[gamma^3=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^4$ is defined to be the matrix given by:[gamma^4=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^5$ is defined to be the matrix given above.\ % a short Definition
enddocument
add a comment
|
I offer a solution based on the xcoffin
package, not to compete with the other excellent solutions proposed, but to show the advantages of a great package.
Many questions posted in this forum relates with the positioning of various elements as graphics, tables, text, etc. on a page, in specific places and in relation with one another.
In many cases against TeX wishes.
Over time I was able to replace geometry
, rotate
, titlepage
, and similar packages with xcoffin
, to design book covers, title-pages, posters, chapter styles, etc. thus avoiding conflicts and specially avoiding the dreadful time checking a full upgrade to discover that old projects not longer produce the same output or simply did not run at all.
To me the lesser number of packages, the better.
xcoffin
provides only a handful of commands with intuitive meaning (at least for me) and does not require remembering dozens of keyvals or options. Excellent manual, by the way.
I also appreciate the fact that in the case of the one-time jobs mentioned earlier, the resulting code is very simple since there not need to contemplate multiple alternatives for the input and it is mostly auto-documented. Even if a book title changes over the course of a project, the corrections are straightforward.
Of course previously you need to produce the material, perhaps using amsmath
, xcolor
, tabularx
, graphicx
, ... and then fill the coffin with it.
Afterward you fit the coffins in the page using as origin the current text insertion point, or in relative positions among themselves, as could be the case of an image and a margin explanatory note. Then you typeset the result at the insertion point or in any other place of the page of your liking (a plus) since the resulting coffin it is not a float.
In this particular case only four coffins are required: the Output which will collect the others, a green rectangle, a side rule, and the inside text, as shown in the code. Both the rectangle and the rule adapts theirs height to the text content.
I also include a macro, to be moved to the preamble, to reduce the clutter of the document. For the fun of it, and supposing that several Definitions will be included in the document, I added a counter and applied the macro five times.
documentclassarticle
usepackagexcolor
usepackageamsmath
usepackagexcoffins,calc
begindocument
%% Create and Set Coffins
NewCoffinOutput %Coffin to hold the others
NewCoffinDefinition % Definition definition ...
NewCoffinBackFrame % Background: green rectangle
NewCoffinSideRule %lateral left border
SetHorizontalCoffinOutput % It will provide the reference point to join the others
SetVerticalCoffinDefinitionlinewidth%
textbfDefinition. $gamma^5$ is defined to be the matrix given by:%
[gamma^5=frac124epsilon_abcdgamma^abcd ]%
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% now your document
We need some more meaningless test to for a multiline paragraph, because these form a basis for the space of all complex $4times4$ matrices.
%% Typeset Definition
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
%%%%%%%%%%%%%%%%% macro def, to be moved to the preamble, use as SetDefinitionyour-text
newcounterdefcounter
newcommandSetDefinition[1]%
SetHorizontalCoffinOutput % It will be the reference point join the others
SetVerticalCoffinDefinitionlinewidthtextbfDefinition stepcounterdefcounterRomandefcounter. #1 %added counter
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% Typeset ooutput
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
%%%%%%%%%%%%%%%%%%%%% end macro
SetDefinition$gamma^1$ is defined to be the matrix given by:[gamma^1=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^2$ is defined to be the matrix given by:[gamma^2=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^3$ is defined to be the matrix given by:[gamma^3=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^4$ is defined to be the matrix given by:[gamma^4=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^5$ is defined to be the matrix given above.\ % a short Definition
enddocument
add a comment
|
I offer a solution based on the xcoffin
package, not to compete with the other excellent solutions proposed, but to show the advantages of a great package.
Many questions posted in this forum relates with the positioning of various elements as graphics, tables, text, etc. on a page, in specific places and in relation with one another.
In many cases against TeX wishes.
Over time I was able to replace geometry
, rotate
, titlepage
, and similar packages with xcoffin
, to design book covers, title-pages, posters, chapter styles, etc. thus avoiding conflicts and specially avoiding the dreadful time checking a full upgrade to discover that old projects not longer produce the same output or simply did not run at all.
To me the lesser number of packages, the better.
xcoffin
provides only a handful of commands with intuitive meaning (at least for me) and does not require remembering dozens of keyvals or options. Excellent manual, by the way.
I also appreciate the fact that in the case of the one-time jobs mentioned earlier, the resulting code is very simple since there not need to contemplate multiple alternatives for the input and it is mostly auto-documented. Even if a book title changes over the course of a project, the corrections are straightforward.
Of course previously you need to produce the material, perhaps using amsmath
, xcolor
, tabularx
, graphicx
, ... and then fill the coffin with it.
Afterward you fit the coffins in the page using as origin the current text insertion point, or in relative positions among themselves, as could be the case of an image and a margin explanatory note. Then you typeset the result at the insertion point or in any other place of the page of your liking (a plus) since the resulting coffin it is not a float.
In this particular case only four coffins are required: the Output which will collect the others, a green rectangle, a side rule, and the inside text, as shown in the code. Both the rectangle and the rule adapts theirs height to the text content.
I also include a macro, to be moved to the preamble, to reduce the clutter of the document. For the fun of it, and supposing that several Definitions will be included in the document, I added a counter and applied the macro five times.
documentclassarticle
usepackagexcolor
usepackageamsmath
usepackagexcoffins,calc
begindocument
%% Create and Set Coffins
NewCoffinOutput %Coffin to hold the others
NewCoffinDefinition % Definition definition ...
NewCoffinBackFrame % Background: green rectangle
NewCoffinSideRule %lateral left border
SetHorizontalCoffinOutput % It will provide the reference point to join the others
SetVerticalCoffinDefinitionlinewidth%
textbfDefinition. $gamma^5$ is defined to be the matrix given by:%
[gamma^5=frac124epsilon_abcdgamma^abcd ]%
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% now your document
We need some more meaningless test to for a multiline paragraph, because these form a basis for the space of all complex $4times4$ matrices.
%% Typeset Definition
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
%%%%%%%%%%%%%%%%% macro def, to be moved to the preamble, use as SetDefinitionyour-text
newcounterdefcounter
newcommandSetDefinition[1]%
SetHorizontalCoffinOutput % It will be the reference point join the others
SetVerticalCoffinDefinitionlinewidthtextbfDefinition stepcounterdefcounterRomandefcounter. #1 %added counter
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% Typeset ooutput
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
%%%%%%%%%%%%%%%%%%%%% end macro
SetDefinition$gamma^1$ is defined to be the matrix given by:[gamma^1=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^2$ is defined to be the matrix given by:[gamma^2=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^3$ is defined to be the matrix given by:[gamma^3=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^4$ is defined to be the matrix given by:[gamma^4=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^5$ is defined to be the matrix given above.\ % a short Definition
enddocument
I offer a solution based on the xcoffin
package, not to compete with the other excellent solutions proposed, but to show the advantages of a great package.
Many questions posted in this forum relates with the positioning of various elements as graphics, tables, text, etc. on a page, in specific places and in relation with one another.
In many cases against TeX wishes.
Over time I was able to replace geometry
, rotate
, titlepage
, and similar packages with xcoffin
, to design book covers, title-pages, posters, chapter styles, etc. thus avoiding conflicts and specially avoiding the dreadful time checking a full upgrade to discover that old projects not longer produce the same output or simply did not run at all.
To me the lesser number of packages, the better.
xcoffin
provides only a handful of commands with intuitive meaning (at least for me) and does not require remembering dozens of keyvals or options. Excellent manual, by the way.
I also appreciate the fact that in the case of the one-time jobs mentioned earlier, the resulting code is very simple since there not need to contemplate multiple alternatives for the input and it is mostly auto-documented. Even if a book title changes over the course of a project, the corrections are straightforward.
Of course previously you need to produce the material, perhaps using amsmath
, xcolor
, tabularx
, graphicx
, ... and then fill the coffin with it.
Afterward you fit the coffins in the page using as origin the current text insertion point, or in relative positions among themselves, as could be the case of an image and a margin explanatory note. Then you typeset the result at the insertion point or in any other place of the page of your liking (a plus) since the resulting coffin it is not a float.
In this particular case only four coffins are required: the Output which will collect the others, a green rectangle, a side rule, and the inside text, as shown in the code. Both the rectangle and the rule adapts theirs height to the text content.
I also include a macro, to be moved to the preamble, to reduce the clutter of the document. For the fun of it, and supposing that several Definitions will be included in the document, I added a counter and applied the macro five times.
documentclassarticle
usepackagexcolor
usepackageamsmath
usepackagexcoffins,calc
begindocument
%% Create and Set Coffins
NewCoffinOutput %Coffin to hold the others
NewCoffinDefinition % Definition definition ...
NewCoffinBackFrame % Background: green rectangle
NewCoffinSideRule %lateral left border
SetHorizontalCoffinOutput % It will provide the reference point to join the others
SetVerticalCoffinDefinitionlinewidth%
textbfDefinition. $gamma^5$ is defined to be the matrix given by:%
[gamma^5=frac124epsilon_abcdgamma^abcd ]%
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% now your document
We need some more meaningless test to for a multiline paragraph, because these form a basis for the space of all complex $4times4$ matrices.
%% Typeset Definition
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
%%%%%%%%%%%%%%%%% macro def, to be moved to the preamble, use as SetDefinitionyour-text
newcounterdefcounter
newcommandSetDefinition[1]%
SetHorizontalCoffinOutput % It will be the reference point join the others
SetVerticalCoffinDefinitionlinewidthtextbfDefinition stepcounterdefcounterRomandefcounter. #1 %added counter
%% Make both BackFrame & SideRule heights = height of Definition + 1*baselineskip
SetHorizontalCoffinBackFramecolorgreen!30!gray!15rulelinewidthCoffinTotalHeightDefinition + baselineskip
SetHorizontalCoffinSideRulecolorgreen!50!blackrule3ptCoffinTotalHeightDefinition +baselineskip %vertical side rule
%% Assembly Coffins
JoinCoffins*Output[l,t]BackFrame[l,t] %attach left-top corner of BackFrame to idem of Output
JoinCoffins*Output[l,t]SideRule[l,t] %attach left-top corner of SideRule to idem of Output
JoinCoffins*Output[l,t]Definition[l,t](0pt,-baselineskip) %attack left-top corner of Definition to idem of Output
%% Typeset ooutput
noindentTypesetCoffinOutput % at the text insertion point. It is not a float.
vspace*CoffinTotalHeightDefinitionbigskip %make some room for Output
%%%%%%%%%%%%%%%%%%%%% end macro
SetDefinition$gamma^1$ is defined to be the matrix given by:[gamma^1=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^2$ is defined to be the matrix given by:[gamma^2=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^3$ is defined to be the matrix given by:[gamma^3=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^4$ is defined to be the matrix given by:[gamma^4=frac124epsilon_abcdgamma^abcd ]
SetDefinition$gamma^5$ is defined to be the matrix given above.\ % a short Definition
enddocument
edited Nov 6 at 19:41
answered Nov 6 at 17:57
Simon DispaSimon Dispa
1928 bronze badges
1928 bronze badges
add a comment
|
add a comment
|
The following might give you an idea on how to start:
documentclassarticle
usepackage[most]tcolorbox
newtcolorboxmybox
enhanced,
boxrule=0pt,frame hidden,
borderline west=4pt0ptgreen!75!black,
colback=green!10!white,
sharp corners
begindocument
beginmybox
textbfDefinition My definition text here
endmybox
enddocument
add a comment
|
The following might give you an idea on how to start:
documentclassarticle
usepackage[most]tcolorbox
newtcolorboxmybox
enhanced,
boxrule=0pt,frame hidden,
borderline west=4pt0ptgreen!75!black,
colback=green!10!white,
sharp corners
begindocument
beginmybox
textbfDefinition My definition text here
endmybox
enddocument
add a comment
|
The following might give you an idea on how to start:
documentclassarticle
usepackage[most]tcolorbox
newtcolorboxmybox
enhanced,
boxrule=0pt,frame hidden,
borderline west=4pt0ptgreen!75!black,
colback=green!10!white,
sharp corners
begindocument
beginmybox
textbfDefinition My definition text here
endmybox
enddocument
The following might give you an idea on how to start:
documentclassarticle
usepackage[most]tcolorbox
newtcolorboxmybox
enhanced,
boxrule=0pt,frame hidden,
borderline west=4pt0ptgreen!75!black,
colback=green!10!white,
sharp corners
begindocument
beginmybox
textbfDefinition My definition text here
endmybox
enddocument
answered Oct 16 at 18:20
leandriisleandriis
23.7k1 gold badge12 silver badges41 bronze badges
23.7k1 gold badge12 silver badges41 bronze badges
add a comment
|
add a comment
|
A very light weight solution is to use a tabular. Not as sexy as tcolorbox
and other TikZ based solution, but it compiles fast. The simplest is to use a p
-column as wide as the linewidth
.
First I define a new column type
N
and calculate its width tolinewidth
minus twotabcolsep
. Then the table fits between the margins and will adapt if you change margins.Since we need some space above an below the "box", I have set the table inside a
center
-environment to ensure that the table is fixed between the margins, and vertical space on par with other environments.Thereafter, I define the width and colour of the left vertical bar. I put the redefinition inside the centring environment, which limits the scope of the redefinitions to this taular. Without, all table rules will be green and 3 pt thick!
I have since yesterday slightly optimised the code. It is possible to define a new environment, and move most of the code to such definition. This may be useful if you have lot of boxes.
documentclassarticle
usepackageamsmath
usepackage[table]xcolor
usepackagearray
newcolumntypeN@
begindocument
We need som more meaningless test to for a multiline paragraph, because these form a basis for the space of all compex $4times4$ matrices.
begincenter
setlengthextrarowheight4pt
setlengtharrayrulewidth3pt
arrayrulecolorgreen!50!black
begintabularN
cellcolorgreen!15
textbfDefinition: $lambda^5$ is defined to be the matrix given by:
medskip
[lambda^5=dfrac114 epsilon_abcdgamma^abcd ]
endtabular
endcenter
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
enddocument
add a comment
|
A very light weight solution is to use a tabular. Not as sexy as tcolorbox
and other TikZ based solution, but it compiles fast. The simplest is to use a p
-column as wide as the linewidth
.
First I define a new column type
N
and calculate its width tolinewidth
minus twotabcolsep
. Then the table fits between the margins and will adapt if you change margins.Since we need some space above an below the "box", I have set the table inside a
center
-environment to ensure that the table is fixed between the margins, and vertical space on par with other environments.Thereafter, I define the width and colour of the left vertical bar. I put the redefinition inside the centring environment, which limits the scope of the redefinitions to this taular. Without, all table rules will be green and 3 pt thick!
I have since yesterday slightly optimised the code. It is possible to define a new environment, and move most of the code to such definition. This may be useful if you have lot of boxes.
documentclassarticle
usepackageamsmath
usepackage[table]xcolor
usepackagearray
newcolumntypeN@
begindocument
We need som more meaningless test to for a multiline paragraph, because these form a basis for the space of all compex $4times4$ matrices.
begincenter
setlengthextrarowheight4pt
setlengtharrayrulewidth3pt
arrayrulecolorgreen!50!black
begintabularN
cellcolorgreen!15
textbfDefinition: $lambda^5$ is defined to be the matrix given by:
medskip
[lambda^5=dfrac114 epsilon_abcdgamma^abcd ]
endtabular
endcenter
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
enddocument
add a comment
|
A very light weight solution is to use a tabular. Not as sexy as tcolorbox
and other TikZ based solution, but it compiles fast. The simplest is to use a p
-column as wide as the linewidth
.
First I define a new column type
N
and calculate its width tolinewidth
minus twotabcolsep
. Then the table fits between the margins and will adapt if you change margins.Since we need some space above an below the "box", I have set the table inside a
center
-environment to ensure that the table is fixed between the margins, and vertical space on par with other environments.Thereafter, I define the width and colour of the left vertical bar. I put the redefinition inside the centring environment, which limits the scope of the redefinitions to this taular. Without, all table rules will be green and 3 pt thick!
I have since yesterday slightly optimised the code. It is possible to define a new environment, and move most of the code to such definition. This may be useful if you have lot of boxes.
documentclassarticle
usepackageamsmath
usepackage[table]xcolor
usepackagearray
newcolumntypeN@
begindocument
We need som more meaningless test to for a multiline paragraph, because these form a basis for the space of all compex $4times4$ matrices.
begincenter
setlengthextrarowheight4pt
setlengtharrayrulewidth3pt
arrayrulecolorgreen!50!black
begintabularN
cellcolorgreen!15
textbfDefinition: $lambda^5$ is defined to be the matrix given by:
medskip
[lambda^5=dfrac114 epsilon_abcdgamma^abcd ]
endtabular
endcenter
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
enddocument
A very light weight solution is to use a tabular. Not as sexy as tcolorbox
and other TikZ based solution, but it compiles fast. The simplest is to use a p
-column as wide as the linewidth
.
First I define a new column type
N
and calculate its width tolinewidth
minus twotabcolsep
. Then the table fits between the margins and will adapt if you change margins.Since we need some space above an below the "box", I have set the table inside a
center
-environment to ensure that the table is fixed between the margins, and vertical space on par with other environments.Thereafter, I define the width and colour of the left vertical bar. I put the redefinition inside the centring environment, which limits the scope of the redefinitions to this taular. Without, all table rules will be green and 3 pt thick!
I have since yesterday slightly optimised the code. It is possible to define a new environment, and move most of the code to such definition. This may be useful if you have lot of boxes.
documentclassarticle
usepackageamsmath
usepackage[table]xcolor
usepackagearray
newcolumntypeN@
begindocument
We need som more meaningless test to for a multiline paragraph, because these form a basis for the space of all compex $4times4$ matrices.
begincenter
setlengthextrarowheight4pt
setlengtharrayrulewidth3pt
arrayrulecolorgreen!50!black
begintabularN
cellcolorgreen!15
textbfDefinition: $lambda^5$ is defined to be the matrix given by:
medskip
[lambda^5=dfrac114 epsilon_abcdgamma^abcd ]
endtabular
endcenter
We can invert this to obtain $ epsilon_abcdigamma^abcd lambda^5$, but we need som more meaningless test to for a multiline paragraph.
enddocument
edited Oct 17 at 11:03
answered Oct 16 at 18:15
SveinungSveinung
16k2 gold badges40 silver badges65 bronze badges
16k2 gold badges40 silver badges65 bronze badges
add a comment
|
add a comment
|
I have used mdframed
instead of tcolorbox
(they are similar package but tcolorbox
is mor complete than mdframed
). You can see that you have the same result. Here there is my proposal where I have used for theorem, definition, examples, the specific package amsthm
with the possibility to create a book: see the specific class of the document documentclass[12pt]book
. For to increase the tickness vertical green line you can to change the value linewidth=2.5pt
.
This example sets the text in italic:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
Another code sets the text in roman adding theoremstyledefinition
. See this MWE:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
theoremstyledefinition
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
add a comment
|
I have used mdframed
instead of tcolorbox
(they are similar package but tcolorbox
is mor complete than mdframed
). You can see that you have the same result. Here there is my proposal where I have used for theorem, definition, examples, the specific package amsthm
with the possibility to create a book: see the specific class of the document documentclass[12pt]book
. For to increase the tickness vertical green line you can to change the value linewidth=2.5pt
.
This example sets the text in italic:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
Another code sets the text in roman adding theoremstyledefinition
. See this MWE:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
theoremstyledefinition
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
add a comment
|
I have used mdframed
instead of tcolorbox
(they are similar package but tcolorbox
is mor complete than mdframed
). You can see that you have the same result. Here there is my proposal where I have used for theorem, definition, examples, the specific package amsthm
with the possibility to create a book: see the specific class of the document documentclass[12pt]book
. For to increase the tickness vertical green line you can to change the value linewidth=2.5pt
.
This example sets the text in italic:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
Another code sets the text in roman adding theoremstyledefinition
. See this MWE:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
theoremstyledefinition
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
I have used mdframed
instead of tcolorbox
(they are similar package but tcolorbox
is mor complete than mdframed
). You can see that you have the same result. Here there is my proposal where I have used for theorem, definition, examples, the specific package amsthm
with the possibility to create a book: see the specific class of the document documentclass[12pt]book
. For to increase the tickness vertical green line you can to change the value linewidth=2.5pt
.
This example sets the text in italic:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
Another code sets the text in roman adding theoremstyledefinition
. See this MWE:
documentclass[12pt]book
usepackageamsthm
usepackageamsmath,amssymb
usepackage[svgnames]xcolor
RequirePackage[framemethod=default]mdframed
newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=Green,
backgroundcolor=Green!10,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=2pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2.5pt,
innerbottommargin=5pt]dBox
theoremstyledefinition
newenvironmentdefinitionbegindBoxbegindefinitionTenddefinitionTenddBox
newtheoremdefinitionTDefinition[section]
begindocument
begindefinition
$gamma^5$ is defined to be a matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd]
enddefinition
enddocument
edited Nov 6 at 20:36
answered Oct 16 at 19:45
SebastianoSebastiano
20.4k5 gold badges30 silver badges87 bronze badges
20.4k5 gold badges30 silver badges87 bronze badges
add a comment
|
add a comment
|
In case that you do not use tcolorbox
or tikz for anything else, is a bit overkill use it for a simple box. What I see is AMS theorem-like environment with the definition
style in a green box with a vertical rule beside, so I made defined the definition
command that make just that. Note that macros cannot have paragraph breaks, so, if you need will that, define a new environment instead of a macro.
The advantage of use the amsthm
package just to write "definition" in bold is that you can just remove the asterisk of line 7 to have numbered definitions that you can reference by the usual label
-- ref
method.
documentclassarticle
usepackagexcolor
usepackageamsthm
usepackagelipsum
theoremstyledefinition
newtheorem*defiDefinition
defdefinition#1parmedskipnoindentcolorgreen!50!blackvrule width 3pt%
colorboxgreen!30!gray!15parbox[c]dimexprlinewidth-3pt-2fboxsep-2fboxrule
begindefi#1enddefiparmedskip
begindocument
lipsum[1][1-4]
definition$gamma^5$ is defined to be the matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd ]
lipsum[2][1-5]
enddocument
add a comment
|
In case that you do not use tcolorbox
or tikz for anything else, is a bit overkill use it for a simple box. What I see is AMS theorem-like environment with the definition
style in a green box with a vertical rule beside, so I made defined the definition
command that make just that. Note that macros cannot have paragraph breaks, so, if you need will that, define a new environment instead of a macro.
The advantage of use the amsthm
package just to write "definition" in bold is that you can just remove the asterisk of line 7 to have numbered definitions that you can reference by the usual label
-- ref
method.
documentclassarticle
usepackagexcolor
usepackageamsthm
usepackagelipsum
theoremstyledefinition
newtheorem*defiDefinition
defdefinition#1parmedskipnoindentcolorgreen!50!blackvrule width 3pt%
colorboxgreen!30!gray!15parbox[c]dimexprlinewidth-3pt-2fboxsep-2fboxrule
begindefi#1enddefiparmedskip
begindocument
lipsum[1][1-4]
definition$gamma^5$ is defined to be the matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd ]
lipsum[2][1-5]
enddocument
add a comment
|
In case that you do not use tcolorbox
or tikz for anything else, is a bit overkill use it for a simple box. What I see is AMS theorem-like environment with the definition
style in a green box with a vertical rule beside, so I made defined the definition
command that make just that. Note that macros cannot have paragraph breaks, so, if you need will that, define a new environment instead of a macro.
The advantage of use the amsthm
package just to write "definition" in bold is that you can just remove the asterisk of line 7 to have numbered definitions that you can reference by the usual label
-- ref
method.
documentclassarticle
usepackagexcolor
usepackageamsthm
usepackagelipsum
theoremstyledefinition
newtheorem*defiDefinition
defdefinition#1parmedskipnoindentcolorgreen!50!blackvrule width 3pt%
colorboxgreen!30!gray!15parbox[c]dimexprlinewidth-3pt-2fboxsep-2fboxrule
begindefi#1enddefiparmedskip
begindocument
lipsum[1][1-4]
definition$gamma^5$ is defined to be the matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd ]
lipsum[2][1-5]
enddocument
In case that you do not use tcolorbox
or tikz for anything else, is a bit overkill use it for a simple box. What I see is AMS theorem-like environment with the definition
style in a green box with a vertical rule beside, so I made defined the definition
command that make just that. Note that macros cannot have paragraph breaks, so, if you need will that, define a new environment instead of a macro.
The advantage of use the amsthm
package just to write "definition" in bold is that you can just remove the asterisk of line 7 to have numbered definitions that you can reference by the usual label
-- ref
method.
documentclassarticle
usepackagexcolor
usepackageamsthm
usepackagelipsum
theoremstyledefinition
newtheorem*defiDefinition
defdefinition#1parmedskipnoindentcolorgreen!50!blackvrule width 3pt%
colorboxgreen!30!gray!15parbox[c]dimexprlinewidth-3pt-2fboxsep-2fboxrule
begindefi#1enddefiparmedskip
begindocument
lipsum[1][1-4]
definition$gamma^5$ is defined to be the matrix given by:
[gamma^5=frac124epsilon_abcdgamma^abcd ]
lipsum[2][1-5]
enddocument
edited Oct 16 at 20:20
answered Oct 16 at 20:03
FranFran
58.7k6 gold badges126 silver badges195 bronze badges
58.7k6 gold badges126 silver badges195 bronze badges
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.
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%2f512501%2fcreate-a-box-using-the-tcolorbox-package-or-any-other-image%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
Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help.
– Stefan Pinnow
Oct 16 at 18:37
Why does the inverted relation have an i and the non inverted one does not?
– Schrödinger's cat
Oct 17 at 0:56