[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 轉問:[Latex]關¤_\begin{CJK}{GBK}和\begin{document}的順



On Sat, Jun 02, 2001 at 03:22:54PM +0800, Adoal Xu wrote:
> 發信人: seki (石頭長大了還是石頭), 信區: Chinese
> 標  題: [Latex]關于\begin{CJK}{GBK}和\begin{document}的順
> 發信站: BBS 水木清華站 (Sat Jun  2 13:48:21 2001)
> 
> 要想得到中文支持,我使用的CJK
> 一般來說先用
> \begin{document}
> \begin{CJK}{GBK}
> ....
> \end{CJK}
> \end{document}
> 現在的問題是如果我想用fancy來加頁眉頁腳,而且想在頁眉頁腳中使用中文。
> 這時\pagestyle{fancy}以及諸如\fancyhead{}等好像都應該用在\begin{document}之前
> 。之後我試過不行的。
> 但是為了支持中文,就得把\begin{CJK}{GBK}放到他們之前。
> 這是就出現的一個問題,結尾就應該是
> \end{document}
> \end{CJK}
> 編譯的時候到了\end{document}就出了一個錯,然而我回車,仍然有結果。

當然有問題啦! \end{document} 之後不可以再加東西的了。

> 請問大蝦,這個問題應該怎麼處理?
> 謝謝

注意以下幾點:

  1. 你可以多次使用 \begin{CJK}{GBK}{字體}....\end{CJK},
     沒有人說你只能用 \begin{CJK}{GBK}{字體} 一次。 ;-)

  2. \begin{CJK}... 在 preamble 裡 (即是 \begin{document} 之前) 也可以用。

  3. 如果你喜歡,fancy header 的定義可以放在 \begin{document} 之後。

我剛剛興起,就跟 CJK 玩了一會兒,終于記起怎樣加中文的頁首、頁尾了。 :-)
附了一份范例文檔,歡迎隨便玩。 :-)

					東東

-- 
Anthony Fok Tung-Ling                Civil and Environmental Engineering
foka@ualberta.ca, foka@debian.org    University of Alberta, Canada
   Debian GNU/Linux Chinese Project -- http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp -- http://www.olvc.ab.ca/

-- 
| This message was re-posted from debian-chinese-gb@lists.debian.org
| and converted from gb2312 to big5 by an automatic gateway.
\documentclass[12pt]{article}
\usepackage{CJK,CJKnumb}
\usepackage{fancyhdr}

% 如何配合 CJK 使用中文的 fancy header?
%
% 以下的范例是其中一个方法。CJK 这个环境可以在 preamble 里使用,
% 但要记得在 \begin{document} 之前关掉,之后可以再另外打开一个
% 新的 CJK 环境。
%
% 另一个重点是在文档末端,未退出 CJK 环境以前,必须加个 \newpage,
% 否则 LaTeX 将会尝试在 CJK 环境以外排版 header/footer 的中文字,
% 那样就出问题了。

\begin{CJK*}{GB}{song}
\lhead{\small 漫谈~glibc-2.2~中文化}
\rhead{\small Debian~中文计划}
\cfoot{\small 第\CJKnumber{\thepage}页}
\rfoot{\footnotesize 第~\thepage~页}
\end{CJK*}

\pagestyle{fancy}

\begin{document}

\begin{CJK*}{GB}{song}

这是我的~CJK for \LaTeX{}~中文测试。也看看~\verb|\emph{|\emph{着重}\verb|}|~%
和~\verb|\textbf{|\textbf{粗体}\verb|}|~在~Debian~上配合~pdf\LaTeX{}~的效果。

\newpage

且看第二页如何?~:-)

欢迎参观~Debian~中文计划的网页:~http://www.cn.debian.org/intl/zh/。;
感谢“中国~Linux~论坛”提供~Debian~在中国大陆的官方网站。

\newpage

\end{CJK*}

\end{document}

Reply to: