summaryrefslogtreecommitdiff
path: root/language/chinese/cjkpunct/setpunct
diff options
context:
space:
mode:
Diffstat (limited to 'language/chinese/cjkpunct/setpunct')
-rw-r--r--language/chinese/cjkpunct/setpunct/README.txt22
-rw-r--r--language/chinese/cjkpunct/setpunct/setpunct-macros.tex128
-rw-r--r--language/chinese/cjkpunct/setpunct/setpunct-main.tex30
3 files changed, 180 insertions, 0 deletions
diff --git a/language/chinese/cjkpunct/setpunct/README.txt b/language/chinese/cjkpunct/setpunct/README.txt
new file mode 100644
index 0000000000..69d79caba7
--- /dev/null
+++ b/language/chinese/cjkpunct/setpunct/README.txt
@@ -0,0 +1,22 @@
+修改 CJKpunct.spa
+
+ 打开文件 setpunct\setpunct-main.tex,
+
+ 1. 根据操作系统修改 \ghostscript 的定义
+
+ 2. 修改 \setpunctfamilies, 添加你所使用的CJKfamily
+
+ 3. 对于miktex, 运行
+
+ latex --enable-write18 setpunct-main
+
+ 对于texlive, 运行
+
+ latex --shell-escape setpunct-main
+
+ 4. 把文件 CJKpunct.spa 复制到 CJKpunct.sty 所在文件夹, 然后运行
+
+ Texhash
+
+ ------ 安装完成
+ \ No newline at end of file
diff --git a/language/chinese/cjkpunct/setpunct/setpunct-macros.tex b/language/chinese/cjkpunct/setpunct/setpunct-macros.tex
new file mode 100644
index 0000000000..2036a0878a
--- /dev/null
+++ b/language/chinese/cjkpunct/setpunct/setpunct-macros.tex
@@ -0,0 +1,128 @@
+\documentclass{article}
+\usepackage{CJK}
+\begin{document}
+\begin{CJK*}{GBK}{song}
+
+
+\makeatletter
+\pagestyle{empty}
+
+\def\puncts{ۣݣ}
+
+\bgroup
+\catcode`\%=11
+\catcode`\{=11
+\catcode`\}=11
+\catcode`\(=1
+\catcode`\)=2
+\catcode`\#=11
+\gdef\sharp(#)
+\global\def\percent(%)
+\global\def\lbrace({)
+\global\def\rbrace(})
+\egroup
+
+\newwrite\fdrubisha
+\newwrite\fdspa
+\newread\fdin
+
+\def\makefile@rubisha{
+\immediate\openout\fdrubisha=rubisha.tex\relax
+\immediate\write\fdrubisha{\string\documentclass{article}}
+\immediate\write\fdrubisha{\string\usepackage{CJK} }
+\immediate\write\fdrubisha{\string\textwidth 200pt }
+\immediate\write\fdrubisha{\string\textheight 200pt }
+\immediate\write\fdrubisha{\string\begin{document} }
+\immediate\write\fdrubisha{\string\begin{CJK*}{GBK}{song}}
+\immediate\write\fdrubisha{\string\makeatletter }
+\immediate\write\fdrubisha{\string\pagestyle{empty} }
+\immediate\write\fdrubisha{\string\def\string\punctlist\sharp1\sharp2\lbrace
+ \sharp1\sharp2\string\rule{0.5pt}{40pt}\string\newpage}
+\immediate\write\fdrubisha{\string\rule{0.5pt}{20pt}\sharp1\sharp2\string\newpage}
+\immediate\write\fdrubisha{\string\@ifnextchar[{\string\xeCJK@gobble@a}{\string\punctlist}\rbrace}
+\immediate\write\fdrubisha{}
+\immediate\write\fdrubisha{\string\def\string\xeCJK@gobble@a[]{} }
+\immediate\write\fdrubisha{}
+\immediate\write\fdrubisha{\string\CJKfamily{\CJKpunct@family}}
+\immediate\write\fdrubisha{\string\fontsize{100pt}{120pt}\string\selectfont}
+{
+\let\protect\@unexpandable@protect
+\immediate\write\fdrubisha{\string\punctlist\space\puncts []}
+}
+\immediate\write\fdrubisha{\string\newpage }
+\immediate\write\fdrubisha{\string\end{CJK*} }
+\immediate\write\fdrubisha{\string\end{document}}
+\immediate\closeout\fdrubisha\relax}
+
+
+
+\newcount\cnta
+\newcount\cntb
+
+\newcommand{\CJKpunctsetfamily}[1]{
+ \edef\CJKpunct@family{#1}
+ \makefile@rubisha
+ \immediate\write18{pdflatex rubisha}
+ \immediate\write18{\ghostscript}
+ \epstobbox
+ }
+
+\catcode`\%=11\relax
+
+\def\epstobbox{
+ \cntb=0
+ \def\CJKpunctspaces{}
+ \immediate\openin\fdin=rubishb.tex\relax
+ \ifeof\fdin
+ \@latex@error{setpunct: file rubishb.tex not found}{}\relax
+ \fi
+ \loop
+ \getxyspace
+ \edef\CJKpunctspaces{\CJKpunctspaces\temp@xspace,}
+ \getxyspace
+ \edef\CJKpunctspaces{\CJKpunctspaces\temp@xspace,}
+ \advance\cntb 1
+ \ifnum\cntb<35\repeat
+ \immediate\closein\fdin
+ \immediate\write\fdspa{\string\def\string\CJKpunct@\CJKpunct@family
+ @spaces{\CJKpunctspaces,,}\string\relax}}
+
+\def\getxyspace{
+ \read\fdin to\tempa
+ \edef\:{\tempa}
+ \expandafter\getleftupdimen\: {} %%BoundingBox: 1 1 0 0 \relax
+ \ifnum\temp@xwidth<0\relax
+ \read\fdin to\tempa
+ \edef\:{\tempa}
+ \expandafter\getleftupdimen\: {} %%BoundingBox: 1 1 0 0 \relax
+ \fi
+ \ifnum\temp@xwidth<1
+ \@latex@error{error in setting punct bbox \tempa}{}\relax
+ \fi
+ \cnta=-\temp@xwidth\relax
+ \advance\cnta 100\relax
+ \ifnum\cnta<0
+ \cnta=0\relax
+ \fi
+ \edef\temp@xspace{\the\cnta}}
+
+\long\def\getleftupdimen#1%%BoundingBox: #2 #3 #4 #5 {
+ \cnta=#4\relax
+ \advance\cnta -#2\relax
+ \edef\temp@xwidth{\the\cnta}
+ \cnta=#5\relax
+ \advance\cnta -#3\relax
+ \edef\temp@yheight{\the\cnta}
+ \gobblerest}
+
+\long\def\gobblerest#1\relax{}
+
+\immediate\openout\fdspa=CJKpunct.spa\relax
+
+\setpunctfamilies
+
+\immediate\closeout\fdspa
+\end{CJK*}
+\end{document}
+
+
diff --git a/language/chinese/cjkpunct/setpunct/setpunct-main.tex b/language/chinese/cjkpunct/setpunct/setpunct-main.tex
new file mode 100644
index 0000000000..d0937c6fb2
--- /dev/null
+++ b/language/chinese/cjkpunct/setpunct/setpunct-main.tex
@@ -0,0 +1,30 @@
+% Linux
+%
+%\def\ghostscript{gs -dBATCH -dEPSCrop -dNOPAUSE \space
+% -sDEVICE=bbox rubisha.pdf 2>rubishb.tex}
+
+% windows
+%
+\def\ghostscript{"gswin32c.exe -dBATCH -dEPSCrop -dNOPAUSE \space
+ -sDEVICE=bbox rubisha.pdf 2>rubishb.tex"}
+
+
+\def\setpunctfamilies{
+ \CJKpunctsetfamily{song}
+ \CJKpunctsetfamily{hei}
+ \CJKpunctsetfamily{fs}
+ \CJKpunctsetfamily{kai}
+ \CJKpunctsetfamily{you}
+ \CJKpunctsetfamily{li}
+}
+
+
+\input{setpunct-macros.tex}
+
+
+
+\endinput
+
+
+
+