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













-1















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.










share|improve this 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 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$} or newcommand{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 that begin{center}$...$end{center} looks suspiciously like you want [...] or begin{equation}...end{equation} or align....

    – 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
















-1















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.










share|improve this 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 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$} or newcommand{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 that begin{center}$...$end{center} looks suspiciously like you want [...] or begin{equation}...end{equation} or align....

    – 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














-1












-1








-1


0






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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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$} or newcommand{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 that begin{center}$...$end{center} looks suspiciously like you want [...] or begin{equation}...end{equation} or align....

    – 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





    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$} or newcommand{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 that begin{center}$...$end{center} looks suspiciously like you want [...] or begin{equation}...end{equation} or align....

    – 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










1 Answer
1






active

oldest

votes


















3














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}


enter image description here






share|improve this answer





















  • 1





    Better use # (or maybe sharp) instead of string##.

    – Henri Menke
    21 hours ago




















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














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}


enter image description here






share|improve this answer





















  • 1





    Better use # (or maybe sharp) instead of string##.

    – Henri Menke
    21 hours ago


















3














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}


enter image description here






share|improve this answer





















  • 1





    Better use # (or maybe sharp) instead of string##.

    – Henri Menke
    21 hours ago
















3












3








3







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}


enter image description here






share|improve this answer















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}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 19 hours ago

























answered 22 hours ago









Ulrich DiezUlrich Diez

5,240619




5,240619








  • 1





    Better use # (or maybe sharp) instead of string##.

    – Henri Menke
    21 hours ago
















  • 1





    Better use # (or maybe sharp) instead of string##.

    – 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





Popular posts from this blog

Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...