summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/generic/upzhkinsoku/README.txt17
-rw-r--r--Master/texmf-dist/doc/generic/upzhkinsoku/upzhkinsoku-doc.pdfbin0 -> 203515 bytes
-rw-r--r--Master/texmf-dist/doc/generic/upzhkinsoku/upzhkinsoku-doc.tex82
-rw-r--r--Master/texmf-dist/tex/generic/upzhkinsoku/upzhkinsoku.sty165
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check2
-rw-r--r--Master/tlpkg/tlpsrc/collection-langchinese.tlpsrc1
-rw-r--r--Master/tlpkg/tlpsrc/upzhkinsoku.tlpsrc0
7 files changed, 266 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/generic/upzhkinsoku/README.txt b/Master/texmf-dist/doc/generic/upzhkinsoku/README.txt
new file mode 100644
index 00000000000..f50ea10413e
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/upzhkinsoku/README.txt
@@ -0,0 +1,17 @@
+
+
+The upzhkinsoku package --- Supplementary Chinese kinsoku for Unicode *pTeX
+
+CTAN Homepage: https://ctan.org/pkg/upzhkinsoku
+
+Repository: https://github.com/Man-Ting-Fang/upzhkinsoku
+
+Version: 2017-09-02 v0.2
+
+Copyright 2017 Yue ZHANG
+
+License: Knuth License (https://ctan.org/license/knuth)
+
+This package provides supplementary Chinese kinsoku (line breaking rules etc.)
+settings for Unicode (e-)upTeX ((e-)upTeX when using Unicode as its internal
+encoding) and ApTeX. Both LaTeX and plain TeX are supported.
diff --git a/Master/texmf-dist/doc/generic/upzhkinsoku/upzhkinsoku-doc.pdf b/Master/texmf-dist/doc/generic/upzhkinsoku/upzhkinsoku-doc.pdf
new file mode 100644
index 00000000000..141a54f995e
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/upzhkinsoku/upzhkinsoku-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/upzhkinsoku/upzhkinsoku-doc.tex b/Master/texmf-dist/doc/generic/upzhkinsoku/upzhkinsoku-doc.tex
new file mode 100644
index 00000000000..6296b86a581
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/upzhkinsoku/upzhkinsoku-doc.tex
@@ -0,0 +1,82 @@
+
+
+% upzhkinsoku-doc.tex
+
+% !TeX encoding = UTF-8
+% !TeX program = pdfLaTeX
+
+\RequirePackage{fix-cm}
+
+\documentclass[a4paper]{article}
+
+\usepackage[OT1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[UKenglish]{babel}
+\usepackage[babel]{microtype}
+\usepackage{etoolbox}
+
+\AtBeginEnvironment{verbatim}{\microtypesetup{activate=false}}
+
+\newcommand\NormalSans{\normalfont\sffamily}
+\newcommand\pkg[1]{{\protect\NormalSans#1}}
+
+\newcommand\pTeX{p\kern-0.15em\TeX}
+\newcommand\e{\ensuremath{\varepsilon}}
+\newcommand\upTeX{u\pTeX}
+\newcommand\ApTeX{A\kern-0.1em\pTeX}
+
+\newcommand\kn{test}
+\newcommand\sk{test}
+
+\font\kn=ipxm-r-u79 at 9.62216pt
+\font\sk=ipxm-r-u52 at 9.62216pt
+
+\begin{document}
+
+\title{The \pkg{upzhkinsoku} package%
+ \thanks{CTAN Homepage: \texttt{https://ctan.org/pkg/upzhkinsoku}}
+ \thanks{Repository: \texttt{https://github.com/Man-Ting-Fang/upzhkinsoku}}}
+\author{Yue \textsc{Zhang}}
+\date{2017-09-02\quad v0.2}
+
+\maketitle
+
+\begin{abstract}
+This package provides supplementary Chinese kinsoku (line breaking rules etc.)
+settings for Unicode (\e-)\upTeX\footnote{(\e-)\upTeX\ when using Unicode as its
+internal encoding.} and \ApTeX.
+\end{abstract}
+
+\section{Introduction}
+
+\textit{Kinsoku} is the romanisation of the Japanese word ``{\kn\char"81\relax
+\sk\char"47}'' which means ``prohibition rules''. It is a set of rules to avoid
+prohibited line breaks in CJK typography, such as ``line-start prohibition
+rules'', ``line-end prohibition rules'', inseparable or unbreakable character
+sequences and so on.\footnote{\textit{Requirements for Japanese Text Layout}:
+\texttt{https://www.w3.org/TR/jlreq/}}
+
+(\e-)\upTeX\ and \ApTeX's default kinsoku parameters are set in
+\verb|ukinsoku.tex|. However, the default settings do not satisfy Chinese
+typesetting,\footnote{\textit{Requirements for Chinese Text Layout}:
+\texttt{https://www.w3.org/TR/clreq/}} thus this package provides supplementary
+Chinese kinsoku settings for Unicode (\e-)\upTeX\ and \ApTeX.
+
+Please note that this package is specifically optimised for Chinese typesetting,
+so it is usually not suitable for document whose main language is not Chinese.
+
+\section{Usage}
+
+This package has no options, just load it as usual:
+\begin{itemize}
+\item \LaTeX: \verb|\usepackage{upzhkinsoku}|
+\item Plain \TeX: \verb|\input upzhkinsoku.sty|
+\end{itemize}
+If you are using \LaTeX\ and would like to change some kinsoku parameters (this
+is usually unnecessary, however), please do that after \verb|\begin{document}|,
+or via \verb|\AtBeginDocument| after loading this package; otherwise they may be
+overridden.\footnote{For technical reasons, the actual execution of this package
+is delayed to \texttt{\char"5C begin\char"7B document\char"7D}, also via
+\texttt{\char"5C AtBeginDocument}.}
+
+\end{document}
diff --git a/Master/texmf-dist/tex/generic/upzhkinsoku/upzhkinsoku.sty b/Master/texmf-dist/tex/generic/upzhkinsoku/upzhkinsoku.sty
new file mode 100644
index 00000000000..0445587214c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/upzhkinsoku/upzhkinsoku.sty
@@ -0,0 +1,165 @@
+
+
+% upzhkinsoku.sty
+% Copyright 2017 Yue ZHANG
+% License: Knuth License (https://ctan.org/license/knuth)
+
+\csname ENDINPUTUPZHKINSOKUDOTSTY\endcsname
+
+\let\ENDINPUTUPZHKINSOKUDOTSTY=\endinput
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname ProvidesPackage\endcsname\relax
+ \else
+ \ProvidesPackage{upzhkinsoku}[2017/09/02 v0.2
+ Supplementary Chinese kinsoku for Unicode *pTeX]%
+ \fi
+
+\edef\UPZHKINSOKUDOTSTYRESTORECATCODE{%
+ \catcode`\noexpand\@=\the\catcode`\@\relax}
+
+\catcode`\@=11\relax
+
+\def\upzhkinsoku@ifprimitive#1{%
+ \begingroup
+ \edef\upzhkinsoku@temp@meaning{\meaning#1}%
+ \edef\upzhkinsoku@temp@string{\string#1}%
+ \expandafter
+ \endgroup
+ \ifx\upzhkinsoku@temp@meaning\upzhkinsoku@temp@string}
+
+\upzhkinsoku@ifprimitive\ucs
+\else
+ \errmessage{upTeX / e-upTeX / ApTeX is required}%
+ \UPZHKINSOKUDOTSTYRESTORECATCODE
+ \expandafter\endinput
+\fi
+
+\ifnum\ucs"3000="3000\relax
+\else
+ \errmessage{Unicode upTeX / Unicode e-upTeX / ApTeX is required}%
+ \UPZHKINSOKUDOTSTYRESTORECATCODE
+ \expandafter\endinput
+\fi
+
+\def\upzhkinsoku@setpenalties{%
+ \postbreakpenalty`\#=10000\relax % U+0023
+ \postbreakpenalty"24=10000\relax % U+0024 ($; variable slot)
+ \prebreakpenalty`\%=10000\relax % U+0025
+ \prebreakpenalty`\&=10000\relax % U+0026
+ \prebreakpenalty`\*=10000\relax % U+002A
+ \prebreakpenalty"2B=10000\relax % U+002B (+; \+ is \outer in plain.tex)
+ \prebreakpenalty`\/=10000\relax % U+002F
+ \prebreakpenalty`\==10000\relax % U+003D
+ \postbreakpenalty`\@=10000\relax % U+0040
+ \prebreakpenalty`\^=10000\relax % U+005E
+ \prebreakpenalty`\~=10000\relax % U+007E
+ \postbreakpenalty`〚=10000\relax % U+301A
+ \prebreakpenalty`〛=10000\relax % U+301B
+ \prebreakpenalty"B7=10000\relax % U+00B7 (·; variable slot)
+ \prebreakpenalty`•=10000\relax % U+2022
+ \prebreakpenalty`‧=10000\relax % U+2027
+ \prebreakpenalty`‐=10000\relax % U+2010
+ \prebreakpenalty`–=10000\relax % U+2013
+ \prebreakpenalty`-=10000\relax % U+FF0D
+ \prebreakpenalty`…=0\relax % U+2026
+ \prebreakpenalty`‥=0\relax % U+2025
+ \prebreakpenalty`/=10000\relax % U+FF0F
+ \prebreakpenalty`~=10000\relax % U+FF5E
+}
+\def\upzhkinsoku@setxspcodes{%
+ \xspcode`\!=2\relax % U+0021
+ \xspcode`\#=1\relax % U+0023
+ \xspcode"24=1\relax % U+0024 ($; variable slot)
+ \xspcode`\%=2\relax % U+0025
+ \xspcode`\&=3\relax % U+0026
+ \xspcode`\:=2\relax % U+003A
+ \xspcode`\?=2\relax % U+003F
+ \xspcode`\@=1\relax % U+0040
+}
+\def\upzhkinsoku@setinhibitxspcodes{%
+ \inhibitxspcode`〚=2\relax % U+301A
+ \inhibitxspcode`〛=1\relax % U+301B
+ \inhibitxspcode"B7=0\relax % U+00B7 (·; variable slot)
+ \inhibitxspcode`•=0\relax % U+2022
+ \inhibitxspcode`‧=0\relax % U+2027
+ \inhibitxspcode`・=0\relax % U+30FB
+ \inhibitxspcode`:=1\relax % U+FF1A
+ \inhibitxspcode`!=1\relax % U+FF01
+ \inhibitxspcode`‐=0\relax % U+2010
+ \inhibitxspcode`–=0\relax % U+2013
+ \inhibitxspcode`⸺=0\relax % U+2E3A
+ \inhibitxspcode`-=0\relax % U+FF0D
+ \inhibitxspcode`‥=0\relax % U+2025
+ \inhibitxspcode`/=0\relax % U+FF0F
+}
+
+\def\upzhkinsoku@setwith@ascii{% variable slots
+ \prebreakpenalty"3C=10000\relax % <
+ \prebreakpenalty"3E=10000\relax % >
+ \prebreakpenalty"5C=10000\relax % \
+ \prebreakpenalty"5F=10000\relax % _
+ \postbreakpenalty"7B=10000\relax % {
+ \prebreakpenalty"7C=10000\relax % |
+ \prebreakpenalty"7D=10000\relax % }
+ \xspcode"22=0\relax % "
+ \xspcode"3C=0\relax % <
+ \xspcode"3E=0\relax % >
+ \xspcode"5C=0\relax % \
+ \xspcode"7B=1\relax % {
+ \xspcode"7D=2\relax % }
+}
+\def\upzhkinsoku@setwith@otlatin{% variable slots
+ \postbreakpenalty"3C=10000\relax % ¡
+ \postbreakpenalty"3E=10000\relax % ¿
+ \postbreakpenalty"5C=10000\relax % “
+ \prebreakpenalty"5F=0\relax % ˙
+ \prebreakpenalty"7B=10000\relax % –
+ \prebreakpenalty"7C=0\relax % —
+ \prebreakpenalty"7D=0\relax % ˝
+ \xspcode"22=2\relax % ”
+ \xspcode"3C=1\relax % ¡
+ \xspcode"3E=1\relax % ¿
+ \xspcode"5C=1\relax % “
+ \xspcode"7B=0\relax % –
+ \xspcode"7D=0\relax % ˝
+}
+
+\def\DisableOTLatinVariableSlotsKinsoku{\upzhkinsoku@setwith@ascii}
+\def\EnableOTLatinVariableSlotsKinsoku{\upzhkinsoku@setwith@otlatin}
+
+\upzhkinsoku@ifprimitive\input
+ \def\upzhkinsoku@input#1{\input#1\relax}%
+\else
+ \def\upzhkinsoku@input#1{\input{#1}}%
+\fi
+
+\edef\upzhkinsoku@otone{OT1}
+\edef\upzhkinsoku@otfour{OT4}
+
+\def\setupzhkinsokuwith#1{%
+ \upzhkinsoku@input{ukinsoku.tex}%
+ \upzhkinsoku@setpenalties
+ \upzhkinsoku@setxspcodes
+ \upzhkinsoku@setinhibitxspcodes
+ \edef\upzhkinsoku@defaultfontenc{#1}%
+ \ifx\upzhkinsoku@defaultfontenc\upzhkinsoku@otone
+ \upzhkinsoku@setwith@otlatin
+ \else
+ \ifx\upzhkinsoku@defaultfontenc\upzhkinsoku@otfour
+ \upzhkinsoku@setwith@otlatin
+ \else
+ \upzhkinsoku@setwith@ascii
+ \fi
+ \fi}
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname encodingdefault\endcsname\relax
+ \setupzhkinsokuwith{\upzhkinsoku@otone}%
+ \else
+ \AtBeginDocument{\setupzhkinsokuwith{\encodingdefault}}%
+ \fi
+
+\UPZHKINSOKUDOTSTYRESTORECATCODE
+
+\endinput
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 88ea5cb1deb..4054859ebe0 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -648,7 +648,7 @@ my @TLP_working = qw(
unravel unswcover
uothesis uowthesis uowthesistitlepage
upca uplatex upmethodology uppunctlm upquote
- uptex-base uptex-fonts
+ uptex-base uptex-fonts upzhkinsoku
uri url urlbst urcls urwchancal usebib ushort uspace uspatent
ut-thesis utf8mex uwmslide uwthesis
vak vancouver variablelm variations varindex varisize
diff --git a/Master/tlpkg/tlpsrc/collection-langchinese.tlpsrc b/Master/tlpkg/tlpsrc/collection-langchinese.tlpsrc
index 7b2e9611223..a0efbf0ef38 100644
--- a/Master/tlpkg/tlpsrc/collection-langchinese.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-langchinese.tlpsrc
@@ -19,6 +19,7 @@ depend latex-notes-zh-cn
depend lshort-chinese
depend texlive-zh-cn
depend texproposal
+depend upzhkinsoku
depend xpinyin
depend zhlipsum
depend zhmetrics
diff --git a/Master/tlpkg/tlpsrc/upzhkinsoku.tlpsrc b/Master/tlpkg/tlpsrc/upzhkinsoku.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/upzhkinsoku.tlpsrc