Skip to content

Instantly share code, notes, and snippets.

@dohyunkim
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save dohyunkim/9035574 to your computer and use it in GitHub Desktop.

Select an option

Save dohyunkim/9035574 to your computer and use it in GitHub Desktop.
metapost로 cases 그리기. mptopdf 명령으로 컴파일한다.
verbatimtex \input kotexutf.tex etex;
input boxes;
input cmarrows;
setup_cmarrows(
brace_name = "Biggbrace";
parameter_file = "cmr12.mf";
macro_name = "LeftBrace"
);
def leftbrace (suffix tt,bb) =
LeftBrace (bb.sw+up*bb.dy -- tt.nw+down*tt.dy)
enddef;
pair hspace; hspace = (8,0);
beginfig(0);
boxit.real (btex 실수 etex);
boxit.ratio(btex 유리수 etex);
boxit.irrat(btex 무리수 etex);
boxit.integ(btex 정수 etex);
boxit.noint(btex 정수 아닌 유리수 etex);
boxit.posit(btex 양의 정수 etex);
boxit.zero (btex $0$ etex);
boxit.negat(btex 음의 정수 etex);
boxit.yuhan(btex 유한소수 etex);
boxit.repea(btex 순환(무한)소수 etex);
boxit.prime(btex 소수 etex);
boxit.one (btex $1$ etex);
boxit.compo(btex 합성수 etex);
boxit.sunsu(btex 순순환(무한)소수 etex);
boxit.honsu(btex 혼순환(무한)소수 etex);
boxit.bisun(btex (대수적)비순환(무한)소수 etex);
boxit.trans(btex 초월수 etex);
one.nw=prime.sw; one.sw=compo.nw; one.w=posit.e+hspace;
zero.nw=posit.sw; zero.sw=negat.nw; zero.w=integ.e+hspace;
sunsu.sw=honsu.nw=repea.e+hspace;
yuhan.sw=repea.nw=noint.e+hspace;
bisun.sw=trans.nw=irrat.e+hspace;
ratio.e+hspace=.5[integ.w,noint.w]; xpart integ.w=xpart noint.w;
real.e+hspace=.5[ratio.w,irrat.w]; xpart ratio.w=xpart irrat.w;
ypart negat.s=ypart yuhan.n;
ypart honsu.s=ypart bisun.n;
drawunboxed(real,ratio,irrat,integ,noint,posit,zero,negat,yuhan,repea,prime,one,compo,sunsu,honsu,bisun,trans);
leftbrace(ratio,irrat);
leftbrace(integ,noint);
leftbrace(posit,negat);
leftbrace(prime,compo);
leftbrace(yuhan,repea);
leftbrace(sunsu,honsu);
leftbrace(bisun,trans);
endfig;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment