Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

ParthKohli

Parameters in `\newcommand`?

  • one year ago
  • one year ago

  • This Question is Closed
  1. UnkleRhaukus
    Best Response
    You've already chosen the best response.
    Medals 3

    yes

    • one year ago
  2. UnkleRhaukus
    Best Response
    You've already chosen the best response.
    Medals 3

    ``\newcommand\cat[4]{^{#1}_{#2}\large\operatorname {\mathcal {UNK}}^{#3}_{#4}} \cat abcd ~\to ~ \cat {\cat defg}{\cat hijk}{\cat lmno}{\cat pqr{\cat {\cat stuv}{\cat wxyz}{\cat \alpha\beta\gamma\delta}{\cat \epsilon\zeta \eta{\cat {\cat \theta\iota \kappa\lambda}{\cat \mu\nu o\pi}{\cat\rho\sigma\tau\upsilon }{\cat \phi\chi\psi\omega}}}}}`` \[\newcommand\cat[4]{^{#1}_{#2}\large\operatorname {\mathcal {UNK}}^{#3}_{#4}} \cat abcd ~\to ~ \cat {\cat defg}{\cat hijk}{\cat lmno}{\cat pqr{\cat {\cat stuv}{\cat wxyz}{\cat \alpha\beta\gamma\delta}{\cat \epsilon\zeta \eta{\cat {\cat \theta\iota \kappa\lambda}{\cat \mu\nu o\pi}{\cat\rho\sigma\tau\upsilon }{\cat \phi\chi\psi\omega}}}}}\]

    • one year ago
  3. ParthKohli
    Best Response
    You've already chosen the best response.
    Medals 1

    LOL wow, can you just show me how to make an operator which colors the text green and makes it gold, and then I could give parameters to it? Like a function in javascript. ``` function ranFunction(ranText) { [insert stuff here] } ``` and then running it on a string. ``` ranFunction("Parth"); ```

    • one year ago
  4. ParthKohli
    Best Response
    You've already chosen the best response.
    Medals 1

    Makes it bold*

    • one year ago
  5. UnkleRhaukus
    Best Response
    You've already chosen the best response.
    Medals 3

    `\newcommand\Parth[1]{\bf\color{green}{#1}} 500+abc+\Parth{13} =?` \[\newcommand\Parth[1]{\bf\color{green}{#1}} 500+abc+\Parth{13} =?\]

    • one year ago
  6. ParthKohli
    Best Response
    You've already chosen the best response.
    Medals 1

    Yes, that's what I wanted! What does the `#` mean? Does it act like a parameter or something?

    • one year ago
  7. UnkleRhaukus
    Best Response
    You've already chosen the best response.
    Medals 3

    after `\newcommand ` and `\Parth` (the operator name) there is a term in square brackets that is the number of variables the operator works with the `#1` is a reference to the first variable

    • one year ago
  8. ParthKohli
    Best Response
    You've already chosen the best response.
    Medals 1

    Ah, nice, we have variables in typesets too.

    • one year ago
  9. ParthKohli
    Best Response
    You've already chosen the best response.
    Medals 1

    \[\newcommand\Unk[1]{\mathbf{#1}}\\ \Unk{UnkleRhaukus~rocks!}\]

    • one year ago
  10. UnkleRhaukus
    Best Response
    You've already chosen the best response.
    Medals 3

    you can leave a variable blank with `{}` `\newcommand\intl[4]{\int\limits_{#1}^{#2}f(#3)\mathrm d#4}` `\intl ab{}z =?` \[\newcommand\intl[4]{\int\limits_{#1}^{#2}f(#3)\mathrm d#4} \intl ab{}z =?\]

    • one year ago
  11. ParthKohli
    Best Response
    You've already chosen the best response.
    Medals 1

    I see.

    • one year ago
  12. ParthKohli
    Best Response
    You've already chosen the best response.
    Medals 1

    Thanks, gotta go. I owe you a lot. =)

    • one year ago
  13. hartnn
    Best Response
    You've already chosen the best response.
    Medals 0

    reference for this ?

    • one year ago
  14. UnkleRhaukus
    Best Response
    You've already chosen the best response.
    Medals 3

    you can even have a newcommand without variables `\newcommand\something[0]{ {\tiny\color{gray} ? }} \ \something` \[\newcommand\something[0]{ {\tiny\color{gray} ? }} \ \something \]

    • one year ago
  15. UnkleRhaukus
    Best Response
    You've already chosen the best response.
    Medals 3

    page 120

    • one year ago
    1 Attachment
  16. UnkleRhaukus
    Best Response
    You've already chosen the best response.
    Medals 3

    maybe you really want to use `\newenvironment` @ParthKohli I haven't tried that command yet

    • one year ago
  17. UnkleRhaukus
    Best Response
    You've already chosen the best response.
    Medals 3

    use \(\text{\ }\boldsymbol{{boldsymbol{}}} \) instead of just \(\bf{\text {\ bf}}\) if you dont want to loose italics ``` \newcommand\Parth[1]{\boldsymbol{\color{green}{#1}}} \Parth{@ParthKohli} ``` \[\newcommand\Parth[1]{\boldsymbol{\color{green}{#1}}} \Parth{@ParthKohli}\]

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.