TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get a Legendre symbol


which just used the dashed line instead of the fractional rule?

share|improve this question
up vote 5 down vote accepted







The user command are \legendre that typesets the symbol in the current math style or \dlegendre and \tlegendre to force display or text style.

enter image description here

The \genfrac parts are only for comparisons.

share|improve this answer
The $\genfrac(){}{}{p}{q}\legendre{p}{q}$ get a bit of larger parenthese. – fas Jun 10 '11 at 16:52
@fas: I've edited the macros. – egreg Jun 10 '11 at 17:10
@fas: I should add that I've seen nowhere this notation. – egreg Jun 10 '11 at 20:08

Interesting question. My first idea was to write In french the symbol is


but without dashed line, the second idea was to use \genfrac but I don't know how to draw the dashed line so the last idea is to use arydshln




enter image description here

share|improve this answer
Looking at the code, \genfrac uses \over (or \above) internally so the line is produced by a primitive and thus I don't think one could easily modify \genfrac to produce a dashed line. Shame. – Loop Space Jun 10 '11 at 7:56

If you are going to use this type of notation a lot, I am not sure if the following is suitable but at least, it is quite simple to get some automation wrapped around it


\node[matrix of math nodes,left delimiter=(,right delimiter=)] (lege) at (0,0) {
#1  \\
#2  \\
\draw[densely dashed] (lege.west) -- (lege.east);

\[ \lege{1252}{567}\lege{1}{0} \int^\infty_0{dx}\]    

Trying out the code

I can't foresee any problems with my code but I can sense that there are. Hence, I am pretty sure that advanced users here would find a smarter way to do it (especially the spacing of the delimiters with xshift etc.). You can scale the whole tikzpicture to get different sizes. Cheers.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.