





% ==========================================================================================================
%
%
%
% 888    d8P  888       888 8888888  .d8888b.     8888888 888b    888 88888888888 8888888b.   .d88888b.
% 888   d8P   888   o   888   888   d88P  Y88b      888   8888b   888     888     888   Y88b d88P" "Y88b
% 888  d8P    888  d8b  888   888   888    888      888   88888b  888     888     888    888 888     888
% 888d88K     888 d888b 888   888   888             888   888Y88b 888     888     888   d88P 888     888
% 8888888b    888d88888b888   888   888             888   888 Y88b888     888     8888888P"  888     888
% 888  Y88b   88888P Y88888   888   888    888      888   888  Y88888     888     888 T88b   888     888
% 888   Y88b  8888P   Y8888   888   Y88b  d88P      888   888   Y8888     888     888  T88b  Y88b. .d88P
% 888    Y88b 888P     Y888 8888888  "Y8888P"     8888888 888    Y888     888     888   T88b  "Y88888P"
%
% Key Words In Context, a.k.a. permuted index
%
%
% ==========================================================================================================
% \renewcommand\cn{\jzrFontCwKai}
% \renewcommand\cn{\jzrFontCwHei}
% \renewcommand\cn{\jzrFontCwFangsong}
% \renewcommand\cn{\jzrFontCwMing}
% ----------------------------------------------------------------------------------------------------------
% \usepackage{cxltx}
\usepackage{cxltx-style-base}
\usepackage{cxltx-style-hyphenation-tolerance}
\usepackage{cxltx-style-oddeven}
\usepackage{cxltx-style-position-absolute}
\usepackage{cxltx-style-pushraise}
\usepackage{cxltx-style-smashbox}
% \usepackage{cxltx-style-solarized}
% \usepackage{cxltx-style-trm}
% % \usepackage{picinpar}
% \usepackage{/Volumes/Storage/downloads/picins/picins}
% \pichskip{1mm}% horizontal distance between midashi glyph and entry text
\usepackage{multirow}
\usepackage{enumitem}
\usepackage{changepage}
\usepackage[%
  bf%
  ]{titlesec}
\setcounter{secnumdepth}{0}
% \titleformat{\chapter}{block}{label}{sep}{before-code}[after-code]
% \titleformat{\chapter}[shape]{format}{label}{sep}{before-code}[after-code]

% using `\setCJKmainfont{Sun-ExtA}` causes typographic errors in many punctuation details
% (including apostrophe, ellipsis), so we set the CJK main font to our latin text font:
\setCJKmainfont{EB Garamond 12 Regular}

