슬라이드 1

Download Report

Transcript 슬라이드 1

Latex І
TA. Janghwan Lee
T. 5584
목차
• 배경지식
• TeX의 구조
• TeX의 장·단점
• 레이텍(Latex) 설치
• 입력파일 구조
• LateX 명령문
배경 지식
• TeX란?
– 텍스트와 수학식을 조판하기 위해 만들어진 프로그램 (by Donald
E. Knuth, 1977)
• Tex의 종류
– PlainTeX: 최초의 TeX 매크로패키지
– hLaTeXp: LaTeX에서 한글을 사용할 수 있도록 한 매크로패키지
– AMS-TeX/AMS-LaTeX: 전문적인 수학기호나 식을 조판하기 위
한 매크로 패키지
– ChemTeX: 화학식이나 화학 기호를 조판하기 위한 매크로 패키
지
– MusicTeX: 악보를 조판하기 위한 매크로 패키지
TeX의 구조
TeX의 장점
• 전문적으로 디자인된 레이아웃을 사용할 수 있다
• 수학식의 조판이 매우 쉽다
• 각주, 상호참조, 목차, 참고 문헌 등도 쉽게 만들 수 있다
• 구조화가 잘 된 문서를 작성할 수 있다
• 매우 이식성이 높고 무료이다
• 프린터하거나 저장할 때 프로그램이 죽는 일이 없다
TeX의 단점
• 처음 접하기가 어렵다
• 새로운 레이아웃을 설계하는 것은 어렵고 시간이 많이 든
다
• 구조화되지 않고 비체계적인 문서를 작성하기가 어렵다
• 다른 사람과 공동 작업을 하는 경우 좀 더 편리하다
설치
용도
Windows
Linux
비고
TeXImpleme MiKTeX-ntation
KTUG
teTeX
teTeX은 별도의 한글 설정
필요
DVI driver
Yap*
XDvi*
MiKTeX 또는 teTeX 의 일부
그림 처리
GhostScript
/GSView
GhostScript*/gv
GhostScript는 필수
*
PDF Viewer
AdobeReade
r
AdobeReader or
gv*/xPdf
한국어 언어팩 설치 필요
Editor
WinEdt or
NTEmacs
Emacs*/VimEdt
*
그밖에 다른 에디터도 가능
Ref. http://faq.ktug.or.kr/mywiki/TeX_bc_b3_c4_a1_c7_cf_b1_e2
MikTeX 설치하기(1)
• http://project.ktug.or.kr/miktex-ktug/
MikTeX 설치하기(2)
MikTeX 설치하기(3)
MikTeX 설치하기(4)
• Path 설정하기
– Windows 98 인 경우
• C:\AUTOEXEC.BAT 파일의 마지막에 추가
• “PATH=%PATH%;C:\texmf\miktex\bin”
– Windows XP/2000 인 경우
• [시작][설정][제어판][시스템][고급][환경변
수][Path 변수]
• “;C:\texmf\miktex\bin”
• 마지막으로
– [시작] [실행] 또는 [도스창]
– “initexmf –-mkmaps”
그 외 프로그램 설치하기
• Gsview, Ghostscript 설치하기
– http://www.cs.wisc.edu/~ghost
• WinEdt 설치하기
– http://www.winedt.com/ (click! WinEdt 5.4)
– WinEdit 과 혼동하지 말기
• Acrobat Reader 설치하기
– http://www.korea.adobe.com/products/acrobat/re
adstep2.html
TeX 파일의 구조
• \documentclass[option]{class}
– 만들려는 문서의 종류를 설정
• \usepackage[option]{package}
– 새로운 기능을 추가하는 패키지 포함
• \begin{document}
– 문서 주요부의 시작을 알림
• \end{document}
– 문서의 끝을 알림
예제
\documentclass[a4paper,11pt]{article}
\usepackage{epsfig}
%define the title
\title{Minimalism}
\begin{document}
Well, and here begins my lovely article.
\end{document}
문서 클래스들
• Article
– 과학 하술지, 프레젠테이션, 짧은 보고서, 프로그램 문
서, 초대장 등
• Report
– 긴 보고서, 작은 책, 박사학위 논문
• Book
– 책
• Slides
– 슬라이드 제작용 클래스
문서 클래스의 옵션
•
10pt, 11pt, 12pt
•
A4paper, letterpaper,…
•
Fleqn
•
•
–
–
–
문서의 기본 글꼴(default – 10pt)
종이크기 (default – letterpaper)
수식을 왼쪽 정렬
Leqno
–
수식의 번호를 왼쪽에 붙인다
Titlepage,notitlepage
–
표지만든후 새로운 쪽에서 시작할 것인지 지정
•
Twocolumn
•
Twoside, oneside
–
–
2단 조판
양면 인쇄용, 단면인쇄용 지정
여러 가지 확장자명
• .tex  LaTeX 혹은 TeX의 입력파일
• .sty  매크로 패키지 파일
• .cls  문서의 양식을 정의하는 클래스파일
• .dvi  장치독립파일. Tex파일을 컴파일 하면 얻어지는 파일.
DVI 미리 보기프로그램을 이용해 내용을 화면으로 볼 수 있다
• .toc/.lof/.lot  타이틀/그림목차/표목차
• .aux  한번 컴파일이 이루어진후 다음번 실행에 전달해줄 정보를
담고있는 파일
기본 입력
• 공백
– 여러 개의 공백도 하나의 공백으로 처리
• 특수문자
– #$%^&_{}
– ~  $\sim$
앞에 \와 함께 사용
• 명령어
– 대소문자 구별한다
– \로 시작하여 문자만으로 이루어져 있다
• 주석
– %이후의 부분은 무시한다
장과 절
• Article
– \Section{…}
– \Subsection{…}
– \subsubsection{…}
\paragraph{…}
\subparagraph{…}
• Report / book
– \part{…} : 장의 번호 매기는 순서에 영향X
– \chapter{…}
• *  차례에 나타나지 않고 번호없음
– Ex) \section*{help}
글자체와 글자크기
줄 바꿈과 여백
• \\ or \newline  강제 줄바꿈
• \\*  쪽나누기 방지
• \hspace{…}  horizontal space
– Ex) in \hspace{1cm} this : in
• \vspace{…}  vertical space
this
제목 과 참조
• \maketitle  문서 전체의 제목 만들기
– \title{…},\author{…},\date{…}
• \tableofcontents  이 명령어 자리에 목차가
생긴다
• \label{maker},\ref{maker},\pageref{maker}
 상호 참조
