# How to create a backslash fraction?

How does one produce a backslash fraction? That is, something like 2\1 with the 1 above the 2.

• Please draw a picture. – MaestroGlanz Oct 19 '16 at 14:25
• Do you mean \frac{1}{2}, using amsmath ? – Andrew Oct 19 '16 at 14:33
• Interesting idea, but also (I'm just curious) why would you write a fraction this way? I spend so much time in classes trying to get the students not to use a slanted lines for fractions 'cause it inevitably leads to all sorts of mistakes. Or, does it have special meaning? – A.Ellett Oct 19 '16 at 22:06
• @A.Ellett I think it was the musical time-signature notation used by that famous American composer, Burt Back-a-frac. ;^) – Steven B. Segletes Oct 21 '16 at 14:43
• @A.Ellett It was my cheap-ass work-around for How to diagonally divide a table cell … properly? – Jim Mar 5 '18 at 21:24

I chose to use math mode to set the argument of \bsfrac, even though I notice that \nicefrac sets in text mode. The behavior can be changed for \bsfrac with the removal of the $ characters. \documentclass{article} \usepackage{graphicx,nicefrac} \newcommand\bsfrac[2]{% \scalebox{-1}[1]{\nicefrac{\scalebox{-1}[1]{$#1$}}{\scalebox{-1}[1]{$#2$}}}% } \begin{document} A nice fraction: \nicefrac{55}{23} or \nicefrac{$(x-1)$}{$x$}. And here is \bsfrac{55}{23} or \bsfrac{(x-1)}{x}. \end{document}  One can simplify the definition as \newcommand\bsfrac[2]{\reflectbox{\nicefrac{\reflectbox{$#1$}}{\reflectbox{$#2$}}}}  or even, as Máté suggests, \newcommand\bsfrac[2]{\reflectbox{\nicefrac[\reflectbox]{$#1$}{$#2$}}}  • Oh, that's what the bs stands for... – MCMastery Oct 19 '16 at 18:39 • @MCMastery Apparently, my efforts to use mnemonic devices to name macros sometimes can be misunderstood...tex.stackexchange.com/questions/167670/… – Steven B. Segletes Oct 19 '16 at 18:42 • You can even further shorten the definition of bsfrac to \newcommand{\bsfrac}[2]{\reflectbox{\nicefrac[\reflectbox]{#1}{#2}}} – Máté Wierdl Sep 20 '17 at 11:47 A shorter less elegant way is to simply use: $^1$/$_2$%or$_1 \backslash ^2\$
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7466433048248291, "perplexity": 2160.570000262507}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-10/segments/1581875143784.14/warc/CC-MAIN-20200218150621-20200218180621-00112.warc.gz"}