\newcommand{\jzrSection}[1]{\section[#1]{\centering #1}}

% \newcommand{\jzrChapter}[1]{\chapter[#1]{\centering #1}}
% \titleformat{\chapter}[hang]
% {\normalfont\huge\bfseries}{}{1em}{\filcenter}
% \titlespacing*{\chapter}{0pt}{0pt}{0pt}
% \usepackage{etoolbox}
% \makeatletter
% \patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{\par}{}{}
% \makeatother
\newcommand{\jzrChapter}[1]{%
  \newpage%
  \begingroup%
  \fontsize{2\myFontsize}{2\myLineheight}\leading{2\myLineheight}\selectfont%
  \setlength{\parskip}{2\myLineheight}%
  \centering%
  #1%
  \eline%
  \endgroup%
  }


% % \newcommand{\jzrChapter}[1]{\chapter[#1]{\centering #1}}
% \titleformat{\chapter}[hang]
%   {\normalfont\huge\bfseries}
%   {}
%   {0pt}
%   {\filcenter}
%   % [\eline]
% \titlespacing*{\chapter}{0pt}{40pt}{40pt}
% \titleformat*{\section}{\centering\Large\bfseries}
% \titleformat*{\subsection}{\centering\large\bfseries}

\newcommand{\eline}{{%
  \centering%
  % {\Huge \cn{中日韓文}}\\[\baselineskip]%
  % {\Huge \cn{字形索引}}\\[\baselineskip]%
  % ~\vspace{4\baselineskip}\\%
  \includegraphics[width=0.75\linewidth]{/Volumes/Storage/temp/french-rule-swell-dash-englische-line/swell-dash.pdf}\\%[3\baselineskip]%
  \par%
  }}

% ----------------------------------------------------------------------------------------------------------
\newenvironment{blockquote}{%
  \begin{adjustwidth}{3mm}{}%
  \begingroup%
  \itshape%
  }{%
  \endgroup%
  \end{adjustwidth}%
  }

% ----------------------------------------------------------------------------------------------------------
% \newcommand{\minheightparbox}[1]{%
%   \sbox{0}{\hbadness=10001\parbox{\columnwidth}{\hfuzz=\maxdimen{}#1}}%
%   \ifdim\dimexpr\ht0+\dp0<14mm%
%   \dp0\dimexpr14mm-\ht0\fi%
%   % \fbox{\usebox{0}}%
%   \usebox{0}%
% }
% \newdimen\foobarlength
% \newcommand{\foobar}[1]{%
%   \zsaveposy{y2-#1}%
%   \foobarlength=\zposy{y2-#1}sp%
%   \ifdim\dimexpr\foobarlength<140mm
%   x%
%   }
% % ----------------------------------------------------------------------------------------------------------
% \newcommand{\HRule}{%
%   \vspace{3mm}%
%   \hrule%
%   \vspace{3mm}%
%   }
% % ----------------------------------------------------------------------------------------------------------
% \newcommand{\HRule}{%
%   \par\nobreak\vspace{0mm}%
%   \noindent\rule{\linewidth}{0.2mm}\par%
%   \vspace{0mm}%
%   }


% ----------------------------------------------------------------------------------------------------------
\newdimen\myLineheight
\newdimen\myFontsize
% \myFontsize=3.5mm% too small
% \myFontsize=4.1667mm
% space between lines 4.6667mm - 3.8mm = 0.8667mm
\myFontsize=3.8mm
\renewcommand{\adjustJzrCjkIdeograph}[1]{\prRaise{-0.125}{\makebox[1.1053\myFontsize]{#1}}} % !!!
\myLineheight=4.6667mm
% \myLineheight=3.8mm % reduced to fontsize
\setlength{\baselineskip}{\myLineheight}
\setlength{\parskip}{0mm}
\setlength{\parindent}{0mm}
% thx to http://www.tug.org/TUGboat/tb28-1/tb88bazargan.pdf for the next:
\lineskiplimit=-10pt%
\lineskip=0pt%
\topskip=\baselineskip%
\newcommand{\bold}[1]{{\fontsize{0.8\myFontsize}{0.8\myFontsize}\jzrFontUbuntuBold#1}}


% ----------------------------------------------------------------------------------------------------------
\usepackage{multicol}
\setlength{\columnsep}{3mm}
\setlength\columnseprule{0.155mm}

% ..........................................................................................................
\usepackage[
  % asymmetric,% see http://tex.stackexchange.com/a/42051/28067
  driver=xetex,
  % showframe,%
  % twoside,
  left=21mm,%
  right=21mm,%
  top=18mm,%
  bottom=11.5mm,%
  headsep=5mm,%
  headheight=5mm,%
  footskip=5mm,%
  marginparsep=0mm,%
  marginparwidth=0mm,%
  includehead=true,%
  includefoot=true,%
  includemp=false,%
  paperwidth=210mm,%
  paperheight=297mm,%
  ]{geometry}
% ..........................................................................................................
% \usepackage{pagegrid}\pagegridsetup{top-left,step=1mm,arrows=false}
% \pagegridsetup{top-left,step=4.6667mm,arrows=false}
% % \pagegridsetup{top-left,step=\myLineheight,arrows=false}
% % \pagegridsetup{top-left,step=7mm,arrows=false}

% ----------------------------------------------------------------------------------------------------------
\let\footruleskip\undefined\usepackage{fancyhdr}
\usepackage{fix2col}% Patch LaTeX's output routine to handle marks correctly with two columns
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0mm}
\renewcommand{\footrulewidth}{0mm}
\fancyhead[OR]{\prPush{1.1}{\cn{{\jzrFontBiauKai{}萬字一覽置換索引}}}}
\fancyhead[EL]{\cn{{\jzrFontBiauKai{}萬字一覽置換索引}}}
% \fancyhead[EL,OR]{\leftmark}
% \fancyhead[OL,ER]{\rightmark\cn{{\jzrFontBiauKai{}字面萬字一覽}}}
\fancyfoot[OR]{\prPush{1.1}{\pageNr{\thepage}}}
\fancyfoot[EL]{\pageNr{\thepage}}
\fancyfoot[OC,EC]{}
\fancyfoot[OL,ER]{}

% \newcommand{\myBigtype}[1]{{%
%   \fontsize{8.4845mm}{8.4845mm}\leading{8.4845mm}\prRaise{0.1}{#1}%
%   }}%


\renewcommand{\usageCode}[1]{{%
  \setlength{\fboxsep}{0.5mm}%
  \setlength{\fboxrule}{0.155mm}%
  \framebox{\jzrFontUbuntu#1}}}

\newcommand{\kwicInfo}[4]{
  \smash{{%
    \prPushRaise{0.0}{1}{
       \setlength{\tabcolsep}{0mm}%
       \leading{0mm}
         \begin{tabular}{ p{6.4mm} p{4.0mm} }
           \prPushRaise{0}{0.775}{\makebox[6.4mm]{\wbf{#1}\hfill{\fontsize{2.5mm}{0mm}\prRaise{0.1}{#3}}}}%
             & \prPushRaise{0}{0.35}{\makebox[4.0mm]{\hfill\pageNr{#4}}} \\%
           \wbf{#2} & \\%
           \end{tabular}%
    }}}%
}

% ..........................................................................................................
\newcommand{\scale}[3]{{%
  #1\fontsize{#2\myFontsize}{#2\myLineheight}\leading{#2\myLineheight}\selectfont%
  #3%
  }}

\newcommand{\wb}[1]{%
  \colorbox{black}{\color{white}%
  #1}%
  }

\newcommand{\zzwbfTable}{
\begingroup
\setlength{\tabcolsep}{0mm}
\renewcommand{\arraystretch}{1}
% \begin{tabular}{ | p{6.4mm} p{6.4mm} | p{6.4mm} | }
\begin{tabular}{ | c c | c | c | c | }
\hline
\wb{\makebox[4mm]{{\jzrFontAplHei{}札}}} & \makebox[6.4mm]{\jzrStrokeclassTextOne}   & \makebox[6.4mm]{\cnjzr{}} & \makebox[6.4mm]{1} & \makebox[6.4mm]{\cn{橫}} \\
\hline
\wb{\makebox[4mm]{{\jzrFontAplHei{}字}}} & \makebox[6.4mm]{\jzrStrokeclassTextTwo}   & \makebox[6.4mm]{\cnjzr{}} & \makebox[6.4mm]{2} & \makebox[6.4mm]{\cn{竪}} \\
\hline
\wb{\makebox[4mm]{{\jzrFontAplHei{}五}}} & \makebox[6.4mm]{\jzrStrokeclassTextThree} & \makebox[6.4mm]{\cnjzr{}} & \makebox[6.4mm]{3} & \makebox[6.4mm]{\cn{撇}} \\
\hline
\wb{\makebox[4mm]{{\jzrFontAplHei{}筆}}} & \makebox[6.4mm]{\jzrStrokeclassTextFour}  & \makebox[6.4mm]{\cnjzr{}} & \makebox[6.4mm]{4} & \makebox[6.4mm]{\cn{点}} \\
\hline
\wb{\makebox[4mm]{{\jzrFontAplHei{}法}}} & \makebox[6.4mm]{\jzrStrokeclassTextFive}  & \makebox[6.4mm]{\cnjzr{}} & \makebox[6.4mm]{5} & \makebox[6.4mm]{\cn{折}} \\
\hline
\end{tabular}
\endgroup
}

\usepackage{/Volumes/Storage/downloads/picins/picins}
\pichskip{1mm}% horizontal distance between midashi glyph and entry text


\newcommand{\zzwbfTableInText}[1]{
  \parpic(34mm,30mm)(-2.35mm,16.7mm)[l][lb]{\zzwbfTable}
  #1\par\picskip{0}
  }

% ----------------------------------------------------------------------------------------------------------
% \usepackage[bottom]{footmisc}
% \usepackage{bigfoot}
% % \renewcommand\footnoterule{\rule{\linewidth}{0pt}}
% % \renewcommand\footnoterule{\rule{\linewidth}{0.1mm}}
% \makeatletter
% \def\footnoterule{\kern-8\p@
%   \hrule \@width \linewidth \kern 7.6\p@} % the \hrule is .4pt high
% \makeatother
\newcommand{\footnoteB}[1]{\footnote{#1}}
% \DeclareNewFootnote[para]{B}[arabic]
% \MakeSortedPerPage{footnoteB}
% \usepackage{manyfoot}
% \newcounter{footnoteB}
% \newcommand{\footnoteB}{%
% \stepcounter{footnoteB}%
% \Footnotemark\thefootnoteB \FootnotetextB\thefootnoteB}
% \renewcommand{\thefootnoteB}{\roman{footnoteB}}

\newcommand{\WBF}{{\jzrFontGaraqmondSC{}wbf}}

\newcommand{\kaiMu}{\kai{木}}
\newcommand{\kaiZha}{\kai{札}}
\newcommand{\kaiL}{\kai{乚}}
\newcommand{\kaiLiao}{\kai{了}}
\newcommand{\kaiZi}{\kai{子}}
\newcommand{\kaiYu}{\kai{于}}
\newcommand{\kaiGan}{\kai{干}}
\newcommand{\kaiYuzhou}{\kai{宇}}
\newcommand{\kaiMuPianpang}{\jzrkai{}}

\newcommand{\kwicIntroTitle}{
\thispagestyle{empty}
\begingroup
\centering
~\vspace{5\baselineskip}\\%
\eline
~\vspace{1\baselineskip}\\%

\scale{}{2}{Permuted Index\\}
\scale{}{2}{\textit{of}\\}
\scale{}{2}{Chinese Characters\\}
~\vspace{0.75\baselineskip}\\%
\scale{\jzrFontAdbKai}{3}{萬字一覽\\置換索引\\}

~\vspace{1.5\baselineskip}\\%
\eline
~\vspace{15\baselineskip}\\%
\cn{字面プロジェクト}\\
The Jizura Project\\
Wolfgang Lipp\\
Berlin 2015\\
\endgroup
\null\newpage
\thispagestyle{empty}
}

\begin{document}
% # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
%  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
% # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
%  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
% # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
%  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
% # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
%  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
% # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
%  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
% # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
%  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
% # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
%  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
% # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
%  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


% \jzrFontDejaVuSansMonoBold%
\fontsize{\myFontsize}{\myLineheight}\leading{\myLineheight}\selectfont%
\setlength{\parskip}{\myLineheight}
% \begin{multicols}{2}
% \sbDummy
% \begingroup\setlength{\baselineskip}{0mm}\setlength{\parskip}{0mm}\vskip 1mm\endgroup

#{content}


% \end{multicols}
\end{document}
