Environment to hide number from numbered equations
I'd like to create an environment that hides equation numbers from numbered equations. I'd should work like this:
documentclass{article}
begin{document}
% ---------------------------
% begin{nonumber}
begin{equation}
a + b = c quad text{this equation should be unnumbered}
end{equation}
% end{nonumber}
begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}
equations amsmath
add a comment |
I'd like to create an environment that hides equation numbers from numbered equations. I'd should work like this:
documentclass{article}
begin{document}
% ---------------------------
% begin{nonumber}
begin{equation}
a + b = c quad text{this equation should be unnumbered}
end{equation}
% end{nonumber}
begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}
equations amsmath
3
why not simply useequation*? (amsmath, or[)
– David Carlisle
Mar 22 at 18:10
To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be likebegin{nonumber}thatcommandend{nonumber}.
– noibe
Mar 22 at 18:47
add a comment |
I'd like to create an environment that hides equation numbers from numbered equations. I'd should work like this:
documentclass{article}
begin{document}
% ---------------------------
% begin{nonumber}
begin{equation}
a + b = c quad text{this equation should be unnumbered}
end{equation}
% end{nonumber}
begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}
equations amsmath
I'd like to create an environment that hides equation numbers from numbered equations. I'd should work like this:
documentclass{article}
begin{document}
% ---------------------------
% begin{nonumber}
begin{equation}
a + b = c quad text{this equation should be unnumbered}
end{equation}
% end{nonumber}
begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}
equations amsmath
equations amsmath
asked Mar 22 at 18:07
noibenoibe
554113
554113
3
why not simply useequation*? (amsmath, or[)
– David Carlisle
Mar 22 at 18:10
To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be likebegin{nonumber}thatcommandend{nonumber}.
– noibe
Mar 22 at 18:47
add a comment |
3
why not simply useequation*? (amsmath, or[)
– David Carlisle
Mar 22 at 18:10
To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be likebegin{nonumber}thatcommandend{nonumber}.
– noibe
Mar 22 at 18:47
3
3
why not simply use
equation* ? (amsmath, or [)– David Carlisle
Mar 22 at 18:10
why not simply use
equation* ? (amsmath, or [)– David Carlisle
Mar 22 at 18:10
To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be like
begin{nonumber}thatcommandend{nonumber}.– noibe
Mar 22 at 18:47
To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be like
begin{nonumber}thatcommandend{nonumber}.– noibe
Mar 22 at 18:47
add a comment |
1 Answer
1
active
oldest
votes
If you're only using equations, then the following will suffice:

documentclass{article}
newenvironment{noeqnumber}
{renewenvironment{equation}{[}{]}}
{}
begin{document}
begin{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be unnumbered}
end{equation}
end{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be numbered}
end{equation}
end{document}
Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.
If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:

documentclass{article}
usepackage{mathtools}
makeatletter
% New tag form that gobbles the number
newtagform{gobble}[@gobble]{}{}
makeatother
letoldrefstepcounterrefstepcounter
newenvironment{noeqnumber}
{renewcommand{refstepcounter}[1]{%
% Only step counter if it is not equation
ifnumpdfstrcmp{##1}{equation}=0else
oldrefstepcounter{##1}%
fi
}%
usetagform{gobble}}
{}
begin{document}
begin{noeqnumber}
begin{align}
a + b &= c quad text{this equation should be unnumbered} \
d &= e + f quad text{this equation should be unnumbered}
end{align}
end{noeqnumber}
begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480960%2fenvironment-to-hide-number-from-numbered-equations%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you're only using equations, then the following will suffice:

documentclass{article}
newenvironment{noeqnumber}
{renewenvironment{equation}{[}{]}}
{}
begin{document}
begin{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be unnumbered}
end{equation}
end{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be numbered}
end{equation}
end{document}
Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.
If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:

documentclass{article}
usepackage{mathtools}
makeatletter
% New tag form that gobbles the number
newtagform{gobble}[@gobble]{}{}
makeatother
letoldrefstepcounterrefstepcounter
newenvironment{noeqnumber}
{renewcommand{refstepcounter}[1]{%
% Only step counter if it is not equation
ifnumpdfstrcmp{##1}{equation}=0else
oldrefstepcounter{##1}%
fi
}%
usetagform{gobble}}
{}
begin{document}
begin{noeqnumber}
begin{align}
a + b &= c quad text{this equation should be unnumbered} \
d &= e + f quad text{this equation should be unnumbered}
end{align}
end{noeqnumber}
begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}
add a comment |
If you're only using equations, then the following will suffice:

documentclass{article}
newenvironment{noeqnumber}
{renewenvironment{equation}{[}{]}}
{}
begin{document}
begin{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be unnumbered}
end{equation}
end{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be numbered}
end{equation}
end{document}
Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.
If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:

documentclass{article}
usepackage{mathtools}
makeatletter
% New tag form that gobbles the number
newtagform{gobble}[@gobble]{}{}
makeatother
letoldrefstepcounterrefstepcounter
newenvironment{noeqnumber}
{renewcommand{refstepcounter}[1]{%
% Only step counter if it is not equation
ifnumpdfstrcmp{##1}{equation}=0else
oldrefstepcounter{##1}%
fi
}%
usetagform{gobble}}
{}
begin{document}
begin{noeqnumber}
begin{align}
a + b &= c quad text{this equation should be unnumbered} \
d &= e + f quad text{this equation should be unnumbered}
end{align}
end{noeqnumber}
begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}
add a comment |
If you're only using equations, then the following will suffice:

documentclass{article}
newenvironment{noeqnumber}
{renewenvironment{equation}{[}{]}}
{}
begin{document}
begin{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be unnumbered}
end{equation}
end{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be numbered}
end{equation}
end{document}
Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.
If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:

documentclass{article}
usepackage{mathtools}
makeatletter
% New tag form that gobbles the number
newtagform{gobble}[@gobble]{}{}
makeatother
letoldrefstepcounterrefstepcounter
newenvironment{noeqnumber}
{renewcommand{refstepcounter}[1]{%
% Only step counter if it is not equation
ifnumpdfstrcmp{##1}{equation}=0else
oldrefstepcounter{##1}%
fi
}%
usetagform{gobble}}
{}
begin{document}
begin{noeqnumber}
begin{align}
a + b &= c quad text{this equation should be unnumbered} \
d &= e + f quad text{this equation should be unnumbered}
end{align}
end{noeqnumber}
begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}
If you're only using equations, then the following will suffice:

documentclass{article}
newenvironment{noeqnumber}
{renewenvironment{equation}{[}{]}}
{}
begin{document}
begin{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be unnumbered}
end{equation}
end{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be numbered}
end{equation}
end{document}
Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.
If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:

documentclass{article}
usepackage{mathtools}
makeatletter
% New tag form that gobbles the number
newtagform{gobble}[@gobble]{}{}
makeatother
letoldrefstepcounterrefstepcounter
newenvironment{noeqnumber}
{renewcommand{refstepcounter}[1]{%
% Only step counter if it is not equation
ifnumpdfstrcmp{##1}{equation}=0else
oldrefstepcounter{##1}%
fi
}%
usetagform{gobble}}
{}
begin{document}
begin{noeqnumber}
begin{align}
a + b &= c quad text{this equation should be unnumbered} \
d &= e + f quad text{this equation should be unnumbered}
end{align}
end{noeqnumber}
begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}
edited Mar 22 at 19:15
answered Mar 22 at 18:59
WernerWerner
449k729971704
449k729971704
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%2f480960%2fenvironment-to-hide-number-from-numbered-equations%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
3
why not simply use
equation*? (amsmath, or[)– David Carlisle
Mar 22 at 18:10
To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be like
begin{nonumber}thatcommandend{nonumber}.– noibe
Mar 22 at 18:47