LaTex 작성때 그림 넣기
Ref : http://wiessen.tistory.com/240
몇 번의 시행 착오 끝에, 장님 더듬거리다 전봇대 붙잡은 기분으로 겨우 성공했습니다 -_-;
까먹기 전에 포스팅!
PostScript 니 GhostScript 니 하는 것들은 쓸 줄 모르겠고 -_-; pdftex을 사용하도록 합시다.
0. 우선, 그림은 .tex 파일이 저장되어 있는 경로에 넣어 두고요. (.jpg 그림 파일. 설명을 위해, 파일 이름이 ImageFileName.jpg라고 합시다.)
1. 패키지 선언.
\usepackage[pdftex]{graphicx}
이렇게 전처리부에 패키지 사용 선언을 하고,
2. 그림 넣을 장소에 이렇게 입력을 하면 됩니다.
\begin{figure}
\centering
\includegraphics[width=0.4\textwidth]{ImageFileName}
\caption{캡션}
\end{figure}
설명. 우선 figure 환경에서
\centering 은 가운데 정렬
\includegraphics 에서
\caption 은 그림 밑에 달리는 캡션. Figure- 라는 그림 제목은 알아서 붙어요.
-------------------------------------------------------------------------------
그림을 A4용지의 글자 폭에 딱 맞춰서 넣으려면
\includegraphics[width=1.0\columnwidth]{ImageFileName}
이렇게 하면 딱 들어감
==============================================================================
만약에 그림을 2 컬럼에 걸쳐서 넣을 경우
(그림의 크기가 큰 경우)
\usepackage{caption} % 캡션을 그림의 가운데로 정렬하기 위해 caption 관련 unpack
\begin{figure*} % 별표를 넣으면 중첩이 금지라는 의미로 본인 영역을 지켜서 가 겹치지 않는다.
\centering
\includegraphics[width=18cm]{F1.pdf}
\captionsetup{justification=centering} % 캡션을 가운데 정렬
\caption{The procedure to detect for the object in a large-size image. We implement the binary classifier and measure the scores to yield correct results. The grouping procedure is iteratively carried out until layer n}
\label{figurelabel}
\end{figure*}
begin 과 end의 figure 끝에 *만 넣어 주면 끝!!
==============================================================================
첫 단락 들여쓰기
전처리부 (\begin{document}) 이전에
\usepackage{indentfirst}
\parindent=1em
선언
==============================================================================
Latex 기호 삽입
기호를 삽입할때 주의 할점 !!!!
예를 들어서 gaussian에 sigma가 2 이다. 라는 것에서 sigma를 LATEX에 넣을때
그냥 \sigma 라고 하면 안되고 수학기호로 인식을 해줘야 하므로 양옆에 달러 표시를 넣어서 $\sigma$ 라고 해줘야 한다.
http://web.ift.uib.no/Teori/KURS/WRK/TeX/symALL.html
==============================================================================
Latex에 # 넣기
latex에 # 넣기는 그냥 넣으면 메크로 어쩌구 잡혀서 안된다. 넣는 방법은
\texttt{\#}
라고 하면됨.
==============================================================================
Latex의 equation 사용할 때 eqnarray에서 띄어쓰기하기
equation 내부에 글자를 작성할 때 그냥 작성하게 되면 띄어쓰기 없이 붙어서 나온다. latex 내에서 띄어쓴다고 해도 실제로 인쇄 되는 것은 붙어서 나온다. 이때 띄어쓰기를 해주기 위해서는 ~ 이 기호를 넣어주어야 한다.
ex) precision rate -> precision~rate
==============================================================================
Table이 page의 밖으로 나올경우 정리법.
우선 단순하게 전체 크기를 줄이는 방법으로 진행할 때
\scalebox{0.7}{ \begin{tabular} ... \end{tabular} }
Ref : http://www.ktug.org/xe/index.php?document_srl=206035&mid=KTUG_QnA_board
밑에 사진은 ref 링크에서 가져온건데 간단히 설명하자면 처리법!!
1. \usepackage{tabu} 를 상단에 삽입
2. \begin{tabu}{|X[c,m]|X[c,m]|X[c,m]|X[c,m]|}
\hline
& Sliding-window-based detection methods & Segmentation methods & Ours \\ \hline
Small rigid object & $Possible$ & $Impossible$ & $Possible$ \\ \hline
Geographic object & $Impossible$ & $Possible$ & $Possible$ \\ \hline
\end{tabu}
begin 에 기존에 있던 table이나 기타 등등을 tabu로 바꿔 준뒤에 옵션을 넣어준다.
기존과 동일한 포멧에서 강력한 지시자인 X를 사용해주면된다.
X에 들어가는 정렬 옵션은 아래 그림과 같다.
==============================================================================
Algorithm 삽입시
\usepackage[titlenumbered,ruled]{algorithm2e}
\begin{algorithm}[H]
\SetAlgoLined
\SetKwInOut{Input}{input}
\SetKwInOut{Output}{output}
\Input{A set of men $M$ such that for all $m \in M$, $m$ is free and has a preference list containing each woman $w \in W$ \newline
A set of women $W$ such that for all $w \in W$, $w$ is free and has a preference list containing each man $m \in M$}
\Output{A perfect matching between $M$ and $W$ with no strong instability}
initialization\;
\While{While condition}{
instructions\;
\eIf{condition}{
instructions1\;
instructions2\;
}{
instructions3\;
}
}
\caption{Min-Max searching}
\end{algorithm}