用latex写一篇简单文章

Reading time ~2 minutes

基本元素

文章类型——最基本的内容

    \documentclass{article}
    \begin{document}
    Hello, world!
    \end{document}

作者、标题、日期——制作标题页

    \title{hello,world!}
    \author{frank weapon}
    \date{\today}
    \begin{document}
    \maketitle
    hello,world!
    \end{document}

章节、段落——组织文章内容

    \begin{document}
    \maketitle
    \section{hello programming language}
    \subsection{hello java}
    \paragraph{java} is a OO language
    \paragraph{java} is a powerful language
    \subsubsection{hello spring}
    \subsubsection{hello struts}
    \subsection{hello ruby}
    \end{document}

目录——整理章节标题

    \begin{document}
    \maketitle
    \tableofcontents
    ...
    \end{document}

版面设置

页边距——利用好页面

    \documentclass{article}
    \usepackage{geometry}
    \geometry{papersize={20cm,15cm}}
    \geometry{left=1cm,right=2cm,top=3cm,bottom=4cm}
    \begin{document}
    Hello, world!
    \end{document}

页眉、页脚——有地方显示页标、作者、日期

    \documentclass{article}
    \usepackage{fancyhdr}
    \pagestyle{fancy}
    \lhead{head left}
    \chead{head center}
    \rhead{head right}
    \lfoot{}
    \cfoot{\thepage}
    \rfoot{}
    \begin{document}
    Hello, world!
    \end{document}

间距——合理调整页面

    %paragraph indentation
    \setlength{\parindent}{4em}
    %paragraph spacing
    \setlength{\parskip}{1em}
    %Line spacing
    \renewcommand{\baselinestretch}{1.5}

插入内容

插入图片——自动编号你的图例

    \begin{figure}[h]
      \centering
      \includegraphics[width=0.8\textwidth]{figure/fig1}
      \caption{demo figure}
      \label{figure demo}
    \end{figure}

插入表格——用代码画出表格

    \begin{table}[h]
    \begin{center}
    \caption{demo table}
    \label{table demo}
    \begin{tabular}{| l | l | l |}
    \hline
    00 & 01 & 02\\
    \hline
    10 & 11 & 12\\
    \hline
    20 & 21 & 22\\
    \hline
    \end{tabular}
    \end{center}
    \end{table}

插入列表——格式化你的内容

    \begin{itemize}
    \item one demo item
    \item another demo item
    \end{itemize}

插入公式——编辑复杂的数学内容

    \documentclass{article}
    \usepackage{amsmath}
    \begin{document}
    Hello, Math !
    $...$ % inline
    \[ .. \] % between two lines
    \begin{equation} % numbered equation between lines\end{equation}
    \end{document}

Hadoop-事件处理机制

- TOC{:toc}# Hadoop中的事件总线之前的文章[Hadoop状态机介绍](http://frankweapon.github.io/Hadoop-MapReduce状态机分析/)提到整个Hadoop的调度由状态机来控制,而驱动状态机变迁的则是事件。这里给出Ha...… Continue reading

Hadoop-MapReduce状态机分析

Published on March 17, 2017

Actor Model (参与者模式)思想与实例

Published on March 15, 2017