summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xtuthesis/body/elements.tex
blob: 7e00a1b43ec6839429934a99fa5077a6778f5983 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
\chapter{图表,伪代码,公式相关排版}\label{elements}

\section{图的排版}
论文没图谁爱看呀!且看咱导言区不是已经加了``\\graphicspath{{figures/}}''吗?没错,
你要做的就是把你的图放到``figures''文件夹下面。

\subsection{单图}
单图排版很简单。

\begin{figure}[!htb]
\centering
\begin{minipage}[t]{\oneimage}
\centering
\includegraphics[width=\oneimage]{Correct_Ratio}
\end{minipage}
\caption{The ratios between the sizes of $\bm{R}$, $\bm{C}$ and their maximal possible sizes during the attack with three pairs of plain-images,
where $k^*$ denotes the index of the attacking steps.}
\label{fig:ratio}
\end{figure}

\subsection{多图}
多图排版很简单。

\begin{figure}[!htb]
\centering
\begin{minipage}[t]{\twoimage}
\centering
\includegraphics[width=\twoimage]{Lenna}
a)
\end{minipage} \hspace{4pt}
\begin{minipage}[t]{\twoimage}
\centering
\includegraphics[width=\twoimage]{Lenna_e}
b)
\end{minipage}
\caption{A pair of plain-image and the corresponding cipher-image:
a) image ``Lenna''; b) cipher-image of a).}
\label{fig:APairPlaintext}
\end{figure}

\section{表格}
看个例子就好了。

\begin{table}[!htb]
\centering
\caption{Blocking sizes for plain-image of size $256\times 256$.}
\label{tb:blocksize}
\begin{tabular}{c|ccc}  \hline
\backslashbox{ $q_1$ }{ $q_2$ }    & 0      & 1       & 2       \\ \hline
  0 & (8,8)  & (8,16)  & (8,32)  \\
  1 & (16,8) & (16,16) & (16,32) \\
  2 & (32,8) & (32,16) & (32,32) \\ \hline
\end{tabular}
\end{table}

\section{伪代码}
伪代码排版使用的是这方面最新的包algorithm2e,我们来看看算法\ref{qsort}(更多样例请google``algorithm2e''):

\begin{algorithm}[H]\label{qsort}
    \SetAlgoLined
    \KwData{this text}
    \KwResult{how to write algorithm with \LaTeX2e }
    initialization\;
    \While{not at end of this document}{
        read current\;
        \eIf{understand}{
            go to next section\;
            current section becomes this one\;
        }{
            go back to the beginning of current section\;
        }
    }
    \caption{How to write algorithms}
\end{algorithm}

\section{公式排版}
论文没公式的话,难道你在写散文?
已知$a+b=c$,那么

\begin{equation*}\label{eq:aplusb}
  a=c-b.
\end{equation*}

来看公式\ref{eq:aplusb}:

\begin{equation}\label{eq:amultib}
  a*b=c.
\end{equation}