Adding conditional to environment
up vote
0
down vote
favorite
I want my assignment solutions to appear only when I set a variable to 1. Right now what I have is
documentclass{article}
newenvironment{solution}{paragraph{textbf{Solution:}}}{par}
newcountSolutions
Solutions=1
begin{document}
Some text.
ifnumSolutions=1
{
begin{solution}
This is a solution.
end{solution}
}fi
end{document}
Is there a more elegant way of implementing this, with the conditional within the environment definition?
environments conditionals
add a comment |
up vote
0
down vote
favorite
I want my assignment solutions to appear only when I set a variable to 1. Right now what I have is
documentclass{article}
newenvironment{solution}{paragraph{textbf{Solution:}}}{par}
newcountSolutions
Solutions=1
begin{document}
Some text.
ifnumSolutions=1
{
begin{solution}
This is a solution.
end{solution}
}fi
end{document}
Is there a more elegant way of implementing this, with the conditional within the environment definition?
environments conditionals
1
This is a FAQ. The standard way is to use thecomment
package.
– egreg
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want my assignment solutions to appear only when I set a variable to 1. Right now what I have is
documentclass{article}
newenvironment{solution}{paragraph{textbf{Solution:}}}{par}
newcountSolutions
Solutions=1
begin{document}
Some text.
ifnumSolutions=1
{
begin{solution}
This is a solution.
end{solution}
}fi
end{document}
Is there a more elegant way of implementing this, with the conditional within the environment definition?
environments conditionals
I want my assignment solutions to appear only when I set a variable to 1. Right now what I have is
documentclass{article}
newenvironment{solution}{paragraph{textbf{Solution:}}}{par}
newcountSolutions
Solutions=1
begin{document}
Some text.
ifnumSolutions=1
{
begin{solution}
This is a solution.
end{solution}
}fi
end{document}
Is there a more elegant way of implementing this, with the conditional within the environment definition?
environments conditionals
environments conditionals
asked yesterday
Yair Zick
1113
1113
1
This is a FAQ. The standard way is to use thecomment
package.
– egreg
yesterday
add a comment |
1
This is a FAQ. The standard way is to use thecomment
package.
– egreg
yesterday
1
1
This is a FAQ. The standard way is to use the
comment
package.– egreg
yesterday
This is a FAQ. The standard way is to use the
comment
package.– egreg
yesterday
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f460698%2fadding-conditional-to-environment%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
This is a FAQ. The standard way is to use the
comment
package.– egreg
yesterday