본문 바로가기

$\LaTeX$으로 나눗셈 구현하기

반응형

$\LaTeX$으로 구현하지 못하는 수식은 거의 없다. 초등학교 때 배우는 세로로 쓰는 나눗셈도 가능하다. 다항식의 나눗셈은 아래와 같이 표현한다. 너무 복잡해서 이걸 쓸 일이 싶을까 싶다. 그래도 혹시나 필요한 사람도 있을 것 같아 올려둔다. 영어로 검색하고 싶다면 long division으로 하면 된다.

\begin{array}{r} x+1\phantom{)} \\ x+2{\overline{\smash{\big)}\,x^2+3x+5\phantom{)}}}\\ \underline{-~\phantom{(}(x^2+2x)\phantom{-b)}}\\ x+5\phantom{)}\\ \underline{-~\phantom{()}(x+2)}\\ 3\phantom{)} \end{array}

$$\begin{array}{r} x+1\phantom{)} \\ x+2{\overline{\smash{\big)}\,x^2+3x+5\phantom{)}}}\\ \underline{-~\phantom{(}(x^2+2x)\phantom{-b)}}\\ x+5\phantom{)}\\ \underline{-~\phantom{()}(x+2)}\\ 3\phantom{)} \end{array}$$

\phantom은 빈 공간을 만든다. 생성되는 박스는 언급되는 주제({ }안에 있는 요소)와 같은 폭과 높이, 깊이를 가진다. 주제가 보이진 않지만 같은 공간을 만든다는 것이다.

https://www.tutorialspoint.com/tex_commands/phantom.htm

 

\phantom - Tex Command

\phantom - Tex Command phantom \phantom - Used to create space. SYNOPSIS { \phantom #1} DESCRIPTION \phantom command draws space. The box created by \phantom has width, height and depth equal to its argument. In other words, \phantom creates horizontal and

www.tutorialspoint.com

입력

\$\phantom{)}{\overline{\smash{\big)}\,\phantom{)}}}\$

출력

$\phantom{)} {\overline{\smash{\big)}\,\phantom{)}}}$

블로그에서 보여줄 수는 없지만 long division 패키지를 설치하면 훨씬 간단하게 나타낼 수 있다.

longdivision_manual.pdf

 

반응형