Framebox around fraction

1,653

Did you forget the $-signs?

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\framebox{$\dfrac{1}{6}$}
\end{document}

produces

enter image description here

which isn't pretty but is a framebox with a fraction in it.

Share:
1,653

Related videos on Youtube

Anon E. Muss
Author by

Anon E. Muss

Updated on August 22, 2020

Comments

  • Anon E. Muss
    Anon E. Muss about 3 years

    I'm trying to box the fraction 1/6, and so I write

     \framebox{\dfrac{1}{6}}
    

    However when I do this I end up with the formatting all off and the framebox and fraction don't show up at all. Is there another way to put a box around the fraction?

    Thanks in advance!

    • Admin
      Admin about 7 years
      This worked for me: \framebox{$\dfrac{1}{6}$} (using framed and amsmath packages). Have you really used \framebox{\dfrac{1}{6}}? That gives errors! Please don't post such fragments only, give a full .tex document instead!
    • Anon E. Muss
      Anon E. Muss about 7 years
      Yeah, I copy/pasted your line and it didn't show at all. I'm using ShareLatex, if that makes any difference. I think some things don't show up there because I've had issues with shapes and \log as well.
    • Admin
      Admin about 7 years
      Sigh, ShareLaTeX ... I am pretty sure that your version must give compilation errors.
    • Anon E. Muss
      Anon E. Muss about 7 years
      Would you recommend another online LaTeX editor? I need to keep it all online because I'm constantly flipping computers. However if there's a light software I might be able to download it
    • Admin
      Admin about 7 years
      No, I don't recommend such editors at all...
    • Bernard
      Bernard about 7 years
      Why not simply \boxed{\frac{1}{6}}?
    • Anon E. Muss
      Anon E. Muss about 7 years
      That also doesn't work.
    • barbara beeton
      barbara beeton about 7 years
      have you used \usepackage{amsmath}? that is needed for many math elements including \log and \dfrac.
    • Anon E. Muss
      Anon E. Muss about 7 years
      Yeah, I'm using it now. Still not working.
    • Admin
      Admin about 7 years
      @AnonE.Muss: Then post your document here, as I have already asked you once! Not working is no precise description!
  • Admin
    Admin about 7 years
    I asked that already in my first comment right below the post ;-)
  • JPi
    JPi about 7 years
    Oops, sorry. Feel free to downvote. Or if you'd prefer, I'll remove my answer.
  • Admin
    Admin about 7 years
    I rarely downvote answers (or questions)... but we have some users here which downvote quite often... I don't say this is to be downvoted at all... keep it as you like
  • JPi
    JPi about 7 years
    I guess I should read the comments more carefully....
  • Admin
    Admin about 7 years
    Well, many (high rep) users post nearly identical comments after similar comments has been made already to the post -- the difference is: The comment of high rep users are upvoted, others aren't although they have been written earlier (and aren't not wrong) ... so much for 'reading comments more carefully' ;-)
  • Admin
    Admin about 7 years
    Of course I meant aren't wrong -- the double negation is a typo ;-) So much for writing comments carefully :D