latex在撰写科技论文、科技报告方面有着强大的优势,在撰写复杂的数学公式和作图方面都很方便,适合有一定代码经验的人使用。
一个框架:
\begin{document}
\begin{CJK*}{UTF8}{gbsn}
...........
\end{CJK*}
\end{document}
\textbf{}%文本黑体 mathbf{}%数学符号黑体 \limits_{i=1}^{n}%符号正上正下方 A_i^n%符号右下右上方
$(\mathbf{x}_j^i,y_j^i),j=1,...,n_i,\mathbf{x}_j^i \in R^d$
\begin{equation}
\label{eq:eqshort}
\begin{split}
\min\limits_{\{\mathbf{\Sigma_i}\},\mathbf{\Omega}} &\quad
\sum\limits_{i=1}^m\frac{2}{n_i(n_i-1)}\sum\limits_{j<k} g(y_{j,k}^i[1-||\mathbf{x}_j^i-\mathbf{x}_k^i||_{\mathbf{\Sigma}_i}^2)+\frac{\lambda_1}{2}\sum\limits_{i=1}^m||\mathbf{\Sigma}_i||_\mathbf{F}^2
\ &\quad+\frac{\lambda_2}{2}tr(\widetilde{\mathbf{\Sigma}}\mathbf{\Omega^{-1}}\widetilde{\mathbf{\Sigma}}^T)\ %&符号在这里用于对齐 \quad 多个空格
%tr(\Sigma\limits_^~\Omega_{-1}\Sigma^T\limits_^~)
\mathrm{s.t.} &\quad \mathbf{\Sigma} \succeq \mathbf{0}\forall i\ &\quad \widetilde{\mathbf{\Sigma}} = (vec(\mathbf{\Sigma}_1),...,vec(\mathbf{\Sigma}_m)) \ &\quad \mathbf{\Omega} = \mathbf{0} \ &\quad tr(\mathbf{\Omega}) = 1 \ \end{split}
\end{equation}
%-----------------------------------算法表格--------------------------------------------%
\begin{algorithm}
\caption{Online学习算法求解$\mathbf{\Sigma}_m$} \label{alg1}
\begin{algorithmic}
\STATE \textbf{输入}:带标签数据($\mathbf{x}_j^m,y_j^m$)(j=1m...,$n_m$), 矩阵$\mathbf{M},\lambda_1^{‘},\lambda_2^{‘}$,学习率$\eta$
\STATE \textbf{初始化}\quad$\mathbf{\Sigma}_m^{(0)}=\frac{\lambda_2^{‘}}{\lambda_1^{‘}}\mathbf{M}$;
\FOR{t=1,...,$T_{max}$\textbf{do}}
\STATE 从训练数据中随机得到一对数据点
$\{(\mathbf{x}_j^m,y_j^m),(\mathbf{x}_k^m,y_k^m)\}$;
计算y:如果$y_j^m=y_k^m$,y=1,否则y=-1;
\IF{$y(1-||\mathbf{x}_j^m-\mathbf{x}_k^m||_{\mathbf{\Sigma
}_m^{(t-1)}}^2) > 0$}
\STATE $\mathbf{\Sigma}_m^{(t)}=\mathbf{\Sigma}_m^{(t-1)}$;
\ELSIF {$y==-1$}
\STATE $\mathbf{\Sigma}_m^{(t)}=\mathbf{\Sigma}_m^{(t-1)}+\eta
(\mathbf{x}_j^m-\mathbf{x}_k^m)(\mathbf{x}_j^m-\mathbf{x}_k^m)^T$
\ELSE
\STATE $\mathbf{\Sigma}_m^{(t)}=\pi_{s_{+}}(\mathbf{\Sigma}_m^{(t-1)}-\eta
(\mathbf{x}_j^m-\mathbf{x}_k^m)(\mathbf{x}_j^m-\mathbf{x}_k^m)^T)$
\ENDIF
\ENDFOR
\end{algorithmic}
\end{algorithm}
%-------------------实验表格-------------------------------------------------%
\begin{table}
\centering
\caption{红酒作为源数据,白酒作为目标数据}
\begin{tabular}{c|c|c|c|c} \hline
{}%空 & \textbf{5\%} & \textbf{10\%} & \textbf{15\%} & \textbf{20\%} \ \hline
RDML & 40.55\% & 41.32\%
& 40.66\% & 42.26\% \ \hline
TML & 42.10\% & 43.29\% & 43.46\% & 44.47\% \\ \hline
\end{tabular}
\label{classNumOne}
\end{table}
%------------------这是一个带括号的矩阵模板-------------------%
\left(
\begin{array}{lcr}
\frac{1-\omega}{m-1}\mathbf{I}_{m-1} & \omega_m\ \omega_m^T & \omega
\end{array}
\right)\\
%------------------------------------------参考文献-----------------------------------%
\begin{thebibliography}{3}
\addtolength{\itemsep}{-0.7em}
\urlstyle{rm}
\bibitem{1} R. Jin, S. Wang, and Y. Zhou. Regularized distance metric learning: Theory and algorithm. In Y. Bengio, D. Schuurmans, J. Lafferty, C. K. I. Williams, and A. Culotta, editors, Advances in Neural Information Processing Systems 22, pages 862–870, Vancouver, British Columbia, Canada, 2009.
\bibitem{2} W. Kienzle and K. Chellapilla. Personalized handwriting recognition via biased regularization. In Proceedings of the Twenty-Third International Conference on Machine Learning, pages 457–464, 2006.
\bibitem{3} E. P. Xing, A. Y. Ng, M. I. Jordan, and S. J.Russell. Distance metric learning with application to clustering with side-information. In S. Becker, S. Thrun, and K. Obermayer, editors, Advances in Neural Information Processing Systems 15, pages 505–512, Vancouver, British Columbia, Canada, 2002.
\end{thebibliography}
原文:http://blog.csdn.net/u010367506/article/details/24886737