LaTeX新人チュートリアル、30分全く知らないから基本入門まで

7279 ワード

参考記事:LaTeX新人チュートリアル、30分全く知らないから基本入門
0.マクロパッケージ
  • 数式を編集するマクロパッケージ:usepackage{amsmath}およびusepackage{amssymb}
  • 数学の定理と証明プロセスを編集するマクロパッケージ:usepackage{amsthm}
  • 挿入画像のマクロパッケージ:usepackage{graphicx}
  • 複雑なテーブルのマクロパッケージ:usepackage{multirow}
  • 1.最初の文書
    WinEdt(Windowsユーザー、Linuxユーザー:texmaker)を開き、新しいドキュメントを作成し、以下の内容をドキュメントにコピーして保存し、保存タイプをUTF-8に選択します.
    \documentclass{article}
    \begin{document}
    hello world!
    \end{document}

    次にWinEdtのツールバーでコンパイルボタン(ゴミ箱とアルファベットBの間)を見つけ、ドロップダウンメニューでXeTeXを選択し、コンパイルをクリックします.うまくいけば、最初のpdfファイルをスムーズに生成することができ、ツールバーの拡大鏡ボタンをクリックすると、生成したpdfファイルをすばやく開くことができます.
    2.タイトル、作成者、コメント
    新しいドキュメントを作成し、以下の内容をドキュメントにコピーして保存し、保存タイプをUTF-8として選択し、現象をコンパイルして観察します.
    \documentclass{article}
    \author{zhang}
    \title{The title}
    \begin{document}
    \maketitle
    hello world! % this is comment
    \end{document}

    3.章と段落
    新しいドキュメントを作成し、以下の内容をドキュメントにコピーして保存し、保存タイプをUTF-8として選択し、現象をコンパイルして観察します.
    \documentclass{article}
    \title{Hello world}
    
    \begin{document}
    	\maketitle
    	\section{Hello China} China is in East Asia.
    		\subsection{Hello Beijing} Beijing is the capital of China.
    			\subsubsection{Hello Dongcheng District} 
    				\paragraph{Tian'anmen Square} is in the center of Beijing.
    					\subparagraph{Chairman Mao} is in the center of Tian'anmen Square.
    		\subsection{Hello Guangzhou}
    				\paragraph{Sun Yat-sen University} is the best university of Guangzhou.
    \end{document}

    4.ディレクトリへの参加
    \tableofcontents
    \documentclass{article} 
    \begin{document} 
      \tableofcontents 
      \section{Hello China} China is in East Asia. 
        \subsection{Hello Beijing} Beijing is the capital of China. 
          \subsubsection{Hello Dongcheng District} 
            \paragraph{Hello Tian'anmen Square}is in the center of Beijing 
              \subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square 
    \end{document} 

    5.画像を挿入
    まず、画像をepsファイルに変換するソフトウェアを検索し、簡単に探し、figure 1のような名前に保存します.eps. 新しいドキュメントを作成し、以下の内容をドキュメントにコピーして保存し、保存タイプをUTF-8として選択し、画像ファイルと同じフォルダに配置し、現象をコンパイルして観察します.
    \documentclass{article} 
      \usepackage{graphicx} 
    \begin{document} 
      \includegraphics[width=4.00in,height=3.00in]{figure1.eps} 
    \end{document} 

    6.簡単な表
    新しいドキュメントを作成し、以下の内容をドキュメントにコピーして保存し、保存タイプをUTF-8として選択し、現象をコンパイルして観察します.
    
    \documentclass{article} 
    \begin{document} 
      \begin{tabular}{|c|c|} 
        a & b \\ 
        c & d\\ 
      \end{tabular} 
    
      \begin{tabular}{|c|c|} 
        \hline 
        a & b \\ 
        \hline 
        c & d\\ 
        \hline 
      \end{tabular} 
    
      \begin{center} 
        \begin{tabular}{|c|c|} 
          \hline 
          a & b \\ \hline 
          c & d\\ 
          \hline 
        \end{tabular} 
      \end{center} 
    \end{document} 

    7.中国語の問題
    \documentclass[nofonts]{ctexart}
    \setCJKmainfont[ItalicFont={AR PL UKai CN}]{AR PL UMing CN} %        
    \setCJKsansfont{WenQuanYi Zen Hei} %                  
    \setCJKmonofont{WenQuanYi Zen Hei Mono} %                    
    \begin{document}
      ,\LaTeX!
    \end{document}