1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

LaTeX frustration - defining commands with arguments

  1. Dec 7, 2008 #1
    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 [tex]$x \overwithdelims () y$[/tex] 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

    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 [tex]$g_2 = 0 \overwithdelims () 7$[/tex]

    /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.

  2. jcsd
  3. Dec 7, 2008 #2
    Ah nevermind, I think I've got it with
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - LaTeX frustration defining Date
Include source code in latex Jan 12, 2013
Latex problem (simple) Dec 13, 2012
Drawing an arrow in LaTeX Mar 18, 2012
A question about LaTeX Apr 3, 2011
Thermodynamics - I am so frustrated! Feb 19, 2007