How to align equation numbers inside and outside of mdframed?
up vote
2
down vote
favorite
I am using mdframed to box equations to include the equation number, as I quite like how it looks. However I've noticed that this results in a misalignment between equation numbers that are boxed, and those that are not. Is there an easy fix for this, or is it recommended to use a different method to mdframed?
Below is an example of how I'm using it.
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
begin{document}
Here is an important equation I would like to highlight:
begin{mdframed}
begin{equation}
e^{ipi}=-1
end{equation}
end{mdframed}
Here is an equation not important enough to deserve a highlight:
begin{equation}
y=mx+c
end{equation}
end{document}
Any advice is appreciated.
equations numbering mdframed emphasis alignment
add a comment |
up vote
2
down vote
favorite
I am using mdframed to box equations to include the equation number, as I quite like how it looks. However I've noticed that this results in a misalignment between equation numbers that are boxed, and those that are not. Is there an easy fix for this, or is it recommended to use a different method to mdframed?
Below is an example of how I'm using it.
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
begin{document}
Here is an important equation I would like to highlight:
begin{mdframed}
begin{equation}
e^{ipi}=-1
end{equation}
end{mdframed}
Here is an equation not important enough to deserve a highlight:
begin{equation}
y=mx+c
end{equation}
end{document}
Any advice is appreciated.
equations numbering mdframed emphasis alignment
2
Unless you make the box run into the right margin, aligning the equation numbers with those outside won't look good, I think. So I am wondering what you want to achieve. Do you want to shift ordinary equation numbers to the left, or run the frame through the numbers, or let the frame intrude the right margin?
– marmot
Oct 3 at 18:50
I reckon the best would probably be to shift the unframed numbers left a little - I imagine there's a simple command for that I could probably look up
– Garf
Oct 3 at 20:02
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am using mdframed to box equations to include the equation number, as I quite like how it looks. However I've noticed that this results in a misalignment between equation numbers that are boxed, and those that are not. Is there an easy fix for this, or is it recommended to use a different method to mdframed?
Below is an example of how I'm using it.
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
begin{document}
Here is an important equation I would like to highlight:
begin{mdframed}
begin{equation}
e^{ipi}=-1
end{equation}
end{mdframed}
Here is an equation not important enough to deserve a highlight:
begin{equation}
y=mx+c
end{equation}
end{document}
Any advice is appreciated.
equations numbering mdframed emphasis alignment
I am using mdframed to box equations to include the equation number, as I quite like how it looks. However I've noticed that this results in a misalignment between equation numbers that are boxed, and those that are not. Is there an easy fix for this, or is it recommended to use a different method to mdframed?
Below is an example of how I'm using it.
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
begin{document}
Here is an important equation I would like to highlight:
begin{mdframed}
begin{equation}
e^{ipi}=-1
end{equation}
end{mdframed}
Here is an equation not important enough to deserve a highlight:
begin{equation}
y=mx+c
end{equation}
end{document}
Any advice is appreciated.
equations numbering mdframed emphasis alignment
equations numbering mdframed emphasis alignment
asked Oct 3 at 16:25
Garf
3227
3227
2
Unless you make the box run into the right margin, aligning the equation numbers with those outside won't look good, I think. So I am wondering what you want to achieve. Do you want to shift ordinary equation numbers to the left, or run the frame through the numbers, or let the frame intrude the right margin?
– marmot
Oct 3 at 18:50
I reckon the best would probably be to shift the unframed numbers left a little - I imagine there's a simple command for that I could probably look up
– Garf
Oct 3 at 20:02
add a comment |
2
Unless you make the box run into the right margin, aligning the equation numbers with those outside won't look good, I think. So I am wondering what you want to achieve. Do you want to shift ordinary equation numbers to the left, or run the frame through the numbers, or let the frame intrude the right margin?
– marmot
Oct 3 at 18:50
I reckon the best would probably be to shift the unframed numbers left a little - I imagine there's a simple command for that I could probably look up
– Garf
Oct 3 at 20:02
2
2
Unless you make the box run into the right margin, aligning the equation numbers with those outside won't look good, I think. So I am wondering what you want to achieve. Do you want to shift ordinary equation numbers to the left, or run the frame through the numbers, or let the frame intrude the right margin?
– marmot
Oct 3 at 18:50
Unless you make the box run into the right margin, aligning the equation numbers with those outside won't look good, I think. So I am wondering what you want to achieve. Do you want to shift ordinary equation numbers to the left, or run the frame through the numbers, or let the frame intrude the right margin?
– marmot
Oct 3 at 18:50
I reckon the best would probably be to shift the unframed numbers left a little - I imagine there's a simple command for that I could probably look up
– Garf
Oct 3 at 20:02
I reckon the best would probably be to shift the unframed numbers left a little - I imagine there's a simple command for that I could probably look up
– Garf
Oct 3 at 20:02
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
It is easiest to let the frame extend in to the right margin:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newlength{mywidth}
setlength{mywidth}{dimexprlinewidth+mdflength{innerrightmargin}+mdflength{linewidth}}
begin{document}
Here is an important equation I would like to highlight:
begin{mdframed}[userdefinedwidth=mywidth]
begin{equation}
e^{ipi}=-1
end{equation}
end{mdframed}
Here is an equation not important enough to deserve a highlight:
begin{equation}
y=mx+c
end{equation}
end{document}
To go the other way, you could perhaps include all displays in an mdframed
, but just hide the lines:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newbool{equationframe}
surroundwithmdframed[hidealllines=ifbool{equationframe}{false}{true}]{equation}
boolfalse{equationframe}
begin{document}
Here is an important equation I would like to highlight but first
enough text to show the width of the line:
{booltrue{equationframe}%
begin{equation}
e^{ipi}=-1
end{equation}}
Here is an equation not important enough to deserve a highlight but
first enough text to show the width of the line:
begin{equation}
y=mx+c
end{equation}
end{document}
Here I have added an extra flag dedicated to frames for equations, to avoid setting hidealllines
globally and thus affecting other mdframed environments.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
It is easiest to let the frame extend in to the right margin:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newlength{mywidth}
setlength{mywidth}{dimexprlinewidth+mdflength{innerrightmargin}+mdflength{linewidth}}
begin{document}
Here is an important equation I would like to highlight:
begin{mdframed}[userdefinedwidth=mywidth]
begin{equation}
e^{ipi}=-1
end{equation}
end{mdframed}
Here is an equation not important enough to deserve a highlight:
begin{equation}
y=mx+c
end{equation}
end{document}
To go the other way, you could perhaps include all displays in an mdframed
, but just hide the lines:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newbool{equationframe}
surroundwithmdframed[hidealllines=ifbool{equationframe}{false}{true}]{equation}
boolfalse{equationframe}
begin{document}
Here is an important equation I would like to highlight but first
enough text to show the width of the line:
{booltrue{equationframe}%
begin{equation}
e^{ipi}=-1
end{equation}}
Here is an equation not important enough to deserve a highlight but
first enough text to show the width of the line:
begin{equation}
y=mx+c
end{equation}
end{document}
Here I have added an extra flag dedicated to frames for equations, to avoid setting hidealllines
globally and thus affecting other mdframed environments.
add a comment |
up vote
2
down vote
It is easiest to let the frame extend in to the right margin:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newlength{mywidth}
setlength{mywidth}{dimexprlinewidth+mdflength{innerrightmargin}+mdflength{linewidth}}
begin{document}
Here is an important equation I would like to highlight:
begin{mdframed}[userdefinedwidth=mywidth]
begin{equation}
e^{ipi}=-1
end{equation}
end{mdframed}
Here is an equation not important enough to deserve a highlight:
begin{equation}
y=mx+c
end{equation}
end{document}
To go the other way, you could perhaps include all displays in an mdframed
, but just hide the lines:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newbool{equationframe}
surroundwithmdframed[hidealllines=ifbool{equationframe}{false}{true}]{equation}
boolfalse{equationframe}
begin{document}
Here is an important equation I would like to highlight but first
enough text to show the width of the line:
{booltrue{equationframe}%
begin{equation}
e^{ipi}=-1
end{equation}}
Here is an equation not important enough to deserve a highlight but
first enough text to show the width of the line:
begin{equation}
y=mx+c
end{equation}
end{document}
Here I have added an extra flag dedicated to frames for equations, to avoid setting hidealllines
globally and thus affecting other mdframed environments.
add a comment |
up vote
2
down vote
up vote
2
down vote
It is easiest to let the frame extend in to the right margin:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newlength{mywidth}
setlength{mywidth}{dimexprlinewidth+mdflength{innerrightmargin}+mdflength{linewidth}}
begin{document}
Here is an important equation I would like to highlight:
begin{mdframed}[userdefinedwidth=mywidth]
begin{equation}
e^{ipi}=-1
end{equation}
end{mdframed}
Here is an equation not important enough to deserve a highlight:
begin{equation}
y=mx+c
end{equation}
end{document}
To go the other way, you could perhaps include all displays in an mdframed
, but just hide the lines:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newbool{equationframe}
surroundwithmdframed[hidealllines=ifbool{equationframe}{false}{true}]{equation}
boolfalse{equationframe}
begin{document}
Here is an important equation I would like to highlight but first
enough text to show the width of the line:
{booltrue{equationframe}%
begin{equation}
e^{ipi}=-1
end{equation}}
Here is an equation not important enough to deserve a highlight but
first enough text to show the width of the line:
begin{equation}
y=mx+c
end{equation}
end{document}
Here I have added an extra flag dedicated to frames for equations, to avoid setting hidealllines
globally and thus affecting other mdframed environments.
It is easiest to let the frame extend in to the right margin:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newlength{mywidth}
setlength{mywidth}{dimexprlinewidth+mdflength{innerrightmargin}+mdflength{linewidth}}
begin{document}
Here is an important equation I would like to highlight:
begin{mdframed}[userdefinedwidth=mywidth]
begin{equation}
e^{ipi}=-1
end{equation}
end{mdframed}
Here is an equation not important enough to deserve a highlight:
begin{equation}
y=mx+c
end{equation}
end{document}
To go the other way, you could perhaps include all displays in an mdframed
, but just hide the lines:
documentclass{article}
usepackage{amsmath}
usepackage{mdframed}
newbool{equationframe}
surroundwithmdframed[hidealllines=ifbool{equationframe}{false}{true}]{equation}
boolfalse{equationframe}
begin{document}
Here is an important equation I would like to highlight but first
enough text to show the width of the line:
{booltrue{equationframe}%
begin{equation}
e^{ipi}=-1
end{equation}}
Here is an equation not important enough to deserve a highlight but
first enough text to show the width of the line:
begin{equation}
y=mx+c
end{equation}
end{document}
Here I have added an extra flag dedicated to frames for equations, to avoid setting hidealllines
globally and thus affecting other mdframed environments.
edited yesterday
answered 2 days ago
Andrew Swann
75.8k9125321
75.8k9125321
add a comment |
add a comment |
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%2f453656%2fhow-to-align-equation-numbers-inside-and-outside-of-mdframed%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
2
Unless you make the box run into the right margin, aligning the equation numbers with those outside won't look good, I think. So I am wondering what you want to achieve. Do you want to shift ordinary equation numbers to the left, or run the frame through the numbers, or let the frame intrude the right margin?
– marmot
Oct 3 at 18:50
I reckon the best would probably be to shift the unframed numbers left a little - I imagine there's a simple command for that I could probably look up
– Garf
Oct 3 at 20:02