\cat software
TeX: Reference and Examples by David Bausum
TeX은 문서조판을 위한 프로그램이다. 일종의 워드프로세서라고 할 수도 있지만 개념이 다르다. TeX 자체가 일종의 프로그래밍언어이며 이를 통해 글을 구조적으로 작성할 수 있게 도와준다. 구조적이지 않게 글을 쓰는 것이 더 어려울 것이다. ;) 이는 대부분의 워드프로세서 사용자들이 스타일등의 기능이 있음에도 불구하고 잘 사용하지 않고 외적인 면에만 신경쓰는 것과는 다르다고 할 수 있다.
Since 2001-02-20
Plain TeX에서 한글쓰기: Plain TeX이라함은 가장 기본적이고 가벼운 TeX이라고 생각하면 된다. 현재까지는 이런 TeX을 이용해서는 한글을 사용할 수 없었다. LaTeX을 기반으로 HFSS(Hangul Font Selection Scheme)나 다른 복잡한 방법을 이용해야만 한글을 사용할 수 있었다. 이에 HLaTeX 폰트를 사용해서 TeX으로 한글을 출력할 수는 없을까하는 생각에 지저분한 코드를 만들게 되었다.
htex.tex을 이용해서 한글을 사용하는 예이다. 한글은 EUC-KR 문자셋으로 입력해야 한다.
\input htex 한글 english 또 한글 \efntsize{scaled 3500} \hfntk{wbm}{scaled 2000} 한글 english 또 한글 \efntname{cmbx9} \hfntksize{scaled 1000} 한글 english 또 한글 \hfntkname{wgr} \hfntksize{at 30pt} 한글 english 또 한글 {\hfntksc\special{여기서 한글은 명령이 아닌 문자 그대로의 한글이다.}} \fntsize{scaled 5000} 한글 english 또 한글 … \end
결과는 다음과 같다.
사용되는 한글글꼴은 HLaTeX의 글꼴을 사용하므로 설치되어 있어야 한다. 그리고 한글글꼴의 크기는 다른 글꼴의 크기에 영향을 주지도 받지도 않는다.
\efnt로 시작하는 명령은 영문글꼴을 한글글꼴과 비슷한 방법으로 사용할 수 있게 해준다.
* 김도현님의 http://people.ktug.or.kr/~nomos/ucsplain/ucsplain.tex을 사용하면 Plain TeX에서 UTF-8 한글입출력이 가능하다.
mptex은 MetaPost 소스와 TeX 또는 LaTeX 소스를 .mptex 이라는 하나의 파일에 같이 코딩할 수 있게 도와준다. mplatex으로 링크를 하면 LaTeX을 실행한다. 사용예는 다음과 같다.
1.mptex (Figure 52, "A User's Manual for MetaPost" by John D. Hobby)
\input epsf \nopagenumbers \bmp input boxes vardef cuta(suffix a,b) expr p = drawarrow p cutbefore bpath.a cutafter bpath.b; point .5*length p of p enddef; vardef self@# expr p = cuta(@#,@#) @#.c{curl0}..@#.c+p..{curl0}@#.c enddef; beginfig(1); verbatimtex \def\stk#1#2{$\displaystyle{\matrix{#1\cr#2\cr}}$} etex circleit.aa(btex\strut Start etex); aa.dx=aa.dy; circleit.bb(btex \stk B{(a|b)^*a} etex); circleit.cc(btex \stk C{b^*} etex); circleit.dd(btex \stk D{(a|b)^*ab} etex); circleit.ee(btex\strut Stop etex); ee.dx=ee.dy; numeric hsep; bb.c-aa.c = dd.c-bb.c = ee.c-dd.c = (hsep,0); cc.c-bb.c = (0,.8hsep); xpart(ee.e - aa.w) = 3.8in; drawboxed(aa,bb,cc,dd,ee); label.ulft(btex$b$etex, cuta(aa,cc) aa.c{dir50}..cc.c); label.top(btex$b$etex, self.cc(0,30pt)); label.rt(btex$a$etex, cuta(cc,bb) cc.c..bb.c); label.top(btex$a$etex, cuta(aa,bb) aa.c..bb.c); label.llft(btex$a$etex, self.bb(-20pt,-35pt)); label.top(btex$b$etex, cuta(bb,dd) bb.c..dd.c); label.top(btex$b$etex, cuta(dd,ee) dd.c..ee.c); label.lrt(btex$a$etex, cuta(dd,bb) dd.c..{dir140}bb.c); label.bot(btex$a$etex, cuta(ee,bb) ee.c..tension1.3..{dir115}bb.c); label.urt(btex$b$etex, cuta(ee,cc) ee.c{(cc.c-ee.c)rotated-15}..cc.c); endfig; end \emp \epsfbox{\jobname.1} \bye
mptex 1.mptex
MetaPost가 생성하는 .ps 파일의 특성상 mptex의 최종 출력물은 .ps 파일이다. .pdf 파일이 아닌 이유는 Acrobat Reader가 .pdf 파일을 읽으면서 잠그고 있어서 실시간으로 출력물을 보면서 재컴파일을 할 수 없기 때문이다. 본인의 완벽한 OS 윈도 XP에서는 GSview를 이용해서 재컴파일 후 바로바로 .ps 파일을 읽어올 수 있으므로 문서작성이 용이하다.
http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html
TeX 엔진을 이용해서 tex 파일을 html로 변환해 준다. TeX 자체를 이용하기 때문에 더 만족스러운 결과를 얻을 수 있다고 생각한다. 다음은 HLaTeX 폰트를 위한 texmf 트리이다.
tex/hlatex-tex4ht-texmf.zip 2005-01-12
설치 원하는 디렉토리에 압축을 푼 후 texmf.cnf 파일이나 ~/.bash_profile 등의 로긴쉘 시작파일에 해당경로를 추가한다. bash의 경우는 export TEXMF='{/home/foo/usr/share/hlatex-tex4ht-texmf}'와 같은 줄을 추가한 후 source ~/.bash_profile; mktexlsr를 실행한다.
\input htex \csname tex4ht\endcsname 한글테스트 $$\sum_{i=1}^n f_i(x)=g(x)$$ \end위 파일을 httex test.tex "xhtml,html4.4ht,htex.4ht,html4-math.4ht" " -cunihtf" 명령으로 처리하면 utf-8으로 인코딩된 xhtml 문서가 생성된다. 단, htex.tex이 EUC-KR만 처리하므로 입력파일의 한글은 EUC-KR만 허용한다.
http://bibliographic.openoffice.org/btxdoc.html
An article from a journal or magazine. Required fields: author, title, journal, year. Optional fields: volume, number, pages, month, note.
A book with an explicit publisher. Required fields: author or editor, title, publisher, year. Optional fields: volume or number, series, address, edition, month, note.
A work that is printed and bound, but without a named publisher or sponsoring institution. Required field: title. Optional fields: author, howpublished, address, month, year, note.
The same as INPROCEEDINGS, included for Scribe compatibility.
A part of a book, which may be a chapter (or section or whatever) and/or a range of pages. Required fields: author or editor, title, chapter and/or pages, publisher, year. Optional fields: volume or number, series, type, address, edition, month, note.
A part of a book having its own title. Required fields: author, title, booktitle, publisher, year. Optional fields: editor, volume or number, series, type, chapter, pages, address, edition, month, note.
An article in a conference proceedings. Required fields: author, title, booktitle, year. Optional fields: editor, volume or number, series, pages, address, month, organization, publisher, note.
Technical documentation. Required field: title. Optional fields: author, organization, address, edition, month, year, note.
A Master’s thesis. Required fields: author, title, school, year. Optional fields: type, address, month, note.
Use this type when nothing else fits. Required fields: none. Optional fields: author, title, howpublished, month, year, note.
A PhD thesis. Required fields: author, title, school, year. Optional fields: type, address, month, note.
The proceedings of a conference. Required fields: title, year. Optional fields: editor, volume or number, series, address, month, organization, publisher, note.
A report published by a school or other institution, usually numbered within a series. Required fields: author, title, institution, year. Optional fields: type, number, address, month, note.
A document having an author and title, but not formally published. Required fields: author, title, note. Optional fields: month, year.
Usually the address of the publisher or other type of institution. For major publishing houses, van Leunen recommends omitting the information entirely. For small publishers, on the other hand, you can help the reader by giving the complete address.
An annotation. It is not used by the standard bibliography styles, but may be used by others that produce an annotated bibliography.
The name(s) of the author(s), in the format described in the LaTeX book.
Title of a book, part of which is being cited. See the LaTeX book for how to type titles. For book entries, use the title field instead.
A chapter (or section or whatever) number.
The database key of the entry being cross referenced.
The edition of a book—for example, "Second". This should be an ordinal, and should have the first letter capitalized, as shown here; the standard styles convert to lower case when necessary.
Name(s) of editor(s), typed as indicated in the LaTeX book. If there is also an author field, then the editor field gives the editor of the book or collection in which the reference appears.
How something strange has been published. The first word should be capitalized.
The sponsoring institution of a technical report.
A journal name. Abbreviations are provided for many journals; see the Local Guide.
Used for alphabetizing, cross referencing, and creating a label when the "author" information (described in Section 4) is missing. This field should not be confused with the key that appears in the \cite command and at the beginning of the database entry.
The month in which the work was published or, for an unpublished work, in which it was written. You should use the standard three-letter abbreviation, as described in Appendix B.1.3 of the LaTeX book.
Any additional information that can help the reader. The first word should be capitalized.
The number of a journal, magazine, technical report, or of a work in a series. An issue of a journal or magazine is usually identified by its volume and number; the organization that issues a technical report usually gives it a number; and sometimes books are given numbers in a named series.
The organization that sponsors a conference or that publishes a manual.
One or more page numbers or range of numbers, such as 42–111 or 7,41,73–97 or 43+ (the '+' in this last example indicates pages following that don't form a simple range). To make it easier to maintain Scribe-compatible databases, the standard styles convert a single dash (as in 7-33) to the double dash used in TEX to denote number ranges (as in 7–33).
The publisher's name.
The name of the school where a thesis was written.
The name of a series or set of books. When citing an entire book, the the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.
The work's title, typed as explained in the LaTeX book.
The type of a technical report—for example, "Research Note".
The volume of a journal or multivolume book.
The year of publication or, for an unpublished work, the year it was written. Generally it should consist of four numerals, such as 1984, although the standard styles can handle any year whose last four nonpunctuation characters are numerals, such as '(about 1984)'.
This perl script helps rearrange entries in a bib file in order of key names. Sometimes, duplicated keys can be created unintentionally when there are too many entries and they are not sorted properly. You may find the following script (vibib) useful when editing a bib file:
#!/bin/sh # change this file name to yours bib=~/bib/myown.bib tmp=/tmp/vibib$$.bib trap "rm -f $tmp" 0 1 2 cp $bib $tmp vim $tmp cp $tmp $bib~ sortbib $tmp > $bib
Each entry should start with "@" and end with "}". All fields in an entry need to be properly indented like the following:
@ARTICLE{Allen:1997, author = {P.M. Allen and J.G. Arnold and E. Jakubowski}, title = {Design and testing of a simple submerged jet device for field determination of soil erodibility}, journal = {Environmental and Engineering Geoscience}, volume = {III}, number = {4}, pages = {579-584}, year = {1997} } @INPROCEEDINGS{Sotiropoulos:2002, author = {D.G. Sotiropoulos and V.P. Plagianakos and M.N. Vrahatis}, title = {An Evolutionary Algorithm for Minimizing Multimodal Functions}, booktitle = {Proceedings of the Fifth Hellenic-European Conference on Computer Mathematics and its Applications (HERCMA 2001)}, year = {2002}, editor = {E.A. Lipitakis}, pages = {496-500}, address = {}, organization = {}, publisher = {LEA Press}, otherinfo = {http://www.math.upatras.gr/~dgs/pub.htm} } @INBOOK{Vieux:2004, author = {Baxter E. Vieux}, title = {Distributed Hydrologic Modeling Using GIS}, chapter = {10}, series = {Water Science and Technology Library}, volume = {48}, pages = {197-215}, publisher = {Kluwer Academic Publishers}, year = {2004} }
Sometimes, I am required to submit to journals a bib file along with the LaTeX source files of papers. However, I don't usually prepare a separate bib file for a specific paper, so I have to create a subset file of my huge bib file only for submission. This perl script extracts from a big bib file the entries cited in a bbl file to create a subset of the bib file. The format of BibTeX entries should be the same as explained in sortbib. The usage is as follows: extractbib bbl_file big_bib_file new_bib_file. The following is a typical way to prepare a small bib file:
latex paper bibtex paper extractbib paper.bbl myhuge.bib paper.bib
\documentclass{article} \usepackage{epsfig} \usepackage{color} \setlength{\textwidth}{100cm} \setlength{\textheight}{100cm} \begin{document} \pagestyle{empty} \input{fig.pstex_t} \end{document}
latex fig.tex dvips -E fig.dvi -o fig.eps