# LaTeX frustration - defining commands with arguments

1. Dec 7, 2008

### Tickitata

Hi all, I'm a beginner to typesetting using LaTeX. I'm not sure if this is the correct place to ask (the stickied LaTeX thread in Tutorials seemed to be devoted to TeX for the forums)

1. The problem statement, all variables and given/known data
I'm attempting to define a command \mlegendre{x}{y} which returns the legendre symbol $$x \overwithdelims () y$$ once already in math mode. My \legendre{x}{y}, to be used while in text mode, seems to be working just fine.

2. Relevant equations
N/A

3. The attempt at a solution
My attempt is
\newcommand{\mlegendre}[2]{#1 \overwithdelims () #2}

but this is producing very odd results in some places, and causing errors in others. For example,

$g_2 = \mlegendre{0}{7}$

produces $$g_2 = 0 \overwithdelims () 7$$

/edit: okay well, apparently I don't know how to use PF's tex commands either, haha. In the first, it should have x in the top, and in the second, it should have parentheses around it.

Cheers!

2. Dec 7, 2008

### Tickitata

Ah nevermind, I think I've got it with
\newcommand{\mlegendre}[2]{(\frac{#1}{#2})}