|
大小: 2384
备注:
|
大小: 7179
备注:
|
| 删除的内容标记成这样。 | 加入的内容标记成这样。 |
| 行号 1: | 行号 1: |
| LateX使用中文的方法: {{{#!latex |
* [[https://github.com/CTeX-org/lshort-zh-cn|The Not So Short Introduction To LaTeX]] * [[http://oz.nthu.edu.tw/~u9771040/TeX+LaTeX.pdf|排版軟件TeX/LaTeX入門]] by 罗玉文 * [[https://www.ctan.org/|The Comprehensive TeX Archive Network]] * [[https://www.andy-roberts.net/writing/latex|Getting to Grips with LaTeX]] * [[http://www.ctex.org/|科技排版系统]] * [[http://blog.sina.com.cn/s/blog_5e16f1770102f8kb.html|如何制作TeXmacs样式文件]] * [[http://theschemer.org/t/132|给 TeXmacs 的推荐信]] LateX使用中文的方法:一种方法是中文用gb编码,使用CJK宏包(在debian下需要安装cjk-latex包) {{{ |
| 行号 10: | 行号 19: |
| \author{czk \and 陈忠克} | \author{陈忠克} |
| 行号 14: | 行号 23: |
| 本文是为了学习Latex而做的测试文件。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长 \end{abstract} |
本文是为了学习Latex而做的测试文件。 \end{abstract} |
| 行号 38: | 行号 48: |
| 另一种方法是中文用utf8编码,使用ucs宏包(debian下要安装latex-ucs) {{{ \documentclass[a4paper,10pt]{article} \usepackage[nocjkgb]{ucs} \usepackage[utf8x]{inputenc} \usepackage[C10,T1]{fontenc} \newcommand\chinesesimptext[1]{\bgroup\fontencoding{C10}\fontfamily{song}\selectfont\SetUnicodeOption{cjkgb}#1\egroup} %opening \title{\chinesesimptext{陈忠克的文档}} \author{\chinesesimptext{陈忠克}} \begin{document} \maketitle \begin{abstract} \chinesesimptext{摘要} \end{abstract} \paragraph{段落} \chinesesimptext{中文} \chinesesimptext{中文} \end{document} }}} == 几段Latex的例子 == {{{ \documentclass[a4paper,10pt]{article} \usepackage[nocjkgb]{ucs} \usepackage[utf8x]{inputenc} \usepackage[C10,T1]{fontenc} \newcommand\chinesesimptext[1]{\bgroup\fontencoding{C10}\fontfamily{song}\selectfont\SetUnicodeOption{cjkgb}#1\egroup} %opening \title{\chinesesimptext{陈忠克的文档}} \author{\chinesesimptext{陈忠克}} \begin{document} \maketitle \begin{abstract} \chinesesimptext{摘要} \end{abstract} \paragraph{段落} \chinesesimptext{中文} \chinesesimptext{中文} \end{document} }}} {{{ \documentclass[a4paper,10pt,twocolumn]{article} \usepackage{CJK} \usepackage{pinyin} \begin{document} \begin{CJK}{GB}{kai} \title{测试文档} \author{陈忠克} \maketitle \tableofcontents \begin{abstract} 本文是为了学习Latex而做的测试文件。 \end{abstract} \section{这是一个section} 第一段内容是这样的。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长 \[y = \left\{ \begin{array}{ll} a & \textrm{if $d>c$}\\ b+x & \textrm{in the morning}\\ l & \textrm{all day long} \end{array} \right. \] 再来一段。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长 \section{这是另一个section} 第一段内容是这样的。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长 再来一段。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长 \end{CJK} \end{document} }}} {{{ \documentclass{article} \usepackage{CJK} \begin{document} \begin{CJK*}{GBK}{song} \title{输入输出} \author{czk} \maketitle \section{C语言} \subsection{scanf} \subsection{getchar} \subsection{gets} \subsection{fgets} \subsection{printf} \subsection{puts} \subsection{putchar} \section{C++语言} \subsection{cin} \subsection{cout} \section{例子} \subsection{遇到特定标志结束输入} \begin{verbatim} while( 1 ) { scanf("%d", &n); if( n == 0) break; // your algorithm goes here } \end{verbatim} \begin{verbatim} while(1) { cin >> n; if( n == 0) break; } \end{verbatim} \subsection{遇到EOF结束输入} \begin{verbatim} while(1) { if( scanf("%d", &n) == EOF ) break; // your algorithm goes here } \end{verbatim} \begin{verbatim} while(1) { int c = getchar(); if(c==EOF) break; } \end{verbatim} \begin{verbatim} while(cin>>n) { // your algorithm goes here } \end{verbatim} \begin{verbatim} while(1) { cin >> n >> m; if(cin.eof()) break; } \end{verbatim} \end{CJK*} \end{document} }}} |
排版軟件TeX/LaTeX入門 by 罗玉文
LateX使用中文的方法:一种方法是中文用gb编码,使用CJK宏包(在debian下需要安装cjk-latex包)
\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage{CJK}
\usepackage{pinyin}
\begin{document}
\begin{CJK}{GB}{kai}
\title{测试文档}
\author{陈忠克}
\maketitle
\tableofcontents
\begin{abstract}
本文是为了学习Latex而做的测试文件。
\end{abstract}
\section{这是一个section}
第一段内容是这样的。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长
\[y = \left\{ \begin{array}{ll}
a & \textrm{if $d>c$}\\
b+x & \textrm{in the morning}\\
l & \textrm{all day long}
\end{array} \right.
\]
再来一段。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长
\section{这是另一个section}
第一段内容是这样的。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长
再来一段。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长
\end{CJK}
\end{document}另一种方法是中文用utf8编码,使用ucs宏包(debian下要安装latex-ucs)
\documentclass[a4paper,10pt]{article}
\usepackage[nocjkgb]{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[C10,T1]{fontenc}
\newcommand\chinesesimptext[1]{\bgroup\fontencoding{C10}\fontfamily{song}\selectfont\SetUnicodeOption{cjkgb}#1\egroup}
%opening
\title{\chinesesimptext{陈忠克的文档}}
\author{\chinesesimptext{陈忠克}}
\begin{document}
\maketitle
\begin{abstract}
\chinesesimptext{摘要}
\end{abstract}
\paragraph{段落}
\chinesesimptext{中文}
\chinesesimptext{中文}
\end{document}
几段Latex的例子
\documentclass[a4paper,10pt]{article}
\usepackage[nocjkgb]{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[C10,T1]{fontenc}
\newcommand\chinesesimptext[1]{\bgroup\fontencoding{C10}\fontfamily{song}\selectfont\SetUnicodeOption{cjkgb}#1\egroup}
%opening
\title{\chinesesimptext{陈忠克的文档}}
\author{\chinesesimptext{陈忠克}}
\begin{document}
\maketitle
\begin{abstract}
\chinesesimptext{摘要}
\end{abstract}
\paragraph{段落}
\chinesesimptext{中文}
\chinesesimptext{中文}
\end{document}\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage{CJK}
\usepackage{pinyin}
\begin{document}
\begin{CJK}{GB}{kai}
\title{测试文档}
\author{陈忠克}
\maketitle
\tableofcontents
\begin{abstract}
本文是为了学习Latex而做的测试文件。
\end{abstract}
\section{这是一个section}
第一段内容是这样的。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长
\[y = \left\{ \begin{array}{ll}
a & \textrm{if $d>c$}\\
b+x & \textrm{in the morning}\\
l & \textrm{all day long}
\end{array} \right.
\]
再来一段。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长
\section{这是另一个section}
第一段内容是这样的。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长
再来一段。很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长
\end{CJK}
\end{document}\documentclass{article}
\usepackage{CJK}
\begin{document}
\begin{CJK*}{GBK}{song}
\title{输入输出}
\author{czk}
\maketitle
\section{C语言}
\subsection{scanf}
\subsection{getchar}
\subsection{gets}
\subsection{fgets}
\subsection{printf}
\subsection{puts}
\subsection{putchar}
\section{C++语言}
\subsection{cin}
\subsection{cout}
\section{例子}
\subsection{遇到特定标志结束输入}
\begin{verbatim}
while( 1 ) {
scanf("%d", &n);
if( n == 0) break;
// your algorithm goes here
}
\end{verbatim}
\begin{verbatim}
while(1) {
cin >> n;
if( n == 0) break;
}
\end{verbatim}
\subsection{遇到EOF结束输入}
\begin{verbatim}
while(1) {
if( scanf("%d", &n) == EOF ) break;
// your algorithm goes here
}
\end{verbatim}
\begin{verbatim}
while(1) {
int c = getchar();
if(c==EOF) break;
}
\end{verbatim}
\begin{verbatim}
while(cin>>n) {
// your algorithm goes here
}
\end{verbatim}
\begin{verbatim}
while(1) {
cin >> n >> m;
if(cin.eof()) break;
}
\end{verbatim}
\end{CJK*}
\end{document}