Latex CJK,tex使用中文

时间:2021-12-21 06:03:23

关于CJK

CJK 是中文(Chinese)、日文(Japanese)、韩文(Korean)三国文字的缩写。顾名思义,它能够支持这三种文字。实际上,CJK 能够支持在 LaTeX 中使用包括中文、日文、韩文在内的多种亚洲双字节文字。
(转载请标注:源自; Phodal's Blog )

关于TEX

TEX(正式写法TEX希腊语/tɛx/,在英语中常用 /ˈtɛk/ ,音译“泰赫”),是一个由美国计算机教授高德纳Donald Ervin Knuth)编写的功能强大的排版软件。它在学术界十分流行,特别是数学物理学计算机科学界。TEX被普遍认为是一个优秀的排版工具,特别是在处理复杂的数学公式时。利用诸如是LaTeX等终端软件,TEX就能够排版出精美的文本

Windows上使用

建议使用texlive或者是国内用得比较多的,比较适合国人使用的CTEX。可以少去很多痛苦同时记得安装上cjk包。

openSUSE上使用

需要用zypper安装包,比如
zypper install latex-cjk

使用方法

示例程序:

% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode

% This is a simple template for a LaTeX document using the "article" class.
% See "book", "report", "letter" for other types of document.

\documentclass[11pt]{article} % use larger type; default would be 10pt

\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)

%%% Examples of Article customizations
% These packages are optional, depending whether you want the features they provide.
% See the LaTeX Companion or other references for full information.

%%% PAGE DIMENSIONS
\usepackage{geometry} % to change the page dimensions
\geometry{a4paper} % or letterpaper (US) or a5paper or....
% \geometry{margin=2in} % for example, change the margins to 2 inches all round
% \geometry{landscape} % set up the page for landscape
%   read geometry.pdf for detailed page layout information
\marginparsep = 7pt
\usepackage{graphicx} % support the \includegraphics command and options

% \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent

%%% PACKAGES
\usepackage{booktabs} % for much better looking tables
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
% These packages are all incorporated in the memoir class to one degree or another...

%%% HEADERS & FOOTERS
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0pt} % customise the layout...
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}
\graphicspath{{dot/}}

%%% SECTION TITLE APPEARANCE
\usepackage{sectsty}
\allsectionsfont{\sffamily\mdseries\upshape} % (See the fntguide.pdf for font help)
% (This matches ConTeXt defaults)

%%% ToC (table of contents) APPEARANCE
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
\usepackage[titles,subfigure]{tocloft} % Alter the style of the Table of Contents
\usepackage{CJK}

\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!

%%% END Article customizations

%%% The "real" document content comes below...

\title{}
\author{2Gether }

\date{1 28,2013} % Activate to display a given date or no date (if empty),
         % otherwise the current date is printed 

\begin{document}
\begin{CJK*}{UTF8}{gbsn}
\maketitle
\newpage
\renewcommand\abstractname{}
\begin{abstract}
content...
\end{abstract}
\newpage
\renewcommand\contentsname{目录}
\tableofcontents
\newpage


\section{开始之前}

\subsection{所需如下}
\large 需要准备的材料有以下:
\begin{itemize}
\item{服务器 (Linux)}
\end{itemize}
\large 其中涉及到的软件及开发环境
\begin{enumerate}
\item{Eclipse}
\item{Vim/Emacs}
\item{其他适合的文本编辑器} 
\end{enumerate}
\large 使用到以下语言但不限于此
\begin{itemize}
\item{C/C++}
\item{Processing}
\item{Python}
\item{Javascript}
\item{HTML/CSS}
\item{Shell}
\item{Java}
\item{SQL}
\end{itemize}

\large 关于服务器,
\begin{itemize}
\item{uWSGI}
\item{Django}
\item{Nginx}
\item{Centos}
\item{Mysql}
\end{itemize}

\newpage
\subsection{材料准备}
\section{fd}
\includegraphics{dot.eps}

\end{CJK*}
\end{document}

需要注意的是

这里可能用的是:
\begin{CJK*}{UTF8}{gbsn}