Index . 블로그창고 . Any comments?

\cat software

TeX
htex.tex
mptex
TeX4ht
BibTeX
Entry Types
Fields
sortbib
extractbib
How to use LaTeX formulas with xfig
Articles
TeX, LaTeX
발음 주의! /텍스, 라텍스/ 절대 아니다. /텍, 레이텍/ 이라고 한다. Greece 어원인 기술(영어로 tech)에서 온 말이다.

TeX

TeX: Reference and Examples by David Bausum

TeX은 문서조판을 위한 프로그램이다. 일종의 워드프로세서라고 할 수도 있지만 개념이 다르다. TeX 자체가 일종의 프로그래밍언어이며 이를 통해 글을 구조적으로 작성할 수 있게 도와준다. 구조적이지 않게 글을 쓰는 것이 더 어려울 것이다. ;) 이는 대부분의 워드프로세서 사용자들이 스타일등의 기능이 있음에도 불구하고 잘 사용하지 않고 외적인 면에만 신경쓰는 것과는 다르다고 할 수 있다.

htex.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

결과는 다음과 같다.

tex/examples/htex/htex_ex.jpg

사용되는 한글글꼴은 HLaTeX의 글꼴을 사용하므로 설치되어 있어야 한다. 그리고 한글글꼴의 크기는 다른 글꼴의 크기에 영향을 주지도 받지도 않는다.

\efnt로 시작하는 명령은 영문글꼴을 한글글꼴과 비슷한 방법으로 사용할 수 있게 해준다.

* 김도현님http://people.ktug.or.kr/~nomos/ucsplain/ucsplain.tex을 사용하면 Plain TeX에서 UTF-8 한글입출력이 가능하다.

mptex

tex/mptex

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
tex/mptex.png

MetaPost가 생성하는 .ps 파일의 특성상 mptex의 최종 출력물은 .ps 파일이다. .pdf 파일이 아닌 이유는 Acrobat Reader가 .pdf 파일을 읽으면서 잠그고 있어서 실시간으로 출력물을 보면서 재컴파일을 할 수 없기 때문이다. 본인의 완벽한 OS 윈도 XP에서는 GSview를 이용해서 재컴파일 후 바로바로 .ps 파일을 읽어올 수 있으므로 문서작성이 용이하다.

TeX4ht

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를 실행한다.

2005-01-12
htex.tex에 대응하는 htex.4ht 추가. Plain TeX으로 쓰여진 한글문서를 변환할 수 있다. 다음은 test.tex 파일이다.
\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만 허용한다.

BibTeX

http://bibliographic.openoffice.org/btxdoc.html

Entry Types

article

An article from a journal or magazine. Required fields: author, title, journal, year. Optional fields: volume, number, pages, month, note.

book

A book with an explicit publisher. Required fields: author or editor, title, publisher, year. Optional fields: volume or number, series, address, edition, month, note.

booklet

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.

conference

The same as INPROCEEDINGS, included for Scribe compatibility.

inbook

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.

incollection

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.

inproceedings

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.

manual

Technical documentation. Required field: title. Optional fields: author, organization, address, edition, month, year, note.

mastersthesis

A Master’s thesis. Required fields: author, title, school, year. Optional fields: type, address, month, note.

misc

Use this type when nothing else fits. Required fields: none. Optional fields: author, title, howpublished, month, year, note.

phdthesis

A PhD thesis. Required fields: author, title, school, year. Optional fields: type, address, month, note.

proceedings

The proceedings of a conference. Required fields: title, year. Optional fields: editor, volume or number, series, address, month, organization, publisher, note.

techreport

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.

unpublished

A document having an author and title, but not formally published. Required fields: author, title, note. Optional fields: month, year.

Fields

address

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.

annote

An annotation. It is not used by the standard bibliography styles, but may be used by others that produce an annotated bibliography.

author

The name(s) of the author(s), in the format described in the LaTeX book.

booktitle

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.

chapter

A chapter (or section or whatever) number.

crossref

The database key of the entry being cross referenced.

edition

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.

editor

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.

howpublished

How something strange has been published. The first word should be capitalized.

institution

The sponsoring institution of a technical report.

journal

A journal name. Abbreviations are provided for many journals; see the Local Guide.

key

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.

month

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.

note

Any additional information that can help the reader. The first word should be capitalized.

number

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.

organization

The organization that sponsors a conference or that publishes a manual.

pages

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).

publisher

The publisher's name.

school

The name of the school where a thesis was written.

series

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.

title

The work's title, typed as explained in the LaTeX book.

type

The type of a technical report—for example, "Research Note".

volume

The volume of a journal or multivolume book.

year

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)'.

sortbib

tex/sortbib

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}
}

extractbib

tex/extractbib

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

How to use LaTeX formulas with xfig

  1. Type LaTeX formulas with the "Special Flag" turned on.
  2. Export the figure using the format "Combined PS/LaTeX (both parts)."
  3. Create a LaTeX file "fig.tex":
    \documentclass{article}
    \usepackage{epsfig}
    \usepackage{color}
    \setlength{\textwidth}{100cm}
    \setlength{\textheight}{100cm}
    \begin{document}
    \pagestyle{empty}
    \input{fig.pstex_t}
    \end{document}
    
  4. Create an eps file:
    latex fig.tex
    dvips -E fig.dvi -o fig.eps
    

Articles


All the works in this site except software and copyrighted materials by others (e.g., 문학) are licensed under a Creative Commons License. 소프트웨어 및 문학과 같이 다른 이에게 저작권이 있는 작품을 제외하고 모두 크리에이티브 커먼즈 라이센스를 따른다.
Tue Oct 13 15:15:55 2020 . XHTML . CSS (lightbox.css is not part of Uniqki. ;-) . Powered by Uniqki!
refresh . edit . loginout . index