docusaurus/assets/js/5785f4e1.076d877b.js
2025-12-09 14:21:12 +00:00

1 line
34 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["27111"],{41452:function(s,e,a){a.d(e,{A:()=>n});let n={tabItem:"tabItem_pnkT"}},18416:function(s,e,a){a.d(e,{A:()=>n});let n={tabList:"tabList_Qoir",tabItem:"tabItem_AQgk"}},80944:function(s,e,a){a.d(e,{A:()=>n});let n={browserWindow:"browserWindow_my1Q",browserWindowHeader:"browserWindowHeader_jXSR",row:"row_KZDM",buttons:"buttons_uHc7",right:"right_oyze",browserWindowAddressBar:"browserWindowAddressBar_Pd8y",dot:"dot_giz1",browserWindowMenuIcon:"browserWindowMenuIcon_Vhuh",bar:"bar_rrRL",browserWindowBody:"browserWindowBody_Idgs"}},8884:function(s,e,a){a.r(e),a.d(e,{assets:()=>d,contentTitle:()=>h,default:()=>p,frontMatter:()=>m,metadata:()=>n,toc:()=>o});var n=a(67013),t=a(74848),l=a(56151),r=a(14729),i=a(13899),c=a(52903);let m={id:"math-equations",description:"Writing LaTeX Math Equations",slug:"/markdown-features/math-equations"},h="Math Equations",d={},o=[{value:"Usage",id:"usage",level:2},{value:"Inline",id:"inline",level:3},{value:"Blocks",id:"blocks",level:3},{value:"Enabling math equations",id:"configuration",level:2},{value:"Self-hosting KaTeX assets",id:"self-hosting-katex-assets",level:2}];function x(s){let e={a:"a",admonition:"admonition",annotation:"annotation",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",math:"math",mi:"mi",mn:"mn",mo:"mo",mrow:"mrow",mspace:"mspace",msubsup:"msubsup",msup:"msup",mtext:"mtext",ol:"ol",p:"p",pre:"pre",semantics:"semantics",span:"span",strong:"strong",...(0,l.R)(),...s.components},{Details:a}=e;return a||function(s,e){throw Error("Expected "+(e?"component":"object")+" `"+s+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.header,{children:(0,t.jsx)(e.h1,{id:"math-equations",children:"Math Equations"})}),"\n","\n",(0,t.jsxs)(e.p,{children:["Mathematical equations can be rendered using ",(0,t.jsx)(e.a,{href:"https://katex.org",children:"KaTeX"}),"."]}),"\n",(0,t.jsxs)(e.p,{children:["See ",(0,t.jsx)(e.a,{href:"#configuration",children:"below"})," how to activate them."]}),"\n",(0,t.jsx)(e.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(e.p,{children:["Please read the ",(0,t.jsx)(e.a,{href:"https://katex.org",children:"KaTeX"})," documentation for more details."]}),"\n",(0,t.jsx)(e.h3,{id:"inline",children:"Inline"}),"\n",(0,t.jsxs)(e.p,{children:["Write inline math equations by wrapping LaTeX equations between ",(0,t.jsx)(e.code,{children:"$"}),":"]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-latex",children:"Let $f\\colon[a,b]\\to\\R$ be Riemann integrable. Let $F\\colon[a,b]\\to\\R$ be\n$F(x)=\\int_{a}^{x} f(t)\\,dt$. Then $F$ is continuous, and at all $x$ such that\n$f$ is continuous at $x$, $F$ is differentiable at $x$ with $F'(x)=f(x)$.\n"})}),"\n",(0,t.jsx)(c.A,{children:(0,t.jsxs)(e.p,{children:["Let ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsxs)(e.mrow,{children:[(0,t.jsx)(e.mi,{children:"f"}),(0,t.jsx)(e.mspace,{}),(0,t.jsx)(e.mspace,{width:"0.1111em"}),(0,t.jsx)(e.mo,{lspace:"0em",rspace:"0.17em"}),(0,t.jsx)(e.mtext,{children:"\u2009\u2063"}),(0,t.jsx)(e.mo,{lspace:"0em",rspace:"0em",children:":"}),(0,t.jsx)(e.mspace,{width:"0.3333em"}),(0,t.jsx)(e.mo,{stretchy:"false",children:"["}),(0,t.jsx)(e.mi,{children:"a"}),(0,t.jsx)(e.mo,{separator:"true",children:","}),(0,t.jsx)(e.mi,{children:"b"}),(0,t.jsx)(e.mo,{stretchy:"false",children:"]"}),(0,t.jsx)(e.mo,{children:"\u2192"}),(0,t.jsx)(e.mi,{mathvariant:"double-struck",children:"R"})]}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"f\\colon[a,b] \\to \\R"})]})})}),(0,t.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10764em"},children:"f"}),(0,t.jsx)(e.span,{className:"mspace nobreak"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1111em"}}),(0,t.jsx)(e.span,{className:"mpunct"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"-0.1667em"}}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,t.jsx)(e.span,{className:"mord",children:(0,t.jsx)(e.span,{className:"mrel",children:":"})}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.3333em"}}),(0,t.jsx)(e.span,{className:"mopen",children:"["}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"a"}),(0,t.jsx)(e.span,{className:"mpunct",children:","}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"b"}),(0,t.jsx)(e.span,{className:"mclose",children:"]"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,t.jsx)(e.span,{className:"mrel",children:"\u2192"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"0.6889em"}}),(0,t.jsx)(e.span,{className:"mord mathbb",children:"R"})]})]})]})," be Riemann integrable. Let ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsxs)(e.mrow,{children:[(0,t.jsx)(e.mi,{children:"F"}),(0,t.jsx)(e.mspace,{}),(0,t.jsx)(e.mspace,{width:"0.1111em"}),(0,t.jsx)(e.mo,{lspace:"0em",rspace:"0.17em"}),(0,t.jsx)(e.mtext,{children:"\u2009\u2063"}),(0,t.jsx)(e.mo,{lspace:"0em",rspace:"0em",children:":"}),(0,t.jsx)(e.mspace,{width:"0.3333em"}),(0,t.jsx)(e.mo,{stretchy:"false",children:"["}),(0,t.jsx)(e.mi,{children:"a"}),(0,t.jsx)(e.mo,{separator:"true",children:","}),(0,t.jsx)(e.mi,{children:"b"}),(0,t.jsx)(e.mo,{stretchy:"false",children:"]"}),(0,t.jsx)(e.mo,{children:"\u2192"}),(0,t.jsx)(e.mi,{mathvariant:"double-struck",children:"R"})]}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"F\\colon[a,b]\\to\\R"})]})})}),(0,t.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"F"}),(0,t.jsx)(e.span,{className:"mspace nobreak"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1111em"}}),(0,t.jsx)(e.span,{className:"mpunct"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"-0.1667em"}}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,t.jsx)(e.span,{className:"mord",children:(0,t.jsx)(e.span,{className:"mrel",children:":"})}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.3333em"}}),(0,t.jsx)(e.span,{className:"mopen",children:"["}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"a"}),(0,t.jsx)(e.span,{className:"mpunct",children:","}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"b"}),(0,t.jsx)(e.span,{className:"mclose",children:"]"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,t.jsx)(e.span,{className:"mrel",children:"\u2192"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"0.6889em"}}),(0,t.jsx)(e.span,{className:"mord mathbb",children:"R"})]})]})]})," be ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsxs)(e.mrow,{children:[(0,t.jsx)(e.mi,{children:"F"}),(0,t.jsx)(e.mo,{stretchy:"false",children:"("}),(0,t.jsx)(e.mi,{children:"x"}),(0,t.jsx)(e.mo,{stretchy:"false",children:")"}),(0,t.jsx)(e.mo,{children:"="}),(0,t.jsxs)(e.msubsup,{children:[(0,t.jsx)(e.mo,{children:"\u222B"}),(0,t.jsx)(e.mi,{children:"a"}),(0,t.jsx)(e.mi,{children:"x"})]}),(0,t.jsx)(e.mi,{children:"f"}),(0,t.jsx)(e.mo,{stretchy:"false",children:"("}),(0,t.jsx)(e.mi,{children:"t"}),(0,t.jsx)(e.mo,{stretchy:"false",children:")"}),(0,t.jsx)(e.mtext,{children:"\u2009"}),(0,t.jsx)(e.mi,{children:"d"}),(0,t.jsx)(e.mi,{children:"t"})]}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"F(x)=\n\\int_{a}^{x} f(t)\\,dt"})]})})}),(0,t.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"F"}),(0,t.jsx)(e.span,{className:"mopen",children:"("}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,t.jsx)(e.span,{className:"mclose",children:")"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,t.jsx)(e.span,{className:"mrel",children:"="}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"1.2151em",verticalAlign:"-0.3558em"}}),(0,t.jsxs)(e.span,{className:"mop",children:[(0,t.jsx)(e.span,{className:"mop op-symbol small-op",style:{marginRight:"0.19445em",position:"relative",top:"-0.0006em"},children:"\u222B"}),(0,t.jsx)(e.span,{className:"msupsub",children:(0,t.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,t.jsxs)(e.span,{className:"vlist-r",children:[(0,t.jsxs)(e.span,{className:"vlist",style:{height:"0.8593em"},children:[(0,t.jsxs)(e.span,{style:{top:"-2.3442em",marginLeft:"-0.1945em",marginRight:"0.05em"},children:[(0,t.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,t.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,t.jsx)(e.span,{className:"mord mtight",children:(0,t.jsx)(e.span,{className:"mord mathnormal mtight",children:"a"})})})]}),(0,t.jsxs)(e.span,{style:{top:"-3.2579em",marginRight:"0.05em"},children:[(0,t.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,t.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,t.jsx)(e.span,{className:"mord mtight",children:(0,t.jsx)(e.span,{className:"mord mathnormal mtight",children:"x"})})})]})]}),(0,t.jsx)(e.span,{className:"vlist-s",children:"\u200B"})]}),(0,t.jsx)(e.span,{className:"vlist-r",children:(0,t.jsx)(e.span,{className:"vlist",style:{height:"0.3558em"},children:(0,t.jsx)(e.span,{})})})]})})]}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10764em"},children:"f"}),(0,t.jsx)(e.span,{className:"mopen",children:"("}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"t"}),(0,t.jsx)(e.span,{className:"mclose",children:")"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"d"}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"t"})]})]})]}),". Then ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsx)(e.mrow,{children:(0,t.jsx)(e.mi,{children:"F"})}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"F"})]})})}),(0,t.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"F"})]})})]})," is continuous, and at all ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsx)(e.mrow,{children:(0,t.jsx)(e.mi,{children:"x"})}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"x"})]})})}),(0,t.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"x"})]})})]})," such that ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsx)(e.mrow,{children:(0,t.jsx)(e.mi,{children:"f"})}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"f"})]})})}),(0,t.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"0.8889em",verticalAlign:"-0.1944em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10764em"},children:"f"})]})})]})," is continuous at ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsx)(e.mrow,{children:(0,t.jsx)(e.mi,{children:"x"})}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"x"})]})})}),(0,t.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"x"})]})})]}),", ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsx)(e.mrow,{children:(0,t.jsx)(e.mi,{children:"F"})}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"F"})]})})}),(0,t.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"F"})]})})]})," is differentiable at ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsx)(e.mrow,{children:(0,t.jsx)(e.mi,{children:"x"})}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"x"})]})})}),(0,t.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"x"})]})})]})," with ",(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsxs)(e.mrow,{children:[(0,t.jsxs)(e.msup,{children:[(0,t.jsx)(e.mi,{children:"F"}),(0,t.jsx)(e.mo,{mathvariant:"normal",lspace:"0em",rspace:"0em",children:"\u2032"})]}),(0,t.jsx)(e.mo,{stretchy:"false",children:"("}),(0,t.jsx)(e.mi,{children:"x"}),(0,t.jsx)(e.mo,{stretchy:"false",children:")"}),(0,t.jsx)(e.mo,{children:"="}),(0,t.jsx)(e.mi,{children:"f"}),(0,t.jsx)(e.mo,{stretchy:"false",children:"("}),(0,t.jsx)(e.mi,{children:"x"}),(0,t.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"F'(x)=f(x)"})]})})}),(0,t.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"1.0019em",verticalAlign:"-0.25em"}}),(0,t.jsxs)(e.span,{className:"mord",children:[(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"F"}),(0,t.jsx)(e.span,{className:"msupsub",children:(0,t.jsx)(e.span,{className:"vlist-t",children:(0,t.jsx)(e.span,{className:"vlist-r",children:(0,t.jsx)(e.span,{className:"vlist",style:{height:"0.7519em"},children:(0,t.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,t.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,t.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,t.jsx)(e.span,{className:"mord mtight",children:(0,t.jsx)(e.span,{className:"mord mtight",children:"\u2032"})})})]})})})})})]}),(0,t.jsx)(e.span,{className:"mopen",children:"("}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,t.jsx)(e.span,{className:"mclose",children:")"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,t.jsx)(e.span,{className:"mrel",children:"="}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10764em"},children:"f"}),(0,t.jsx)(e.span,{className:"mopen",children:"("}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,t.jsx)(e.span,{className:"mclose",children:")"})]})]})]}),"."]})}),"\n",(0,t.jsx)(e.h3,{id:"blocks",children:"Blocks"}),"\n",(0,t.jsxs)(e.p,{children:["For equation block or display mode, use line breaks and ",(0,t.jsx)(e.code,{children:"$$"}),":"]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-latex",children:"$$\nI = \\int_0^{2\\pi} \\sin(x)\\,dx\n$$\n"})}),"\n",(0,t.jsx)(c.A,{children:(0,t.jsx)(e.span,{className:"katex-display",children:(0,t.jsxs)(e.span,{className:"katex",children:[(0,t.jsx)(e.span,{className:"katex-mathml",children:(0,t.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,t.jsxs)(e.semantics,{children:[(0,t.jsxs)(e.mrow,{children:[(0,t.jsx)(e.mi,{children:"I"}),(0,t.jsx)(e.mo,{children:"="}),(0,t.jsxs)(e.msubsup,{children:[(0,t.jsx)(e.mo,{children:"\u222B"}),(0,t.jsx)(e.mn,{children:"0"}),(0,t.jsxs)(e.mrow,{children:[(0,t.jsx)(e.mn,{children:"2"}),(0,t.jsx)(e.mi,{children:"\u03C0"})]})]}),(0,t.jsx)(e.mi,{children:"sin"}),(0,t.jsx)(e.mo,{children:"\u2061"}),(0,t.jsx)(e.mo,{stretchy:"false",children:"("}),(0,t.jsx)(e.mi,{children:"x"}),(0,t.jsx)(e.mo,{stretchy:"false",children:")"}),(0,t.jsx)(e.mtext,{children:"\u2009"}),(0,t.jsx)(e.mi,{children:"d"}),(0,t.jsx)(e.mi,{children:"x"})]}),(0,t.jsx)(e.annotation,{encoding:"application/x-tex",children:"I = \\int_0^{2\\pi} \\sin(x)\\,dx"})]})})}),(0,t.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.07847em"},children:"I"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,t.jsx)(e.span,{className:"mrel",children:"="}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,t.jsxs)(e.span,{className:"base",children:[(0,t.jsx)(e.span,{className:"strut",style:{height:"2.476em",verticalAlign:"-0.9119em"}}),(0,t.jsxs)(e.span,{className:"mop",children:[(0,t.jsx)(e.span,{className:"mop op-symbol large-op",style:{marginRight:"0.44445em",position:"relative",top:"-0.0011em"},children:"\u222B"}),(0,t.jsx)(e.span,{className:"msupsub",children:(0,t.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,t.jsxs)(e.span,{className:"vlist-r",children:[(0,t.jsxs)(e.span,{className:"vlist",style:{height:"1.564em"},children:[(0,t.jsxs)(e.span,{style:{top:"-1.7881em",marginLeft:"-0.4445em",marginRight:"0.05em"},children:[(0,t.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,t.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,t.jsx)(e.span,{className:"mord mtight",children:"0"})})]}),(0,t.jsxs)(e.span,{style:{top:"-3.8129em",marginRight:"0.05em"},children:[(0,t.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,t.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,t.jsxs)(e.span,{className:"mord mtight",children:[(0,t.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,t.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03C0"})]})})]})]}),(0,t.jsx)(e.span,{className:"vlist-s",children:"\u200B"})]}),(0,t.jsx)(e.span,{className:"vlist-r",children:(0,t.jsx)(e.span,{className:"vlist",style:{height:"0.9119em"},children:(0,t.jsx)(e.span,{})})})]})})]}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,t.jsx)(e.span,{className:"mop",children:"sin"}),(0,t.jsx)(e.span,{className:"mopen",children:"("}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,t.jsx)(e.span,{className:"mclose",children:")"}),(0,t.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"d"}),(0,t.jsx)(e.span,{className:"mord mathnormal",children:"x"})]})]})]})})}),"\n",(0,t.jsx)(e.h2,{id:"configuration",children:"Enabling math equations"}),"\n",(0,t.jsx)(e.p,{children:"Enable KaTeX:"}),"\n",(0,t.jsxs)(e.ol,{children:["\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsxs)(e.p,{children:["Install the ",(0,t.jsx)(e.code,{children:"remark-math"})," and ",(0,t.jsx)(e.code,{children:"rehype-katex"})," plugins:"]}),"\n",(0,t.jsxs)(r.A,{groupId:"npm2yarn",children:[(0,t.jsx)(i.A,{value:"npm",children:(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-bash",children:"npm install --save remark-math@6 rehype-katex@7\n"})})}),(0,t.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-bash",children:"yarn add remark-math@6 rehype-katex@7\n"})})}),(0,t.jsx)(i.A,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-bash",children:"pnpm add remark-math@6 rehype-katex@7\n"})})}),(0,t.jsx)(i.A,{value:"bun",label:"Bun",children:(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-bash",children:"bun add remark-math@6 rehype-katex@7\n"})})})]}),"\n",(0,t.jsx)(e.admonition,{type:"warning",children:(0,t.jsxs)(e.p,{children:["Make sure to use ",(0,t.jsx)(e.code,{children:"remark-math 6"})," and ",(0,t.jsx)(e.code,{children:"rehype-katex 7"})," for Docusaurus v3 (using MDX v3). We can't guarantee other versions will work."]})}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsxs)(e.p,{children:["These 2 plugins are ",(0,t.jsx)(e.a,{href:"https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c",children:(0,t.jsx)(e.strong,{children:"only available as ES Modules"})}),". We recommended to use an ",(0,t.jsx)(e.a,{href:"https://flaviocopes.com/es-modules/",children:(0,t.jsx)(e.strong,{children:"ES Modules"})})," config file:"]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-js",metastring:'title="ES module docusaurus.config.js"',children:"// highlight-start\nimport remarkMath from 'remark-math';\nimport rehypeKatex from 'rehype-katex';\n// highlight-end\n\n// highlight-start\nexport default {\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n docs: {\n path: 'docs',\n // highlight-start\n remarkPlugins: [remarkMath],\n rehypePlugins: [rehypeKatex],\n // highlight-end\n },\n },\n ],\n ],\n};\n"})}),"\n",(0,t.jsxs)(a,{children:[(0,t.jsx)("summary",{children:(0,t.jsxs)(e.p,{children:["Using a\n",(0,t.jsx)(e.a,{href:"https://nodejs.org/api/modules.html#modules-commonjs-modules",children:(0,t.jsx)(e.strong,{children:"CommonJS"})}),"\nconfig file?"]})}),(0,t.jsx)(e.p,{children:"If you decide to use a CommonJS config file, it is possible to load those ES module plugins thanks to dynamic imports and an async config creator function:"}),(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-js",metastring:'title="CommonJS module docusaurus.config.js"',children:"// highlight-start\nmodule.exports = async function createConfigAsync() {\n // highlight-end\n return {\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n docs: {\n path: 'docs',\n // highlight-start\n remarkPlugins: [(await import('remark-math')).default],\n rehypePlugins: [(await import('rehype-katex')).default],\n // highlight-end\n },\n },\n ],\n ],\n };\n};\n"})})]}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsxs)(e.p,{children:["Include the KaTeX CSS in your config under ",(0,t.jsx)(e.code,{children:"stylesheets"}),":"]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-js",children:"export default {\n //...\n stylesheets: [\n {\n href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css',\n type: 'text/css',\n integrity:\n 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',\n crossorigin: 'anonymous',\n },\n ],\n};\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(a,{children:[(0,t.jsx)("summary",{children:"See a config file example"}),(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"// highlight-start\nimport remarkMath from 'remark-math';\nimport rehypeKatex from 'rehype-katex';\n// highlight-end\n\nexport default {\n title: 'Docusaurus',\n tagline: 'Build optimized websites quickly, focus on your content',\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n docs: {\n path: 'docs',\n // highlight-start\n remarkPlugins: [remarkMath],\n rehypePlugins: [rehypeKatex],\n // highlight-end\n },\n },\n ],\n ],\n // highlight-start\n stylesheets: [\n {\n href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css',\n type: 'text/css',\n integrity:\n 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',\n crossorigin: 'anonymous',\n },\n ],\n // highlight-end\n};\n"})})]}),"\n",(0,t.jsx)(e.h2,{id:"self-hosting-katex-assets",children:"Self-hosting KaTeX assets"}),"\n",(0,t.jsxs)(e.p,{children:["Loading stylesheets, fonts, and JavaScript libraries from CDN sources is a good practice for popular libraries and assets, since it reduces the amount of assets you have to host. In case you prefer to self-host the ",(0,t.jsx)(e.code,{children:"katex.min.css"})," (along with required KaTeX fonts), you can download the latest version from ",(0,t.jsx)(e.a,{href:"https://github.com/KaTeX/KaTeX/releases",children:"KaTeX GitHub releases"}),", extract and copy ",(0,t.jsx)(e.code,{children:"katex.min.css"})," and ",(0,t.jsx)(e.code,{children:"fonts"})," directory (only ",(0,t.jsx)(e.code,{children:".woff2"})," font types should be enough) to your site's ",(0,t.jsx)(e.code,{children:"static"})," directory, and in ",(0,t.jsx)(e.code,{children:"docusaurus.config.js"}),", replace the stylesheet's ",(0,t.jsx)(e.code,{children:"href"})," from the CDN URL to your local path (say, ",(0,t.jsx)(e.code,{children:"/katex/katex.min.css"}),")."]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n stylesheets: [\n {\n href: '/katex/katex.min.css',\n type: 'text/css',\n },\n ],\n};\n"})})]})}function p(s={}){let{wrapper:e}={...(0,l.R)(),...s.components};return e?(0,t.jsx)(e,{...s,children:(0,t.jsx)(x,{...s})}):x(s)}},13899:function(s,e,a){a.d(e,{A:()=>r});var n=a(74848);a(96540);var t=a(11118),l=a(41452);function r({children:s,hidden:e,className:a}){return(0,n.jsx)("div",{role:"tabpanel",className:(0,t.A)(l.A.tabItem,a),hidden:e,children:s})}},14729:function(s,e,a){a.d(e,{A:()=>p});var n=a(74848),t=a(96540),l=a(11118),r=a(85208),i=a(31191),c=a(17060),m=a(30926),h=a(18416);function d({className:s,block:e,selectedValue:a,selectValue:t,tabValues:r}){let c=[],{blockElementScrollPositionUntilNextRender:m}=(0,i.a_)(),d=s=>{let e=s.currentTarget,n=r[c.indexOf(e)].value;n!==a&&(m(e),t(n))},o=s=>{let e=null;switch(s.key){case"Enter":d(s);break;case"ArrowRight":{let a=c.indexOf(s.currentTarget)+1;e=c[a]??c[0];break}case"ArrowLeft":{let a=c.indexOf(s.currentTarget)-1;e=c[a]??c[c.length-1]}}e?.focus()};return(0,n.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.A)("tabs",{"tabs--block":e},s),children:r.map(({value:s,label:e,attributes:t})=>(0,n.jsx)("li",{role:"tab",tabIndex:a===s?0:-1,"aria-selected":a===s,ref:s=>{c.push(s)},onKeyDown:o,onClick:d,...t,className:(0,l.A)("tabs__item",h.A.tabItem,t?.className,{"tabs__item--active":a===s}),children:e??s},s))})}function o({lazy:s,children:e,selectedValue:a}){let r=(Array.isArray(e)?e:[e]).filter(Boolean);if(s){let s=r.find(s=>s.props.value===a);return s?(0,t.cloneElement)(s,{className:(0,l.A)("margin-top--md",s.props.className)}):null}return(0,n.jsx)("div",{className:"margin-top--md",children:r.map((s,e)=>(0,t.cloneElement)(s,{key:e,hidden:s.props.value!==a}))})}function x(s){let e=(0,c.u)(s);return(0,n.jsxs)("div",{className:(0,l.A)(r.G.tabs.container,"tabs-container",h.A.tabList),children:[(0,n.jsx)(d,{...e,...s}),(0,n.jsx)(o,{...e,...s})]})}function p(s){let e=(0,m.A)();return(0,n.jsx)(x,{...s,children:(0,c.v)(s.children)},String(e))}},17060:function(s,e,a){a.d(e,{u:()=>d,v:()=>m});var n=a(96540),t=a(49519),l=a(57190),r=a(11864),i=a(84329),c=a(34123);function m(s){return n.Children.toArray(s).filter(s=>"\n"!==s).map(s=>{if(!s||(0,n.isValidElement)(s)&&function(s){let{props:e}=s;return!!e&&"object"==typeof e&&"value"in e}(s))return s;throw Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof s.type?s.type:s.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h({value:s,tabValues:e}){return e.some(e=>e.value===s)}function d(s){let e,{defaultValue:a,queryString:d=!1,groupId:o}=s,x=function(s){let{values:e,children:a}=s;return(0,n.useMemo)(()=>{let s=e??m(a).map(({props:{value:s,label:e,attributes:a,default:n}})=>({value:s,label:e,attributes:a,default:n})),n=(0,i.XI)(s,(s,e)=>s.value===e.value);if(n.length>0)throw Error(`Docusaurus error: Duplicate values "${n.map(s=>s.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return s},[e,a])}(s),[p,j]=(0,n.useState)(()=>(function({defaultValue:s,tabValues:e}){if(0===e.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(s){if(!h({value:s,tabValues:e}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${s}" but none of its children has the corresponding value. Available values are: ${e.map(s=>s.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return s}let a=e.find(s=>s.default)??e[0];if(!a)throw Error("Unexpected error: 0 tabValues");return a.value})({defaultValue:a,tabValues:x})),[u,g]=function({queryString:s=!1,groupId:e}){let a=(0,t.W6)(),l=function({queryString:s=!1,groupId:e}){if("string"==typeof s)return s;if(!1===s)return null;if(!0===s&&!e)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return e??null}({queryString:s,groupId:e});return[(0,r.aZ)(l),(0,n.useCallback)(s=>{if(!l)return;let e=new URLSearchParams(a.location.search);e.set(l,s),a.replace({...a.location,search:e.toString()})},[l,a])]}({queryString:d,groupId:o}),[N,f]=function({groupId:s}){let e=s?`docusaurus.tab.${s}`:null,[a,t]=(0,c.Dv)(e);return[a,(0,n.useCallback)(s=>{e&&t.set(s)},[e,t])]}({groupId:o}),y=h({value:e=u??N,tabValues:x})?e:null;return(0,l.A)(()=>{y&&j(y)},[y]),{selectedValue:p,selectValue:(0,n.useCallback)(s=>{if(!h({value:s,tabValues:x}))throw Error(`Can't select invalid tab value=${s}`);j(s),g(s),f(s)},[g,f,x]),tabValues:x}}},52903:function(s,e,a){a.d(e,{A:()=>r});var n=a(74848);a(96540);var t=a(11118),l=a(80944);function r({children:s,minHeight:e,url:a="http://localhost:3000",style:r,bodyStyle:i}){return(0,n.jsxs)("div",{className:l.A.browserWindow,style:{...r,minHeight:e},children:[(0,n.jsxs)("div",{className:l.A.browserWindowHeader,children:[(0,n.jsxs)("div",{className:l.A.buttons,children:[(0,n.jsx)("span",{className:l.A.dot,style:{background:"#f25f58"}}),(0,n.jsx)("span",{className:l.A.dot,style:{background:"#fbbe3c"}}),(0,n.jsx)("span",{className:l.A.dot,style:{background:"#58cb42"}})]}),(0,n.jsx)("div",{className:(0,t.A)(l.A.browserWindowAddressBar,"text--truncate"),children:a}),(0,n.jsx)("div",{className:l.A.browserWindowMenuIcon,children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:l.A.bar}),(0,n.jsx)("span",{className:l.A.bar}),(0,n.jsx)("span",{className:l.A.bar})]})})]}),(0,n.jsx)("div",{className:l.A.browserWindowBody,style:i,children:s})]})}},56151:function(s,e,a){a.d(e,{R:()=>r,x:()=>i});var n=a(96540);let t={},l=n.createContext(t);function r(s){let e=n.useContext(l);return n.useMemo(function(){return"function"==typeof s?s(e):{...e,...s}},[e,s])}function i(s){let e;return e=s.disableParentContext?"function"==typeof s.components?s.components(t):s.components||t:r(s.components),n.createElement(l.Provider,{value:e},s.children)}},67013:function(s){s.exports=JSON.parse('{"id":"guides/markdown-features/math-equations","title":"Math Equations","description":"Writing LaTeX Math Equations","source":"@site/docs/guides/markdown-features/markdown-features-math-equations.mdx","sourceDirName":"guides/markdown-features","slug":"/markdown-features/math-equations","permalink":"/docs/markdown-features/math-equations","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/guides/markdown-features/markdown-features-math-equations.mdx","tags":[],"version":"current","lastUpdatedBy":"dependabot[bot]","lastUpdatedAt":1765289882000,"frontMatter":{"id":"math-equations","description":"Writing LaTeX Math Equations","slug":"/markdown-features/math-equations"},"sidebar":"docs","previous":{"title":"MDX Plugins","permalink":"/docs/markdown-features/plugins"},"next":{"title":"Diagrams","permalink":"/docs/markdown-features/diagrams"}}')}}]);