'latex'에 해당되는 글 1건

  1. 2015.10.16 LaTeX - Document class (template) 시작하기
LaTeX2015. 10. 16. 19:07

문제:

LaTeX에서 새로운 문서 template을 만들기 위한 document class 작성.

이를 시작하기 위한 최소한의 template file (cls file).

 

 

단계 1:

'hanmin'이라는 document class를 만드려면, hanmin.cls file을 만든다 (한 줄이면 됨):

 

hanmin.cls:

\renewcommand\normalsize{\fontsize{10pt}{12pt}\selectfont}

 

 

단계 2:

이를 test하기 위한 TeX source file:

 

main.tex

\documentclass{hanmin}

 

\begin{document}

This is a test article of the hanmin document class.

\end{document}

 

 

결과물:

pdfLaTeX로 main.tex를 compile한 결과 (Compile 할 때, main.texhanmin.cls는 같은 folder 안에 있어야 함):

 

main.pdf:

 

 

덧:

사실, LaTeX와 함께 배포되는 minimal.cls file을 바탕으로 새로운 document class를 작성하는 것도 좋은 방법이다.

더 자세히는 참고 문헌 [1]을 참고.

 

 

시연:

 

 

 

참고 문헌:

  1. F. Mittelbach and M. Goossens, "Package and class file structure," in The LaTeX Companion, 2nd ed. Addison Wesley, 2006, ch. A, sec. 4, pp. 877-888.
Posted by topazus