From 8626a9c3cb5dc8d02d779d5b5b1e3933d5626f43 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sat, 2 May 2020 03:03:34 +0000
Subject: CTAN sync 202005020303

---
 language/japanese/jlreq/jlreq.cls | 71 +++++++++++++++++++++++++++------------
 1 file changed, 50 insertions(+), 21 deletions(-)

(limited to 'language/japanese/jlreq/jlreq.cls')

diff --git a/language/japanese/jlreq/jlreq.cls b/language/japanese/jlreq/jlreq.cls
index 8f1ed6dfb1..913785b02d 100644
--- a/language/japanese/jlreq/jlreq.cls
+++ b/language/japanese/jlreq/jlreq.cls
@@ -5,7 +5,7 @@
 %%
 % (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/)
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jlreq}[2020/02/07 jlreq]
+\ProvidesClass{jlreq}[2020/05/01 jlreq]
 \RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
 \RequirePackage{jlreq-helpers}
 
@@ -3769,6 +3769,14 @@
   {%
     \begingroup
       \jlreq@pagestyle@parse@position@#1-\jlreq@endmark
+      \ifthenelse{\equal{\jlreq@tempa}{fore}}{%
+        \expandafter\jlreq@pagestyle@parse@position@\jlreq@tempb-\jlreq@endmark
+        \ifthenelse{\equal{\jlreq@tempa}{edge}}{%
+          \def\jlreq@tempa{fore-edge}%
+        }{%
+          \ClassError{jlreq}{Invalid position: fore-\jlreq@tempa}{\@ehc}%
+        }%
+      }{}%
       % \jlreq@tempcに縦方向を，\jlreq@tempdに横方向を入れる
       \def\jlreq@tempc{}\def\jlreq@tempd{}%
       \jlreq@pagestyle@parse@position@@{\jlreq@tempa}%
@@ -3786,8 +3794,8 @@
   \jlreq@ifempty{#2}{%
     \ifx\jlreq@tempb\@empty\ClassError{jlreq}{Invalid position: #1}{\@ehc}\fi
   }{%
-    \def\@tempa##1-{\def\jlreq@tempb{##1}}%
-    \@tempa#2\relax
+    \def\@tempa##1-\jlreq@endmark{\def\jlreq@tempb{##1}}%
+    \@tempa#2\jlreq@endmark\relax
   }%
 }
 
@@ -4230,9 +4238,8 @@
     \jlreq@if{\ifjlreq@pstate\fi}{% tate
       % headの方に処理を入れる．footは空．
       \def\jlreq@oddfoot{}\def\jlreq@evenfoot{}%
-      \jlreq@for@noexpand\jlreq@position:=\jlreq@nombre@i@position,\jlreq@running@head@i@position\do{%
-        \expandafter\ifx\jlreq@position\@empty\expandafter\def\jlreq@position{0pt}\fi
-      }%
+      \ifx\jlreq@nombre@i@position\@empty\def\jlreq@nombre@i@position{5\jlreq@zw}\fi
+      \ifx\jlreq@running@head@i@position\@empty\def\jlreq@running@head@i@position{4\jlreq@zw}\fi
       \edef\jlreq@gapcs{\noexpand\hskip\noexpand\glueexpr\expandonce{\jlreq@nombre@gap}\noexpand\relax}%
       \jlreq@pagestyle@addifempty{\jlreq@nombre@iii@position}{\jlreq@nombre@ii}{\jlreq@gapcs}{\jlreq@nombre@iii}%
       \jlreq@pagestyle@addifempty{\jlreq@nombre@ii@position}{\jlreq@nombre@i}{\jlreq@gapcs}{\jlreq@nombre@ii}%
@@ -4246,15 +4253,16 @@
         \expandafter\let\expandafter\jlreq@position\csname jlreq@nombre@\jlreq@i @position\endcsname
         \expandafter\ifx\csname jlreq@nombre@\jlreq@i\endcsname\@empty\else
           \jlreq@ifgluezero{\glueexpr\jlreq@position\relax}{\def\jlreq@position{}}{}%
+          \expandafter\let\expandafter\jlreq@tempa\expandafter=\csname jlreq@nombre@\jlreq@i\endcsname
+          \jlreq@pagestyle@addfont@tocs{jlreq@tempa}{jlreq@nombre@font}%
           \eappto\jlreq@nombre@contents{%
             \noexpand\hbox to 0pt{\noexpand\hss
+              \expandonce{\jlreq@tempa}%
               \ifx\jlreq@position\@empty\else\unexpanded{\hskip \glueexpr}\expandonce{\jlreq@position}\noexpand\relax\fi
-              \csexpandonce{jlreq@nombre@\jlreq@i}%
             }%
           }%
         \fi
       }%
-      \jlreq@pagestyle@addfont@tocs{jlreq@nombre@contents}{jlreq@nombre@font}%
       % \jlreq@(odd|even)@contentsに柱を入れる（上の方に出力）
       \@for\jlreq@parity:=odd,even\do{%
         \expandafter\def\csname jlreq@\jlreq@parity @contents\endcsname{}%
@@ -4262,17 +4270,18 @@
           \expandafter\let\expandafter\jlreq@position\csname jlreq@running@head@\jlreq@i @position\endcsname
           \expandafter\ifx\csname jlreq@\jlreq@parity @running@head@\jlreq@i\endcsname\@empty\else
             \jlreq@ifgluezero{\glueexpr\jlreq@position\relax}{\def\jlreq@position{}}{}%
+            \expandafter\let\expandafter\jlreq@tempa\expandafter=\csname jlreq@\jlreq@parity @running@head@\jlreq@i\endcsname
+            \jlreq@pagestyle@addfont@tocs{jlreq@tempa}{jlreq@running@head@font}%
             \expandafter\eappto\csname jlreq@\jlreq@parity @contents\endcsname{%
               \noexpand\hbox to 0pt{\unexpanded{\hskip\glueexpr\headsep + \headheight}%
                 \if@tate\else\unexpanded{+ \topskip - \Cht}\fi
                 \ifx\jlreq@position\@empty\else + \expandonce{\jlreq@position}\fi\noexpand\relax
-                \csexpandonce{jlreq@\jlreq@parity @running@head@\jlreq@i}%
+                \expandonce{\jlreq@tempa}%
                 \noexpand\hss
               }%
             }%
           \fi
         }%
-        \jlreq@pagestyle@addfont@tocs{jlreq@\jlreq@parity @contents}{jlreq@running@head@font}%
         % \jlreq@(odd|even)headの構築
         % 空き指定には基本版面の文字サイズを使う（2.6.1.c）
         \@ifundefined{jlreq@\jlreq@parity headformat}
@@ -4455,7 +4464,7 @@
       \jlreq@pagestyle@setheadfoot{\jlreq@oddfoot}{jlreq@odd@bottom@left}{jlreq@odd@bottom@center}{jlreq@odd@bottom@right}%
       \jlreq@pagestyle@setheadfoot{\jlreq@evenhead}{jlreq@even@top@left}{jlreq@even@top@center}{jlreq@even@top@right}%
       \jlreq@pagestyle@setheadfoot{\jlreq@evenfoot}{jlreq@even@bottom@left}{jlreq@even@bottom@center}{jlreq@even@bottom@right}%
-      \ifthenelse{\lengthtest{\marginparwidth>0pt} \AND \(\NOT\boolean{@tate}\)}{%
+      \ifthenelse{\lengthtest{\jlreq@sidenote@length >0pt} \AND \(\NOT\boolean{@tate}\)}{%
         \def\jlreq@defaultformat{\hss\hbox to \jlreqyokoheadlength{####1}\hss}%
       }{%
         \def\jlreq@defaultformat{####1}%
@@ -4465,7 +4474,7 @@
       \jlreq@pagestyle@applyformat{\jlreq@oddfoot}{\jlreq@oddfootformat}{\jlreq@defaultformat}%
       \jlreq@pagestyle@applyformat{\jlreq@evenfoot}{\jlreq@evenfootformat}{\jlreq@defaultformat}%
       % 傍注用調整
-      \ifdim\marginparwidth>0pt
+      \ifdim\jlreq@sidenote@length>0pt
         \if@tate\else
           \if@twocolumn
             \jlreq@pagestyle@addsidenotemargin@bothside{\jlreq@oddhead}%
@@ -4507,14 +4516,14 @@
 \if@tate
   \def\jlreqyokoheadlength{\textheight}
 \else
-  \ifdim\marginparwidth>0pt
+  \ifdim\jlreq@sidenote@length>0pt
     \if@twocolumn
       \def\jlreqyokoheadlength{\dimexpr\textwidth + 2\jlreq@sidenote@length + 2\jlreq@sidenote@sep\relax}
     \else
       \def\jlreqyokoheadlength{\dimexpr\textwidth + \jlreq@sidenote@length + \jlreq@sidenote@sep\relax}
     \fi
   \else
-    \def\jlreqyokoheadlength{\textwidth}
+    \def\jlreqyokoheadlength{\dimexpr\textwidth\relax}
   \fi
 \fi
 \edef\jlreqtateheadlength{\unexpanded{\dimexpr\headsep + \headheight + \textheight}\if@tate\else\unexpanded{- \topskip + 1\jlreq@zh}\fi\noexpand\relax}
@@ -5615,18 +5624,20 @@
 \def\@begintheorem#1#2{\topsep=\dimexpr\jlreq@theorem@beforeafter@space\relax
   \trivlist\labelsep=1\jlreq@zw
   \itemindent=\dimexpr\jlreq@theorem@indent\relax
-   \item[\hskip \labelsep{\sffamily\gtfamily\bfseries #1\ #2}]}
+  \jlreq@theorem@font
+   \item[\hskip \labelsep{\reset@font\jlreq@theorem@label@font #1\ #2}]}
 \def\@opargbegintheorem#1#2#3{\topsep=\dimexpr\jlreq@theorem@beforeafter@space\relax
   \trivlist\labelsep=1\jlreq@zw
   \itemindent=\dimexpr\jlreq@theorem@indent\relax
-  \item[\hskip \labelsep{\sffamily\gtfamily\bfseries #1\ #2（#3）}]}
+  \jlreq@theorem@font
+  \item[\hskip \labelsep{\reset@font\jlreq@theorem@label@font #1\ #2（#3）}]}
 \AtEndOfPackageFile*{amsthm}{%
   \jlreq@saveoriginalcs{\proof}%
   \jlreq@saveoriginalcs{\endproof}%
   \edef\jlreq@do{
     \unexpanded{\def\jlreq@proof[#1]}{%
       \unexpanded{\labelsep=1\jlreq@zw}%
-      \expandonce{\proof[{\reset@font\sffamily\gtfamily\bfseries #1\inhibitglue}\nopunct]}%
+      \expandonce{\proof[{\reset@font\jlreq@proof@label@font #1\inhibitglue}\nopunct]}%
     }
   }
   \jlreq@do
@@ -5636,17 +5647,29 @@
   \theoremstyle{jlreq}
 }
 \def\jlreq@setupamsthm{
-  \newtheoremstyle{jlreq}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\normalfont}{\dimexpr\jlreq@theorem@indent\relax}{\sffamily\gtfamily\bfseries}{}{1\jlreq@zw}{\thmname{##1}\thmnumber{\ ##2}\thmnote{（##3）}}
+  \newtheoremstyle{jlreq}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\jlreq@theorem@font}{\dimexpr\jlreq@theorem@indent\relax}{\jlreq@theorem@label@font}{}{1\jlreq@zw}{\thmname{##1}\thmnumber{\ ##2}\thmnote{（##3）}}
 }
 \jlreq@jlreqsetup@add{theorem_beforeafter_space}{
   \def\jlreq@theorem@beforeafter@space{#1}
+  \begingroup\jlreq@tempdima=\dimexpr\jlreq@theorem@beforeafter@space\relax\endgroup
   \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
 }
 \jlreq@jlreqsetup@add{theorem_indent}{
   \def\jlreq@theorem@indent{#1}
+  \begingroup\jlreq@tempdima=\dimexpr\jlreq@theorem@indent\relax\endgroup
   \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
 }
-
+\jlreq@jlreqsetup@add{theorem_font}{
+  \def\jlreq@theorem@font{#1}
+  \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
+}
+\jlreq@jlreqsetup@add{theorem_label_font}{
+  \def\jlreq@theorem@label@font{#1}
+  \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
+}
+\jlreq@jlreqsetup@add{proof_label_font}{
+  \def\jlreq@proof@label@font{#1}
+}
 
 %. デフォルト設定
 %.. 見出し
@@ -5765,7 +5788,7 @@
 \jlreqsetup{footnote_second_indent=1\jlreq@zw}
 \jlreqsetup{endnote_second_indent=2\jlreq@zw}
 \jlreqsetup{endnote_position=headings}
-\ifdim\marginparwidth>0pt
+\ifdim\jlreq@sidenote@length>0pt
   \jlreqsetup{sidenote_type=number}
   \jlreqsetup{sidenote_symbol=＊,sidenote_keyword_font={}}
 \fi
@@ -5930,7 +5953,13 @@
 }
 \jlreqsetup{theindex_pagestyle=plain}
 \jlreqsetup{year_style=seireki}
-\jlreqsetup{theorem_beforeafter_space=1\baselineskip,theorem_indent=0pt}
+\jlreqsetup{
+  theorem_beforeafter_space=1\baselineskip,
+  theorem_indent=0pt,
+  theorem_label_font = {\bfseries\gtfamily\sffamily},
+  theorem_font = {\normalfont},
+  proof_label_font = {\bfseries\gtfamily\sffamily},
+}
 
 
 \newcommand{\contentsname}{目次}
-- 
cgit v1.2.3