• \footnote{footnote text}  각주
환경
• 형식
– \begin{environment}
– Text
– \end{environment}
• 종류
– Itemize, Enumerate, Description
• 단순 나열, 번호나열, 설명을 위한 나열
– Flushleft, Flushright, Center
• 왼쪽 정렬, 오른쪽 정렬, 가운데 정렬
– Quote, Quotation, Verse (중요한 구절이나 예문인용)
– Verbatim(그래도 보이기)
환경 예제(1)
Here are main research topics:
\begin{itemize}
\item Character Recognition
\begin{itemize}
\item On-line Recognition
\item Off-line Recognition
\end{itemize}
\item Intelligent Tutoring
System
\begin{enumerate}
\item Problem Solving Module
\item Student Modelling Module
\end{enumerate}
\end{itemize}
Here are main research topics:
• Character Recognition
– On-line Recognition
– Off-line Recognition
• Intelligent Tutoring System
1. Problem Solving Module
2. Student Modelling Module
환경 예제(2)
테이블 만들기
• 형식
– \begin{tabular}{table spec}
– Table sepc : 표의 모양 지정
• l,r,c: 왼쪽,오른쪽, 가운데 정렬
• | : 세로줄 삽입
• Tabular 내에서의 명령어
–
–
–
–
& : 다음 열로 넘김
\\: 새로운 행의 시작
\hline: 가로줄 삽입
\cline{j-i}: j와i 열 사이에 부분 줄 추가
테이블 예제
7C0 Hexa
3700 Octal
1111000 binary
1984 decimal
\begin{tabular}{|r|l|}
\hline
7C0 & Hexa \\
3700 & Octal \\
\cline{2-2}
1111000 & binary \\
\hline \hline
1984 & decimal \\
\hline
\end{tabular}
테이블 위치 지정하기
• 형식
– \begin{table}[placement specifier}
– \caption{caption text}
– \begin{tabular} …
• 위치 지정 선택인자(placement specifier)
–
–
–
–
h: here(이 명령이 사용된 바로 그 위치)
t: top(쪽의 윗부분)
b: bottom(쪽의 아래부분)
p: page(그림이나 표만 모아둔 특별한 쪽에 위치)
그림 삽입
• Use a picture with eps format
– Encapsulated PostScript
– One of the postscript files
– Postscript is page description language
• Image Converting tool
– Photoshop, imagemagick, jpeg2ps, bmp2eps, gif2eps, ps2eps, etc.
– Example
usepackage{epsfig}
usepackage{epsfig}
\begin{figure}[h]
\centerline{\epsfig{file=amath.eps, height = 4cm, width = 10cm}}
\caption{Location of building number E2-1}
\end{figure}
Userpackage
[options]{package}
• If you want to include graphics, coloured text or source
code from a file into your document, you need to
enhance the capabilities of LaTex. Such enhancements
are called packages
– amsmath : mathematical environment
– makeidx : make index
• Options is a list of keywords which trigger special
features in the package
• Reference
– http://www.ktug.or.kr/
– http://www.tex.ac.uk/texarchive/help/Catalogue/catalogue.html
LAB #3.
• Make the following table
Code Number
CC510 Introduction to Computer Systems and
Applications
Instructor
Yung Hwan Oh (yhoh@speech_kaist_ac_kr)
Place & Hour
Dept. of CS Lecture Hall(#1501), Wed. 1:00 ~ 3:00 pm
Table 1. Course Information