How to compare number from newenvironment argument
up vote
6
down vote
favorite
I am trying to create a new environment as follows
newenvironment{letters}[1]{%
vspace{-3mm}
ifnum #1=1%
else
begin{multicols}{#1}
fi
begin{enumerate}[label=textbf{(alph*)}]
}{%
end{enumerate}
ifnum #1=1%
else
end{multicols}
fi
vspace{-5mm}
}
My question is: Why doesn't it work?!
Note: this is not a duplicate from this post, since I don't want to do the RenewDocumentEnvironment
. Instead, I want to create a new environment.
environments conditionals
add a comment |
up vote
6
down vote
favorite
I am trying to create a new environment as follows
newenvironment{letters}[1]{%
vspace{-3mm}
ifnum #1=1%
else
begin{multicols}{#1}
fi
begin{enumerate}[label=textbf{(alph*)}]
}{%
end{enumerate}
ifnum #1=1%
else
end{multicols}
fi
vspace{-5mm}
}
My question is: Why doesn't it work?!
Note: this is not a duplicate from this post, since I don't want to do the RenewDocumentEnvironment
. Instead, I want to create a new environment.
environments conditionals
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
I am trying to create a new environment as follows
newenvironment{letters}[1]{%
vspace{-3mm}
ifnum #1=1%
else
begin{multicols}{#1}
fi
begin{enumerate}[label=textbf{(alph*)}]
}{%
end{enumerate}
ifnum #1=1%
else
end{multicols}
fi
vspace{-5mm}
}
My question is: Why doesn't it work?!
Note: this is not a duplicate from this post, since I don't want to do the RenewDocumentEnvironment
. Instead, I want to create a new environment.
environments conditionals
I am trying to create a new environment as follows
newenvironment{letters}[1]{%
vspace{-3mm}
ifnum #1=1%
else
begin{multicols}{#1}
fi
begin{enumerate}[label=textbf{(alph*)}]
}{%
end{enumerate}
ifnum #1=1%
else
end{multicols}
fi
vspace{-5mm}
}
My question is: Why doesn't it work?!
Note: this is not a duplicate from this post, since I don't want to do the RenewDocumentEnvironment
. Instead, I want to create a new environment.
environments conditionals
environments conditionals
asked Nov 14 at 20:20
Brasil
340312
340312
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
If you look at the log you'll see that the first thing TeX complains about is:
! Illegal parameter number in definition of endletters.
<to be read again>
1
l.22 }
That's because you tried to use #1
in the end
part of the environment, but you can't use the arguments passed to the begin
part in the end
part of an environment.
If you were to do that, then the usage of the environment would have to be
something like this:
begin{letters}{1}
item stuff
end{letters}{1}
passing the argument to end{letters}
too.
To do what you want you need to devise another way to pass that information to the end
part. For instance, with a newif
:
documentclass{article}
usepackage{enumitem}
usepackage{multicol}
newififLettersMulticol
newenvironment{letters}[1]{%
vspace{-3mm}
ifnum #1=1
else
LettersMulticoltrue
begin{multicols}{#1}
fi
begin{enumerate}[label=textbf{(alph*)}]
}{%
end{enumerate}
ifLettersMulticol
end{multicols}
fi
vspace{-5mm}
}
begin{document}
begin{letters}{1}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
begin{letters}{2}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
end{document}
Also, as it's been noted in the comments, it's not a good idea to add a %
at the end of the line in ifnum
tests (and a couple other cases too). When TeX is scanning the numbers in the ifnum
test, it is expanding tokens, and will continue to do so until something that is not a number is found. For instance, the following (perhaps idiotic, but serves as demonstration) code
ifnum1=0%
ifnum2=2
1%
else
2%
fi
a%
else
b%
fi
produces a
, instead of b
, as someone that took a quick glance at the ifnum1=0
would guess. If, however, you remove the very first %
, the output is b
.
Also, a missing %
at the end of a ifnum#1=1
test will not appear in the output, because TeX's number scanning mechanism says that a number can be followed by an optional space, so this one is safe. To be sure, of course, one can end the scanning of the ifnum
test with relax
: ifnum#1=1relax
.
In this particular case, the %
wouldn't casuse troubles, but it's probably better to be on the safe side.
maybe stress that you correctly removed the1%
and replaced them by1<end of line space>
else theifnum
test won't work correctly (except if one gets lucky).
– jfbu
Nov 14 at 21:26
1
@jfbu In this case one is lucky, becauseelse
just follows1
and so TeX knows it has to stop evaluating the number or the conditional would go wrong. Of course a proper constant termination is much better.
– egreg
Nov 14 at 21:45
@jfbu Thanks for the reminder. I forgot I changed that :-)
– Phelype Oleinik
Nov 14 at 23:10
@egreg I agree. Thepagenumbering{gobble}
was there because I forgot to remove it from another code, sorry for the noise. Thanks :-)
– Phelype Oleinik
Nov 14 at 23:12
+1 for the added explanation aboutifnum
and termination of numbers.relax
is not an option if you want to maintain expandability, but in 99% of user cases, that is not the goal, sorelax
. You can also usespace
. But the most general isnumexpr#1relax
because it allows for#1
both explicit digit tokens or a TeX count variable. (I think vaguely that @egreg had a non e-TeX trick somewhere recently but I forgot where).
– jfbu
Nov 15 at 8:04
|
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
If you look at the log you'll see that the first thing TeX complains about is:
! Illegal parameter number in definition of endletters.
<to be read again>
1
l.22 }
That's because you tried to use #1
in the end
part of the environment, but you can't use the arguments passed to the begin
part in the end
part of an environment.
If you were to do that, then the usage of the environment would have to be
something like this:
begin{letters}{1}
item stuff
end{letters}{1}
passing the argument to end{letters}
too.
To do what you want you need to devise another way to pass that information to the end
part. For instance, with a newif
:
documentclass{article}
usepackage{enumitem}
usepackage{multicol}
newififLettersMulticol
newenvironment{letters}[1]{%
vspace{-3mm}
ifnum #1=1
else
LettersMulticoltrue
begin{multicols}{#1}
fi
begin{enumerate}[label=textbf{(alph*)}]
}{%
end{enumerate}
ifLettersMulticol
end{multicols}
fi
vspace{-5mm}
}
begin{document}
begin{letters}{1}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
begin{letters}{2}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
end{document}
Also, as it's been noted in the comments, it's not a good idea to add a %
at the end of the line in ifnum
tests (and a couple other cases too). When TeX is scanning the numbers in the ifnum
test, it is expanding tokens, and will continue to do so until something that is not a number is found. For instance, the following (perhaps idiotic, but serves as demonstration) code
ifnum1=0%
ifnum2=2
1%
else
2%
fi
a%
else
b%
fi
produces a
, instead of b
, as someone that took a quick glance at the ifnum1=0
would guess. If, however, you remove the very first %
, the output is b
.
Also, a missing %
at the end of a ifnum#1=1
test will not appear in the output, because TeX's number scanning mechanism says that a number can be followed by an optional space, so this one is safe. To be sure, of course, one can end the scanning of the ifnum
test with relax
: ifnum#1=1relax
.
In this particular case, the %
wouldn't casuse troubles, but it's probably better to be on the safe side.
maybe stress that you correctly removed the1%
and replaced them by1<end of line space>
else theifnum
test won't work correctly (except if one gets lucky).
– jfbu
Nov 14 at 21:26
1
@jfbu In this case one is lucky, becauseelse
just follows1
and so TeX knows it has to stop evaluating the number or the conditional would go wrong. Of course a proper constant termination is much better.
– egreg
Nov 14 at 21:45
@jfbu Thanks for the reminder. I forgot I changed that :-)
– Phelype Oleinik
Nov 14 at 23:10
@egreg I agree. Thepagenumbering{gobble}
was there because I forgot to remove it from another code, sorry for the noise. Thanks :-)
– Phelype Oleinik
Nov 14 at 23:12
+1 for the added explanation aboutifnum
and termination of numbers.relax
is not an option if you want to maintain expandability, but in 99% of user cases, that is not the goal, sorelax
. You can also usespace
. But the most general isnumexpr#1relax
because it allows for#1
both explicit digit tokens or a TeX count variable. (I think vaguely that @egreg had a non e-TeX trick somewhere recently but I forgot where).
– jfbu
Nov 15 at 8:04
|
show 1 more comment
up vote
6
down vote
accepted
If you look at the log you'll see that the first thing TeX complains about is:
! Illegal parameter number in definition of endletters.
<to be read again>
1
l.22 }
That's because you tried to use #1
in the end
part of the environment, but you can't use the arguments passed to the begin
part in the end
part of an environment.
If you were to do that, then the usage of the environment would have to be
something like this:
begin{letters}{1}
item stuff
end{letters}{1}
passing the argument to end{letters}
too.
To do what you want you need to devise another way to pass that information to the end
part. For instance, with a newif
:
documentclass{article}
usepackage{enumitem}
usepackage{multicol}
newififLettersMulticol
newenvironment{letters}[1]{%
vspace{-3mm}
ifnum #1=1
else
LettersMulticoltrue
begin{multicols}{#1}
fi
begin{enumerate}[label=textbf{(alph*)}]
}{%
end{enumerate}
ifLettersMulticol
end{multicols}
fi
vspace{-5mm}
}
begin{document}
begin{letters}{1}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
begin{letters}{2}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
end{document}
Also, as it's been noted in the comments, it's not a good idea to add a %
at the end of the line in ifnum
tests (and a couple other cases too). When TeX is scanning the numbers in the ifnum
test, it is expanding tokens, and will continue to do so until something that is not a number is found. For instance, the following (perhaps idiotic, but serves as demonstration) code
ifnum1=0%
ifnum2=2
1%
else
2%
fi
a%
else
b%
fi
produces a
, instead of b
, as someone that took a quick glance at the ifnum1=0
would guess. If, however, you remove the very first %
, the output is b
.
Also, a missing %
at the end of a ifnum#1=1
test will not appear in the output, because TeX's number scanning mechanism says that a number can be followed by an optional space, so this one is safe. To be sure, of course, one can end the scanning of the ifnum
test with relax
: ifnum#1=1relax
.
In this particular case, the %
wouldn't casuse troubles, but it's probably better to be on the safe side.
maybe stress that you correctly removed the1%
and replaced them by1<end of line space>
else theifnum
test won't work correctly (except if one gets lucky).
– jfbu
Nov 14 at 21:26
1
@jfbu In this case one is lucky, becauseelse
just follows1
and so TeX knows it has to stop evaluating the number or the conditional would go wrong. Of course a proper constant termination is much better.
– egreg
Nov 14 at 21:45
@jfbu Thanks for the reminder. I forgot I changed that :-)
– Phelype Oleinik
Nov 14 at 23:10
@egreg I agree. Thepagenumbering{gobble}
was there because I forgot to remove it from another code, sorry for the noise. Thanks :-)
– Phelype Oleinik
Nov 14 at 23:12
+1 for the added explanation aboutifnum
and termination of numbers.relax
is not an option if you want to maintain expandability, but in 99% of user cases, that is not the goal, sorelax
. You can also usespace
. But the most general isnumexpr#1relax
because it allows for#1
both explicit digit tokens or a TeX count variable. (I think vaguely that @egreg had a non e-TeX trick somewhere recently but I forgot where).
– jfbu
Nov 15 at 8:04
|
show 1 more comment
up vote
6
down vote
accepted
up vote
6
down vote
accepted
If you look at the log you'll see that the first thing TeX complains about is:
! Illegal parameter number in definition of endletters.
<to be read again>
1
l.22 }
That's because you tried to use #1
in the end
part of the environment, but you can't use the arguments passed to the begin
part in the end
part of an environment.
If you were to do that, then the usage of the environment would have to be
something like this:
begin{letters}{1}
item stuff
end{letters}{1}
passing the argument to end{letters}
too.
To do what you want you need to devise another way to pass that information to the end
part. For instance, with a newif
:
documentclass{article}
usepackage{enumitem}
usepackage{multicol}
newififLettersMulticol
newenvironment{letters}[1]{%
vspace{-3mm}
ifnum #1=1
else
LettersMulticoltrue
begin{multicols}{#1}
fi
begin{enumerate}[label=textbf{(alph*)}]
}{%
end{enumerate}
ifLettersMulticol
end{multicols}
fi
vspace{-5mm}
}
begin{document}
begin{letters}{1}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
begin{letters}{2}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
end{document}
Also, as it's been noted in the comments, it's not a good idea to add a %
at the end of the line in ifnum
tests (and a couple other cases too). When TeX is scanning the numbers in the ifnum
test, it is expanding tokens, and will continue to do so until something that is not a number is found. For instance, the following (perhaps idiotic, but serves as demonstration) code
ifnum1=0%
ifnum2=2
1%
else
2%
fi
a%
else
b%
fi
produces a
, instead of b
, as someone that took a quick glance at the ifnum1=0
would guess. If, however, you remove the very first %
, the output is b
.
Also, a missing %
at the end of a ifnum#1=1
test will not appear in the output, because TeX's number scanning mechanism says that a number can be followed by an optional space, so this one is safe. To be sure, of course, one can end the scanning of the ifnum
test with relax
: ifnum#1=1relax
.
In this particular case, the %
wouldn't casuse troubles, but it's probably better to be on the safe side.
If you look at the log you'll see that the first thing TeX complains about is:
! Illegal parameter number in definition of endletters.
<to be read again>
1
l.22 }
That's because you tried to use #1
in the end
part of the environment, but you can't use the arguments passed to the begin
part in the end
part of an environment.
If you were to do that, then the usage of the environment would have to be
something like this:
begin{letters}{1}
item stuff
end{letters}{1}
passing the argument to end{letters}
too.
To do what you want you need to devise another way to pass that information to the end
part. For instance, with a newif
:
documentclass{article}
usepackage{enumitem}
usepackage{multicol}
newififLettersMulticol
newenvironment{letters}[1]{%
vspace{-3mm}
ifnum #1=1
else
LettersMulticoltrue
begin{multicols}{#1}
fi
begin{enumerate}[label=textbf{(alph*)}]
}{%
end{enumerate}
ifLettersMulticol
end{multicols}
fi
vspace{-5mm}
}
begin{document}
begin{letters}{1}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
begin{letters}{2}
item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
item tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
item quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
item consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
item proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{letters}
end{document}
Also, as it's been noted in the comments, it's not a good idea to add a %
at the end of the line in ifnum
tests (and a couple other cases too). When TeX is scanning the numbers in the ifnum
test, it is expanding tokens, and will continue to do so until something that is not a number is found. For instance, the following (perhaps idiotic, but serves as demonstration) code
ifnum1=0%
ifnum2=2
1%
else
2%
fi
a%
else
b%
fi
produces a
, instead of b
, as someone that took a quick glance at the ifnum1=0
would guess. If, however, you remove the very first %
, the output is b
.
Also, a missing %
at the end of a ifnum#1=1
test will not appear in the output, because TeX's number scanning mechanism says that a number can be followed by an optional space, so this one is safe. To be sure, of course, one can end the scanning of the ifnum
test with relax
: ifnum#1=1relax
.
In this particular case, the %
wouldn't casuse troubles, but it's probably better to be on the safe side.
edited Nov 14 at 23:08
answered Nov 14 at 20:28
Phelype Oleinik
20.4k54277
20.4k54277
maybe stress that you correctly removed the1%
and replaced them by1<end of line space>
else theifnum
test won't work correctly (except if one gets lucky).
– jfbu
Nov 14 at 21:26
1
@jfbu In this case one is lucky, becauseelse
just follows1
and so TeX knows it has to stop evaluating the number or the conditional would go wrong. Of course a proper constant termination is much better.
– egreg
Nov 14 at 21:45
@jfbu Thanks for the reminder. I forgot I changed that :-)
– Phelype Oleinik
Nov 14 at 23:10
@egreg I agree. Thepagenumbering{gobble}
was there because I forgot to remove it from another code, sorry for the noise. Thanks :-)
– Phelype Oleinik
Nov 14 at 23:12
+1 for the added explanation aboutifnum
and termination of numbers.relax
is not an option if you want to maintain expandability, but in 99% of user cases, that is not the goal, sorelax
. You can also usespace
. But the most general isnumexpr#1relax
because it allows for#1
both explicit digit tokens or a TeX count variable. (I think vaguely that @egreg had a non e-TeX trick somewhere recently but I forgot where).
– jfbu
Nov 15 at 8:04
|
show 1 more comment
maybe stress that you correctly removed the1%
and replaced them by1<end of line space>
else theifnum
test won't work correctly (except if one gets lucky).
– jfbu
Nov 14 at 21:26
1
@jfbu In this case one is lucky, becauseelse
just follows1
and so TeX knows it has to stop evaluating the number or the conditional would go wrong. Of course a proper constant termination is much better.
– egreg
Nov 14 at 21:45
@jfbu Thanks for the reminder. I forgot I changed that :-)
– Phelype Oleinik
Nov 14 at 23:10
@egreg I agree. Thepagenumbering{gobble}
was there because I forgot to remove it from another code, sorry for the noise. Thanks :-)
– Phelype Oleinik
Nov 14 at 23:12
+1 for the added explanation aboutifnum
and termination of numbers.relax
is not an option if you want to maintain expandability, but in 99% of user cases, that is not the goal, sorelax
. You can also usespace
. But the most general isnumexpr#1relax
because it allows for#1
both explicit digit tokens or a TeX count variable. (I think vaguely that @egreg had a non e-TeX trick somewhere recently but I forgot where).
– jfbu
Nov 15 at 8:04
maybe stress that you correctly removed the
1%
and replaced them by 1<end of line space>
else the ifnum
test won't work correctly (except if one gets lucky).– jfbu
Nov 14 at 21:26
maybe stress that you correctly removed the
1%
and replaced them by 1<end of line space>
else the ifnum
test won't work correctly (except if one gets lucky).– jfbu
Nov 14 at 21:26
1
1
@jfbu In this case one is lucky, because
else
just follows 1
and so TeX knows it has to stop evaluating the number or the conditional would go wrong. Of course a proper constant termination is much better.– egreg
Nov 14 at 21:45
@jfbu In this case one is lucky, because
else
just follows 1
and so TeX knows it has to stop evaluating the number or the conditional would go wrong. Of course a proper constant termination is much better.– egreg
Nov 14 at 21:45
@jfbu Thanks for the reminder. I forgot I changed that :-)
– Phelype Oleinik
Nov 14 at 23:10
@jfbu Thanks for the reminder. I forgot I changed that :-)
– Phelype Oleinik
Nov 14 at 23:10
@egreg I agree. The
pagenumbering{gobble}
was there because I forgot to remove it from another code, sorry for the noise. Thanks :-)– Phelype Oleinik
Nov 14 at 23:12
@egreg I agree. The
pagenumbering{gobble}
was there because I forgot to remove it from another code, sorry for the noise. Thanks :-)– Phelype Oleinik
Nov 14 at 23:12
+1 for the added explanation about
ifnum
and termination of numbers. relax
is not an option if you want to maintain expandability, but in 99% of user cases, that is not the goal, so relax
. You can also use space
. But the most general is numexpr#1relax
because it allows for #1
both explicit digit tokens or a TeX count variable. (I think vaguely that @egreg had a non e-TeX trick somewhere recently but I forgot where).– jfbu
Nov 15 at 8:04
+1 for the added explanation about
ifnum
and termination of numbers. relax
is not an option if you want to maintain expandability, but in 99% of user cases, that is not the goal, so relax
. You can also use space
. But the most general is numexpr#1relax
because it allows for #1
both explicit digit tokens or a TeX count variable. (I think vaguely that @egreg had a non e-TeX trick somewhere recently but I forgot where).– jfbu
Nov 15 at 8:04
|
show 1 more 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%2f460011%2fhow-to-compare-number-from-newenvironment-argument%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