Using Latex for Chinese typography

Source: Internet
Author: User

Latex is a good thing, I hope you have. Installing CJK

Latex typography was originally designed for English typography and is not supported for Asian double-byte text, but Werner Lemberg has written CJK macro packages to support double-byte fonts. CJK is the abbreviation for Chinese (Chinese), Japanese (Japanese), and Korean (Korean) languages. The following is a brief description of the steps to install CJK under Windows environment. Download and install MiKTeX. Click here to download click "Start" – "All Programs" – "MiKTeX 2.9" – "Maintenance (Admin)" – "MiKTeX Settings (Admin)", this will bring up the Settings menu and select the "Packages" tab. In the left "MiKTeX Packages" directory tree, expand "Language support" and tick "Chinese Japanese Korean" to select all the subkeys below the directory entry. Click Apply to start the download. or click "Start Package Manager" to search for the three packages in the popup pack manager Note When downloading CJK, be sure to select the Chinese mirror , otherwise the download timeout will be disconnected.
Enable Font

This step is very important, before the landlord download installed CJK did not carry out this step, a variety of not compile successfully, will always prompt the source file not found , but after this step can be compiled successfully.

  Open Command Window cmd (execute as Administrator) "

  input:

 initexmf-u

  Wait a little while, let the command finish, and then enter:

  initexmf--edit-config-file updmap

  A notebook will appear, and we will enter the font to be enabled:

  map cwmu.map
  map cwku.map
  map cwfsu.map
  map cwhbu.map map
  Cwyu.map

  save, close, and then enter command in console:

  initexmf--mkmaps

  command is complete, you are done.
QuickStart
\documentclass[12pt]{article}
\USEPACKAGE{CJK}

\begin{document}
\begin{cjk*}{gb}{song}

This article uses the Chinese song body, this article uses Chinese song Ti characters.
{\cjkfamily{kai} This sentence is in Chinese italics.
The following sentence is still the Chinese song body.

\end{cjk*}
\end{document}

As can be seen in the above example, all Chinese are placed in the middle of \begin{cjk*}{gb}{...} and \end{cjk*} at the beginning of the file to add \USEPACKAGE{CJK}, if it is BIG5 encoding, only need to replace {GB} {Bg5}, Other compatible with Western Latex general template

A simple report template

\documentclass[a4paper, 11pt]{article}%%%%%% Import Package%%%%%% \usepackage{cjkutf8} \usepackage{graphicx} \usepackage[ Unicode]{hyperref} \usepackage{xcolor} \usepackage{cite} \usepackage{indentfirst}%%%%%% set font size%%%%%% \newcommand{\ Chuhao}{\fontsize{42pt}{\baselineskip}\selectfont} \newcommand{\xiaochuhao}{\fontsize{36pt}{\baselineskip}\ Selectfont} \newcommand{\yihao}{\fontsize{28pt}{\baselineskip}\selectfont} \newcommand{\erhao}{\fontsize{21pt}{\ Baselineskip}\selectfont} \newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}\selectfont} \newcommand{\sanhao }{\fontsize{15.75pt}{\baselineskip}\selectfont} \newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont} \ Newcommand{\xiaosihao}{\fontsize{12pt}{\baselineskip}\selectfont} \newcommand{\wuhao}{\fontsize{10.5pt}{\ Baselineskip}\selectfont} \newcommand{\xiaowuhao}{\fontsize{9pt}{\baselineskip}\selectfont} \newcommand{\liuhao} {\fontsize{7.875pt}{\baselineskip}\selectfont} \newcommand{\qihao}{\fontsize{5.25pt}{\baselineskip}\selectfont}

