summaryrefslogtreecommitdiff
path: root/macros/luatex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex')
-rw-r--r--macros/luatex/generic/luatexja/README8
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-en.pdfbin702554 -> 703072 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-ja.pdfbin1137264 -> 1137731 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-ruby.pdfbin353336 -> 375376 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-ruby.tex373
-rw-r--r--macros/luatex/generic/luatexja/src/addons/luatexja-ajmacros.sty4
-rw-r--r--macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty29
-rw-r--r--macros/luatex/generic/luatexja/src/jfm-ujis.lua13
-rw-r--r--macros/luatex/generic/luatexja/src/jfm-ujisv.lua11
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-jfmglue.lua31
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-latex.sty4
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-otf.lua4
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-ruby.lua184
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja.sty4
-rw-r--r--macros/luatex/latex/hu-berlin-bundle/README.md139
-rw-r--r--macros/luatex/latex/hu-berlin-bundle/hu-berlin-bundle.dtx2039
-rw-r--r--macros/luatex/latex/hu-berlin-bundle/hu-berlin-bundle.pdfbin0 -> 301369 bytes
-rw-r--r--macros/luatex/latex/hu-berlin-bundle/img/texografie-logo.pdfbin0 -> 14903 bytes
-rw-r--r--macros/luatex/latex/hu-berlin-bundle/makefile134
19 files changed, 2711 insertions, 266 deletions
diff --git a/macros/luatex/generic/luatexja/README b/macros/luatex/generic/luatexja/README
index 7488d2f5d1..a4c1384466 100644
--- a/macros/luatex/generic/luatexja/README
+++ b/macros/luatex/generic/luatexja/README
@@ -1,4 +1,4 @@
-The LuaTeX-ja Package 20201005.0
+The LuaTeX-ja Package 20201030.0
--------------------------------
Copyright (c) 2011--2020 The LuaTeX-ja project
License: modified BSD (see COPYING)
@@ -45,9 +45,9 @@ Installation
2. If you must/want to install manually:
a. Download the source archive from CTAN,
- or tagged as 20201005.0 in the Git repository by
+ or tagged as 20201030.0 in the Git repository by
<http://git.osdn.jp/view?p=luatex-ja/luatexja.git
- ;a=snapshot;h=refs/tags/20201005.0;sf=tgz>
+ ;a=snapshot;h=refs/tags/20201030.0;sf=tgz>
b. Extract the archive and process following three files by LuaLaTeX
to generate classes for Japanese typesetting:
@@ -96,4 +96,4 @@ Notes
This file and ltj-kinsoku.lua are not used anymore.
(Do not remove ltj-kinsoku.tex.)
-Last commit date: Mon Oct 5 15:47:16 2020 +0900
+Last commit date: Fri Oct 30 14:32:37 2020 +0900
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
index 6b2043d2af..890021f98c 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
+++ b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
index 8d19e491c8..41e9b9ba33 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
+++ b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ruby.pdf b/macros/luatex/generic/luatexja/doc/luatexja-ruby.pdf
index ade61a681c..0b436587ab 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-ruby.pdf
+++ b/macros/luatex/generic/luatexja/doc/luatexja-ruby.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ruby.tex b/macros/luatex/generic/luatexja/doc/luatexja-ruby.tex
index f4a3614447..d135b02acc 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-ruby.tex
+++ b/macros/luatex/generic/luatexja/doc/luatexja-ruby.tex
@@ -1,7 +1,8 @@
%#! lualatex
%%% a test of ruby.
-\documentclass[a4paper,10pt]{ltjsarticle}
+\documentclass[a4paper,10ptj]{ltjsarticle}
\usepackage[rgb]{xcolor}
+\usepackage{enumitem,mleftright}
\usepackage{luatexja-otf,amsmath,bxghost}
\usepackage[no-math]{fontspec}
\usepackage[match]{luatexja-fontspec}
@@ -47,6 +48,9 @@
\title{\textsf{luatexja-ruby}パッケージ}
\author{\LuaTeX-jaプロジェクトチーム}
\date{\texttt{\csname ver@luatexja-ruby.sty\endcsname}(\today)}
+\makeatletter
+\def\mybox#1{\unskip\ {\Large \fboxrule=0.1mm\fboxsep=0mm\fcolorbox{cyan}{white}{\hbox{\<\ltjjachar#1\<}}}\ }
+
\begin{document}
\catcode`\<=13
\def<#1>{{\rmfamily\mdseries\itshape$\langle$#1\/$\rangle$}}
@@ -77,15 +81,30 @@ plain \LuaTeX でのロードはまだサポートしておらず,
\href{http://zrbabbler.sp.land.to/pxrubrica.html}{\textsf{pxrubrica}パッケージ}%
での用法に準ずる.
-\begin{quotation}
-進入あり:と\ltjruby{暁}{あかつき}の
-
-進入なし:{\setkeys[ltj]{ruby}{mode=0}と\ltjruby{暁}{あかつき}の}
+\begin{quote}
+ 進入あり:と\ltjruby{暁}{あかつき}の\\
+ 進入なし:と\ltjruby[mode=0]{暁}{あかつき}の\\
+ 突出あり:\ltjruby[stretch={1}{2}{1}]{聴衆}{ちようしゆう}\\
+ 突出なし:\ltjruby[stretch={0}{2}{0}]{聴衆}{ちようしゆう}
+\end{quote}
-突出あり:{\setkeys[ltj]{ruby}{stretch={1}{2}{1}}\ltjruby{聴衆}{ちようしゆう}}
+なお,本パッケージでは親文字と直前・直後の文字の間に0でない和文処理グルー
+\footnote{JFMで指定されたグルーや,標準の和文間空白(\Param{kanjiskip}),標準の和欧文間空白(\Param{xkanjiskip}).}%
+がくることも考慮しているため,「\emph{前後の文字への}\underline{進入(許容)量}」と「進入(許容)量」とは異なる可能性がある.
+この文書では次のように称する:
+\begin{description}
+ \item[\underline{文字進入量}] 前後の文字へルビ文字が実際にかかる長さ.常に下線を引くことにする.
+ \item[進入量] 前後の文字,およびそれとルビの間の和文処理グルーにかかる長さ
+\end{description}
+多くの場合,和文処理グルーは0以上の長さのため,進入量は\underline{文字進入量}以上である.
-突出なし:{\setkeys[ltj]{ruby}{stretch={0}{2}{0}}\ltjruby{聴衆}{ちようしゆう}}
-\end{quotation}
+例えば次の例では,直前の文字「来」への\underline{前文字進入量}は0であるが,
+前進入量は(和欧文間空白にかかる分まで含めるので)正である.
+\begin{quote}
+ \Large
+ 本来\ltjruby{foohoge}{\vrule ほげほげふがふが\vrule}においては……\\
+ 本来foohogeにおいては……
+\end{quote}
\subsection{\ruby{命|令}{めい|れい}}
\paragraph{\cs{ltjruby}}
@@ -93,71 +112,37 @@ plain \LuaTeX でのロードはまだサポートしておらず,
\begin{quote}
\ttfamily \textbackslash ltjruby[<option>]\{親|文|字\}\{おや|も|じ\}
\end{quote}
-のように使用する.
+のように親文字→ルビの順序で指定する.
第2・第3引数内の「\verb+|+」はグループの区切りを表す.詳細は\ref{ssec:grp}\nobreak 小節を参照.
-<option>には以下の内容をkey-valueリストで指定可能である:
+\medskip
+<option>には以下の内容をkey-valueリストで指定可能である.
+<real>は10進の実数値を表す.<bool>は真偽値\texttt{true}(真)か\texttt{false}(偽)であり,
+値を省略したときには\texttt{true}の意味になる.
+
\begin{description}
\def\makelabel#1{\ttfamily\bfseries #1}
-\item[pre=<real>] 前進入許容量をルビ全角単位で指定.
+\item[pre=<real>] \underline{前文字進入許容量}をルビ全角単位で指定.
負の長さを指定した場合は,ルビの状況や直前の文字に応じた自動指定を意味する.
既定値は負(つまり,自動指定).
-\item[post=<real>] 同様に,後進入許容量を指定する.既定値は負(自動指定).
+\item[post=<real>] 同様に,\underline{後文字進入許容量}を指定する.既定値は負(自動指定).
\item[mode] 進入処理のモードを表すbit vector.下位2\,bitは,\texttt{pre}や
\texttt{post}が負である場合にしか効力を発揮しない.既定値は$(0001)_2 = 1$.
\begin{description}
- \item[bit 0] 進入を無効にするならば0,有効にするならば1.
+ \item[bit 0] 前後の\underline{文字への進入}を無効にするならば0,有効にするならば1.
\item[bit 1] 前進入許容量$B$と後進入許容量$A$が異なった場合,
-そのまま処理する場合は0,小さい方に揃えるならば1.
- \item[bit 2--3] ルビ文字の突出量$x$から実際の前進入量$b$,後進入量$a$の計算方法を指定する.
-親文字の文字数が$k+1$,親文字の前に入る空白量・間の空白量・後ろの空白量の比が$p:q:r$のとき,
-\begin{description}
- \item[00] $b=\min(B, xp/(p+kq+r))$, \ $a=\min(A, xr/(p+kq+r))$
- \item[01] $b=\min(B, x)$, \ $a=\min(A, \max(x-b,0))$
- \item[10] $a=\min(A, x)$, \ $b=\min(B, \max(x-a,0))$
- \item[11] $M=\min(B,A)$とおく.もし$x\le 2M$ならば$b=a=x/2$.そうでなければ
-\[
- b=\min\left(B, M + \frac{(x-2M)p}{p+kq+r}\right),\qquad
- a=\min\left(A, M + \frac{(x-2M)r}{p+kq+r}\right)
-\]
-\end{description}
-
- \typeout{AAAA}
-組み方の具体例を実際に示す.例示のため,平仮名にはルビが1字まで,「立」にはルビを
-0.5字分までかけてよいことにしている.
-\begin{description}
-\item[00]{\setkeys[ltj]{ruby}{mode=1}%
-\ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
-は\ltjruby{美}{うつく}しい
- \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
-は\ltjruby{暁}{あかつき}立\quad
-は\ltjruby{聴衆}{ちようしゆう}立\par}
-\item[01]{\setkeys[ltj]{ruby}{mode=5}%
-\ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
-は\ltjruby{美}{うつく}しい
- \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
-は\ltjruby{暁}{あかつき}立\quad
-は\ltjruby{聴衆}{ちようしゆう}立\par}
-\item[10]{%
- \typeout{MODE: \csname ltj@@rubyip@mode\endcsname.}%
- \setkeys[ltj]{ruby}{mode=9}%
- \typeout{MODE: \csname ltj@@rubyip@mode\endcsname.}%
-\ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
-は\ltjruby{美}{うつく}しい
- \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
-は\ltjruby{暁}{あかつき}立\quad
-は\ltjruby{聴衆}{ちようしゆう}立\par}
-\item[11]{\setkeys[ltj]{ruby}{mode=13}%
-\ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
-は\ltjruby{美}{うつく}しい\quad
-は\ltjruby{聴衆}{ちようしゆう}と\quad
-は\ltjruby{暁}{あかつき}立\quad
-は\ltjruby{聴衆}{ちようしゆう}立\par}
-\end{description}
-
+ そのまま処理する場合は0,小さい方に揃えるならば1.
+ \item[bit 2--3] ルビ文字の突出量から実際の前・後進入量の計算方法を指定する.
+ 詳しい計算方法については\ref{ssec:calc_intrusion}\nobreak 小節を参照.
\end{description}
+\item[intrude\_jfmgk=<bool>] 進入量算出の際に,前後のJFMグルーの自然長を考慮するか否か.既定値は真.
+\item[intrude\_kanjiskip=<bool>] 進入量算出の際に,ルビ前後に挿入される
+ 標準の和文間空白(\Param{kanjiskip})の自然長を
+ 考慮するか否か.既定値は真.
+\item[intrude\_xkanjiskip=<bool>] 進入量算出の際に,ルビ前後に挿入される
+ 標準の和欧文間空白(\Param{xkanjiskip})の自然長を考慮するか否か.既定値は真.
\item[stretchruby=\{<left>\}\{<middle>\}\{<right>\}] 親文字の合計長が
ルビ文字の合計長より長い時に,ルビ文字の前・間・後に入れる空白の割合であり,
それぞれ0--7の自然数で指定する.
@@ -177,9 +162,9 @@ plain \LuaTeX でのロードはまだサポートしておらず,
\item[後突出禁止] \verb+{1}{1}{0}+
\end{description}
-\item[stretchbol=\{<left>\}\{<middle>\}\{<right>\}] 行頭形〜.
+\item[stretchbol=\{<left>\}\{<middle>\}\{<right>\}] 行頭形に対する\texttt{stretch}と同様の指定.
既定値は\ \verb+{0}{1}{1}+ である.
-\item[stretcheol=\{<left>\}\{<middle>\}\{<right>\}] 行末形〜.
+\item[stretcheol=\{<left>\}\{<middle>\}\{<right>\}] 行末形に対する\texttt{stretch}と同様の指定.
既定値は\ \verb+{1}{1}{0}+ である.
\item[maxmargin=<real>] 親文字の方がルビより長い時に,ルビの先頭と親文字の先頭,及び
@@ -204,9 +189,9 @@ plain \LuaTeX でのロードはまだサポートしておらず,
\emph{縦組以外での}ルビの親文字の高さを全角高さの<real>倍と強制的に固定する.
負の値が指定された場合は「固定しない」(すなわち,v0.3より前の挙動と同じになる).
既定値は0.88.
-\item[tbaseheight=<real>] \texttt{ybaselineshift}と同様だが,こちらは\emph{縦組での}ルビの親文字の高さを指定する.
+\item[tbaseheight=<real>] \texttt{ybaseheight}と同様だが,こちらは\emph{縦組での}ルビの親文字の高さを指定する.
既定値は0.5.
-\item[baseheight=<real>] \texttt{ybaselineshift},\texttt{tbaselinesift}を同時に指定したことと同義.
+\item[baseheight=<real>] \texttt{ybaseheight},\texttt{tbaseheight}を同時に指定したことと同義.
\begin{LTXexample}[width=0.3\textwidth, preset=\Large]
\noindent
\ltjruby[baseheight=0.88]{本}{ほん}\
@@ -221,8 +206,9 @@ plain \LuaTeX でのロードはまだサポートしておらず,
-\item[kenten=<command>]各文字につく圏点の出力命令を指定する.既定値は「\verb+\ltjalchar`•+」
-であり,\texttt{U+2022} (Bullet)を\textbf{ALchar}として出力することを指定している.
+\item[kenten=<command>]各文字につく圏点の出力命令を指定する.
+ 既定値は「\verb+\ltjalchar`+\texttt{\ltjalchar`•}」であり,\texttt{U+2022}~(Bullet)を
+ \textbf{ALchar}として出力することを指定している.
\item[fontcmd=<command>]ルビ用のフォント切り替え命令を指定する.
このキーの内容が実行された後に\ \verb+\fontsize...\selectfont+\ が実行されるので,
@@ -240,7 +226,7 @@ plain \LuaTeX でのロードはまだサポートしておらず,
\medskip
次の2つは,以上で説明した複数のオプションを一度に設定するためのものである.
-普通はこの2つのうちいずれかを設定するだけで足りるだろう.
+普通はこの2\nobreak つのうちいずれかを設定するだけで足りるだろう.
\begin{description}
\def\makelabel#1{\ttfamily\bfseries #1}
@@ -262,37 +248,42 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1}
stretchruby={1}{2}{1}, stretch = {1}{2}{1},
stretchbol={0}{1}{1}, stretcheol={1}{1}{0},
maxmargin=0.5, size=0.5, intergap=0, rubysmash=false,
- kenten=\ltjalchar`•, fontcmd=\relax, ybaseheight=0.88, tbaseheight=0.5
+ kenten=\ltjalchar`•, fontcmd=\relax, ybaseheight=0.88, tbaseheight=0.5,
+ intrude_jfmgk, intrude_kanjiskip, intrude_xkanjiskip
\end{verbatim}
\paragraph{\texttt{\textbackslash ltjsetparamater} に追加されるキー}
\begin{description}
\item[\Param{rubypreintrusion}\ttfamily =\{<chr\_code>, <pre\_int>\}]
-文字<chr\_code> に,その\textbf{直後}のルビによって掛けられるルビ文字列の最大長をルビ全角単位で指定.
+ 文字<chr\_code> に,その\textbf{直後}のルビによって掛けられるルビ文字列の最大長
+ (つまり,\underline{前文字進入許容量})をルビ全角単位で指定.
\item[\Param{rubypostintrusion}\ttfamily =\{<chr\_code>, <post\_int>\}]
-文字<chr\_code> に,その\textbf{直前}のルビによって掛けられるルビ文字列の最大長をルビ全角単位で指定.
+ 文字<chr\_code> に,その\textbf{直前}のルビによって掛けられるルビ文字列の最大長
+ (つまり,\underline{後文字進入許容量})をルビ全角単位で指定.
\end{description}
以下の文字は\Param{rubypreintrusion},~\Param{rubypostintrusion}とも初期値は1である:
-\makeatletter
-\def\mybox#1{{\fboxrule=0.1mm\fboxsep=0mm\fcolorbox{cyan}{white}{\hbox{\null\ltjjachar#1\null}}}}
\begin{quote}
ひらがな(\texttt{U+3040}--\texttt{U+309F}),カタカナ(\texttt{U+30A0}--\texttt{U+30FF}),
仮名補助など(\texttt{U+1B000}--\texttt{U+1B16F}),\\
- 中点類・分離禁止文字
- \@for\@tmp:=`\・,`\:,`\;,`\―,`\‥,`\…,`〳,`\〴,`\〵,"2014 \do{\mybox{\@tmp}}
+ 分離禁止文字
+ \@for\@tmp:=`\―,`\‥,`\…,`〳,`\〴,`\〵,"2014 \do{\mybox{\@tmp}}
+\end{quote}
+次に,以下の文字は\Param{rubypreintrusion},~\Param{rubypostintrusion}とも初期値は0.5である:
+\begin{quote}
+ 中点類\@for\@tmp:=`\・,`\:,`\; \do{\mybox{\@tmp}}
\end{quote}
-次に,以下の文字は\Param{rubypreintrusion}のみ初期値は1である:
+また,以下の文字は\Param{rubypreintrusion}のみ初期値は1である:
\begin{quote}
始め括弧類
- \@for\@tmp:=`\‘,`\“,`\〈,`\《,`\「,`\『,`\【,`\〔,`\〖,`\〘,`\〝,`\(,`\[,`\{,`\⦅ \do{\mybox{\@tmp}},
+ \@for\@tmp:=`\‘,`\“,`\〈,`\《,`\「,`\『,`\【,`\〔,`\〖,`\〘,`\〝,`\(,`\[,`\{,`\⦅ \do{\mybox{\@tmp}}\unskip,
「文字コード$-1$の文字
- \footnote{段落開始の\ \texttt{\textbackslash parindent}\ を表す.
+ \footnote{段落開始の\ \texttt{\textbackslash parindent}分インデントを表す.
通常の\LuaTeX-jaにおける指定では「文字コード$-1$」は文中数式境界を表していることに注意.}」
\end{quote}
-また,以下の文字は\Param{rubypostintrusion}のみ初期値は1である:
+さらに,以下の文字は\Param{rubypostintrusion}のみ初期値は1である:
\begin{quote}
閉じ括弧類
- \@for\@tmp:=`\’,`\”,`\〉,`\》,`\」,`\』,`\】,`\〕,`\〗,`\〙,`\〟,`\),`\],`\},`\⦆ \do{\mybox{\@tmp}},
+ \@for\@tmp:=`\’,`\”,`\〉,`\》,`\」,`\』,`\】,`\〕,`\〗,`\〙,`\〟,`\),`\],`\},`\⦆ \do{\mybox{\@tmp}}\unskip,
句読点類\@for\@tmp:=`\、,`\,,`\。,`\. \do{\mybox{\@tmp}}
\end{quote}
\makeatother
@@ -305,10 +296,11 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1}
\ttfamily\cs{ltjkenten}[<option>]\{親文字\}
\end{quote}
のように使用する.複数文字に圏点をつける場合でも,\verb+\ltjruby+ のように「\texttt{|}」を使って
-文字を区切る\textbf{必要はない}ことに注意してほしい.
+文字を区切る\textbf{必要はない}(\verb+\kenten+内では「\texttt{|}」は特別な意味を持たない)
+ことに注意してほしい.
-圏点として出力される文字は \texttt{kenten} キーによって指定し,
-圏点自身の大きさは(ルビと同様に)\texttt{size} キーで指定する.
+圏点として出力される文字は\texttt{kenten}キーによって指定し,
+圏点自身の大きさは(ルビと同様に)\texttt{size}キーで指定する.
\subsection{グループの\ruby{指|定}{し|てい}}
\label{ssec:grp}
@@ -362,25 +354,22 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1}
面倒でも手動で \texttt{pre}, \texttt{post} などを使って頑張って欲しい.
\item 実装方法の都合により,ルビの直前・直後・途中で2箇所以上の改行が起きる場合,例えば
\begin{center}
- \begin{tabular}{lll}
- \toprule
\Large …の\ltjruby[stretch=110]{表}{ひよう}
- \vrule\ltjruby[stretch=010]{現|力}{げん|りよく}\vrule&
+ \vrule\ltjruby[stretch=010]{現|力}{げん|りよく}\vrule\qquad
\Large \vrule\ltjruby[stretch=010]{表|現}{ひよう|げん}
- \vrule\ltjruby[stretch=011]{力}{りよく}は…&
-\Large \vrule\ltjruby[stretch=010]{表|現|力}{ひよう|げん|りよく}\vrule\\
-\bottomrule
- \end{tabular}
+ \vrule\ltjruby[stretch=011]{力}{りよく}は…\qquad
+\Large \vrule\ltjruby[stretch=010]{表|現|力}{ひよう|げん|りよく}\vrule
+
\end{center}
などの組み方は\emph{想定していない}.
+エラーが発生して止まることもあるし,エラーが発生しなくても正しく組まれない.
\end{itemize}
\section{\ruby{注|意|点}{ちゆう|い|てん}}
-\begin{description}
-\item[ルビ文字のはみ出し]
+\paragraph{前後からのルビ文字のはみ出し}
「日本語組版処理の要件」の図3.82のように,
-ルビ文字のはみ出しが繋がらないようにする処理について述べる.
+前後からのルビ文字のはみ出しが繋がらないようにする処理が組み込まれている.
例えば,
\begin{LTXexample}[preset=\Large,width=0.3\textwidth]
@@ -389,44 +378,42 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1}
\end{LTXexample}
において,1行目右側の「\ltjruby{陵}{みささぎ}」のルビが前の「と」にかかる量は次のように決まる:
\begin{enumerate}
-\item 1回目の実行では,行分割前に「\ltjruby{陵}{りよう}」の後側進入量は前もって知ることはでき
+\item 1回目の実行では,行分割前に「\ltjruby{陵}{りよう}」の\underline{後文字進入量}は前もって知ることはでき
ない.なので,「\ltjruby{陵}{りよう}」は行中形で組まれるものとして
-「\ltjruby{陵}{みささぎ}」前側進入許容量は
+「\ltjruby{陵}{みささぎ}」前文字進入許容量は
\[
\underbrace{0.5\,\mathrm{zw}}_{\text{元々の許容量}}
--\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの後側進入量(行中形)}}=0.25\,\mathrm{zw}
+-\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの\underline{後文字進入量}(行中形)}}=0.25\,\mathrm{zw}
\]
-となる.行分割後,「\ltjruby{陵}{りよう}」の実際の後側進入量は
+となる.行分割後,「\ltjruby{陵}{りよう}」の実際の\underline{後文字進入量}は
<jobname>\texttt{.ltjruby}ファイルに記述される.
-\item 2回目以降の実行では,<jobname>\texttt{.ltjruby}ファイルに保存された「\ltjruby{陵}{りよう}」の後側進入量
-を用いて,「\ltjruby{陵}{みささぎ}」前側進入許容量を次のように計算する:
+\item 2回目以降の実行では,<jobname>\texttt{.ltjruby}ファイルに保存された「\ltjruby{陵}{りよう}」の\underline{後文字進入量}
+を用いて,「\ltjruby{陵}{みささぎ}」の\underline{前文字進入許容量}を次のように計算する:
\[
\underbrace{0.5\,\mathrm{zw}}_{\text{元々の許容量}}
--\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの後側進入量 (from \texttt{.ltjruby})}}=0.25\,\mathrm{zw}.
+-\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの\underline{後文字進入量}(from \texttt{.ltjruby})}}=0.25\,\mathrm{zw}.
\]
\end{enumerate}
<jobname>\texttt{.ltjruby}ファイルに保存する際,各 \verb+\ltjruby+ 命令の呼び出しを識別するキーが必要になるが,
そのキーとしては単純に「何個目の \verb+\ltjruby+ 命令か」である.
なお,以上の処理は,1行目と2行目を比較すれば分かるように,
-「\ltjruby{陵}{みささぎ}」の\emph{前進入許容量指定(\texttt{pre})が自動}になっている場合のみ
+「\ltjruby{陵}{みささぎ}」の\emph{\underline{前文字進入許容量}指定(\texttt{pre})が自動}になっている場合のみ
実施される.
-\item[段落末尾のルビ]
+\paragraph{段落末尾のルビ}
段落がルビで終わった場合,そのルビが行末形で組まれることはない.
これは,段落の「本当の」末尾には \verb+\penalty10000\parfillskip+ があるためで,
-ルビ処理用に作った最後のグルー(\ref{sec:impl}\nobreak 節の説明では$g_2$)が消去されないことによる.
+ルビ処理用に作った最後のグルー(\ref{ssec:impl}\nobreak 小節の説明では$g_2$)が消去されないことによる.
\verb+\parfillskip+ の長さ(や,場合によっては \verb+\rightskip+)を実測し,
それによって処理を変えるのも可能だが,そのようなことはしなかった.
段落がルビで終わることは普通ない(最低でも句点が続くだろう)と思うからである.
-
-
-\item[段落先頭のルビ]
+\paragraph{段落先頭のルビ}
同様に,段落先頭のルビは行頭形にはならない.
-\texttt{pre}が負(つまり,自動指定)のとき,段落最初の \verb+\parindent+ 部分への
-進入は可能である.\verb+\parindent+ 部分への進入許容量は
+\texttt{pre}が負(つまり,自動指定)のとき,段落最初の \verb+\parindent+ 分への
+進入は可能である.ここ\verb+\parindent+ 分のインデントへの\underline{進入許容量}は
「文字$-1$」に対する\Param{rubypreintrusion}(既定値は1,ルビ全角単位)と
\ \verb+\parindent+ の長さのうち小さい方である.
\begin{LTXexample}[preset=\Large,width=0.4\textwidth]
@@ -435,12 +422,137 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1}
\ltjruby{承}{うけたまわ}り……\par
\parindent0.25\zw\ltjruby{陵}{みささぎ}は……
\end{LTXexample}
-\end{description}
+
+\paragraph{和文処理グルーの伸縮}
+現バージョンでは,進入量調整に和文処理グルーを考慮させる,
+\begin{quote}
+\texttt{intrude\_jfmgk}, \texttt{intrude\_kanjiskip}, \texttt{intrude\_xkanjiskip}キー
+\end{quote}
+の値が\texttt{true}(真)で
+あった状況でも,考慮されるのは\emph{自然長の値のみ}である.そのため,行の調整処理が発生した場合は
+意図しない結果となる.
+
+例えば,標準設定での中黒「・」の直後のルビからの中黒への進入許容量は
+\begin{quote}
+ 中黒「・」への\underline{前進入許容量}はルビ全角の半分で,
+ 中黒本体の後の四分空きには進入可能
+\end{quote}
+となっている.そのため,下の例の1, 2行目ともルビの前進入量は0.5\,zwとなる.
+しかし,2行目では詰め量の0.5\,zwがほとんど中黒周囲の四分空きで負担されるため,
+実際には「中黒本体にほぼ0.5\,zwが進入する」という望ましくない結果が得られている.
+\begin{LTXexample}[preset=\Large,width=0.4\textwidth]
+\leavevmode\hbox{あ・\ltjruby{◆}{◆◆◆◆}漢字}\\
+\hbox spread-0.5\zw{あ・\ltjruby{◆}{◆◆◆◆}漢字}
+\end{LTXexample}
+
+また,次の例では2行目では前後の\underline{文字進入量}がルビ1字分と等しくなっているが,
+3行目のように1全角伸ばすという調整が行われた後は\underline{文字進入量}が不揃いになってしまっている.
+これはもともと「\texttt{;}」には後側にのみ和欧文間空白が入ることと,3行目ではこの和欧文間空白が
+伸びているためである.
+\begin{LTXexample}[preset=\Large,width=0.4\textwidth]
+\leavevmode\hbox{……に%
+ \ltjruby{\texttt{;}}{セミコロン}という……}\\
+\hbox spread\zw{……に%
+ \ltjruby{\texttt{;}}{セミコロン}という……}
+\end{LTXexample}
\newpage
\section{\ruby{実|装}{じつ|そう}について}
-\label{sec:impl}
-次の例で実装の大まかな方法を説明する.
+\subsection{進入量の計算}
+\label{ssec:calc_intrusion}
+ルビ文字を自然に組んだときの幅が親文字のそれより多い場合,
+ルビの前後への進入量は次のように決定される.
+\begin{enumerate}[label=\emph{Step~\arabic*},labelindent=0pt,itemindent=*,itemsep=\medskipamount]
+ \item \underline{前文字進入許容量}$B_0$,\underline{後進入文字許容量}$A_0$の算出.
+
+ ルビ全角の長さを$r$とする.
+ \begin{enumerate}
+ \item \texttt{pre}の指定値が非負であった場合は,それに$r$を掛けたものを$B_0$とする.\\
+ そうでなかった場合は,「ルビの直前の文字」に対する
+ \Param{rubypreintrusion}の値に$r$を掛けたものを$B_0$とする
+ \footnote{%
+ なお,「ルビの直前の文字」が段落最初の\cs{parindent}分のインデントであった場合,
+ $B_0$を,「文字コード$-1$の文字」\Param{rubypreintrusion}の値に$r$を掛けた値と\cs{parindent}のうち
+ 小さい方とする.
+ }.
+ \item \texttt{post}の指定値が非負であった場合は,それに$r$を掛けたものを$A_0$とする.\\
+ そうでなかった場合は,「ルビの直後の文字」に対する
+ \Param{rubypostintrusion}の値にルビ全角の値を掛けたものを$A_0$とする.
+ \item \texttt{mode}の最下位ビット(bit~0)が0であった場合は,$B_0\leftarrow 0$, $A\leftarrow 0$とする.
+ \item もし2つ前の文字がルビで,その直後(つまりいま処理しているルビから見れば直前)
+ の文字へ$a'$だけの進入があった場合,現在のルビについて$B_0←\min(0,B_0-a')$とする.
+ \end{enumerate}
+ \item 前進入許容量$B$,後進入許容量$A$の算出.
+ \begin{enumerate}
+ \item まず$B\leftarrow B_0$,\ \ $A\leftarrow A_0$とする.
+ \item ルビとその直前の文字の間に和文処理グルー$g$が挿入された場合,
+ \begin{itemize}
+ \item $g$がJFMグルーの場合は,\texttt{intrude\_jfmgk}が真の場合に,
+ \item $g$が標準の和文間空白(\Param{kanjiskip})の場合は,
+ \texttt{intrude\_kanjiskip}が真の場合に,
+ \item $g$が標準の和欧文間空白(\Param{xkanjiskip})の場合は,
+ \texttt{intrude\_xkanjiskip}が真の場合に,
+ \end{itemize}
+ それぞれ$g$の自然長を$B$に加算する.
+
+ ルビとその直後の文字との間に和文処理グルーが挿入された場合も同様である.
+
+ \item \texttt{mode}の2番目のビット(bit~1)が0であった場合は,$B$,~$A\leftarrow \min(B,A)$とする.
+ \end{enumerate}
+ \item 実際の前進入量$b$,後進入量$a$の計算.
+
+ ルビ文字の突出量を$x$,
+ 親文字の文字数を$k+1$,親文字の前に入る空白量・間の空白量・後ろの空白量の比を$p:q:r$とする.
+ このとき,\texttt{mode}のbit 2,~3の値によって$b$,~$a$を次のように算出する:
+\begin{description}[labelindent=\zw]
+ \item[00] $b=\min(B, xp/(p+kq+r))$, \ $a=\min(A, xr/(p+kq+r))$
+ \item[01] $b=\min(B, x)$, \ $a=\min(A, \max(x-b,0))$
+ \item[10] $a=\min(A, x)$, \ $b=\min(B, \max(x-a,0))$
+ \item[11] $M=\min(B,A)$とおく.もし$x\le 2M$ならば$b=a=x/2$.そうでなければ
+\[
+ b=\min\mleft(B, M + \frac{(x-2M)p}{p+kq+r}\mright),\qquad
+ a=\min\mleft(A, M + \frac{(x-2M)r}{p+kq+r}\mright).
+\]
+\end{description}
+
+組み方の具体例を実際に示す.例示のため,平仮名にはルビが1字まで,「立」にはルビを
+0.5字分までかけてよいことにしている.
+\begin{description}[labelindent=\zw]
+\item[00]{\setkeys[ltj]{ruby}{mode=1}%
+\ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
+は\ltjruby{美}{うつく}しい
+ \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
+は\ltjruby{暁}{あかつき}立\quad
+は\ltjruby{峠}{とうげ}立\quad
+は\ltjruby{聴衆}{ちようしゆう}立\par}
+\item[01]{\setkeys[ltj]{ruby}{mode=5}%
+\ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
+は\ltjruby{美}{うつく}しい
+ \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
+は\ltjruby{暁}{あかつき}立\quad
+は\ltjruby{峠}{とうげ}立\quad
+は\ltjruby{聴衆}{ちようしゆう}立\par}
+\item[10]{%
+\setkeys[ltj]{ruby}{mode=9}%
+\ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
+は\ltjruby{美}{うつく}しい
+ \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
+は\ltjruby{暁}{あかつき}立\quad
+は\ltjruby{峠}{とうげ}立\quad
+は\ltjruby{聴衆}{ちようしゆう}立\par}
+\item[11]{\setkeys[ltj]{ruby}{mode=13}%
+\ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
+は\ltjruby{美}{うつく}しい\quad
+は\ltjruby{聴衆}{ちようしゆう}と\quad
+は\ltjruby{暁}{あかつき}立\quad
+は\ltjruby{峠}{とうげ}立\quad
+は\ltjruby{聴衆}{ちようしゆう}立\par}
+\end{description}
+\end{enumerate}
+
+\subsection{ノードの扱い}
+\label{ssec:impl}
+次の例で内部実装の大まかな方法を説明する.
\begin{LTXexample}[preset=\Large]
……を\ltjruby{流|暢}{りゆう|ちよう}に……
\end{LTXexample}
@@ -534,7 +646,7 @@ $g_0\rightarrow W\rightarrow r_1\rightarrow g_2 \rightarrow r_2\rightarrow g_2$\
$g_i$,~$r_i$達の幅は,図\nobreak\ref{fig:node}に示したような対応に沿って算出する.
例えばこの場合,行中形$n_5$に対して
\[
- g_0+r_1+g_2+r_2+g_2 = 3\,\mathrm{zw}-(0.25\,\mathrm{zw}\times 2)=2.5\,\mathrm{zw}
+ g_0+r_1+g_2+r_2+g_2 = (3-0.25\times 2)\,\mathrm{zw}=2.5\,\mathrm{zw}
\]
という方程式が立つ(zwは親文字全角の幅,進入量込).
$n_1$から$n_5$まで計5本の方程式が立つが,これらはGau\ss の消去法で解くことができて
@@ -702,6 +814,24 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B
\ruby[size=1]{Cogito ergo sum}{コギト・エルゴ・スム}% 欧文空白は伸長しない
\end{LTXexample}
+
+\typeout{AAAAAA}
+\setbox0=\vbox{\hsize20\zw
+ \ltjsetparameter{rubypreintrusion={`◆,1}}
+ \ltjsetparameter{rubypostintrusion={`◆,1}}
+ \def\TEST{\ruby{CD}{◆ンパクト・ディス◆}}
+ %\ltjsetparameter{xkanjiskip=.25\zw}
+ ◆◆◆\TEST ◆◆◆◆◆◆◆◆◆◆◆\TEST %
+ ◆◆◆◆◆◆\kern1\zw ◆◆◆◆◆◆◆◆◆\kern0.5\zw ◆◆◆◆◆◆◆◆◆◆◆◆◆◆\TEST ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
+
+ 値とは\ruby{\texttt{;}}{セミコロン}で区切\\
+ ◆\ruby{A}{◆}◆\\◆\ruby{A}{◆◆}◆\\◆\ruby{A}{◆◆◆}◆\\◆\ruby{A}{◆◆◆◆}◆\\%
+ ◆\ruby{A}{◆◆◆◆◆}◆\\◆\ruby{A}{◆◆◆◆◆◆}◆\\◆A◆
+
+ \makebox[10\zw][s]{値とは\ruby{\texttt{;}}{セミコロン}で区切}%
+}
+\fbox{\box0}
+
\newpage
\section{『日本語組版処理の要件』20120403の例}
@@ -715,7 +845,7 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B
3.50 \ruby{人}{ひと}に\ruby{誨}{おし}えて\ruby{\倦}{う}まず
% モノルビ.面倒でも複数回の実行が必要
3.51 \ruby{鬼}{き}\ruby{門}{もん}の\ruby{方}{ほう}\ruby{角}{がく}を%
- \ruby{凝}{ぎょう}\ruby{視}{し}する
+ \ruby{凝}{ぎよう}\ruby{視}{し}する
% 熟語ルビ
3.52 \ruby{鬼|門}{き|もん}の\ruby{方|角}{ほう|がく}を\ruby{凝|視}{ぎよう|し}する
3.53 \ruby{茅場町}{かやばちよう}\quad\ruby{茅|場}{かや|ば}\ruby{町}{ちよう}
@@ -793,9 +923,9 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B
% モノルビ配置.望ましくない
3.76× の\ruby{流}{りゆう}\ruby{儀}{ぎ}を\quad の\ruby{無}{む}\ruby{常}{じよう}を\quad%
-要調整 3.77\ {\ltjsetruby{stretchbol=121, stretcheol=121}% 行頭・行末揃えず
- \hbox{\vrule\vbox{\hsize=10\zw ああああああああの%
- \ruby{流|儀}{りゆう|ぎ}がある.}\vrule}\textbf{←なぜ改行できない}\quad%
+3.77 {\ltjsetruby{stretchbol=121, stretcheol=121}% 行頭・行末揃えず
+ \hbox{\vrule\vbox{\hsize=10\zw\noindent\kern.75\zw
+ あああああああの\ruby{流|儀}{りゆう|ぎ}がある.}\vrule}\quad%
\hbox{\vrule\vbox{\hsize=5\zw ……等の\ruby{無|常}{む|じよう}を}\vrule}}
\end{LTXexample}
@@ -803,7 +933,6 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B
\begin{LTXexample}[pos=t]
\obeylines
3.78 \ruby{人}{ひと}は\ruby{死}{し}して\ruby{名}{な}を\ruby{残}{のこ}す
-% 現在の自動設定の仕様では「脚」の前が四分だけ「要件」の例より空く
3.79 漢字の部首には\ruby{偏}{へん}・\ruby{冠}{かんむり}・\ruby{脚}{きやく}・%
\ruby{旁}{つくり}がある
3.79 漢字の部首には\ruby{偏}{へん},\ruby{冠}{かんむり},\ruby{脚}{きやく},%
@@ -811,11 +940,6 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B
\end{LTXexample}
\begin{LTXexample}[pos=t]
\obeylines
-% もちろん手動で進入量を指定すれば話は別
-3.79 漢字の部首には\ruby{偏}{へん}・\ruby{冠}{かんむり}・\ruby[pre=1]{脚}{きやく}・%
- \ruby{旁}{つくり}がある
-3.79 漢字の部首には\ruby{偏}{へん},\ruby{冠}{かんむり},\ruby[pre=1]{脚}{きやく},%
- \ruby{旁}{つくり}がある
3.79 この\ruby{\噂}{うわさ}の好きな人は\ruby{懐}{ふところ}ぐあいもよく、\ruby{檜}{ひのき}を
3.80 漢字の部首には「\ruby{偏}{へん}」「\ruby{冠}{かんむり}」「\ruby{脚}{きやく}」%
「\ruby{旁}{つくり}」がある
@@ -823,8 +947,13 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B
3.81× に\ruby{暁}{あかつき}の\kern-1\zw の\ruby{趣}{おもむき}を(良くない例)
3.82 に\ruby{暁}{あかつき}の\ruby{趣}{おもむき}を
-% 漢字にルビを2分まで掛けても良い流儀
+% 漢字・ひらがな・カタカナにルビを2分まで掛けても良い流儀
{%
+ \catcode`\<12%
+ \makeatletter\count@="3040\loop\relax\ifnum \count@<"30FF%
+ \ltjsetparameter{rubypreintrusion={\the\count@,0.5}, %
+ rubypostintrusion={\the\count@,0.5}}%
+ \advance\count@1 \repeat
\ltjsetparameter{rubypostintrusion={`好,0.5}}
\ltjsetparameter{rubypostintrusion={`具,0.5}}
\ltjsetparameter{rubypostintrusion={`材,0.5}}
diff --git a/macros/luatex/generic/luatexja/src/addons/luatexja-ajmacros.sty b/macros/luatex/generic/luatexja/src/addons/luatexja-ajmacros.sty
index ca187cc900..10c2cd8fde 100644
--- a/macros/luatex/generic/luatexja/src/addons/luatexja-ajmacros.sty
+++ b/macros/luatex/generic/luatexja/src/addons/luatexja-ajmacros.sty
@@ -68,7 +68,7 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja-ajmacros}[2017/05/05]
+ \ProvidesPackage{luatexja-ajmacros}[2020-10-09]
\fi %</LaTeX>
%%------------------
@@ -435,7 +435,7 @@
\@tempcntb12054
\@aj@ligaturedef{医療法人}{学校法人}{共同組合}{協同組合}{合資会社}{合名会社}{社団法人}{宗教法人}{郵便番号}\@nil
\expandafter\gdef\csname ajLigオングストローム*\endcsname
- {\mbox{\kern.05zw\ajLig{オントロ}\kern-.1zw\ajLig{グスーム}\kern.05zw}}
+ {\mbox{\kern.05\zw\ajLig{オントロ}\kern-.1\zw\ajLig{グスーム}\kern.05\zw}}
\@tempcnta20929
\@tempcntb20943
\@aj@ligaturedef{ガル}{グレイ}{クローナ}{シーベルト}{シェケル}{ジュール}{デシベル}{ドット}{バイト}{ビット}{ベクレル}{ボー}{ランド}{リンギット}\@nil%AJ1-6
diff --git a/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty b/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty
index 7c1a939e6d..149dd03de7 100644
--- a/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty
+++ b/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty
@@ -4,7 +4,7 @@
% LaTeX only!
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-ruby}[2020-10-05 v0.3]
+\ProvidesPackage{luatexja-ruby}[2020-10-30 v0.4]
\RequirePackage{luatexja}
%%------------------
@@ -73,8 +73,11 @@
\expandafter\def\csname ltj@@rubyip@ybaseheight\endcsname{#1}%
\expandafter\def\csname ltj@@rubyip@tbaseheight\endcsname{#1}%
}
-
%% これらの値が正のとき,親文字の高さをこの値(\zh 単位)とみなす
+\define@boolkey[ltj]{ruby}{intrude_jfmgk}[true]{}
+\define@boolkey[ltj]{ruby}{intrude_xkanjiskip}[true]{}
+\define@boolkey[ltj]{ruby}{intrude_kanjiskip}[true]{}
+
%%%%%%%% setkeys の別名
\protected\def\ltjsetruby{\setkeys[ltj]{ruby}}
@@ -91,8 +94,11 @@
%%%%%%%% 補助関数
% Lua ソースに渡す table 生成
-\def\ltj@@ruby@create@table#1{% #1: ルビ全角
+\bgroup
+\catcode`\_=11
+\gdef\ltj@@ruby@create@table#1{% #1: ルビ全角
\string{
+ before_jfmgk = 0, after_jfmgk = 0,
rubyzw = \ltj@safe@dimen{#1},
maxmargin = \ltj@safe@dimen{\ltj@@rubyip@maxmargin\zw},
pre = \ltj@safe@dimen{\ltj@@rubyip@pre#1},
@@ -108,8 +114,20 @@
+ 1048576 * \ifltj@ruby@rubysmash1\else0\fi),
baseheight = \ltj@safe@dimen{\ifnum\ltjgetparameter{direction}=3
\ltj@@rubyip@tbaseheight\else\ltj@@rubyip@ybaseheight\fi\zh},
+ intrude_jfmgk = \string{
+ \ifltj@ruby@intrude_jfmgk [luatexja.icflag_table.FROM_JFM]=true,\fi
+ \ifltj@ruby@intrude_kanjiskip
+ [luatexja.icflag_table.KANJI_SKIP]=true,
+ [luatexja.icflag_table.KANJI_SKIP_JFM]=true,
+ \fi
+ \ifltj@ruby@intrude_xkanjiskip
+ [luatexja.icflag_table.XKANJI_SKIP]=true,
+ [luatexja.icflag_table.XKANJI_SKIP_JFM]=true,
+ \fi
+ \string}
\string}
}
+\egroup
%%%
%%% 1098765432109876543210976543210
%%% |st_ruby|! |--| ← mode
@@ -213,7 +231,7 @@
{\ltjsetparameter{rubypostintrusion={\@tmp,1}}}
%% 中点類
\@for\@tmp:=`\・,`\:,`\;,`\―,`\‥,`\…,`〳,`\〴,`\〵,"2014 \do
- {\ltjsetparameter{rubypreintrusion={\@tmp,1},rubypostintrusion={\@tmp,1}}}
+ {\ltjsetparameter{rubypreintrusion={\@tmp,0.5},rubypostintrusion={\@tmp,0.5}}}
%% 読点・句点
\@for\@tmp:=`\、,`\,,`\。,`\. \do
{\ltjsetparameter{rubypostintrusion={\@tmp,1}}}
@@ -225,7 +243,8 @@
stretchruby={1}{2}{1}, stretch = {1}{2}{1},
stretchbol={0}{1}{1}, stretcheol={1}{1}{0},
maxmargin=0.5, size=0.5, intergap=0, rubysmash=false,
- kenten=\ltjalchar`•, fontcmd=\relax, ybaseheight=0.88, tbaseheight=0.5
+ kenten=\ltjalchar`•, fontcmd=\relax, ybaseheight=0.88, tbaseheight=0.5,
+ intrude_jfmgk, intrude_kanjiskip, intrude_xkanjiskip
}
\endinput
diff --git a/macros/luatex/generic/luatexja/src/jfm-ujis.lua b/macros/luatex/generic/luatexja/src/jfm-ujis.lua
index 5df1986ea6..07c51b554f 100644
--- a/macros/luatex/generic/luatexja/src/jfm-ujis.lua
+++ b/macros/luatex/generic/luatexja/src/jfm-ujis.lua
@@ -6,7 +6,6 @@
-- kanjiskip: 0pt plus .25zw minus 0pt
-- xkanjiskip: .25zw plus .25zw (or .0833zw) minus .125zw
-
local t = {
version = 3,
dir = 'yoko',
@@ -332,11 +331,12 @@ local t = {
}
},
-
[99] = { -- box末尾
- chars = {'boxbdd', 'parbdd', 'glue'},
+ chars = {'boxbdd', 'glue'},
+ },
+ [199] = { -- box末尾
+ chars = {'parbdd'},
},
-
}
local ht = t[007].chars
@@ -357,4 +357,9 @@ for i,v in pairs(t) do
end
end
+local jf = luatexja.jfont.jfm_feature
+if jf and jf.beginpar_middledot_zw==true then
+ t[199].kern = { [3] = 0.25 }
+end
+
luatexja.jfont.define_jfm(t)
diff --git a/macros/luatex/generic/luatexja/src/jfm-ujisv.lua b/macros/luatex/generic/luatexja/src/jfm-ujisv.lua
index b2044bde5a..62becb25a3 100644
--- a/macros/luatex/generic/luatexja/src/jfm-ujisv.lua
+++ b/macros/luatex/generic/luatexja/src/jfm-ujisv.lua
@@ -6,7 +6,6 @@
-- kanjiskip: 0pt plus .25zw minus 0pt
-- xkanjiskip: .25zw plus .25zw (or .0833zw) minus .125zw
-
local t = {
version = 3,
dir = 'tate',
@@ -275,7 +274,10 @@ local t = {
},
[99] = { -- box末尾
- chars = {'boxbdd', 'parbdd', 'glue'},
+ chars = {'boxbdd', 'glue'},
+ },
+ [199] = { -- box末尾
+ chars = {'parbdd'},
},
}
@@ -305,4 +307,9 @@ for i,v in pairs(t) do
end
end
+local jf = luatexja.jfont.jfm_feature
+if jf and jf.beginpar_middledot_zw==true then
+ t[199].kern = { [3] = 0.25 }
+end
+
luatexja.jfont.define_jfm(t)
diff --git a/macros/luatex/generic/luatexja/src/ltj-jfmglue.lua b/macros/luatex/generic/luatexja/src/ltj-jfmglue.lua
index e3cae86534..7775e4720d 100644
--- a/macros/luatex/generic/luatexja/src/ltj-jfmglue.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-jfmglue.lua
@@ -3,7 +3,7 @@
--
luatexbase.provides_module({
name = 'luatexja.jfmglue',
- date = '2020-10-05',
+ date = '2020-10-22',
description = 'Insertion process of JFM glues, [x]kanjiskip and others',
})
luatexja.jfmglue = luatexja.jfmglue or {}
@@ -1220,27 +1220,10 @@ do
end
end
-local ensure_tex_attr = ltjb.ensure_tex_attr
-local function cleanup(mode, TEMP)
- -- luatexja.ext_show_node_list(to_node(head), '> ', print)
- -- adjust attr_icflag for avoiding error
- if tex.getattribute(attr_icflag)~=0 then ensure_tex_attr(attr_icflag, 0) end
- node_free(kanji_skip);
- node_free(xkanji_skip); node_free(TEMP)
-
- if mode then
- local h = node_next(head)
- if getid(h) == id_penalty and getfield(h, 'penalty') == 10000 then
- h = node_next(h)
- if getid(h) == id_glue and getsubtype(h) == 15 and not node_next(h) then
- return false
- end
- end
- end
- return head
-end
-------------------- 外部から呼ばれる関数
+local ensure_tex_attr = ltjb.ensure_tex_attr
+local tex_getattr = tex.getattribute
-- main interface
function luatexja.jfmglue.main(ahead, mode, dir)
if not ahead then return ahead end
@@ -1267,9 +1250,11 @@ function luatexja.jfmglue.main(ahead, mode, dir)
end
handle_list_tail(mode, last)
end
- --luatexja.ext_show_node_list(to_node(ahead ), '>A ', print)
- --print()
- return cleanup(mode, TEMP)
+ -- adjust attr_icflag for avoiding error
+ if tex_getattr(attr_icflag)~=0 then ensure_tex_attr(attr_icflag, 0) end
+ node_free(kanji_skip);
+ node_free(xkanji_skip); node_free(TEMP)
+ return head
end
end
diff --git a/macros/luatex/generic/luatexja/src/ltj-latex.sty b/macros/luatex/generic/luatexja/src/ltj-latex.sty
index 834f16e70a..506adea2e7 100644
--- a/macros/luatex/generic/luatexja/src/ltj-latex.sty
+++ b/macros/luatex/generic/luatexja/src/ltj-latex.sty
@@ -12,7 +12,7 @@
\def\luatexjalatexLoaded{\endinput}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ltj-latex}[2020-10-01 LaTeX support of LuaTeX-ja]
+\ProvidesPackage{ltj-latex}[2020-10-09 LaTeX support of LuaTeX-ja]
% cleanup at end of the document
%\let\ltj@@orig@end=\@@end
@@ -67,7 +67,7 @@
\def\ltj@pkgpatch#1{\@ifnextchar[{\ltj@pkgpatch@{#1}}{\ltj@pkgpatch@{#1}[lltjp-#1]}}%]
\ifltj@ltfilehook@avail
- \def\ltj@pkgpatch@@{\AddToHook{env/document/before}[luatexja.autopatch]}
+ \def\ltj@pkgpatch@@{\AddToHook{begindocument/before}[luatexja.autopatch]}
\else
\def\ltj@pkgpatch@@{\gpreto\@begindocumenthook}
\fi
diff --git a/macros/luatex/generic/luatexja/src/ltj-otf.lua b/macros/luatex/generic/luatexja/src/ltj-otf.lua
index 56c0154e34..42792769d7 100644
--- a/macros/luatex/generic/luatexja/src/ltj-otf.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-otf.lua
@@ -191,13 +191,13 @@ ltjb.add_to_callback('pre_linebreak_filter', extract,'ltj.otf',
-- 和文フォント読み込み時に,ind -> unicode 対応をとっておく.
local function ind_to_uni(fmtable, fn)
if fn<0 then return end
- local cid = ltju.get_cidinfo(fn);
+ local cid = ltju.get_cidinfo(fn)
local t = ltjf_font_extra_info[fn]; t = t and t.ind_to_uni
if t and cid.ordering == "Japan1" then
for i, v in pairs(fmtable.chars) do
local j = string.match(i, "^AJ1%-([0-9]*)")
if j then
- j = t[i]
+ j = t[tonumber(j)]
if j then
fmtable.cid_char_type = fmtable.cid_char_type or {}
fmtable.cid_char_type[j] = v
diff --git a/macros/luatex/generic/luatexja/src/ltj-ruby.lua b/macros/luatex/generic/luatexja/src/ltj-ruby.lua
index e2cb40d925..685e19bb0b 100644
--- a/macros/luatex/generic/luatexja/src/ltj-ruby.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-ruby.lua
@@ -3,7 +3,7 @@
--
luatexbase.provides_module({
name = 'luatexja.ruby',
- date = '2020-10-05',
+ date = '2020-10-30',
description = 'Ruby annotation',
})
luatexja.ruby = {}
@@ -43,14 +43,7 @@ local id_pbox_w = 258 -- cluster which consists of a whatsit
local attr_icflag = luatexbase.attributes['ltj@icflag']
-- ルビ処理用の attribute は他のやつの流用なので注意!
-- 進入許容量 (sp)
-local attr_ruby_maxprep = luatexbase.attributes['ltj@charclass']
-local attr_ruby_maxpostp = luatexbase.attributes['ltj@kcat0']
-local attr_ruby_maxmargin = luatexbase.attributes['ltj@kcat1']
-local attr_ruby_stretch = luatexbase.attributes['ltj@kcat2']
-local attr_ruby_mode = luatexbase.attributes['ltj@kcat3']
local attr_ruby_id = luatexbase.attributes['ltj@kcat4'] -- uniq id
-local attr_ruby_intergap = luatexbase.attributes['ltj@kcat5']
-local attr_ruby_baseheight= luatexbase.attributes['ltj@kcat6']
local attr_ruby = luatexbase.attributes['ltj@rubyattr']
-- ルビ内部処理用,以下のようにノードによって使われ方が異なる
-- * (whatsit) では JAglue 処理時に,
@@ -260,17 +253,9 @@ local function texiface_low(rst, rtlr, rtlp)
setfield(w, 'type', 110); setfield(w, 'user_id', RUBY_PRE)
local wv = node_new(id_whatsit, sid_user)
setfield(w, 'value', to_node(wv))
- setfield(wv, 'type', 100)
- setfield(wv, 'value', floor(#rtlr))
+ setfield(wv, 'type', 108)
+ setfield(wv, 'value', rst); rst.count = floor(#rtlr)
setfield(wv, 'user_id', RUBY_PRE) -- dummy
- set_attr(wv, attr_ruby, rst.rubyzw)
- set_attr(wv, attr_ruby_maxmargin, rst.maxmargin)
- set_attr(wv, attr_ruby_maxprep, rst.pre)
- set_attr(wv, attr_ruby_maxpostp, rst.post)
- set_attr(wv, attr_ruby_intergap, rst.intergap)
- set_attr(wv, attr_ruby_baseheight, rst.baseheight)
- set_attr(wv, attr_ruby_stretch, rst.stretch)
- set_attr(wv, attr_ruby_mode, rst.mode)
local n = wv
for i = 1, #rtlr do
_, n = insert_after(wv, n, rtlr[i])
@@ -314,13 +299,19 @@ end
----------------------------------------------------------------
-- r, p の中身のノードは再利用される
-local function enlarge_parent(r, p, tmp_tbl, intmode)
+local function enlarge_parent(r, p, tmp_tbl, no_begin, no_end)
-- r: ルビ部分の格納された box,p: 同,親文字
local rwidth = getfield(r, 'width')
local sumprot = rwidth - getfield(p, 'width') -- >0
local pre_intrusion, post_intrusion
local ppre, pmid, ppost = tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost
local mapre, mapost = tmp_tbl.mapre, tmp_tbl.mapost
+ local intmode = floor(tmp_tbl.mode/4)%4
+ if no_begin then mapre = mapre + tmp_tbl.before_jfmgk end
+ if no_end then mapost = mapost + tmp_tbl.after_jfmgk end
+ if (tmp_tbl.mode%4 >=2) and (tmp.pre<0) and (tmp.post<0) then
+ mapre = min(mapre,mapost); mapost = mapre
+ end
if intmode == 0 then -- とりあえず組んでから決める
p = enlarge(p, rwidth, ppre, pmid, ppost, 0, 0)
pre_intrusion = min(mapre, round(ppre*getfield(p, 'glue_set')*65536))
@@ -350,25 +341,26 @@ local function enlarge_parent(r, p, tmp_tbl, intmode)
setfield(p, 'width', rwidth)
local ps = getlist(p)
setfield(ps, 'width', getfield(ps, 'width') - pre_intrusion)
- return r, p, post_intrusion
+ local orig_post_intrusion = post_intrusion
+ if no_end then orig_post_intrusion = max(orig_post_intrusion - tmp_tbl.after_jfmgk, 0) end
+ return r, p, orig_post_intrusion
end
-- ルビボックスの生成(単一グループ)
-- returned value: <new box>, <ruby width>, <post_intrusion>
local max_margin
-local function new_ruby_box(r, p, tmp_tbl)
+local function new_ruby_box(r, p, tmp_tbl, no_begin, no_end)
local post_intrusion = 0
local imode
local ppre, pmid, ppost = tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost
local mapre, mapost = tmp_tbl.mapre, tmp_tbl.mapost
local rpre, rmid, rpost, rsmash
- imode = floor(tmp_tbl.imode/0x100000); rsmash = (imode%2 ==1)
+ imode = floor(tmp_tbl.mode/0x100000); rsmash = (imode%2 ==1)
imode = floor(imode/2); rpost = imode%8;
imode = (imode-rpost)/8; rmid = imode%8;
imode = (imode-rmid)/8; rpre = imode%8
if getfield(r, 'width') > getfield(p, 'width') then -- change the width of p
- r, p, post_intrusion = enlarge_parent(r, p, tmp_tbl,
- floor(tmp_tbl.imode/4)%4)
+ r, p, post_intrusion = enlarge_parent(r, p, tmp_tbl, no_begin, no_end)
elseif getfield(r, 'width') < getfield(p, 'width') then -- change the width of r
r = enlarge(r, getfield(p, 'width'), rpre, rmid, rpost, 0, 0)
post_intrusion = 0
@@ -392,10 +384,10 @@ local function new_ruby_box(r, p, tmp_tbl)
end
local a, k = node_new(id_rule), node_new(id_kern, 1)
setfield(a, 'width', 0); setfield(a, 'height', 0)
- setfield(a, 'depth', 0); setfield(k, 'kern', tmp_tbl.rgap)
+ setfield(a, 'depth', 0); setfield(k, 'kern', tmp_tbl.intergap)
insert_after(r, r, a); insert_after(r, a, k);
insert_after(r, k, p); setfield(p, 'next', nil)
- if tmp_tbl.bheight >= 0 then setfield(p, 'height', tmp_tbl.bheight) end
+ if tmp_tbl.baseheight >= 0 then setfield(p, 'height', tmp_tbl.baseheight) end
a = node.direct.vpack(r); setfield(a, 'shift', 0)
set_attr(a, attr_ruby, post_intrusion)
if rsmash or getfield(a, 'height')<getfield(p, 'height') then
@@ -416,10 +408,7 @@ local max_allow_pre, max_allow_post
-- 中付き熟語ルビ,cmp containers
-- 「文字の構成を考えた」やつはどうしよう
-local pre_low_cal_box
-do
-local tmp_tbl = {}
-pre_low_cal_box = function (w, cmp)
+local function pre_low_cal_box(w, cmp)
local rb = {}
local pb = {}
local kf = {}
@@ -427,17 +416,15 @@ pre_low_cal_box = function (w, cmp)
-- kf[cmp+i] : container i--cmp からなる行頭形
-- kf[2cmp+1] : 行中形
local wv = getfield(w, 'value')
+ local rst = getfield(wv, 'value')
local mdt -- nt*: node temp
local coef = {} -- 連立一次方程式の拡大係数行列
- local rtb = expand_3bits(has_attr(wv, attr_ruby_stretch))
- tmp_tbl.rgap = has_attr(wv, attr_ruby_intergap)
- tmp_tbl.imode = has_attr(wv, attr_ruby_mode)
- tmp_tbl.bheight = has_attr(wv, attr_ruby_baseheight)
+ local rtb = expand_3bits(rst.stretch)
-- node list 展開・行末形の計算
local nt, nta, ntb = wv, nil, nil -- nt*: node temp
- tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost = rtb[6], rtb[5], rtb[4]
- tmp_tbl.mapre, tmp_tbl.mapost = max_allow_pre, 0
+ rst.ppre, rst.pmid, rst.ppost = rtb[6], rtb[5], rtb[4]
+ rst.mapre, rst.mapost = max_allow_pre, 0
for i = 1, cmp do
nt = node_next(nt); rb[i] = nt; nta = concat(nta, node_copy(nt))
nt = node_next(nt); pb[i] = nt; ntb = concat(ntb, node_copy(nt))
@@ -445,31 +432,31 @@ pre_low_cal_box = function (w, cmp)
for j = 1, 2*i do coef[i][j] = 1 end
for j = 2*i+1, 2*cmp+1 do coef[i][j] = 0 end
kf[i], coef[i][2*cmp+2]
- = new_ruby_box(node_copy(nta), node_copy(ntb), tmp_tbl)
+ = new_ruby_box(node_copy(nta), node_copy(ntb), rst, true, false)
end
node_free(nta); node_free(ntb)
-- 行頭形の計算
local nta, ntb = nil, nil
- tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost = rtb[9], rtb[8], rtb[7]
- tmp_tbl.mapre, tmp_tbl.mapost = 0, max_allow_post
+ rst.ppre, rst.pmid, rst.ppost = rtb[9], rtb[8], rtb[7]
+ rst.mapre, rst.mapost = 0, max_allow_post
for i = cmp,1,-1 do
coef[cmp+i] = {}
for j = 1, 2*i-1 do coef[cmp+i][j] = 0 end
for j = 2*i, 2*cmp+1 do coef[cmp+i][j] = 1 end
nta = concat(node_copy(rb[i]), nta); ntb = concat(node_copy(pb[i]), ntb)
kf[cmp+i], coef[cmp+i][2*cmp+2]
- = new_ruby_box(node_copy(nta), node_copy(ntb), tmp_tbl)
+ = new_ruby_box(node_copy(nta), node_copy(ntb), rst, false, true)
end
-- ここで,nta, ntb には全 container を連結した box が入っているので
-- それを使って行中形を計算する.
coef[2*cmp+1] = {}
for j = 1, 2*cmp+1 do coef[2*cmp+1][j] = 1 end
- tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost = rtb[3], rtb[2], rtb[1]
- tmp_tbl.mapre, tmp_tbl.mapost = max_allow_pre, max_allow_post
+ rst.ppre, rst.pmid, rst.ppost = rtb[3], rtb[2], rtb[1]
+ rst.mapre, rst.mapost = max_allow_pre, max_allow_post
kf[2*cmp+1], coef[2*cmp+1][2*cmp+2], post_intrusion_backup
- = new_ruby_box(nta, ntb, tmp_tbl)
+ = new_ruby_box(nta, ntb, rst, true, true)
-- w.value の node list 更新.
local nt = wv
@@ -483,7 +470,6 @@ pre_low_cal_box = function (w, cmp)
end
return coef
end
-end
local first_whatsit
do
@@ -535,8 +521,9 @@ local function pre_high(ahead)
local n = first_whatsit(head)
while n do
if getsubtype(n) == sid_user and getfield(n, 'user_id') == RUBY_PRE then
- local nv = getfield(n, 'value')
- max_allow_pre = has_attr(nv, attr_ruby_maxprep) or 0
+ local nv = getfield(n, 'value')
+ local rst = getfield(nv, 'value')
+ max_allow_pre = rst.pre or 0
local atr = has_attr(n, attr_ruby) or 0
if max_allow_pre < 0 then
if atr>0 then
@@ -550,13 +537,12 @@ local function pre_high(ahead)
end
end
post_intrusion_backup = 0
- max_allow_post = has_attr(nv, attr_ruby_maxpostp) or 0
- max_margin = has_attr(nv, attr_ruby_maxmargin) or 0
- local coef = pre_low_cal_box(n, getfield(nv, 'value'))
+ max_allow_post = rst.post or 0
+ max_margin = rst.maxmargin or 0
+ local coef = pre_low_cal_box(n, rst.count)
local s = node_tail(nv) --ルビ文字
head, n = pre_low_app_node(
- head, n, getfield(nv, 'value'), coef,
- getfield(s, 'height'), getfield(s, 'depth')
+ head, n, rst.count, coef, getfield(s, 'height'), getfield(s, 'depth')
)
else
n = first_whatsit(node_next(n))
@@ -646,7 +632,7 @@ local function post_high_break(head)
rs[1], rw = ha, nil; ha = node_next(ha)
elseif i==2 then
rw = ha
- cmp = getfield(getfield(rw, 'value'), 'value')
+ cmp = getfield(getfield(rw, 'value'), 'value').count
local hb, hc = node_remove(getlist(h), rw)
setfield(h, 'head', hb); ha = hc
else -- i>=3
@@ -678,7 +664,7 @@ local function post_high_hbox(ahead)
rs[1], rw = ha, nil; ha = node_next(ha)
elseif i==2 then
rw = ha
- cmp = getfield(getfield(rw, 'value'), 'value')
+ cmp = getfield(getfield(rw, 'value'), 'value').count
head, ha = node_remove(head, rw)
else -- i >= 3
rs[#rs+1] = ha; ha = node_next(ha)
@@ -701,37 +687,38 @@ do
elseif getfield(lp, 'user_id') == RUBY_PRE then
Np.first, Np.nuc, Np.last = lp, lp, lp
local lpv = getfield(lp, 'value')
+ local rst = getfield(lpv, 'value')
local x = node_next(node_next(lpv))
Np.last_char = luatexja.jfmglue.check_box_high(Np, getlist(x), nil)
if Nq.id ~=id_pbox_w then
if type(Nq.char)=='number' then
-- Nq is a JAchar
- if has_attr(lpv, attr_ruby_maxprep) < 0 then -- auto
+ if rst.pre < 0 then -- auto
local p = round((ltjs.table_current_stack[RIPRE + Nq.char] or 0)
- *has_attr(lpv, attr_ruby))
- if has_attr(lpv, attr_ruby_mode)%2 == 0 then -- intrusion 無効
+ *rst.rubyzw)
+ if rst.mode%2 == 0 then -- intrusion 無効
p = 0
end
- set_attr(lpv, attr_ruby_maxprep, -p)
+ rst.pre = -p
end
if Nq.prev_ruby then
set_attr(lp, attr_ruby, Nq.prev_ruby)
end
- elseif has_attr(lpv, attr_ruby_maxprep) < 0 then -- auto
+ elseif rst.pre < 0 then -- auto
if Nq.char == 'parbdd' then
local p = round((ltjs.table_current_stack[RIPRE-1] or 0)
- *has_attr(lpv, attr_ruby))
+ *rst.rubyzw)
p = min(p, Nq.width)
- if has_attr(lpv, attr_ruby_mode)%2 == 0 then -- intrusion 無効
+ if rst.mode%2 == 0 then -- intrusion 無効
p = 0
end
- set_attr(lpv, attr_ruby_maxprep, p)
+ rst.pre = p
else
- set_attr(lpv, attr_ruby_maxprep, 0)
+ rst.pre = 0
end
end
- elseif has_attr(lpv, attr_ruby_maxprep) < 0 then -- auto
- set_attr(lpv, attr_ruby_maxprep, 0)
+ elseif rst.pre < 0 then -- auto
+ rst.pre = 0
end
return Np
else
@@ -743,6 +730,16 @@ do
end
do
+ local FROM_JFM = luatexja.icflag_table.FROM_JFM
+ local KANJI_SKIP = luatexja.icflag_table.KANJI_SKIP
+ local function add_gk(t, index, p)
+ local ic = get_attr_icflag(p)
+ if ic and (ic>FROM_JFM) and (ic<KANJI_SKIP) then ic = FROM_JFM end
+ if t.intrude_jfmgk[ic] then
+ if getid(p)==id_kern then t[index] = t[index] + getfield(p, 'kern')
+ else t[index] = t[index] + getfield(p, 'width') end
+ end
+ end
local RIPOST = luatexja.stack_table_index.RIPOST
local function whatsit_after_callback(s, Nq, Np)
if not s and getfield(Nq.nuc, 'user_id') == RUBY_PRE then
@@ -752,44 +749,35 @@ do
insert_before(Nq.nuc, Np.first, last_glue)
Np.first = last_glue
next_cluster_array[Nq.nuc] = last_glue -- ルビ処理用のグルー
--- if Nq.gk then
--- if type(Nq.gk)=="table" then
--- for _,v in ipairs(Nq.gk) do luatexja.ext_show_node(node.direct.tonode(v), 'BBt> ', print) end
--- else luatexja.ext_show_node(node.direct.tonode(Nq.gk), 'BBB> ', print) end
--- end
end
local nqnv = getfield(Nq.nuc, 'value')
+ local rst = getfield(nqnv, 'value')
+ if Nq.gk then
+ if type(Nq.gk)=="table" then
+ for _,v in ipairs(Nq.gk) do add_gk(rst, 'before_jfmgk', v) end
+ else add_gk(rst, 'before_jfmgk', Nq.gk) end
+ end
local x = node_next(node_next(nqnv))
- for i = 2, getfield(nqnv, 'value') do x = node_next(node_next(x)) end
+ for i = 2, rst.count do x = node_next(node_next(x)) end
Nq.last_char = luatexja.jfmglue.check_box_high(Nq, getlist(x), nil)
luatexja.jfmglue.after_hlist(Nq)
if Np and Np.id ~=id_pbox_w and type(Np.char)=='number' then
-- Np is a JAchar
- local rm = has_attr(nqnv, attr_ruby_mode)
- if has_attr(nqnv, attr_ruby_maxpostp) < 0 then -- auto
+ if rst.post < 0 then -- auto
local p = round((ltjs.table_current_stack[RIPOST + Np.char] or 0)
- *has_attr(nqnv, attr_ruby))
- if rm%2 == 0 then -- intrusion 無効
+ *rst.rubyzw)
+ if rst.mode%2 == 0 then -- intrusion 無効
p = 0
end
- if rm%4 >= 2 then
- local q = has_attr(nqnv, attr_ruby_maxprep)
- if q < p then p = q
- elseif q > p then
- set_attr(nqnv, attr_ruby_maxprep, p)
- end
- end
- set_attr(nqnv, attr_ruby_maxpostp, p)
+ rst.post = p
end
Np.prev_ruby = has_attr(getfield(Nq.nuc, 'value'), attr_ruby_id)
-- 前のクラスタがルビであったことのフラグ
else -- 直前が文字以外
local nqnv = getfield(Nq.nuc, 'value')
- if has_attr(nqnv, attr_ruby_maxpostp) < 0 then -- auto
- set_attr(nqnv, attr_ruby_maxpostp, 0)
- if has_attr(nqnv, attr_ruby_mode)%4 >= 2 then
- set_attr(nqnv, attr_ruby_maxprep, 0)
- end
+ local rst = getfield(nqnv, 'value')
+ if rst.post < 0 then -- auto
+ rst.post = 0
end
end
return true
@@ -799,16 +787,16 @@ do
end
luatexbase.add_to_callback("luatexja.jfmglue.whatsit_after", whatsit_after_callback,
"luatexja.ruby.np_info_after", 1)
-end
-if false then -- いまは off
- local function w (s, Nq, Np)
- if Np.gk then
- if type(Np.gk)=="table" then
- for _,v in ipairs(Np.gk) do luatexja.ext_show_node(node.direct.tonode(v), 'AAt> ', print) end
- else luatexja.ext_show_node(node.direct.tonode(Np.gk), 'AAA> ', print) end
- end
- end
- luatexbase.add_to_callback("luatexja.jfmglue.whatsit_last_minute", w,
+ local function w (s, Nq, Np)
+ if not s and getfield(Nq.nuc, 'user_id') == RUBY_PRE then
+ local rst = getfield(getfield(Nq.nuc, 'value'), 'value')
+ if Np.gk then
+ if type(Np.gk)=="table" then
+ for _,v in ipairs(Np.gk) do add_gk(rst, 'after_jfmgk', v) end
+ else add_gk(rst, 'after_jfmgk', Np.gk) end
+ end
+ end
+ end
+ luatexbase.add_to_callback("luatexja.jfmglue.whatsit_last_minute", w,
"luatexja.ruby.np_info_last_minute", 1)
end
-
diff --git a/macros/luatex/generic/luatexja/src/luatexja.sty b/macros/luatex/generic/luatexja/src/luatexja.sty
index 74df9c779c..f70120dd1f 100644
--- a/macros/luatex/generic/luatexja/src/luatexja.sty
+++ b/macros/luatex/generic/luatexja/src/luatexja.sty
@@ -35,13 +35,13 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja}[2020-10-05 Japanese Typesetting with Lua(La)TeX]
+ \ProvidesPackage{luatexja}[2020-10-30 Japanese Typesetting with Lua(La)TeX]
\DeclareOption{disablejfam}{\ltj@disablejfamtrue}
\DeclareOption*{}
\ProcessOptions\relax
\fi %</LaTeX>
%%%% VERSION
-\def\LuaTeXjaversion{20201005.0}
+\def\LuaTeXjaversion{20201030.0}
\directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs
diff --git a/macros/luatex/latex/hu-berlin-bundle/README.md b/macros/luatex/latex/hu-berlin-bundle/README.md
new file mode 100644
index 0000000000..c308748424
--- /dev/null
+++ b/macros/luatex/latex/hu-berlin-bundle/README.md
@@ -0,0 +1,139 @@
+hu-berlin-bundle
+================
+
+This package provides files according to the corporate design
+for the Humboldt-Universität zu Berlin.
+It is _no_ official package of the university itself and
+not officially approved by it.
+
+You find more information in the official [corporate design guideline](https://www.hu-berlin.de/de/hu-intern/design/basiselemente/leitfaden-corporate-design-hu.pdf)
+and on the website <https://www.hu-berlin.de/de/hu-intern/design>.
+
+## Documents and Documentations for hu-berlin bundle
+
+This bundle provides following files:
+
+ * `hu-berlin-bundle.dtx` which is the core file designed with literate programming
+ * `hu-berlin-bundle.ins` which is the installation file for all necessary files generated automatically
+ * `hu-berlin-bundle.pdf` is documentation of the bundle.
+ * `README.md`
+ * `makefile`
+
+All other files can and will be generated from the `.dtx` file (see below).
+
+Furthermore there is the folder `img` which contains the necessary image files.
+
+This work has the LPPL maintenance status _maintained_.
+The current maintainer of this work is [Lukas C. Bossert](https://github.com/lukascbossert).
+
+You find this bundle versioned and available on [Zenodo](https://doi.org/10.5281/zenodo.3251728)
+
+
+With this (unofficial) bundle you have several documents which are designed according to the corporate design of the Humboldt-Universität zu Berlin.
+
+Following documents or documentclasses are available:
+
+* letter (`hu-berlin-letter.cls`); via `.tex` and `.md`
+* base package (`hu-berlin-base.sty`)
+
+## Installation of the bundle
+`hu-berlin` is part of the distributions [MiKTeX](http://www.miktex.org)
+and [TeXLive](http://www.tug.org/texlive) -- thus, you
+can easily install it using the respective package manager.
+If you would like to
+install `hu-berlin-bundle` into your local folder manually, do the following:
+Go to your terminal, browse to the folder of this bundle and run
+
+```
+make install
+```
+
+If you are using macOS you might be asked for your user account password for the installation.
+
+Further options of this makefile are:
+
+* `clean`: deletes all unnecessary files
+* `cleanbundle`: deletes all files except `.dtx`, `.md`. You will get the plain version of this bundle.
+This might be helpful if you send the bundle to someone else.
+* `ctan`: this will create a zip file which can be used to send to CTAN.
+* `files`: will only create the files from the `.dtx`-scratch.
+* `uninstall`: will erase the locally installed files.
+
+This bundle is constantly updated. For hints, errors or suggestions use the GitHub repository [https://github.com/LukasCBossert/hu-berlin-bundle](https://github.com/LukasCBossert/hu-berlin-bundle).
+
+## Changelog
+
+All notable changes to this project will be documented in the [README.md](https://github.com/LukasCBossert/hu-berlin-bundle/blob/master/README.md).
+This project **does not** adhere to [Semantic Versioning](http://semver.org/).
+The markdown syntax is inspired by the conventions proposed by [keepachangelog.com](http://keepachangelog.com/).
+
+### v1.0.8 (2020/10/30)
+* (letter) replacing actual logo with a dummy text (due to possible copyright conflicts).
+ The correct logo has to be called `hu-berlin-logo.pdf`
+ and needs to be put somewhere in PATH so it will be found.
+ If such file cannot be found a dummy text will be taken instead (`Humboldt-Universität zu Berlin´)
+
+### v1.0.7 (2020/10/29)
+* (letter) fixed missing `\removereffields`
+* (letter) added missing suffix for hu-logo (`.pdf`)
+
+### v1.0.6 (2020-10-22)
+* (letter) changed address separator
+* (letter) fixed empty minipage when no metadata given
+* (letter) changed default backaddress
+
+### v1.0.5 (2020-04-28)
+* (general) Changed logo format to `.pdf`
+* (letter) Changed `\ifkomavarempty` to `\ifkomavarempty`, fixes
+ [github-issue nr. 1](https://github.com/LukasCBossert/hu-berlin-bundle/issues/1)
+
+### v1.0.4 (2019-12-19)
+* Added `hu-berlin-base.sty` as a package which contains all relevant code for documents and documentclasses of the bundle.
+
+### v1.0.3 (2019-06-26)
+ * Changed the main font for compatibility with UNIX-systems (TeX Gyre Heros instead of Verdana).
+
+### v1.0.2 (2019-06-22)
+ Renaming files for CTAN compatability.
+
+### v1.0.1 (2019-06-21)
+ Internal changes for publishing. Still one documentclass for a letter.
+
+### v1.0.0 (2019-06-21)
+ First release with a documentclass for letter.
+
+## Copyright
+Various parts of this bundle have different copyrights.
+If not otherwise stated the copyright is [The LaTeX project public license (LPPL), version 1.3c](https://www.latex-project.org/lppl/lppl-1-3c/)
+
+### Boilerplate / markdown-template
+The template for the markdown conversion,
+forked from the pandoc-templates and [JensErat pandoc-scrlttr2](https://github.com/JensErat/pandoc-scrlttr2) is dual-licensed,
+under both the GPL (v2 or higher, same as pandoc) and the BSD 3-clause license (included below).
+
+----
+
+Copyright (c) 2014, John MacFarlane\\
+Copyright (c) 2014, Jens Erat\\
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+* Neither the name of John MacFarlane nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/macros/luatex/latex/hu-berlin-bundle/hu-berlin-bundle.dtx b/macros/luatex/latex/hu-berlin-bundle/hu-berlin-bundle.dtx
new file mode 100644
index 0000000000..20c78fce0f
--- /dev/null
+++ b/macros/luatex/latex/hu-berlin-bundle/hu-berlin-bundle.dtx
@@ -0,0 +1,2039 @@
+% \iffalse
+%<*internal|cls|sty>
+\def\Version{2020/10/30 v1.0.8}
+%</internal|cls|sty>
+%<*internal>
+\iffalse
+%</internal>
+%<cls|sty>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+%<*cls&letter>
+\ProvidesClass{hu-berlin-letter}
+ [\Version\ Humboldt-Universit"at zu Berlin - letter documentclass]
+\ClassInfo{hu-berlin}{* * * hu-berlin * * *\MessageBreak
+ Part of the hu-berlin Bundle }
+%</cls&letter>
+%<*sty>
+%<*style>
+\ProvidesPackage{hu-berlin-bundle-style}
+ [\Version\space hu-berlin - package for style the documentation]
+ \PackageInfo{hu-berlin}{* * * hu-berlin * * *\MessageBreak
+ Part of the hu-berlin Bundle}
+%</style>
+%<*base>
+\ProvidesPackage{hu-berlin-base}
+ [\Version\space hu-berlin - package for basic features]
+ \PackageInfo{hu-berlin}{* * * hu-berlin * * *\MessageBreak
+ Part of the hu-berlin Bundle}
+%</base>
+%</sty>
+%<*driver>
+\catcode9=12
+\ProvidesFile{\jobname.dtx}
+ [\Version\space Documentation of the hu-berlin Bundle]
+%</driver>
+% /*
+% ██████ ███████ █████ ██████ ███ ███ ███████
+% ▄ ██ ▄██ ██ ██ ██ ██ ██ ██ ████ ████ ██
+% ████ ██████ █████ ███████ ██ ██ ██ ████ ██ █████
+% ▀ ██ ▀██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
+% ██ ██ ███████ ██ ██ ██████ ██ ██ ███████
+% */
+%<*readme&main>
+hu-berlin-bundle
+================
+
+This package provides files according to the corporate design
+for the Humboldt-Universität zu Berlin.
+It is _no_ official package of the university itself and
+not officially approved by it.
+
+You find more information in the official [corporate design guideline](https://www.hu-berlin.de/de/hu-intern/design/basiselemente/leitfaden-corporate-design-hu.pdf)
+and on the website <https://www.hu-berlin.de/de/hu-intern/design>.
+
+## Documents and Documentations for hu-berlin bundle
+
+
+This bundle provides following files:
+
+ * `hu-berlin-bundle.dtx` which is the core file designed with literate programming
+ * `hu-berlin-bundle.ins` which is the installation file for all necessary files generated automatically
+ * `hu-berlin-bundle.pdf` is documentation of the bundle.
+ * `README.md`
+ * `makefile`
+
+All other files can and will be generated from the `.dtx` file (see below).
+
+Furthermore there is the folder `img` which contains the necessary image files.
+
+
+This work has the LPPL maintenance status _maintained_.
+The current maintainer of this work is [Lukas C. Bossert](https://github.com/lukascbossert).
+
+
+You find this bundle versioned and available on [Zenodo](https://doi.org/10.5281/zenodo.3251728)
+
+%</readme&main>
+% /*
+% ██ ██████ ███████ █████ ██████ ███ ███ ███████
+% ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██
+% ██ ██████ █████ ███████ ██ ██ ██ ████ ██ █████
+% ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
+% ██ ██ ██ ███████ ██ ██ ██████ ██ ██ ███████
+% */
+% /*
+% ██████ ██ ██████
+% ▄ ██ ▄██ ██ ██ ██ ██
+% ████ ██████ ██ ██████
+% ▀ ██ ▀██ ██ ██ ██ ██
+% ██████ ██ ██████
+% */
+%<*bib>
+%%
+%% Encoding: UTF-8
+%%
+@InCollection{Hoare1973,
+ author = {Charles Antony Richard Hoare},
+ title = {Hints on programming language design},
+ editor = {C. Bunyan},
+ booktitle = {Computer Systems Reliability},
+ series = {State of the Art Report},
+ number = {20},
+ pages = {193--216},
+ date = {1973},
+ url={http://flint.cs.yale.edu/cs428/doc/HintsPL.pdf},
+ urldate={2018-09-06},
+ comment = {\blockcquote[195]{Hoare1973}{Documentation must be regarded as an integral part of the process of design and coding.
+ A good programming language will encourage and assist the programmer to write clear,
+ self-documenting code,
+ and even perhaps to develop
+ and display a pleasant style
+ of writing.}}
+}
+
+%</bib>
+% /*
+% ██ ██████ ██ ██████
+% ██ ██ ██ ██ ██ ██
+% ██ ██████ ██ ██████
+% ██ ██ ██ ██ ██ ██
+% ██ ██████ ██ ██████
+% */
+%<*internal>
+\fi
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+ \expandafter\begingroup
+\fi
+%</internal>
+% /*
+% ██ ███ ██ ███████
+% ▄ ██ ▄██ ████ ██ ██
+% ████ ██ ██ ██ ██ ███████
+% ▀ ██ ▀██ ██ ██ ██ ██
+% ██ ██ ████ ███████
+% */
+%<*install>
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+
+\nopreamble\nopostamble
+
+\usedir{doc/latex/\jobname}
+\generate{
+ \file{README.md}{\from{\jobname.dtx}{readme,main}}
+ \file{hu-berlin-bundle-bibliography.bib}{\from{\jobname.dtx}{bib}}
+ \file{hu-berlin-letter-example-lualatex.tex}{\from{\jobname.dtx}{example,letter}}
+ \file{hu-berlin-letter-example-markdown.md}{\from{\jobname.dtx}{example,letter-md}}
+}
+
+\preamble
+----------------------------------------------------------------
+hu-berlin-bundle
+Author: Lukas C. Bossert
+E-mail: lukas@texografie.de
+License: Released under the LaTeX Project Public License v1.3c or later
+See: http://www.latex-project.org/lppl.txt
+Various parts my have a different licence,
+please consider and respect them carefully.
+----------------------------------------------------------------
+
+\endpreamble
+\postamble
+
+Copyright (C) 2019-2020
+\endpostamble
+
+\usedir{tex/latex/\jobname}
+\generate{
+ \file{hu-berlin-letter-example-lualatex.tex}{\from{\jobname.dtx}{example,letter}}
+ \file{hu-berlin-letter-example.lco}{\from{\jobname.dtx}{example,lco}}
+ \file{hu-berlin-letter.cls}{\from{\jobname.dtx}{cls,letter}}
+ %
+ \file{hu-berlin-base.sty}{\from{\jobname.dtx}{sty,base}}
+ \file{hu-berlin-bundle-style.sty}{\from{\jobname.dtx}{sty,style}}
+ \file{hu-berlin-letter-template.latex}{\from{\jobname.dtx}{template,letter-md}}
+}
+%</install>
+%<install>\endbatchfile
+%<*internal>
+\usedir{source/latex/\jobname}
+\generate{
+ \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+}
+\ifx\fmtname\nameofplainTeX
+ \expandafter\endbatchfile
+\else
+ \expandafter\endgroup
+\fi
+%</internal>
+% /*
+% ██ ██ ███ ██ ███████
+% ██ ██ ████ ██ ██
+% ██ ██ ██ ██ ██ ███████
+% ██ ██ ██ ██ ██ ██
+% ██ ██ ██ ████ ███████
+% */
+%<*driver>
+\ProvidesFile{\jobname.dtx}
+ [\Version\space Documents and documentation for hu-berlin]
+%</driver>
+% /*
+% ██████ ██████ ██████ ██████ ██ █████ ███████ ███████
+% ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
+% ██ ██ ██ ██ ██ ██ ██ ███████ ███████ ███████
+% ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
+% ██████ ██████ ██████ ██████ ███████ ██ ██ ███████ ███████
+% */
+%<*driver>
+\def\huberlinsubject{Guideline}
+\def\huberlinshort{hu-berlin-bundle}
+\def\huberlintitle{%
+Documents and Documentations for \LaTeX\ at the Humboldt-Universität zu Berlin (unofficial)}
+\def\huberlinsubtitle{For Authors and Developers}
+\def\huberlinauthor{Lukas C. Bossert}
+\RequirePackage{scrlfile}
+\PassOptionsToClass{%
+ english
+ ,oneside
+ }{scrbook}
+\ReplaceClass{article}{scrbook}
+\documentclass{ltxdoc}
+\usepackage{hu-berlin-bundle-style}
+\GetFileInfo{\jobname.dtx}
+% /*
+% ██████ ██████ ██████ ██ ██ ███ ███ ███████ ███ ██ ████████
+% ▄ ██ ▄ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██ ████ ██ ██
+% ████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ █████ ██ ██ ██ ██
+% ▀ ██ ▀ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
+% ██████ ██████ ██████ ██████ ██ ██ ███████ ██ ████ ██
+% */
+\begin{document}
+\openoutputfile{\jobname.pkglist}{pkglist}
+\pdfbookmark[section]{\contentsname}{toc}
+\tableofcontents
+\clearpage
+\chapter{Introduction}
+\begin{markdown*}{hybrid=true}
+%</driver>
+% /*
+% ██████ ███████ █████ ██████ ███ ███ ███████
+% ▄ ██ ▄██ ██ ██ ██ ██ ██ ██ ████ ████ ██
+% ████ ██████ █████ ███████ ██ ██ ██ ████ ██ █████
+% ▀ ██ ▀██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
+% ██ ██ ███████ ██ ██ ██████ ██ ██ ███████
+% */
+%<*readme,main>
+
+With this (unofficial) bundle you have several documents which are designed according to the corporate design of the Humboldt-Universität zu Berlin.
+
+
+Following documents or documentclasses are available:
+
+* letter (`hu-berlin-letter.cls`); via `.tex` and `.md`
+* base package (`hu-berlin-base.sty`)
+
+
+## Installation of the bundle
+`hu-berlin` is part of the distributions [MiKTeX](http://www.miktex.org)
+and [TeXLive](http://www.tug.org/texlive) -- thus, you
+can easily install it using the respective package manager.
+If you would like to
+install `hu-berlin-bundle` into your local folder manually, do the following:
+Go to your terminal, browse to the folder of this bundle and run
+
+```
+make install
+```
+
+
+If you are using macOS you might be asked for your user account password for the installation.
+
+
+Further options of this makefile are:
+
+* `clean`: deletes all unnecessary files
+* `cleanbundle`: deletes all files except `.dtx`, `.md`. You will get the plain version of this bundle.
+This might be helpful if you send the bundle to someone else.
+* `ctan`: this will create a zip file which can be used to send to CTAN.
+* `files`: will only create the files from the `.dtx`-scratch.
+* `uninstall`: will erase the locally installed files.
+
+
+This bundle is constantly updated. For hints, errors or suggestions use the GitHub repository [https://github.com/LukasCBossert/hu-berlin-bundle](https://github.com/LukasCBossert/hu-berlin-bundle).
+
+## Changelog
+
+All notable changes to this project will be documented in the [README.md](https://github.com/LukasCBossert/hu-berlin-bundle/blob/master/README.md).
+This project **does not** adhere to [Semantic Versioning](http://semver.org/).
+The markdown syntax is inspired by the conventions proposed by [keepachangelog.com](http://keepachangelog.com/).
+
+### v1.0.8 (2020/10/30)
+* (letter) replacing actual logo with a dummy text (due to possible copyright conflicts).
+ The correct logo has to be called `hu-berlin-logo.pdf`
+ and needs to be put somewhere in PATH so it will be found.
+ If such file cannot be found a dummy text will be taken instead (`Humboldt-Universität zu Berlin´)
+
+
+### v1.0.7 (2020/10/29)
+* (letter) fixed missing `\removereffields`
+* (letter) added missing suffix for hu-logo (`.pdf`)
+
+
+
+### v1.0.6 (2020-10-22)
+* (letter) changed address separator
+* (letter) fixed empty minipage when no metadata given
+* (letter) changed default backaddress
+
+
+### v1.0.5 (2020-04-28)
+* (general) Changed logo format to `.pdf`
+* (letter) Changed `\ifkomavarempty` to `\ifkomavarempty`, fixes
+ [github-issue nr. 1](https://github.com/LukasCBossert/hu-berlin-bundle/issues/1)
+
+
+### v1.0.4 (2019-12-19)
+* Added `hu-berlin-base.sty` as a package which contains all relevant code for documents and documentclasses of the bundle.
+
+### v1.0.3 (2019-06-26)
+ * Changed the main font for compatibility with UNIX-systems (TeX Gyre Heros instead of Verdana).
+
+### v1.0.2 (2019-06-22)
+ Renaming files for CTAN compatability.
+
+
+### v1.0.1 (2019-06-21)
+ Internal changes for publishing. Still one documentclass for a letter.
+
+### v1.0.0 (2019-06-21)
+ First release with a documentclass for letter.
+
+## Copyright
+Various parts of this bundle have different copyrights.
+If not otherwise stated the copyright is [The LaTeX project public license (LPPL), version 1.3c](https://www.latex-project.org/lppl/lppl-1-3c/)
+
+
+### Boilerplate / markdown-template
+The template for the markdown conversion,
+forked from the pandoc-templates and [JensErat pandoc-scrlttr2](https://github.com/JensErat/pandoc-scrlttr2) is dual-licensed,
+under both the GPL (v2 or higher, same as pandoc) and the BSD 3-clause license (included below).
+
+----
+
+Copyright (c) 2014, John MacFarlane\\
+Copyright (c) 2014, Jens Erat\\
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+* Neither the name of John MacFarlane nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+%</readme,main>
+% /*
+% ██ ██████ ███████ █████ ██████ ███ ███ ███████
+% ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██
+% ██ ██████ █████ ███████ ██ ██ ██ ████ ██ █████
+% ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
+% ██ ██ ██ ███████ ██ ██ ██████ ██ ██ ███████
+% */
+%<*driver>
+\end{markdown*}
+\clearpage
+\chapter{Preambel}
+
+This bundle consists of various files
+which are either generated by the core file (|.dtx|)
+or are part of the basic structure of this bundle.
+You can easily pick up the basic file structure from \cref{hu-berlin:bundle-structure}.
+
+\begin{figure}[!htb]
+\footnotesize
+\dirtree{%
+.1 \huberlinFolder hu-berlin-bundle.
+.2 hu-berlin-bundle.dtx \DTcomment{code and documentation}.
+.2 hu-berlin-bundle.pdf \DTcomment{documentation}.
+.2 hu-berlin-base.sty \DTcomment{basic components of the bundle}.
+.2 hu-berlin-letter-example-lualatex.tex \DTcomment{letter}.
+.2 hu-berlin-letter-example.lco \DTcomment{datafile for letter}.
+.2 hu-berlin-letter-example-lualatex.pdf \DTcomment{letter}.
+.2 hu-berlin-letter-example-markdown.pdf \DTcomment{converted letter from markdown}.
+.2 hu-berlin-letter-example-markdown.md \DTcomment{example markdown file }.
+.2 hu-berlin-letter-template.latex \DTcomment{template for conversion}.
+.2 \huberlinFolder img\DTcomment{folder for images}.
+.3 texografie-logo.pdf\DTcomment{logo of maintainer}.
+.2 makefile\DTcomment{makefile to generate all required files}.
+.2 README.md\DTcomment{README file with information on installation}.
+}
+\caption{Structure of \texttt{hu-berlin} bundle}
+\label{hu-berlin:bundle-structure}
+\end{figure}
+
+When you run the |makefile|
+you get all these various files described above.
+
+
+
+
+\DocInput{\jobname.dtx}
+
+\printbibliography
+
+
+\part{Example files}
+\chapter{Letter}
+\section{From \texttt{.tex}}
+\IfFileExists{hu-berlin-letter-example-lualatex.pdf}
+ {\includepdf[%
+ pagecommand={\pagestyle{scrheadings}}
+ ,link
+ ,pages=-
+ % ,scale=.5
+ ,nup=2x1
+ ,frame]{hu-berlin-letter-example-lualatex.pdf}}
+ {|hu-berlin-letter-example-lualatex.pdf| missing!}
+
+\section{From \texttt{.md}}
+\IfFileExists{hu-berlin-letter-example-markdown.pdf}
+ {\includepdf[%
+ pagecommand={\pagestyle{scrheadings}}
+ ,link
+ ,pages=-
+ % ,scale=.5
+ ,nup=2x1
+ ,frame]{hu-berlin-letter-example-markdown.pdf}}
+ {|hu-berlin-letter-example-markdown.pdf| missing!}
+
+
+\end{document}
+%</driver>
+% /*
+% ██ ██████ ██████ ██████ ██ ██ ███ ███ ███████ ███ ██ ████████
+% ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██ ████ ██ ██
+% ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ █████ ██ ██ ██ ██
+% ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
+% ██ ██████ ██████ ██████ ██████ ██ ██ ███████ ██ ████ ██
+% */
+% /*
+% ██████ ██████ ██████ ███████
+% ██ ██ ██ ██ ██ ██
+% █████ ██ ██ ██ ██ ██ █████ █████
+% ██ ██ ██ ██ ██ ██
+% ██████ ██████ ██████ ███████
+% */
+% \fi
+%
+% \part{Guideline for Users}
+% \begin{macrocode}
+%<*example>
+% \end{macrocode}
+% \chapter{Letter}
+% We give an example on how to create a letter.
+%
+% \section{\texttt{.lco}-file}
+% \begin{macrocode}
+%<*lco>
+% \end{macrocode}
+% This is the file you load into your |.tex| letter.
+% The information you provide here do normally not change from letter to letter.
+% That’s why we put it in a separate file.
+%
+% The first line should provide this information.
+% \begin{macrocode}
+\ProvidesFile{hu-berlin-letter-example.lco}
+% \end{macrocode}
+% Now we set up the personal data.
+%
+% We start with the name of the sender.
+% \begin{macrocode}
+\setkomavar{fromname}
+% \end{macrocode}
+% you can also write the position of this person in brackets, this is optional;
+% \oarg{position}
+% \begin{macrocode}
+ [Wissenschaftlicher Mitarbeiter]
+% \end{macrocode}
+% But you need to give a name:
+% \begin{macrocode}
+ {Dr. Max Mustermann}
+% \end{macrocode}
+% The mail address
+% \begin{macrocode}
+\setkomavar{fromemail}{max.mustermann@hu-berlin.de}
+% \end{macrocode}
+% For phone and fax number you only need to type the last digits.
+% \begin{macrocode}
+\setkomavar{fromphone}{1234}
+% \end{macrocode}
+% If you don’t have a fax (or a phone),
+% leave it empty. Do \emph{not} delete it.
+% \begin{macrocode}
+\setkomavar{fromfax}{5678}
+% \end{macrocode}
+% And finally the URL.
+% \begin{macrocode}
+\setkomavar{fromurl}{www.hu-berlin.de}
+% \end{macrocode}
+% If your backaddress is to long
+% – it will be set up automatically –
+% you can redefine it.
+%
+% \begin{macrocode}
+%% \setkomavar{backaddress}{HU Berlin\\
+%% Unter den Linden 6\\
+%% D-10099 Berlin}
+% \end{macrocode}
+% Selfexplaining: the faculty.
+% \begin{macrocode}
+\setkomavar{faculty}{%
+Philosophische Fakultät
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setkomavar{institute}{%
+ \mbox{Institut für Briefvorlagen}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{institute.additional}{Here you can add more text.}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{institute.head}[Dekanin]{Prof. Dr. Maike Musterfrau}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{institute.head.mail}{maike.musterfrau@hu-berlin.de}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{local}{%
+ Mohrenstraße 40/41\\
+ Zimmer X\\
+ D-10117 Berlin}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{connections}{U Bahnhof Hausvogteiplatz (U2)}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{accessibility}{Hausvogteiplatz}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{signature}{%
+ \usekomavar{institute.head} --
+ \usekomavar{fromname}
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</lco>
+% \end{macrocode}
+% \huberlinlisting%
+% [listing options = {%
+% ,linerange={18-48}
+% ,numbers = left
+% ,numbersep = 10pt
+% ,numberstyle =\footnotesize\ttfamily\color{hu-berlin-grey}
+% }]%
+% {hu-berlin-letter-example.lco}
+%
+% \section{\texttt{.tex}-file}
+% \begin{macrocode}
+%<*letter>
+% \end{macrocode}
+% \begin{macrocode}
+\documentclass{hu-berlin-letter}
+% \end{macrocode}
+% Now we load the personal data-file which has the ending |.lco|.
+% \begin{macrocode}
+\LoadLetterOption{hu-berlin-letter-example}
+% \end{macrocode}
+% If you have the HU font installed on your computer,
+% you can load it, too:
+% \begin{macrocode}
+% \setmainfont[%
+% BoldFont=ScalaSans-BoldLF,
+% Numbers=OldStyle]{ScalaSans-RegularLF}
+% \end{macrocode}
+% Now following the reference information
+% \begin{macrocode}
+\setkomavar{myref}{}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{yourref}{}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{yourmail}{}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{customer}{}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{invoice}{}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar{subject}{Betreff}
+% \end{macrocode}
+% \begin{macrocode}
+\usepackage{blindtext}
+% \end{macrocode}
+% We close the preamble and start the letter
+% \begin{macrocode}
+\begin{document}
+% \end{macrocode}
+% The address is written as \marg{address}
+% \begin{macrocode}
+\begin{letter}{%
+% \end{macrocode}
+% \begin{macrocode}
+ Erika Musterfrau\par
+ Musterweg 43\par
+ 56789 Musterhausen%
+% \end{macrocode}
+% Closing now again.
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\opening{Sehr geehrte Frau Musterfrau,}
+% \end{macrocode}
+% This is just some blindtext.
+% \begin{macrocode}
+\blindtext[2]
+\clearpage
+\blindtext
+% \end{macrocode}
+% Closing letter
+% \begin{macrocode}
+\closing{Mit freundlichen Grüßen}
+% \end{macrocode}
+% If you still have something to say/write.
+% \begin{macrocode}
+\ps PS: \dots
+% \end{macrocode}
+% Any amendment.
+% \begin{macrocode}
+\encl{%
+ Anlage 1\\
+ Anlage 2%
+}
+% \end{macrocode}
+% This is the distribution
+% \begin{macrocode}
+\cc{%
+ Verteiler 1\\
+ Verteiler 2%
+}
+% \end{macrocode}
+% That’s it. Done.
+% \begin{macrocode}
+\end{letter}
+\end{document}
+% \end{macrocode}
+% And how does a example letter looks like?
+% \huberlinlisting%
+% [listing options = {%
+% ,linerange={18-48}
+% ,numbers = left
+% ,numbersep = 10pt
+% ,numberstyle =\footnotesize\ttfamily\color{hu-berlin-grey}
+% }]%
+% {hu-berlin-letter-example-lualatex.tex}
+% \begin{macrocode}
+%</letter>
+% \end{macrocode}
+% \section{Letter from markdown}
+% \begin{macrocode}
+%<*letter-md>
+% \end{macrocode}
+% You need to have |pandoc| installed on your computer.
+% To create letters via markdown and |pandoc| run from the command line:
+%
+% \begin{warning}pandoc --pdf-engine=lualatex --template hu-berlin-letter-template.latex -o YOUR-FILE.pdf YOUR-FILE.md\end{warning}
+% The |.md| file needs a section with metadata.
+%
+% It starts and ends with three |---|.
+% All necessary metadata information are listed inbetween.
+% \begin{macrocode}
+---
+documentclass: hu-berlin-letter
+% \end{macrocode}
+% The following will load the |.lco|-file, you replace that with the name of your |.lco|-file.
+% \begin{macrocode}
+sender: hu-berlin-letter-example
+% \end{macrocode}
+% You should also tell a short subject
+% \begin{macrocode}
+subject: Short description
+% \end{macrocode}
+% The information for the addressee has to be written like this:
+% \begin{macrocode}
+addressee:
+ - Alexander von Humboldt
+ - Unter den Linden 6
+ - 10099 Berlin
+% \end{macrocode}
+% \begin{macrocode}
+---
+% \end{macrocode}
+% You find a list with possible options for this metadata information header below.
+%
+% Now the content of your letter
+% \begin{macrocode}
+Thank you very much for your letter.
+% \end{macrocode}
+% Let’s see how this example file looks like:
+% \huberlinlisting%
+% [listing options = {%
+% ,numbers = left
+% ,numbersep = 10pt
+% ,numberstyle =\footnotesize\ttfamily\color{hu-berlin-grey}
+% }]%
+% {hu-berlin-letter-example-markdown.md}
+% \begin{macrocode}
+%</letter-md>
+% \end{macrocode}
+% Here we close the example files.
+% \begin{macrocode}
+%</example>
+% \end{macrocode}
+%\part{Guide for Coders}
+% \begin{macrocode}
+%<*sty>
+% \end{macrocode}
+%\chapter{hu-berlin-base-package}
+% \begin{macrocode}
+%<*base>
+% \end{macrocode}
+% Since we do want to compile with \lualatex,
+% we make sure that it will be compilable only with that.
+% \begin{macrocode}
+\RequirePackage{ifluatex,luatex85}
+% \end{macrocode}
+% Now a fix.\fnurl{https://tex.stackexchange.com/a/75065}
+% \begin{macrocode}
+\ifx\directlua\relax
+ \let\directlua\UnDeFiNeD
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\ifluatex
+\else
+\GenericError{hu-berlin}%
+ {Please use `LuaLaTeX' as Compiler.^^J I abort here.}
+\fi
+% \end{macrocode}
+% We do not need many packages.
+% The ones we need are loaded now.
+% \begin{macrocode}
+\RequirePackage[english,ngerman]{babel}
+% \end{macrocode}
+% Common package for handling figures is \pkg{graphicx}.
+% \begin{macrocode}
+\RequirePackage{graphicx}
+% \end{macrocode}
+% For loading fonts.
+% \begin{macrocode}
+\RequirePackage{fontspec}
+% \end{macrocode}
+% Actually the corporate design says
+% that the font Verdana should be used.
+% But since this font is not included in
+% UNIX-systems we use a derivative.
+% \begin{macrocode}
+\setmainfont{TeX Gyre Heros}
+% \end{macrocode}
+% If you have Verdana on your system
+% you can uncomment the following line.
+% \begin{macrocode}
+% \setmainfont{Verdana}
+% \end{macrocode}
+% For the wheelchair symbol we load \pkg{marvosym}
+% \begin{macrocode}
+\RequirePackage{marvosym}
+% \end{macrocode}
+% And we define various colors from the corporate design manual.
+% \begin{macrocode}
+\RequirePackage{xcolor}
+\definecolor{hu-berlin-blue}{RGB}{0,65,137}
+\definecolor{hu-berlin-green}{RGB}{150,190,20}
+\definecolor{hu-berlin-grey}{RGB}{169,169,169}
+\definecolor{hu-berlin-brown}{RGB}{82,79,60}
+\definecolor{hu-berlin-red}{RGB}{180,0,0}
+% \end{macrocode}
+% That’s all for the base package, so we close it.
+% \begin{macrocode}
+%</base>
+% \end{macrocode}
+% \begin{macrocode}
+%</sty>
+% \end{macrocode}
+% \begin{macrocode}
+%<*cls>
+% \end{macrocode}
+%\chapter{Letter}
+% \begin{macrocode}
+%<*letter>
+% \end{macrocode}
+% We load \pkg{scrlttr2} which is the documentclass for letters.
+% Furthermore we set up some options.
+% \begin{macrocode}
+\LoadClass[%
+ fontsize=10pt,
+ version=last,
+% \end{macrocode}
+% If there is anything to debug, you can enable |visualize|
+% \begin{macrocode}
+ % visualize
+% \end{macrocode}
+% \begin{macrocode}
+]{scrlttr2}
+% \end{macrocode}
+% For debugging also uncomment the \cs{showfields}\marg{fields} commanand.
+% \begin{macrocode}
+% \showfields{head,address,location,refline,foot}
+% \end{macrocode}
+% Since all common and basic features of the bundle
+% are located in a separate package we load that first.
+% \begin{macrocode}
+\RequirePackage{hu-berlin-base}
+% \end{macrocode}
+% To get the HU logo on the second and following pages we load \pkg{scrlayer-scrpage}.\fnurl{https://tex.stackexchange.com/a/495258/98739}
+% \begin{macrocode}
+\RequirePackage{scrlayer-scrpage}
+\clearpairofpagestyles
+\DeclareNewLayer[
+ foreground,
+ voffset=\useplength{firstheadvpos},
+ hoffset=\useplength{firstheadhpos},
+ width=\useplength{firstheadwidth},
+ mode=picture,
+ contents=\putUL{\raisebox{-\height}{\usekomavar{firsthead}}}
+]{likefirstpage.head}
+\AddLayersToPageStyle{scrheadings}{likefirstpage.head}
+\DeclareNewLayer[
+ foreground,
+ align=r,
+ voffset=\useplength{locvpos},
+ hoffset=\paperwidth-\useplength{lochpos},
+ width=\useplength{locwidth},
+ height=\useplength{locheight},
+ contents=\usekomavar{nextlocation},
+ %pretocontents=\layercontentsmeasure% to show the position of the layer
+]{likefirstpage.loc}
+\AddLayersToPageStyle{scrheadings}{likefirstpage.head,likefirstpage.loc}
+% \end{macrocode}
+% Now we apply the code for following pages.
+% \begin{macrocode}
+\newkomavar{nextlocation}
+\setkomavar{nextlocation}{%
+ \raggedright
+ \fontsize{7}{8.5}\selectfont
+ \pagemark
+}
+% \end{macrocode}
+% For better adjustments of the layout we load \pkg{geometry}.
+% \begin{macrocode}
+\RequirePackage{geometry}
+\geometry{%
+ a4paper
+ ,left =25mm
+ ,bottom =16mm
+ ,foot =4mm
+ ,top =77mm
+ ,headheight =15pt
+ ,textwidth =117mm
+ ,marginparsep =0mm
+ ,marginparwidth =0mm
+}
+% \end{macrocode}
+% Main Text and signature should be raggedright.
+% \begin{macrocode}
+\renewcommand*{\raggedsignature}{\raggedright}
+\raggedright
+% \end{macrocode}
+% We also want to put the enclosures at the bottom of the page.\fnurl{https://tex.stackexchange.com/questions/77991/put-the-encl-at-the-bottom-of-the-page-lettre-class}
+% \begin{macrocode}
+\def\stopletter{}
+\let\enclold\encl
+\renewcommand\encl[1]{\vskip0ptplus1filll\enclold{#1}}
+% \end{macrocode}
+% We define new |komavar|s.
+%
+% First the possibility to name the faculty,
+% \begin{macrocode}
+\newkomavar{faculty}
+\newkomafont{faculty}{\bfseries\fontsize{8.5}{10}\selectfont}
+% \end{macrocode}
+% then the institute
+% \begin{macrocode}
+\newkomavar{institute}
+\newkomafont{institute}{\fontsize{8.5}{10}\selectfont}
+% \end{macrocode}
+% and further fields for information.
+% \begin{macrocode}
+\newkomavar{institute.additional}
+% \end{macrocode}
+% We pass the name of the head of the institute.
+% \begin{macrocode}
+\newkomafont{institute.head}{\bfseries}
+\newkomavar{institute.head}%
+% \end{macrocode}
+% Its position will be written as the optional argument.
+%
+% There is even the possibility to print the email-address onto the letter.
+% \begin{macrocode}
+\newkomavar{institute.head.mail}%
+% \end{macrocode}
+% Since there are many buildings with offices we tell where to find the sender
+% \begin{macrocode}
+\newkomavar{local}
+\setkomavar*{local}{Sitz:}
+% \end{macrocode}
+% and how to get there.
+% \begin{macrocode}
+\newkomavar{connections}
+\setkomavar*{connections}{Verkehrsverbindungen:}
+% \end{macrocode}
+% Furthermore we inform about office hours
+% \begin{macrocode}
+\newkomavar{officehours}
+\setkomavar*{officehours}{Sprechzeiten:}
+% \end{macrocode}
+% and if there is accessibility for wheelchairs etc.
+% \begin{macrocode}
+\newkomavar{accessibility}
+\setkomavar*{accessibility}{{\large\reflectbox{\Wheelchair}} Eingang:}
+% \end{macrocode}
+% \begin{macrocode}
+\newkomavar{bank}
+\setkomavar*{bank}{Bankverbindung:}
+\setkomavar{bank}{Deutsche Bank PGK AG}
+\newkomavar{IBAN}
+\setkomavar{IBAN}{\mbox{IBAN DE95 1007 0848 0512 6206 01}}
+\newkomavar{BIC}
+\setkomavar{BIC}{BIC DEUTDEDB110}
+% \end{macrocode}
+% Now we set the location field,
+% which is the section on the right with additional information:
+% \begin{macrocode}
+\setkomavar{location}{%
+% \end{macrocode}
+% First anything regarding the font
+% \begin{macrocode}
+ \raggedright
+ \fontsize{7}{8.5}\selectfont
+% \begin{macrocode}
+% and for the section of faculty, institute etc. we use \env{minipage}
+% \begin{macrocode}
+\begin{minipage}[t][64mm]{\useplength{locwidth}}
+% \end{macrocode}
+% then the faculty
+% \begin{macrocode}
+\Ifkomavarempty{faculty}
+% \end{macrocode}
+% This is a fake space to avoid any trouble
+% if no custom metadata are given.
+% \begin{macrocode}
+ {\hspace*{1em}}
+ {\usekomafont{faculty}%
+ \usekomavar{faculty}\\[1\baselineskip]}
+% \end{macrocode}
+% and the institute.
+% \begin{macrocode}
+\Ifkomavarempty{institute}
+ {}
+ {\usekomafont{institute}\usekomavar{institute}\\[1\baselineskip]}
+% \end{macrocode}
+% Now anything else regarding the institute.
+% \begin{macrocode}
+\Ifkomavarempty{institute.additional}
+ {}
+ {\usekomavar{institute.additional}\\[1\baselineskip]}
+% \end{macrocode}
+% What follows is the head of institute and its position name.
+% \begin{macrocode}
+\Ifkomavarempty{institute.head}
+ {}
+ {{\usekomafont{institute.head}%
+ \usekomavar{institute.head}}\\%
+ \usekomavar*{institute.head}}
+% \end{macrocode}
+% We close this section and the minipage.
+% \begin{macrocode}
+ \end{minipage}
+% \end{macrocode}
+% Let’s turn to further information.
+%
+% For example date:
+% \begin{macrocode}
+ \textbf{\usekomavar*{date}}\\
+ \usekomavar{date}\par
+% \end{macrocode}
+% and the sender of the letter.
+% \begin{macrocode}
+\Ifkomavarempty{fromname}
+ {}
+ {\textbf{\usekomavar*{fromname}}\\
+ \usekomavar{fromname}\par}
+% \end{macrocode}
+% And the reference of correspondence.
+% \begin{macrocode}
+\Ifkomavarempty{myref}
+ {}
+ {\textbf{\usekomavar*{myref}}\\
+ \usekomavar{myref}\par}
+% \end{macrocode}
+% To complete this template we provide the possibility to name further reference fields.
+% \begin{macrocode}
+\Ifkomavarempty{yourref}
+ {}
+ {\textbf{\usekomavar*{yourref}}\\
+ \usekomavar{yourref}\par}
+% \end{macrocode}
+% \begin{macrocode}
+\Ifkomavarempty{yourmail}
+ {}
+ {\textbf{\usekomavar*{yourmail}}\\
+ \usekomavar{yourmail}\par}
+% \end{macrocode}
+% \begin{macrocode}
+\Ifkomavarempty{customer}
+ {}
+ {\textbf{\usekomavar*{customer}}\\
+ \usekomavar{customer}\par}
+% \end{macrocode}
+% \begin{macrocode}
+\Ifkomavarempty{invoice}
+ {}
+ {\textbf{\usekomavar*{invoice}}\\
+ \usekomavar{invoice}\par}
+% \end{macrocode}
+% \begin{macrocode}
+ \textbf{\usekomavar*{fromaddress}}\\
+ \usekomavar{fromaddress}
+ \Ifkomavarempty{fromphone}
+ {\par}
+ {\\\usekomavar*{fromphone}\usekomavar{fromphone}
+ \Ifkomavarempty{fromfax}
+ {\par}
+ {\\}}
+ \Ifkomavarempty{fromfax}
+ {}
+ {\usekomavar*{fromfax}\usekomavar{fromfax}\par}
+% \end{macrocode}
+% Next, emails and url:
+% \begin{macrocode}
+\Ifkomavarempty{institute.head.mail}
+ {}
+ {\usekomavar{institute.head.mail}
+ \Ifkomavarempty{fromemail}
+ {\Ifkomavarempty{fromurl}
+ {\par}
+ {\\}}
+ {\\}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\Ifkomavarempty{fromemail}
+ {}
+ {\usekomavar{fromemail}
+ \Ifkomavarempty{fromurl}
+ {\par}
+ {\\}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\Ifkomavarempty{fromurl}
+ {}
+ {\usekomavar{fromurl}\par}
+% \end{macrocode}
+% Now the actual location of the sender
+% \begin{macrocode}
+\Ifkomavarempty{local}
+ {}
+ {\textbf{\usekomavar*{local}}\\
+ \usekomavar{local}\par}
+% \end{macrocode}
+% The last information section should be pinned to the bottom.
+% \begin{macrocode}
+\vfill
+% \end{macrocode}
+% Inform your addressee about the connection possibilities.
+% \begin{macrocode}
+\Ifkomavarempty{connections}
+ {}
+ {\textbf{\usekomavar*{connections}}\\
+ \usekomavar{connections}\par}
+% \end{macrocode}
+% \begin{macrocode}
+\Ifkomavarempty{officehours}
+ {}
+ {\textbf{\usekomavar*{officehours}}\\
+ \usekomavar{officehours}\par}
+% \end{macrocode}
+% If there is a barrier free entrance, tell it.
+% \begin{macrocode}
+\Ifkomavarempty{accessibility}
+ {}
+ {\textbf{\usekomavar*{accessibility}}\\
+ \usekomavar{accessibility}\par}
+% \end{macrocode}
+% And last the bank connection
+% \begin{macrocode}
+\Ifkomavarempty{bank}
+ {}
+ {\textbf{\usekomavar*{bank}}\\
+ \usekomavar{bank}\\
+ \usekomavar{IBAN}\\
+ \usekomavar{BIC}
+ }
+% \end{macrocode}
+% Finally we close \cs{setkomavar}\marg{location}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% To fulfill the Corporate Design rules we adjust a few things.
+% \begin{macrocode}
+\KOMAoptions{%
+ numericaldate =true
+ ,refline =nodate
+ ,backaddress =plain
+ ,parskip =half-
+}
+% \end{macrocode}
+% Getting rid of all other fields and their default position.
+% \begin{macrocode}
+\removereffields
+% \end{macrocode}
+% Redefining length.
+% \begin{macrocode}
+\setplength{refvpos}{110mm}
+\setplength{refaftervskip}{0pt}
+\setplength{toaddrhpos}{25mm}
+\setplength{firstheadhpos}{\useplength{toaddrhpos}}
+\setplength{lochpos}{15mm}
+\setplength{locvpos}{\useplength{toaddrvpos}}
+\addtoplength{locvpos}{.75\baselineskip}
+\setplength{locwidth}{45mm}
+\setplength{locheight}{232mm}
+% \end{macrocode}
+% Now resetting or pre-defining some variables.
+%
+% First we set the head of the first page,
+% which is the logo.
+% Be sure that you have the right using it!
+% Everything regarding the logo is defined in
+% the corporate design guidlines.\fnurl{https://www.hu-berlin.de/de/hu-intern/design/basiselemente/leitfaden-corporate-design-hu.pdf}
+% You need to have the actual logo of the Humboldt-Universität zu Berlin which has to be called |hu-berlin-logo.pdf|.
+% It can be downloaded here: \url{http://zope.hu-berlin.de/hu-intern/design/downloads/logo}
+% If this logo is not found a replacement text is shown instead.
+% \begin{macrocode}
+\setkomavar{firsthead}{%
+\IfFileExists{hu-berlin-logo.pdf}
+ {\includegraphics[width=145mm]{hu-berlin-logo.pdf}}
+ {{\vspace*{2em}\hfil\scshape [humboldt-universität zu berlin]}}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setkomavar{backaddressseparator}{~\textbar~}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setkomavar{fromphone}{0000}
+\setkomavar*{fromphone}{Telefon +49 [30] 2093–}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setkomavar{fromfax}{0000}
+\setkomavar*{fromfax}{Telefax +49 [30] 2093–}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setkomavar*{fromaddress}{Postanschrift:}
+\setkomavar{fromaddress}{%
+ Humboldt-Universität zu Berlin\\
+ Unter den Linden 6\\
+ D-10099 Berlin}
+% \end{macrocode}
+% The default backaddress is slightly changed:
+% \begin{macrocode}
+\setkomavar{backaddress}{%
+ Humboldt-Universität zu Berlin\\
+ UdL 6\\
+ D-10099 Berlin}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setkomavar*{date}{Datum:}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setkomavar*{fromname}{Bearbeiter:}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setkomavar*{myref}{Geschäftszeichen:}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar*{enclseparator}{Anlage}
+% \end{macrocode}
+% \begin{macrocode}
+\setkomavar*{ccseparator}{Kopie an}
+% \end{macrocode}
+% \begin{macrocode}
+% \RequirePackage{hyperref}
+% \AtBeginDocument{{
+% \usekomavar[\def\author]{fromname}
+% \usekomavar[\def\subject]{subject}
+% \hypersetup{%
+% pdftitle = {\subject},
+% pdfauthor = {\author},
+% pdfsubject = {\subject},
+% pdfkeywords = {\author, \subject},
+% pdflang = de,
+% pdfdisplaydoctitle = true,
+% colorlinks = true,
+% plainpages = false,
+% hypertexnames = false,
+% unicode,
+% }
+% }}
+% \end{macrocode}
+% \begin{macrocode}
+%</letter>
+% \end{macrocode}
+% \begin{macrocode}
+%</cls>
+% \end{macrocode}
+% \begin{macrocode}
+%<*template>
+% \end{macrocode}
+% \chapter{Boilerplate / Template for letters }
+% \begin{macrocode}
+%<*letter-md>
+% \end{macrocode}
+% \begin{macrocode}
+\documentclass{hu-berlin-letter}
+% \end{macrocode}
+% We predefine two variables.
+% \begin{macrocode}
+\newkomavar{opening}
+\newkomavar{closing}
+\setkomavar{opening}{Sehr geehrte Damen und Herren}
+\setkomavar{closing}{Mit freundlichen Grüßen}
+% \end{macrocode}
+% \begin{macrocode}
+$for(letteroption)$
+\LoadLetterOption{$letteroption$}
+$endfor$
+$if(sender)$\LoadLetterOption{$sender$}$endif$
+$if(addresseeimage)$\setkomavar{addresseeimage}{$addresseeimage$}$endif$
+$if(backaddress)$\setkomavar{backaddress}{$backaddress$}\KOMAoptions{backaddress=true}$endif$
+$if(fromalign)$\KOMAoptions{fromalign=$fromalign$}$endif$
+$if(customer)$\setkomavar{customer}{$customer$}$endif$
+$if(date)$\setkomavar{date}{$date$}$endif$
+$if(fromaddress)$\setkomavar{fromaddress}{$fromaddress$}$endif$
+$if(frombank)$\setkomavar{frombank}{$frombank$}$endif$
+$if(fromemail)$\setkomavar{fromemail}{$fromemail$}\KOMAoptions{fromemail=true}$endif$
+$if(fromfax)$\setkomavar{fromfax}{$fromfax$}\KOMAoptions{fromfax=true}$endif$
+$if(fromlogo)$\setkomavar{fromlogo}{$fromlogo$}\KOMAoptions{fromlogo=true}$endif$
+$if(frommobilephone)$\setkomavar{frommobilephone}{$frommobilephone$}\KOMAoptions{frommobilephone=true}$endif$
+$if(fromname)$\setkomavar{fromname}{$fromname$}$endif$
+$if(fromphone)$\setkomavar{fromphone}{$fromphone$}\KOMAoptions{fromphone=true}$endif$
+$if(fromurl)$\setkomavar{fromurl}{$fromurl$}\KOMAoptions{fromurl=true}$endif$
+$if(fromzipcode)$\setkomavar{fromzipcode}{$fromzipcode$}$endif$
+$if(invoice)$\setkomavar{invoice}{$invoice$}$endif$
+$if(location)$\setkomavar{location}{$location$}$endif$
+$if(myref)$\setkomavar{myref}{$myref$}$endif$
+$if(myrefname)$\setkomavar*{myref}{$myrefname$}$endif$
+$if(place)$\setkomavar{place}{$place$}$endif$
+$if(PPcode)$\setkomavar{PPcode}{$PPcode$}$endif$
+$if(signature)$\setkomavar{signature}{$signature$}$endif$
+$if(specialmail)$\setkomavar{specialmail}{$specialmail$}$endif$
+$if(subject)$\setkomavar{subject}{$subject$}$endif$
+$if(title)$\setkomavar{title}{$title$}$endif$
+$if(yourmail)$\setkomavar{yourmail}{$yourmail$}$endif$
+$if(yourref)$\setkomavar{yourref}{$yourref$}$endif$
+$if(opening)$\setkomavar{opening}{$opening$}$endif$
+$if(closing)$\setkomavar{closing}{$closing$}$endif$
+$if(firstfoot)$\setkomavar{firstfoot}{$firstfoot$}$endif$
+% \end{macrocode}
+% Ok, let’s sum up the possible options you can use to pass data to the letter:
+% \begin{itemize} \item addresseeimage \item backaddress \item customer \item date \item fromaddress \item frombank \item fromemail \item fromfax \item fromlogo \item frommobilephone \item fromname \item fromphone \item fromurl \item fromzipcode \item invoice \item location \item myref \item myrefname \item place \item PPcode \item signature \item specialmail \item subject \item title \item yourmail \item yourref \item opening \item closing \item firstfoot \end{itemize}
+% Sometimes you might not have an addressee – we are checking this, too.
+% \begin{macrocode}
+$if(addressee)$
+$else$
+\KOMAoptions{addrfield=false}
+$endif$
+% \end{macrocode}
+% Now the actual content of the letter
+% \begin{macrocode}
+\begin{document}
+\begin{letter}{%
+$for(addressee)$
+$addressee$$sep$\\
+$endfor$
+}
+$for(include-before)$
+$include-before$
+$endfor$
+\opening{\usekomavar{opening}}
+$body$
+\closing{\usekomavar{closing}}
+$if(ps)$\ps{$ps$}$endif$
+$if(encl)$\encl{$encl$}$endif$
+$for(include-after)$$include-after$$endfor$
+\end{letter}
+\end{document}
+% \end{macrocode}
+% \begin{macrocode}
+%</letter-md>
+%</template>
+% \end{macrocode}
+%\chapter{Documentation preamble \param{style}}
+% \begin{macrocode}
+%<*sty>
+%<*style>
+\makeatletter
+\addtolength\marginparwidth{-40pt}
+\addtolength\marginparsep{4mm}
+\addtolength\oddsidemargin{-20pt}
+\addtolength\evensidemargin{-20pt}
+\let\PrintDescribeMacro=\@gobble
+\let\PrintDescribeEnv=\@gobble
+% \def\Describe@Macro#1{\endgroup
+% %\marginnote{\PrintDescribeMacro{#1}}%
+% \SpecialUsageIndex{#1}\@esphack\ignorespaces%
+% }
+%\def\Describe@Env#1{\endgroup
+% %\marginnote{\PrintDescribeEnv{#1}}%
+% \SpecialEnvIndex{#1}\@esphack\ignorespaces%
+% }
+\makeatother
+\AtBeginDocument{\normalmarginpar}
+\setlength\MacrocodeTopsep{.5\baselineskip}
+\setlength\MacroIndent{6mm}
+
+
+\RequirePackage{luatexbase}
+\RequirePackage[ngerman,english]{babel}
+\RequirePackage{calc}
+
+\RequirePackage[
+ paper = a4paper, % - use A4 paper size
+ foot = 2cm,
+ inner = 3cm, % - total body: left margin (odd pages)
+ top = 3cm, % - total body: top margin
+ outer = 3cm, % - total body: right margin (odd pages)
+ bottom = 3cm, % - total body: bottom margin
+ marginparwidth = 2cm, % - width for side note
+ marginparsep = .5cm, % - space between notes and body text (content)
+% showframe,
+]{geometry}
+
+\newlength\fullwidth
+\setlength\fullwidth{\textwidth+\marginparwidth+\marginparsep}
+
+\KOMAoptions{
+ numbers = noenddot,
+}
+\AtBeginDocument{
+ \KOMAoptions{
+ % headwidth = {\fullwidth},
+ % footwidth = {\fullwidth},
+ footheight = 20pt,
+ headheight = 29pt,
+ captions = tableheading,
+}}
+
+
+
+\title{\huberlintitle}
+%\subtitle{\huberlinsubtitle}
+\author{\huberlinauthor}
+\date{\Version}
+
+
+%---- Required Packages
+\RequirePackage{ifluatex,luatex85}
+\ifx\directlua\relax
+ \let\directlua\UnDeFiNeD
+\fi
+\ifluatex
+\else
+\GenericError{hu-berlin}%
+ {Please use `LuaLaTeX' as Compiler.^^J I abort here.}
+\fi
+% \end{macrocode}
+% For fonts we load the package \pkg{fontspec} which
+% has almost no limits handling font-stuff.
+% \begin{macrocode}
+\RequirePackage{fontspec}
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage[mono=false]{libertine}
+\RequirePackage{amssymb}
+
+\defaultfontfeatures{%
+ Ligatures = TeX
+}
+% \end{macrocode}
+% For fonts we use the available |TeX Gyre Pagella| as main font.\fnurl{http://www.gust.org.pl/projects/e-foundry/tex-gyre}
+% \begin{macrocode}
+\setmainfont[%
+ Ligatures = TeX
+ ,Numbers = OldStyle]{TeX Gyre Pagella}
+% \end{macrocode}
+% And we declare also the other fonts, too.
+% \begin{macrocode}
+\setmonofont[%
+ Scale=1
+]{TeX Gyre Cursor}
+\setsansfont[%
+ ,LetterSpace = .8
+]{TeX Gyre Adventor-Regular}
+\linespread{1.05}
+% \end{macrocode}
+% \begin{macrocode}
+
+
+
+\RequirePackage{marginnote}
+\renewcommand*{\marginfont}{%
+ \rule{0pt}{0.7\baselineskip}%
+ \footnotesize%
+ \color{hu-berlin-brown}}
+
+\RequirePackage[
+ german = guillemets,
+ style = german,
+]{csquotes}
+
+\RequirePackage{enumitem}
+\setlist{
+ nosep,
+ % itemindent=1em,
+ % labelindent=0.5\parindent,
+ leftmargin=*}
+\newlist{tabitemize}{itemize}{2}% neue Listenumgebung
+\setlist[tabitemize]{%
+ nosep,
+ leftmargin=*
+ }
+\setlist[tabitemize,1]{label=\labelitemi}
+\setlist[tabitemize,2]{label=\labelitemii}
+
+
+\clubpenalty=10000 % prevent single lines at the beginning of a paragraph (Schusterjungen)
+\widowpenalty=10000 % prevent single lines at the end of a paragraph (Hurenkinder)
+\displaywidowpenalty=10000 %
+
+\RequirePackage{pdfpages}
+\RequirePackage{biblatex}
+\addbibresource{\jobname-bibliography.bib}
+\addbibresource{\jobname-ctan.bib}
+\RequirePackage{ccicons} %creative commons
+\RequirePackage{xparse}
+\RequirePackage{ragged2e}
+\RequirePackage{microtype}
+\RequirePackage{xspace}
+\RequirePackage{graphicx}
+\graphicspath{{img/}}
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{etoolbox}
+%https://tex.stackexchange.com/a/235881/98739
+\AfterEndPreamble{%
+ \maketitle
+ \renewcommand\MacroFont{\ttfamily}
+ \renewcommand\AltMacroFont{\ttfamily\linespread{.8}}% slanted verbatim
+}
+
+% https://tex.stackexchange.com/a/401466/98739
+\makeatletter
+\renewcommand*{\maketitle}{%
+ % taken and shortened from /usr/share/texmf/tex/latex/koma-script/scrartcl.cls
+ \begin{titlepage}
+ \newgeometry{left=3cm,right=3cm,top=1.5cm,bottom=2cm}
+ \global\@topnum=\z@
+ \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
+ \null
+ {\large\@author\hfill \href{mailto:lukas@texografie.de}{lukas@texografie.de}\par}
+ \vskip 10em%
+ {\begin{center}\color{hu-berlin-blue}
+ {\fontsize{50}{55}\selectfont\huberlinshort{} \par\vskip .5em%
+ \Large\sffamily\@title}\par
+ \vskip .5em
+ \end{center}}%
+ {\ifx\@subtitle\@empty\else\usekomafont{subtitle}\@subtitle\par\fi}%
+ \null\vskip 5em%
+ \blockcquote[195]{Hoare1973}{Documentation must be regarded as an integral part of the process of design and coding.
+ A good programming language will encourage and assist the programmer to write clear,
+ self-documenting code,
+ and even perhaps to develop
+ and display a pleasant style
+ of writing.}
+ \null\vfill
+ {\usekomafont{subtitle}{\@date \hfill
+ \includegraphics[width=4cm]{img/texografie-logo.pdf}\\}}%
+ \par
+ \vskip 0em
+ \restoregeometry
+ \end{titlepage}
+}%
+\makeatother
+
+\RequirePackage{xcolor}
+\definecolor{hu-berlin-blue}{RGB}{0,65,137} % HEX 004189
+\definecolor{hu-berlin-green}{RGB}{150,190,20} % HEX 93C11A % Topoi
+\definecolor{hu-berlin-grey}{RGB}{169,169,169}
+\definecolor{hu-berlin-brown}{RGB}{82,79,60}
+\definecolor{hu-berlin-red}{RGB}{180,0,0}
+
+
+\RequirePackage{dirtree}
+\renewcommand*\DTstylecomment{%
+ \color{hu-berlin-grey}%
+ \footnotesize%
+ \sffamily}
+\renewcommand*\DTstyle{%
+ \ttfamily%
+ \small%
+ }
+
+\RequirePackage[
+ markcase = noupper,
+ footsepline = .5pt,
+ % headsepline = .5pt,
+ autooneside = false,% use left and right marks with a onesided document
+ automark,% set \leftmark and \rightmark automatically by *\section and \subsection
+ draft = false,
+ ]{scrlayer-scrpage}
+
+\pagestyle{scrheadings}
+\clearscrheadfoot
+\rofoot*{\thepage}
+\lofoot*{\textcolor{hu-berlin-blue}{\huberlintitle}\ \vrule\ \textcolor{hu-berlin-brown}{\huberlinsubtitle}}
+\rohead*{hu-berlin-bundle}
+\lohead*{Version: \Version}
+% \end{macrocode}
+% \begin{macrocode}
+% https://tex.stackexchange.com/a/352925/98739
+\newcommand*\partnumber{}
+\DeclareNewLayer[
+ background,
+ textarea,
+ addwidth=\marginparsep+\marginparwidth,
+ mode=picture,
+ contents={%
+ \putC{\makebox[0pt][c]{\raisebox{-.5\height}{\scalebox{50}{\textcolor{black!5}{\partnumber}}}}}\gdef\partnumber{}%
+ }
+]{partnumber}
+\DeclareNewPageStyleByLayers{part}{partnumber}
+\renewcommand\partpagestyle{part}
+\renewcommand*{\partformat}{\gdef\partnumber{\thepart}}
+
+% only a dirty workaround for the part title
+\newcommand*\changedpartwidth[1]{%
+ \makebox[\linewidth][l]{%
+ \parbox{\dimexpr\textwidth+\marginparsep+\marginparwidth\relax}{\raggedpart#1}%
+ }%
+}
+% add \changedpartwidth as last command to the settings for font element part
+\addtokomafont{part}{\Huge\changedpartwidth}
+
+
+
+%-https://tex.stackexchange.com/a/339516/98739 | https://tex.stackexchange.com/a/96722/98739
+% footnotes in the footer:
+\deffootnote%
+ %[\normalparindent]%<width of mark>
+ {0.0cm}%<indent of footnote text>
+ {\normalparindent}%<paragraph indent in the footnote text>
+ {\makebox[\normalparindent][r]%
+ {\thefootnotemark\hspace*{3pt}}}%<definition of mark>
+\newlength{\normalparindent}
+\AtBeginDocument{\setlength{\normalparindent}{\parindent}}
+ \setfootnoterule{0pt}% Kein Fußnotenstrich
+ %\setfootnoterule[<height>]{<length>}
+
+% \end{macrocode}
+% This will put the numbers of the chapters and sections into the margin.
+% \begin{macrocode}
+\renewcommand\sectionlinesformat[4]{%
+ \makebox[0pt][r]{#3}#4%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{url}
+% \urlstyle{same}
+
+\setkomafont{title}{\sffamily\color{hu-berlin-blue}\flushleft\bfseries}
+\setkomafont{disposition}{\color{hu-berlin-brown}\sffamily\bfseries\large}
+\setkomafont{section}{\usekomafont{disposition}}
+\setkomafont{subsection}{\usekomafont{disposition}}
+\setkomafont{subsubsection}{\usekomafont{disposition}}
+% \setkomafont{paragraph}{\bfseries}
+% \setkomafont{subsubsection}{\sffamilybold}
+\setkomafont{subtitle}{\large\color{hu-berlin-brown}\sffamily\flushleft}
+\setkomafont{pageheadfoot}{\footnotesize\sffamily\color{hu-berlin-grey}}
+\setkomafont{descriptionlabel}{\bfseries}
+\setkomafont{footnotelabel}{\bfseries}
+\addtokomafont{titlehead}{\flushright}
+% \setkomafont{headsepline}{\color{hu-berlin-blue}}
+%\setkomafont{marginnote}{\MakeUppercase\color{hu-berlin-brown}}
+\addtokomafont{caption}{\scriptsize}
+\setkomafont{captionlabel}{\bfseries\sffamily}
+\setkomafont{subject}{\bfseries\sffamily}
+\setcapindent{0pt}
+
+\raggedbottom
+
+\RequirePackage{listings}
+\PassOptionsToPackage{final}{listings}
+\RequirePackage[%
+ skins
+ ,listings
+ ,breakable
+ ,xparse
+ ,documentation
+]{tcolorbox}
+\lstMakeShortInline[language=TeX,basicstyle=\ttfamily]|
+% \end{macrocode}
+% Following we load \pkg{hyperxmp} and \pkg{hyperref} for \pdf-meta data and interactive linked text.
+% \begin{macrocode}
+\RequirePackage{hyperxmp}
+\RequirePackage{hyperref}
+\hypersetup{% setup the hyperref-package options
+ unicode = true,
+ pdfauthor = {hu-berlin}, % - author (PDF meta)
+ pdfauthortitle = {},
+ pdfcopyright = {Copyright (c) \the\year . All rights reserved.},
+ pdfhighlight = /N,
+ pdfdisplaydoctitle = true,
+ pdflang = {},%de en
+ pdfcaptionwriter = {Lukas C. Bossert},
+ pdfkeywords = {hu-berlin},
+ pdfencoding = auto,
+ pdfproducer = {hu-berlin with LuaLaTeX},
+ bookmarksnumbered = true,
+ bookmarksopenlevel = 2,
+ bookmarksopen = true,
+ bookmarksdepth = 3,
+ colorlinks = true, %Colours links instead of ugly boxes
+ urlcolor = hu-berlin-blue, %Colour for external hyperlinks
+ linkcolor = black, %Colour of internal links
+ citecolor = black, %Colour of citations
+ linktoc = page,
+ pdfborder = {0 0 0},
+ breaklinks = true, %allow line break inside links
+ final
+}
+\RequirePackage{bookmark}
+
+\RequirePackage[
+ sort,
+ nameinlink,
+ compress,
+ ngerman,english
+]{cleveref}
+
+
+%---- newcommands
+\newcommand{\TeXografie}{Lukas C. Bossert
+ (www.texografie.de)}
+\newcommand\huberlin{\huberlintitle\xspace}
+
+
+\newcommand\huberlinFolder{%
+ \begingroup%
+ \normalfont%
+ \color{hu-berlin-blue}%
+ % \faFolderOpen% taken from fontawesome
+ \hspace{.3em}%
+ \endgroup}
+
+
+
+\RedeclareSectionCommands[
+ tocraggedpagenumber,
+ toclinefill=\tocpageseparator,
+ tocindent=0em,
+ tocnumwidth=4em,
+ tocpagenumberbox=\tocpagenumberbox% <- added
+% tocpagenumberformat=\textsf,
+]{chapter,section,subsection,subsubsection,paragraph}
+
+\newcommand\tocgobble[1]{}% <- added
+\newcommand\tocpageseparator{\footnotesize\,\mbox{---}\,}
+\newcommand\tocpagenumberbox[1]{\mbox{#1}}% <- added
+\KOMAoptions{toc=indentunnumbered}
+
+\RedeclareSectionCommand[
+% tocbeforeskip=1.25em plus 1pt
+ ,tocentryformat=\large\scshape%
+ ,tocindent=0em
+ ,tocnumwidth=4em
+ ,tocpagenumberbox=\tocgobble% <- added
+]{part}
+%\addtokomafont{partentry}{\scshape\sffamily\bfseries}
+
+\RedeclareSectionCommand[%
+% ,beforeskip=1.15em plus 1pt%
+ ,tocentryformat=\textbf%
+ % ,toclinefill={\TOCLineLeaderFill}%\TOCLineLeaderFill[\textbf{.}]
+]{chapter}
+
+
+
+
+\newtcolorbox{example}[1][]{
+ breakable,
+ top=5pt,
+ bottom=5pt,
+ colback=hu-berlin-blue!10,
+ colframe=hu-berlin-blue,
+ left=5pt,
+ right=5pt,
+ sharp corners,
+ boxrule=0pt,
+ bottomrule=2pt,
+ toprule=2pt,
+ enhanced jigsaw,
+ lefttitle=0pt,
+ coltitle=white,
+ fonttitle=\bfseries,
+ fontupper=\small,%\ttfamily,
+ % colbacktitle=hu-berlin-blue!20
+ #1,
+}
+
+% Replace the squat-u symbol for spaces
+% https://tex.stackexchange.com/a/488123/98739
+\makeatletter
+\def\lst@visiblespace{\lst@ttfamily{\char32}$\textcolor{hu-berlin-grey}{\cdot}$}
+\makeatother
+
+
+\lstset{%
+ basicstyle = \linespread{0.7}\ttfamily
+ ,breaklines = true
+ ,breakatwhitespace
+ ,alsoletter=\\\{\}\*\[\]\-
+ ,showstringspaces=true
+ }
+
+\lstdefinestyle{hu-berlinlistingstyledef}{%
+ tabsize = 4,
+ breaklines = true,
+ breakatwhitespace = true,
+ postbreak=\mbox{$\hookrightarrow$},
+ %keepspaces = true,
+ escapeinside = {(*@}{@*)},
+ moredelim = {[is][\ttfamily\bfseries\color{hu-berlin-blue}]{|}{|}},
+ moredelim = {[is][\ttfamily\bfseries\color{hu-berlin-blue}]{|1}{1|}},
+ moredelim = {[is][\ttfamily\bfseries\color{hu-berlin-red}]{|2}{2|}},
+ aboveskip=0pt,
+ belowskip=0pt,
+ captionpos=b,
+ resetmargins=true,
+ sensitive=true,
+ upquote=true,
+ showspaces=true,
+ showtabs=true,
+ tab=\textcolor{hu-berlin-grey}{\rightarrowfill},
+ %numbers=left,
+ %numberstyle=\footnotesize\ttfamily\color{hu-berlin-grey},
+ comment = [l]{\%},
+ commentstyle = \footnotesize\color{hu-berlin-grey}\addfontfeature{LetterSpace=.7},
+ % deletecomment = [l]{\%<}
+ % morecomment = [l][\nullfont]{\%<},
+ % deletecomment = [is]{\%<}{>},
+}
+
+\lstdefinestyle{hu-berlinlistingstyle}{%
+ language = {TeX},
+ style = {hu-berlinlistingstyledef},
+}
+
+
+
+
+
+
+\tcbset{%
+hu-berlinstyle/.style={%
+ enhanced,
+ before skip=2mm,
+ after skip=3mm,
+ boxrule=0.7pt,
+ left=2mm,
+ right=2mm,
+ top=2mm,
+ bottom=2mm,
+ sharp corners,
+ colback=white,
+ colbacklower=white,
+ % fonttitle=\sffamily\bfseries,
+ breakable,
+ %before skip=\baselineskip,
+ coltitle=white,
+ colbacktitle=hu-berlin-blue!50!black,
+ fonttitle=\bfseries\sffamily\footnotesize,
+ % before upper={\mynote{\thetcbcounter}},
+ title={\hfill{Example \thetcbcounter}},
+ },
+codecomment/.style={%
+ listing outside comment,%
+ boxrule=0pt,
+ colback=white,
+ }
+}
+
+\newtcolorbox{warning}[1][]{
+ enhanced,
+ before skip=2mm,
+ after skip=3mm,
+ boxrule=0.7pt,
+ left=5mm,
+ right=2mm,
+ top=2mm,
+ bottom=2mm,
+ colback=white,
+ colframe=yellow!20!black,
+ sharp corners,
+ rounded corners=southeast,
+ arc is angular,
+ arc=3mm,
+ underlay={%
+ \path[fill=hu-berlin-grey!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
+ \path[draw=hu-berlin-grey,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
+ \path[fill=red!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
+ },
+ drop fuzzy shadow,
+ #1
+ }
+
+\newtcblisting[%
+ auto counter,
+ crefname = {example}{examples},
+ Crefname = {Example}{Examples},
+]{codetext}[2][]{%
+ hu-berlinstyle,
+% side text,
+ rounded corners=northeast,
+ arc=6mm,
+ listing style=hu-berlinlistingstyle,
+ label = #2,
+ #1,
+ }
+
+\newtcblisting[%
+ use counter from=codetext,
+ crefname={code example}{code examples},
+ Crefname={Code example}{Code examples}%
+]{code}[2][]{%
+ hu-berlinstyle,
+ rounded corners=southeast,
+ arc=6mm,
+ listing only,
+ listing style=hu-berlinlistingstyle,
+ label = #2,
+ #1,
+}
+
+
+\DeclareTCBInputListing[%
+ use counter from=codetext,
+ crefname={code example}{code examples},
+ Crefname={Code example}{Code examples}%
+]{\huberlinlisting}{ O{} m }{%
+ hu-berlinstyle,
+ listing file={#2},
+ listing only,
+ listing style=hu-berlinlistingstyle,
+ #1,
+}
+
+% \end{macrocode}
+% \begin{macrocode}
+\makeatletter
+\newrobustcmd*{\fnurl}[1][]{\hyper@normalise\ltd@fnurl{#1}}
+\def\ltd@fnurl#1#2{\footnote{#1\hyper@linkurl{\Hurl{#2}}{#2}}}
+\makeatother
+% \end{macrocode}
+% The first command is used to refrence packages with:
+% \cmd{\pkg}\marg{package name}.\footnote{Do not forget to
+% insert the name of the package into the makefile
+% in the definition of |PKG|.}
+% The name of the package is linked to its entry on CTAN and
+% refrenced to the bibliography in the end of this documentation.
+% \begin{macrocode}
+\RequirePackage{newfile}
+\newoutputstream{pkglist}
+% \end{macrocode}
+% \begin{macrocode}
+\NewDocumentCommand{\pkg}{om}{%
+ \IfNoValueTF{#1}
+ {\lowercase{\href{http://www.ctan.org/pkg/#2}}{\textbf{#2}}}
+ {\lowercase{\href{http://www.ctan.org/pkg/#1-#2}}{\textbf{#2}}}%
+ \space\cite{#2}%
+ \addtostream{pkglist}{#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newrobustcmd*{\lit}[1]{\textsf{#1}}
+\newrobustcmd*{\Code}[1]{\texttt{#1}}
+\newrobustcmd*{\tex}{\TeX}
+\newrobustcmd*{\etex}{\mbox{e-TeX}}
+\newrobustcmd*{\pdftex}{pdf\-\tex}
+\newrobustcmd*{\xetex}{Xe\-\tex}
+\newrobustcmd*{\luatex}{Lua\-\tex}
+\newrobustcmd*{\latex}{\LaTeX}%{La\kern-0.07em TeX}
+\newrobustcmd*{\pdflatex}{pdf\-\latex}
+\newrobustcmd*{\xelatex}{Xe\-\latex}
+\newrobustcmd*{\lualatex}{Lua\-\latex}
+\newrobustcmd*{\miktex}{Mik\-\tex}
+\newrobustcmd*{\texlive}{\tex~live}
+\newrobustcmd*{\bibtex}{Bib\kern-0.07em TeX}
+\newrobustcmd*{\lppl}{\latex{} Project Public License}
+\newrobustcmd*{\pdf}{{PDF}}
+\newrobustcmd*{\md}{{MarkDown}}
+\newrobustcmd*{\utf}{\mbox{{UTF}-8}}
+% no \mbox here, we may have to break things
+\newrobustcmd*{\bibfield}[1]{\Code{#1}}
+\newrobustcmd*{\opt}[1]{\Code{#1}}
+\newrobustcmd*{\bibmacro}[1]{\Code{#1}}
+\newrobustcmd*{\bibtype}[1]{\Code{@#1}}
+%\renewrobustcmd*{\cmd}[1]{\Code{\textbackslash #1}}
+\renewrobustcmd\meta[1]{\normalfont{\textlangle}{\itshape#1\/}{\textrangle}}
+
+% directly taken from ltxdoc.dtx
+\renewrobustcmd\marg[1]{%
+ {\ttfamily\textcolor{hu-berlin-red}{\{}}%
+ \meta{#1}%
+ {\ttfamily\textcolor{hu-berlin-red}{\}}}%
+ }
+
+\renewrobustcmd\oarg[1]{%
+ {\ttfamily\textcolor{hu-berlin-green}{[}}%
+ \meta{#1}%
+ {\ttfamily\textcolor{hu-berlin-green}{]}}%
+ }
+
+% adapted from listings.dtx (lstdoc.sty)
+\renewrobustcmd\cmd[1]{%
+ \texttt{\color{hu-berlin-blue}\textbackslash\string#1}\xspace%
+ }
+
+\newrobustcmd\env[2][]{%
+ \texttt{%
+ \color{hu-berlin-blue}%
+ \textbackslash begin\{\string#2\}#1}%
+ \ldots
+ \texttt{%
+ \color{hu-berlin-blue}%
+ \textbackslash end\{\string#2\}}%
+ \xspace}
+% \end{macrocode}
+% For a common layout of the parameter style to identify code
+% of the different documents, files and packages we use
+% \cmd{param}\marg{name of the parameter}.
+% \begin{macrocode}
+\newcommand\param[1]{%
+ \begingroup%
+ \normalfont%
+ \ttfamily%
+ \bfseries%
+ \textless%
+ #1%
+ \ttfamily%
+ \bfseries%
+ \textgreater%
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\pdfstringdefDisableCommands{%
+ \def\lstinline#1{<#1>}
+ \def\tex{TeX}%
+ \def\etex{e-TeX}%
+ \def\xetex{XeTeX}%
+ \def\latex{LaTeX}%
+ \def\xelatex{XeLaTeX}%
+ \def\bibtex{BibTeX}%
+ \def\lppl{LaTeX Project Public License}%
+ \def\pdf{PDF}%
+ \def\utf{UTF-8}%
+ \def\\{}%
+ \def\texttt#1{<#1>}%
+ \def\marg#1{\{#1\}}%
+ \def\oarg#1{[#1]}%
+ \def\color#1#2{}%
+ \def\env#1{<#1>}
+ \def\cmd#1{#1}
+}
+% https://tex.stackexchange.com/a/24067/98739
+\makeatletter
+\patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
+\makeatother
+%
+\RequirePackage[tightLists=false]{markdown}
+\markdownSetup{rendererPrototypes={%
+ link = {\href{#3}{#1}}%
+}}
+%</style>
+% \end{macrocode}
+% \begin{macrocode}
+%</sty>
+% \end{macrocode} \ No newline at end of file
diff --git a/macros/luatex/latex/hu-berlin-bundle/hu-berlin-bundle.pdf b/macros/luatex/latex/hu-berlin-bundle/hu-berlin-bundle.pdf
new file mode 100644
index 0000000000..56c521ac5a
--- /dev/null
+++ b/macros/luatex/latex/hu-berlin-bundle/hu-berlin-bundle.pdf
Binary files differ
diff --git a/macros/luatex/latex/hu-berlin-bundle/img/texografie-logo.pdf b/macros/luatex/latex/hu-berlin-bundle/img/texografie-logo.pdf
new file mode 100644
index 0000000000..5609d8aee5
--- /dev/null
+++ b/macros/luatex/latex/hu-berlin-bundle/img/texografie-logo.pdf
Binary files differ
diff --git a/macros/luatex/latex/hu-berlin-bundle/makefile b/macros/luatex/latex/hu-berlin-bundle/makefile
new file mode 100644
index 0000000000..85956df80d
--- /dev/null
+++ b/macros/luatex/latex/hu-berlin-bundle/makefile
@@ -0,0 +1,134 @@
+PROJECT:=hu-berlin-bundle
+SHELL = bash
+MAKE = make
+CTANBIB = $(PROJECT)-ctan.bib
+PKG = $(shell cat $(PROJECT).pkglist)
+CTAN = ctanbib $$pkg >> $(CTANBIB) && echo "... $$pkg"
+# install
+LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL)
+# zip
+PWD = $(shell pwd)
+TEMP := $(shell mktemp -d -t tmp.XXXXXXXXXX)
+TDIR = $(TEMP)/$(PROJECT)
+VERS = $(shell /bin/date "+%Y-%m-%d---%H-%M-%S")
+DATE = $(shell /bin/date "+%Y-%m-%d")
+# Colors
+RED = \033[0;31m
+CYAN = \033[0;36m
+NC = \033[0m
+echoPROJECT = @echo -e "$(CYAN) <$(PROJECT)>$(RED)"
+
+
+
+.PHONY: test
+
+all: doc
+
+
+
+examples: files
+ $(MAKE) letter
+ $(MAKE) md2pdf-letter
+
+md2pdf-letter: files
+ pandoc --pdf-engine=lualatex --template hu-berlin-letter-template.latex -o hu-berlin-letter-example-markdown.pdf hu-berlin-letter-example-markdown.md
+
+letter: files
+ latexmk -lualatex -gg -interaction=nonstopmode hu-berlin-letter-example-lualatex.tex
+
+# How to get information from CTAN
+CTAN: $(PROJECT).pkglist
+ @for pkg in $(PKG);\
+ do \
+ $(CTAN); \
+ done
+
+# before we retrieve infos from CTAN
+# we clean and sort the list with packages
+getCTAN: $(PROJECT).pkglist
+ $(echoPROJECT) "$(RED)Retrieving$(NC) information from CTAN."
+ $(echoPROJECT) "Fetching information from CTAN about package...$(NC)"
+ @-rm $(CTANBIB)
+ $(shell sort -u $(PROJECT).pkglist > $(TEMP)/pkg1.lst)
+ mv $(TEMP)/pkg1.lst $(PROJECT).pkglist
+ $(MAKE) CTAN
+
+$(PROJECT).pkglist:
+ lualatex $(PROJECT).dtx
+
+files: $(PROJECT).ins
+ lualatex $(PROJECT).ins
+ $(echoPROJECT) "* source files created * $(NC)"
+
+$(PROJECT).ins:
+ lualatex $(PROJECT).dtx
+
+doc: files
+ $(MAKE) $(PROJECT).pdf
+ # $(MAKE) install
+ $(MAKE) examples
+ latexmk -lualatex -f --shell-escape $(PROJECT).dtx
+ $(echoPROJECT) "* $(PROJECT).pdf created * $(NC)"
+ @exit 0
+
+$(PROJECT).pdf: getCTAN files
+ $(echoPROJECT) "* creating $(PROJECT).pdf * $(NC)"
+ latexmk -lualatex -f --shell-escape $(PROJECT).dtx
+ $(echoPROJECT) "* $(PROJECT).pdf created * $(NC)"
+
+# clean all temporary files
+clean:
+ rm -f $(PROJECT).{sectionbibs.aux,fls,pkglist,thm,bibexample,biographies.aux,xdv,aux,mw,bbl,bcf,blg,doc,fdb_latexmk,fls,glo,gls,hd,idx,ilg,ind,listing,log,nav,out,run.xml,snm,synctex.gz,toc,vrb}
+ rm -f $(PROJECT).markdown.{in,lua,out}
+ rm -f *.{log,aux,latexmk}
+ rm -rf _markdown_*
+ $(echoPROJECT) "* cleaned temp files * $(NC)"
+
+ctan: $(PROJECT).dtx
+ $(echoPROJECT) "* start zipping files * $(NC)"
+ @-mkdir archive
+ @rm -f archive/$(PROJECT)-$(DATE)*.zip
+ @mkdir $(TDIR)
+ @cp $(PROJECT).{dtx,pdf} README.md makefile $(TDIR)
+ -@rm -f img/.DS_Store
+ @cp -R img $(TDIR)
+ @cd $(TEMP); \
+ zip -Drq $(PWD)/archive/$(PROJECT)-$(VERS).zip $(PROJECT)
+ $(echoPROJECT) "* files zipped * $(NC)"
+
+
+# clean all files
+cleanbundle: clean
+ rm -f *.{{b,c,d,l}bx,ins,pdf,zip,bib,sty,cls}
+ rm -f hu-berlin-letter*.{tex,md,lco,latex}
+ $(echoPROJECT) "* cleaned all files * $(NC)"
+
+# This will check whether there is the folder
+# .pandoc in the main directory
+pandoc-files:
+ifneq ("$(wildcard ~/.pandoc/templates/)","")
+ $(echoPROJECT) "* pandoc/templates/ exists. * $(NC)"
+else
+ $(echoPROJECT) "* pandoc/templates/ missing, creating it. * $(NC)"
+ mkdir ~/.pandoc
+ mkdir ~/.pandoc/templates
+endif
+ cp hu-berlin-*-template.* ~/.pandoc/templates/
+
+
+
+install: uninstall files
+ @mkdir -p $(LOCAL)/{tex,source,doc}/latex/$(PROJECT)
+ @cp $(PROJECT).{dtx,ins} $(LOCAL)/source/latex/$(PROJECT)
+ @cp hu-berlin-*.{cls,sty} $(LOCAL)/tex/latex/$(PROJECT)
+ @cp img/* $(LOCAL)/tex/latex/$(PROJECT)
+ @cp $(PROJECT).pdf $(LOCAL)/doc/latex/$(PROJECT)
+ mktexlsr
+ $(MAKE) pandoc-files
+ $(echoPROJECT) "* all files installed * $(NC)"
+
+
+uninstall:
+ @rm -rf $(LOCAL)/{tex,source,doc}/latex/$(PROJECT)
+ @rm -rf $(LOCAL)/{tex/latex,bibtex/bib}/$(PROJECT)
+ $(echoPROJECT) "* all files uninstalled * $(NC)"