# Writing a bar on top of a number

I want to write a question in which I have a bar on top of a number or letter to represent a recurring digit. however, I can't find any options to write the particular digit, even when I search the help center for Latex, which is supposed to be used to edit any math statements. What will I use to write it ?

Any suggestions will be appreciated.

• $\overline{5}$$=\overline{5}$.
– David Roberts Mod
Commented Jun 25, 2023 at 10:18
• @DavidRoberts thanks ! Commented Jun 25, 2023 at 10:56
• Corresponds to \underline Commented Jun 26, 2023 at 15:30
• @DavidRoberts, re, in case it's of interest, you can fix the poor spacing with a spurious atom: $\overline{5}$${}= \overline{5}$ $\overline{5}$ ${}= \overline{5}$. Commented Jun 29, 2023 at 23:57

To give the question an answer so it can be accepted: you can use $\overline{...}$ to get a bar over any letter or digit or group thereof.
• Alrernatively, $\bar{5}$ $\bar{5}$ Commented Jun 25, 2023 at 12:36
• @TheAmplitwist, re, good point! Let's put them side by side to see the subtle difference: $\overline5\bar5$ \overline5\bar5. It's less subtle when overlining groups: $\overline5\overline6\overline{56}\bar5\bar6\bar{56}$ \overline5\overline6\overline{56}\bar{56}\bar5\bar6. (I don't see a rendering difference between \overline5\overline6 and \overline{56}, though the widths probably differ slightly. I include \bar{56} for parallelism, but, of course, it is almost certainly not what is desired.) Commented Jun 25, 2023 at 18:55
• Re, oops, I somehow switched \bar{56} and \bar5\bar6 between the actual code and the quoted code. They look like $\bar{56}$ \bar{56} vs. $\bar5\bar6$ \bar5\bar6. Commented Jul 16, 2023 at 18:24