%%%% Set section property%%%% \makeatletter \renewcommand\section{\ @startsection {section}{1}{\z@}% { -1.5ex \ @plus-.5ex \ @minu S-.2ex}% {. 5ex \ @plus. 1ex}% {\normalfont\sihao\cjkfamily{hei}}} \makeatother%%%% set subsection properties%%%% \makeatletter \ Renewcommand\subsection{\ @startsection {subsection}{1}{\z@}% { -1.25ex \ @plus-.5ex \ @minus-.2ex}% {. 4ex \ @plus. 1ex}% { \normalfont\xiaosihao\cjkfamily{hei}}} \makeatother%%%% set subsubsection property%%%% \makeatletter \renewcommand\ Subsubsection{\ @startsection {subsubsection}{1}{\z@}% { -1ex \ @plus-.5ex \ @minus-.2ex}% {. 3ex \ @plus. 1ex}% {\ Normalfont\xiaosihao\cjkfamily{hei}}} \makeatother%%%% paragraph first line indent two words%%%% \makeatletter \let\ @afterindentfalse \@ Afterindenttrue \ @afterindenttrue \makeatother \setlength{\parindent}{2em}% Chinese indent two kanji bits%%%% the following command redefine the page margins so that they conform to the Chinese publication Habit Percent \addtolength{\topmargin}{-54pt} \setlength{\oddsidemargin}{0.63cm}% 3.17cm-1 inch \setlength{\evensidemargin}{\ Oddsidemargin} \setlength{\textwidth}{14.66cm} \setlength{\textheight}{24.00cm}% 24.62%%%% The following command sets the line spacing to the paragraph spacing%%%% \linespread{1.4}% \setlength{\parskip}{1ex} \setlength{\parskip}{0.5\ba             Selineskip}%%%% body start%%%% \begin{document} \begin{cjk}{utf8}{gbsn}%%%% theorem class environment definition%%%% \newtheorem{example}{Example} % overall number \newtheorem{algorithm}{algorithm} \newtheorem{theorem}{theorem}[section]% \newtheorem{definition}{definition by section number} \newthe orem{axiom}{axiom} \newtheorem{property}{Nature} \newtheorem{proposition}{proposition} \newtheorem{lemma}{lemma} \newtheorem{ corollary}{Inference} \newtheorem{remark}{annotations} \newtheorem{condition}{condition} \newtheorem{conclusion}{Conclusion} \newtheorem{ assumption}{hypothesis}%%%% redefine%%%% \renewcommand{\contentsname}{directory}% change contents to directory \renewcommand{\abstractname}{summary}% will Abst Ract to abstract \renewcommand{\refname}{reference}% change references to reference \renewcommand{\indexname}{index} \renewcommand{\figurename} {Figure} \renewcommand{\tablename}{table} \renewcommand{\appendixname}{Appendix} \renewcommand{\algorithm}{algorithm}%%%% define title format, including title , Author,affiliation,email and other%%%% \title{performance monitoring and tracking debugging tools in large-scale distributed system environment \ rSummary of results} \author{Fu Haiping \footnote{e-mail: haipingf@gmail.com, Study No.: 201128013229018}\\[2EX] \xiaosihao Institute of Computing Technology of CAS \\[2ex]} \
date{2012 May}%%%% The following sections are body text%%%% \maketitle \tableofcontents \newpage in this input body, both English and Chinese are available. \END{CJK} \end{document}

Pro-Test available Chinese templates can be accessed on my git https://github.com/whu-king/TexTemplate
More templates Visit Latex editorial site http://www.latexstudio.net/hulatex/templet/graduateThesis.htm problem Solving

! Argument of \cjk@xx have an extra}.
First make sure the curly brace {} is matched, and then look at \end{cjk*} or \END{CJK} There are no extra symbols, such as \ \ etc, to fragment directly empty line, not recommended to use \ \ If no longer, only with the last move, in \end{cjk*} before the command: \clearp Age

CJKCAPTAIN{GB} error
GB.CPX An error occurred, remove the line declaration , or download the full GB.CPX to replace the broken local gb.cpx.
Reference link http://www.newsmth.net/nForum/#!article/TeX/219410

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.