{"id":3326,"date":"2022-07-13T22:11:25","date_gmt":"2022-07-13T22:11:25","guid":{"rendered":"https:\/\/opentextbc.ca\/pressbooks\/?post_type=chapter&#038;p=3326"},"modified":"2022-07-13T22:15:53","modified_gmt":"2022-07-13T22:15:53","slug":"how-do-i-write-a-fraction-in-latex","status":"publish","type":"chapter","link":"https:\/\/opentextbc.ca\/pressbooks\/chapter\/how-do-i-write-a-fraction-in-latex\/","title":{"raw":"How do I write a fraction in LaTeX?","rendered":"How do I write a fraction in LaTeX?"},"content":{"raw":"<div class=\"textbox textbox--sidebar\">Last update: Jul 13\/22<\/div>\r\nThe simplest commands for writing fractions are <code>\\frac{n}{d}<\/code> and <code>\\dfrac{n}{d}<\/code>, in which \"n\" is the numerator and \"d\" is the denominator.\r\n\r\nThe <code>\\dfrac<\/code> command is best used when you want to write a large \"display\" fraction, likely on its own line. If you're writing a fraction in running text and need it to be close to the same size as the text around it, the <code>\\frac<\/code> command is probably better. If you're not sure which command to use in any given case, try both and see which size is more appropriate.\r\n\r\nDisplay fractions look like this:[footnote]You can right-click this expression and go to <strong>Math Settings &gt; Math Renderer &gt; Plain Source<\/strong> and then back to <strong>Common HTML<\/strong> to switch between seeing the original LaTeX markup and the expression in display form.[\/footnote]\r\n<p style=\"text-align: center;\">[latex]\\dfrac{13}{4a}=\\dfrac{3b}{5}[\/latex]<\/p>\r\nRegular fractions look like this:\r\n<p style=\"text-align: center;\">If you give [latex]\\frac{3}{8}[\/latex] of the pizza to your big sister and [latex]\\frac{1}{8}[\/latex] to each of your two little brothers, you'll have [latex]\\frac{3}{8}[\/latex] left for yourself.<\/p>\r\nLaTeX can also handle more complex fractional expressions. For example:\r\n<p style=\"text-align: center;\">[latex]\\dfrac{d}{dx}(\\sin x)\\approx \\dfrac{\\sin (x+0.01)-\\sin x}{0.01}[\/latex]<\/p>\r\nYou can also create fractional expressions using words:\r\n<p style=\"text-align: center;\">[latex]\\text{slope}=\\dfrac{\\text{rise}}{\\text{run}}[\/latex]<\/p>\r\nFor more commands related to fractions, see <a href=\"https:\/\/www.overleaf.com\/learn\/latex\/Fractions_and_Binomials\">Fractions and Binomials on the Overleaf website<\/a>.","rendered":"<div class=\"textbox textbox--sidebar\">Last update: Jul 13\/22<\/div>\n<p>The simplest commands for writing fractions are <code>\\frac{n}{d}<\/code> and <code>\\dfrac{n}{d}<\/code>, in which &#8220;n&#8221; is the numerator and &#8220;d&#8221; is the denominator.<\/p>\n<p>The <code>\\dfrac<\/code> command is best used when you want to write a large &#8220;display&#8221; fraction, likely on its own line. If you&#8217;re writing a fraction in running text and need it to be close to the same size as the text around it, the <code>\\frac<\/code> command is probably better. If you&#8217;re not sure which command to use in any given case, try both and see which size is more appropriate.<\/p>\n<p>Display fractions look like this:<a class=\"footnote\" title=\"You can right-click this expression and go to Math Settings &gt; Math Renderer &gt; Plain Source and then back to Common HTML to switch between seeing the original LaTeX markup and the expression in display form.\" id=\"return-footnote-3326-1\" href=\"#footnote-3326-1\" aria-label=\"Footnote 1\"><sup class=\"footnote\">[1]<\/sup><\/a><\/p>\n<p style=\"text-align: center;\">[latex]\\dfrac{13}{4a}=\\dfrac{3b}{5}[\/latex]<\/p>\n<p>Regular fractions look like this:<\/p>\n<p style=\"text-align: center;\">If you give [latex]\\frac{3}{8}[\/latex] of the pizza to your big sister and [latex]\\frac{1}{8}[\/latex] to each of your two little brothers, you&#8217;ll have [latex]\\frac{3}{8}[\/latex] left for yourself.<\/p>\n<p>LaTeX can also handle more complex fractional expressions. For example:<\/p>\n<p style=\"text-align: center;\">[latex]\\dfrac{d}{dx}(\\sin x)\\approx \\dfrac{\\sin (x+0.01)-\\sin x}{0.01}[\/latex]<\/p>\n<p>You can also create fractional expressions using words:<\/p>\n<p style=\"text-align: center;\">[latex]\\text{slope}=\\dfrac{\\text{rise}}{\\text{run}}[\/latex]<\/p>\n<p>For more commands related to fractions, see <a href=\"https:\/\/www.overleaf.com\/learn\/latex\/Fractions_and_Binomials\">Fractions and Binomials on the Overleaf website<\/a>.<\/p>\n<hr class=\"before-footnotes clear\" \/><div class=\"footnotes\"><ol><li id=\"footnote-3326-1\">You can right-click this expression and go to <strong>Math Settings &gt; Math Renderer &gt; Plain Source<\/strong> and then back to <strong>Common HTML<\/strong> to switch between seeing the original LaTeX markup and the expression in display form. <a href=\"#return-footnote-3326-1\" class=\"return-footnote\" aria-label=\"Return to footnote 1\">&crarr;<\/a><\/li><\/ol><\/div>","protected":false},"author":124,"menu_order":12,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-3326","chapter","type-chapter","status-publish","hentry"],"part":2754,"_links":{"self":[{"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/pressbooks\/v2\/chapters\/3326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/wp\/v2\/users\/124"}],"version-history":[{"count":3,"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/pressbooks\/v2\/chapters\/3326\/revisions"}],"predecessor-version":[{"id":3329,"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/pressbooks\/v2\/chapters\/3326\/revisions\/3329"}],"part":[{"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/pressbooks\/v2\/parts\/2754"}],"metadata":[{"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/pressbooks\/v2\/chapters\/3326\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/wp\/v2\/media?parent=3326"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/pressbooks\/v2\/chapter-type?post=3326"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/wp\/v2\/contributor?post=3326"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/opentextbc.ca\/pressbooks\/wp-json\/wp\/v2\/license?post=3326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}