Use variables like #1 in math [on hold]TeX in small caps?Storing environment argumentsAdd par only if last...
Is it possible to counterspell the revised Artificer?
Do AL rules let me pick different starting equipment?
Why would the IRS ask for birth certificates or even audit a small tax return?
How to fix my table, centering of columns
Practical reasons to have both a large police force and bounty hunting network?
Sometimes a banana is just a banana
Why are special aircraft used for the carriers in the United States Navy?
Wardrobe above a wall with fuse boxes
3.5% Interest Student Loan or use all of my savings on Tuition?
What are SHA-rounds?
Why do members of Congress in committee hearings ask witnesses the same question multiple times?
Should I use HTTPS on a domain that will only be used for redirection?
What does each site of a vanilla 9.1 installation do?
When was drinking water recognized as crucial in marathon running?
Rationale to prefer local variables over instance variables?
Reason why dimensional travelling would be restricted
How can neutral atoms have exactly zero electric field when there is a difference in the positions of the charges?
When do _WA_Sys_ statistics Get Updated?
How to get the first first element while continue streaming?
For the Kanji 校 is the fifth stroke connected to the sixth stroke?
Can a space-faring robot still function over a billion years?
How can I highlight parts in a screenshot
If there are any 3nion, 5nion, 7nion, 9nion, 10nion, etc.
A bug in Excel? Conditional formatting for marking duplicates also highlights unique value
Use variables like #1 in math [on hold]
TeX in small caps?Storing environment argumentsAdd par only if last paragraph did not end with displayed mathCompiler Error when Creating a Macro/EnvironmentDefine a new command with parameters inside newcommandLoop code for repeated sumsDraw a shape with operation on parameters in TikzLogical markup for math symbols/variables, alternative to newcommandMake paired delimiter with prefix for Re and ImIndexing variables
I'm writing this small newcommand
, and I want to send numbers as parameters. But since the math mode always tries to interpret the #
in a different way. I don't know what to do. Here is what I have tried so far:
newcommand{scoring}[1]{%
begin{center}
$K^1=$#1 % this does work, however it looks ugly
$K^1=#1$ % does work
$K^1=#1$ % does not work
$K^1={#1}$ % does also not work
end{center}
}
I call this command with this:
scoring{4}
So a 4 should appear.
macros variable
put on hold as off-topic by Werner, Raaja, Stefan Pinnow, egreg, Marcel Krüger 20 hours ago
- This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.
|
show 4 more comments
I'm writing this small newcommand
, and I want to send numbers as parameters. But since the math mode always tries to interpret the #
in a different way. I don't know what to do. Here is what I have tried so far:
newcommand{scoring}[1]{%
begin{center}
$K^1=$#1 % this does work, however it looks ugly
$K^1=#1$ % does work
$K^1=#1$ % does not work
$K^1={#1}$ % does also not work
end{center}
}
I call this command with this:
scoring{4}
So a 4 should appear.
macros variable
put on hold as off-topic by Werner, Raaja, Stefan Pinnow, egreg, Marcel Krüger 20 hours ago
- This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.
3
Off-topic: Why you have to usebegin{center} $a=b$ end{center}
when you already have[a=b]
?
– JouleV
yesterday
4
I don't find any problem with simple command definitions likenewcommand{scoring}[1]{$K^1=#1$}
ornewcommand{scoring}[1]{[K^1=#1]}
.
– JouleV
yesterday
2
$K^1=#1$
should actually work in that it would output K^1=4. Can you show us a complete example document where that goes wrong, please? I agree with JouleV thatbegin{center}$...$end{center}
looks suspiciously like you want[...]
orbegin{equation}...end{equation}
oralign
....
– moewe
yesterday
1
documentclass{article} newcommand{scoring}[1]{[K^1=#1]} begin{document} scoring{4} end{document}
works flawlessly for me
– sheß
yesterday
5
I'm voting to close this question as off-topic because the problem cannot be replicated.
– Werner
22 hours ago
|
show 4 more comments
I'm writing this small newcommand
, and I want to send numbers as parameters. But since the math mode always tries to interpret the #
in a different way. I don't know what to do. Here is what I have tried so far:
newcommand{scoring}[1]{%
begin{center}
$K^1=$#1 % this does work, however it looks ugly
$K^1=#1$ % does work
$K^1=#1$ % does not work
$K^1={#1}$ % does also not work
end{center}
}
I call this command with this:
scoring{4}
So a 4 should appear.
macros variable
I'm writing this small newcommand
, and I want to send numbers as parameters. But since the math mode always tries to interpret the #
in a different way. I don't know what to do. Here is what I have tried so far:
newcommand{scoring}[1]{%
begin{center}
$K^1=$#1 % this does work, however it looks ugly
$K^1=#1$ % does work
$K^1=#1$ % does not work
$K^1={#1}$ % does also not work
end{center}
}
I call this command with this:
scoring{4}
So a 4 should appear.
macros variable
macros variable
edited 10 hours ago
Phil Roggenbuck
asked yesterday
Phil RoggenbuckPhil Roggenbuck
1256
1256
put on hold as off-topic by Werner, Raaja, Stefan Pinnow, egreg, Marcel Krüger 20 hours ago
- This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as off-topic by Werner, Raaja, Stefan Pinnow, egreg, Marcel Krüger 20 hours ago
- This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.
3
Off-topic: Why you have to usebegin{center} $a=b$ end{center}
when you already have[a=b]
?
– JouleV
yesterday
4
I don't find any problem with simple command definitions likenewcommand{scoring}[1]{$K^1=#1$}
ornewcommand{scoring}[1]{[K^1=#1]}
.
– JouleV
yesterday
2
$K^1=#1$
should actually work in that it would output K^1=4. Can you show us a complete example document where that goes wrong, please? I agree with JouleV thatbegin{center}$...$end{center}
looks suspiciously like you want[...]
orbegin{equation}...end{equation}
oralign
....
– moewe
yesterday
1
documentclass{article} newcommand{scoring}[1]{[K^1=#1]} begin{document} scoring{4} end{document}
works flawlessly for me
– sheß
yesterday
5
I'm voting to close this question as off-topic because the problem cannot be replicated.
– Werner
22 hours ago
|
show 4 more comments
3
Off-topic: Why you have to usebegin{center} $a=b$ end{center}
when you already have[a=b]
?
– JouleV
yesterday
4
I don't find any problem with simple command definitions likenewcommand{scoring}[1]{$K^1=#1$}
ornewcommand{scoring}[1]{[K^1=#1]}
.
– JouleV
yesterday
2
$K^1=#1$
should actually work in that it would output K^1=4. Can you show us a complete example document where that goes wrong, please? I agree with JouleV thatbegin{center}$...$end{center}
looks suspiciously like you want[...]
orbegin{equation}...end{equation}
oralign
....
– moewe
yesterday
1
documentclass{article} newcommand{scoring}[1]{[K^1=#1]} begin{document} scoring{4} end{document}
works flawlessly for me
– sheß
yesterday
5
I'm voting to close this question as off-topic because the problem cannot be replicated.
– Werner
22 hours ago
3
3
Off-topic: Why you have to use
begin{center} $a=b$ end{center}
when you already have [a=b]
?– JouleV
yesterday
Off-topic: Why you have to use
begin{center} $a=b$ end{center}
when you already have [a=b]
?– JouleV
yesterday
4
4
I don't find any problem with simple command definitions like
newcommand{scoring}[1]{$K^1=#1$}
or newcommand{scoring}[1]{[K^1=#1]}
.– JouleV
yesterday
I don't find any problem with simple command definitions like
newcommand{scoring}[1]{$K^1=#1$}
or newcommand{scoring}[1]{[K^1=#1]}
.– JouleV
yesterday
2
2
$K^1=#1$
should actually work in that it would output K^1=4. Can you show us a complete example document where that goes wrong, please? I agree with JouleV that begin{center}$...$end{center}
looks suspiciously like you want [...]
or begin{equation}...end{equation}
or align
....– moewe
yesterday
$K^1=#1$
should actually work in that it would output K^1=4. Can you show us a complete example document where that goes wrong, please? I agree with JouleV that begin{center}$...$end{center}
looks suspiciously like you want [...]
or begin{equation}...end{equation}
or align
....– moewe
yesterday
1
1
documentclass{article} newcommand{scoring}[1]{[K^1=#1]} begin{document} scoring{4} end{document}
works flawlessly for me– sheß
yesterday
documentclass{article} newcommand{scoring}[1]{[K^1=#1]} begin{document} scoring{4} end{document}
works flawlessly for me– sheß
yesterday
5
5
I'm voting to close this question as off-topic because the problem cannot be replicated.
– Werner
22 hours ago
I'm voting to close this question as off-topic because the problem cannot be replicated.
– Werner
22 hours ago
|
show 4 more comments
1 Answer
1
active
oldest
votes
documentclass[a4paper]{article}
newcommand{scoring}[1]{%
begin{center}%
$K^1=#1$\%
$K^1={#1}$\%
$K^1=string###1$\%
$K^1={string###1}$\%
$K^1={##1}$\%
$K^1={sharp#1}$%
end{center}%
}
begin{document}
verb|scoring{4}|:
scoring{4}
verb|scoring{5}|:
scoring{5}
end{document}
1
Better use#
(or maybesharp
) instead ofstring##
.
– Henri Menke
21 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
documentclass[a4paper]{article}
newcommand{scoring}[1]{%
begin{center}%
$K^1=#1$\%
$K^1={#1}$\%
$K^1=string###1$\%
$K^1={string###1}$\%
$K^1={##1}$\%
$K^1={sharp#1}$%
end{center}%
}
begin{document}
verb|scoring{4}|:
scoring{4}
verb|scoring{5}|:
scoring{5}
end{document}
1
Better use#
(or maybesharp
) instead ofstring##
.
– Henri Menke
21 hours ago
add a comment |
documentclass[a4paper]{article}
newcommand{scoring}[1]{%
begin{center}%
$K^1=#1$\%
$K^1={#1}$\%
$K^1=string###1$\%
$K^1={string###1}$\%
$K^1={##1}$\%
$K^1={sharp#1}$%
end{center}%
}
begin{document}
verb|scoring{4}|:
scoring{4}
verb|scoring{5}|:
scoring{5}
end{document}
1
Better use#
(or maybesharp
) instead ofstring##
.
– Henri Menke
21 hours ago
add a comment |
documentclass[a4paper]{article}
newcommand{scoring}[1]{%
begin{center}%
$K^1=#1$\%
$K^1={#1}$\%
$K^1=string###1$\%
$K^1={string###1}$\%
$K^1={##1}$\%
$K^1={sharp#1}$%
end{center}%
}
begin{document}
verb|scoring{4}|:
scoring{4}
verb|scoring{5}|:
scoring{5}
end{document}
documentclass[a4paper]{article}
newcommand{scoring}[1]{%
begin{center}%
$K^1=#1$\%
$K^1={#1}$\%
$K^1=string###1$\%
$K^1={string###1}$\%
$K^1={##1}$\%
$K^1={sharp#1}$%
end{center}%
}
begin{document}
verb|scoring{4}|:
scoring{4}
verb|scoring{5}|:
scoring{5}
end{document}
edited 19 hours ago
answered 22 hours ago
Ulrich DiezUlrich Diez
5,240619
5,240619
1
Better use#
(or maybesharp
) instead ofstring##
.
– Henri Menke
21 hours ago
add a comment |
1
Better use#
(or maybesharp
) instead ofstring##
.
– Henri Menke
21 hours ago
1
1
Better use
#
(or maybe sharp
) instead of string##
.– Henri Menke
21 hours ago
Better use
#
(or maybe sharp
) instead of string##
.– Henri Menke
21 hours ago
add a comment |
3
Off-topic: Why you have to use
begin{center} $a=b$ end{center}
when you already have[a=b]
?– JouleV
yesterday
4
I don't find any problem with simple command definitions like
newcommand{scoring}[1]{$K^1=#1$}
ornewcommand{scoring}[1]{[K^1=#1]}
.– JouleV
yesterday
2
$K^1=#1$
should actually work in that it would output K^1=4. Can you show us a complete example document where that goes wrong, please? I agree with JouleV thatbegin{center}$...$end{center}
looks suspiciously like you want[...]
orbegin{equation}...end{equation}
oralign
....– moewe
yesterday
1
documentclass{article} newcommand{scoring}[1]{[K^1=#1]} begin{document} scoring{4} end{document}
works flawlessly for me– sheß
yesterday
5
I'm voting to close this question as off-topic because the problem cannot be replicated.
– Werner
22 hours ago