summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-05 03:01:34 +0000
committerNorbert Preining <norbert@preining.info>2022-10-05 03:01:34 +0000
commit6925a15396a955498e1d1663204e7fa7da3d1728 (patch)
tree925ce3e30472ef82315230ec2772e2e104642541 /macros
parent30b3429f0e138c93c5f1ba1d1a6d46728c0943e9 (diff)
CTAN sync 202210050301
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/semantex/semantex.pdfbin397503 -> 397454 bytes
-rw-r--r--macros/latex/contrib/semantex/semantex.sty72
-rw-r--r--macros/latex/contrib/semantex/semantex.tex64
-rw-r--r--macros/latex/contrib/semantex/stripsemantex.lua620
-rw-r--r--macros/latex/contrib/semantex/stripsemantex.sty2
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md9
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin617808 -> 617674 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-number.dtx40
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin665418 -> 665420 bytes
-rw-r--r--macros/latex/contrib/upmethodology/src/UPMVERSION.def2
-rw-r--r--macros/latex/contrib/upmethodology/src/upmethodology-document.cls2
-rw-r--r--macros/latex/contrib/upmethodology/src/upmethodology-fmt.sty32
-rw-r--r--macros/latex/required/babel/base/README.md31
-rw-r--r--macros/latex/required/babel/base/babel.dtx201
-rw-r--r--macros/latex/required/babel/base/babel.ins2
-rw-r--r--macros/latex/required/babel/base/babel.pdfbin885746 -> 885961 bytes
-rw-r--r--macros/latex/required/babel/base/bbcompat.dtx2
-rw-r--r--macros/luatex/generic/lualibs/NEWS6
-rw-r--r--macros/luatex/generic/lualibs/README.md9
-rw-r--r--macros/luatex/generic/lualibs/lualibs-basic-merged.lua641
-rw-r--r--macros/luatex/generic/lualibs/lualibs-dir.lua12
-rw-r--r--macros/luatex/generic/lualibs/lualibs-extended-merged.lua1173
-rw-r--r--macros/luatex/generic/lualibs/lualibs-file.lua2
-rw-r--r--macros/luatex/generic/lualibs/lualibs-gzip.lua180
-rw-r--r--macros/luatex/generic/lualibs/lualibs-io.lua10
-rw-r--r--macros/luatex/generic/lualibs/lualibs-lpeg.lua12
-rw-r--r--macros/luatex/generic/lualibs/lualibs-math.lua16
-rw-r--r--macros/luatex/generic/lualibs/lualibs-os.lua748
-rw-r--r--macros/luatex/generic/lualibs/lualibs-util-deb.lua22
-rw-r--r--macros/luatex/generic/lualibs/lualibs-util-jsn.lua19
-rw-r--r--macros/luatex/generic/lualibs/lualibs-util-prs.lua67
-rw-r--r--macros/luatex/generic/lualibs/lualibs-util-sac.lua582
-rw-r--r--macros/luatex/generic/lualibs/lualibs-util-str.lua59
-rw-r--r--macros/luatex/generic/lualibs/lualibs-util-tab.lua54
-rw-r--r--macros/luatex/generic/lualibs/lualibs-util-zip.lua684
-rw-r--r--macros/luatex/generic/lualibs/lualibs.dtx31
-rw-r--r--macros/luatex/generic/lualibs/lualibs.pdfbin81627 -> 81128 bytes
-rw-r--r--macros/luatex/latex/japanese-mathformulas/README.txt2
-rw-r--r--macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.pdfbin132535 -> 132365 bytes
-rw-r--r--macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.tex2
-rw-r--r--macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.pdfbin536610 -> 550271 bytes
-rw-r--r--macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.sty698
-rw-r--r--macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.tex2857
-rw-r--r--macros/unicodetex/latex/bithesis/bithesis.dtx1942
-rw-r--r--macros/unicodetex/latex/bithesis/bithesis.pdfbin857788 -> 968083 bytes
46 files changed, 7796 insertions, 3113 deletions
diff --git a/macros/latex/contrib/semantex/semantex.pdf b/macros/latex/contrib/semantex/semantex.pdf
index 4e50ebe1d4..64e0bae6cf 100644
--- a/macros/latex/contrib/semantex/semantex.pdf
+++ b/macros/latex/contrib/semantex/semantex.pdf
Binary files differ
diff --git a/macros/latex/contrib/semantex/semantex.sty b/macros/latex/contrib/semantex/semantex.sty
index ed347ffb6a..1937f4e5c4 100644
--- a/macros/latex/contrib/semantex/semantex.sty
+++ b/macros/latex/contrib/semantex/semantex.sty
@@ -1,5 +1,5 @@
\RequirePackage{xparse,l3keys2e,leftindex,semtex}
-\ProvidesExplPackage{semantex}{2022/09/24}{0.521}{}
+\ProvidesExplPackage{semantex}{2022/10/04}{0.522}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
@@ -10,7 +10,7 @@
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\tl_set:Nn\SemantexVersion{0.521}
+\tl_set:Nn\SemantexVersion{0.522}
\cs_set_eq:NN \semantex_keyval_parse:NNn \keyval_parse:NNn
\cs_set:Npn \semantex_singlekey_parse:Nn#1#2 { \clist_map_function:nN { #2 } #1 }
@@ -887,7 +887,7 @@
{
\semantex_inner_pre_return:n { #1 }
\tl_set:Nx \l__semantex_render_output_class_temp_tl { \semantex_data_tl_get:nn { #1 } { output } } % The output class
- \tl_set:Nx \l__semantex_render_object_associated_to_output_class_tempt_tl {
+ \tl_set:Nx \l__semantex_render_object_associated_to_output_class_temp_tl {
object_associated_to_\l__semantex_render_output_class_temp_tl
}
\exp_args:NNx\cs_set:Nn\l__semantex_render_output_options_temp_cs:n
@@ -899,7 +899,7 @@
}
\tl_put_right:Nx \l__semantex_render_output_options_temp_tl
{
- { \l__semantex_render_output_class_temp_tl }
+ { \l__semantex_render_object_associated_to_output_class_temp_tl }
}
\exp_args:NNo\tl_set:No \l__semantex_render_output_options_temp_tl
{
@@ -922,21 +922,21 @@
% makes a one-time object of class ??? and allows us to
% immediately pass options to it
{
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ upper~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { upper } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ lower~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { lower } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ pre~upper~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~upper } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ post~upper~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { post~upper } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ pre~lower~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~lower } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ post~lower~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { post~lower } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ slanting~phantom } { } % reset slanting phantom
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ math~class } { \semantex_data_tl_get_exp_not:nn { #1 } { math~class } }
\exp_not:V \l__semantex_render_output_options_temp_tl
% These are the options we pass to the output class so that it
@@ -959,23 +959,23 @@
% makes a one-time object of class ??? and allows us to
% immediately pass options to it
{
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ upper~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { upper~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ lower~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { lower~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ pre~upper~left~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~upper~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ post~upper~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { post~upper~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ pre~lower~left~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~lower~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ post~lower~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { post~lower~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ height~phantom } { \semantex_data_tl_get_exp_not:nn { #1 } { height~phantom } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ slanting~phantom } { \semantex_data_tl_get_exp_not:nn { #1 } { slanting~phantom } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ math~class } { \semantex_data_tl_get_exp_not:nn { #1 } { math~class } }
\exp_not:V \l__semantex_render_output_options_temp_tl
% These are the options we pass to the output class so that it
@@ -997,35 +997,35 @@
% makes a one-time object of class ??? and allows us to
% immediately pass options to it
{
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ upper~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { upper } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ lower~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { lower } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ upper~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { upper~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ lower~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { lower~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ pre~upper~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~upper } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ post~upper~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { post~upper } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ pre~lower~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~lower } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ post~lower~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { post~lower } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ pre~upper~left~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~upper~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ post~upper~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { post~upper~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ pre~lower~left~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~lower~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ post~lower~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { post~lower~left } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ height~phantom } { \semantex_data_tl_get_exp_not:nn { #1 } { height~phantom } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ slanting~phantom } { \semantex_data_tl_get_exp_not:nn { #1 } { slanting~phantom } }
- \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl }
+ \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_temp_tl }
{ math~class } { \semantex_data_tl_get_exp_not:nn { #1 } { math~class } }
\exp_not:V \l__semantex_render_output_options_temp_tl
% These are the options we pass to the output class so that it
diff --git a/macros/latex/contrib/semantex/semantex.tex b/macros/latex/contrib/semantex/semantex.tex
index bd932ca3be..08587d1ad8 100644
--- a/macros/latex/contrib/semantex/semantex.tex
+++ b/macros/latex/contrib/semantex/semantex.tex
@@ -2135,9 +2135,9 @@ $\int \vf \wedgeD{\vx[1],
\chapter{Using \texorpdfstring{Seman\!\TeX{}}{SemanTeX} in other commands using \texorpdfstring{\texttt{\textbackslash UseClassInCommand}}{\string\UseClassInCommand}}\label{sec:UseClassInCommand}
\SemantexRecordObject{\Frac}
-\newcommand\Frac[2]{
- \SemantexRecordSource{\Frac{#1}{#2}}
- \UseClassInCommand\MyVar{ \frac{#1}{#2} }
+\newcommand\Frac[2]{%
+ \SemantexRecordSource{\Frac{#1}{#2}}%
+ \UseClassInCommand\MyVar{\frac{#1}{#2}}%
}
Sometimes, it is useful to create other commands based on \semantex
@@ -2148,7 +2148,9 @@ a command~\lstinline!\Frac! which automatically wraps
the fraction in~\lstinline!\MyVar!. The first guess how to
do that would be something like
\begin{lstlisting}
-\newcommand\Frac[2]{ \MyVar{ \frac{#1}{#2} } }
+\newcommand\Frac[2]{%
+ \MyVar{\frac{#1}{#2}}%
+}
\end{lstlisting}
\begin{LTXexample}
\[
@@ -2162,9 +2164,9 @@ your document of \semantex{} markup. But in order to prepare yourself for this p
in a slightly more cumbersome way:
\begin{lstlisting}
\SemantexRecordObject{\Frac}
-\newcommand\Frac[2]{
- \SemantexRecordSource{\Frac{#1}{#2}}
- \UseClassInCommand\MyVar{ \frac{#1}{#2} }
+\newcommand\Frac[2]{%
+ \SemantexRecordSource{\Frac{#1}{#2}}%
+ \UseClassInCommand\MyVar{\frac{#1}{#2}}%
}
\end{lstlisting}
\begin{LTXexample}
@@ -2240,27 +2242,27 @@ Therefore, we do three things:
\NewObject\MyVar\catvect{\categoryformat{Vect}}
\SemantexRecordObject{\catxmod}
-\newcommand\catxmod[1]{
- \SemantexRecordSource{\catxmod{#1}}
- \UseClassInCommand\MyVar{#1\categoryformat{-mod}}
+\newcommand\catxmod[1]{%
+ \SemantexRecordSource{\catxmod{#1}}%
+ \UseClassInCommand\MyVar{#1\categoryformat{-mod}}%
}
\SemantexRecordObject{\catmodx}
-\newcommand\catmodx[1]{
- \SemantexRecordSource{\catmodx{#1}}
- \UseClassInCommand\MyVar{\categoryformat{mod-}#1}
+\newcommand\catmodx[1]{%
+ \SemantexRecordSource{\catmodx{#1}}%
+ \UseClassInCommand\MyVar{\categoryformat{mod-}#1}%
}
\SemantexRecordObject{\catxmody}
-\newcommand\catxmody[2]{
- \SemantexRecordSource{\catxmody{#1}{#2}}
- \UseClassInCommand\MyVar{#1\categoryformat{-mod-}#2}
+\newcommand\catxmody[2]{%
+ \SemantexRecordSource{\catxmody{#1}{#2}}%
+ \UseClassInCommand\MyVar{#1\categoryformat{-mod-}#2}%
}
\SemantexRecordObject{\catxmodx}
-\newcommand\catxmodx[1]{
- \SemantexRecordSource{\catxmodx{#1}}
- \UseClassInCommand\MyVar{#1\categoryformat{-mod-}#1}
+\newcommand\catxmodx[1]{%
+ \SemantexRecordSource{\catxmodx{#1}}%
+ \UseClassInCommand\MyVar{#1\categoryformat{-mod-}#1}%
}
The above method can be used to create commands
@@ -2293,9 +2295,9 @@ For this, we use the constructions we learned at the introduction
to this chapter:
\begin{lstlisting}
\SemantexRecordObject{\catxmod}
-\newcommand\catxmod[1]{
- \SemantexRecordSource{\catxmod{#1}}
- \UseClassInCommand\MyVar{#1\categoryformat{-mod}}
+\newcommand\catxmod[1]{%
+ \SemantexRecordSource{\catxmod{#1}}%
+ \UseClassInCommand\MyVar{#1\categoryformat{-mod}}%
}
\end{lstlisting}
\begin{LTXexample}
@@ -2310,21 +2312,21 @@ of other situations, like
\( \catmodx{\vR} \) or~\( \catxmody{\vR}{\vS} \):
\begin{lstlisting}
\SemantexRecordObject{\catmodx}
-\newcommand\catmodx[1]{
- \SemantexRecordSource{\catmodx{#1}}
- \UseClassInCommand\MyVar{\categoryformat{mod-}#1}
+\newcommand\catmodx[1]{%
+ \SemantexRecordSource{\catmodx{#1}}%
+ \UseClassInCommand\MyVar{\categoryformat{mod-}#1}%
}
\SemantexRecordObject{\catxmody}
-\newcommand\catxmody[2]{
- \SemantexRecordSource{\catxmody{#1}{#2}}
- \UseClassInCommand\MyVar{#1\categoryformat{-mod-}#2}
+\newcommand\catxmody[2]{%
+ \SemantexRecordSource{\catxmody{#1}{#2}}%
+ \UseClassInCommand\MyVar{#1\categoryformat{-mod-}#2}%
}
\SemantexRecordObject{\catxmodx}
-\newcommand\catxmodx[1]{
- \SemantexRecordSource{\catxmodx{#1}}
- \UseClassInCommand\MyVar{#1\categoryformat{-mod-}#1}
+\newcommand\catxmodx[1]{%
+ \SemantexRecordSource{\catxmodx{#1}}%
+ \UseClassInCommand\MyVar{#1\categoryformat{-mod-}#1}%
}
\end{lstlisting}
diff --git a/macros/latex/contrib/semantex/stripsemantex.lua b/macros/latex/contrib/semantex/stripsemantex.lua
index 30d4c58be6..d0eb5d1963 100644
--- a/macros/latex/contrib/semantex/stripsemantex.lua
+++ b/macros/latex/contrib/semantex/stripsemantex.lua
@@ -1,311 +1,311 @@
--- aliases for protected environments
-local assert, io_open
- = assert, io.open
-
--- load the ltn12 module
-local ltn12 = require("ltn12")
-
--- No more global accesses after this point
-if _VERSION == "Lua 5.2" then _ENV = nil end
-
--- copy a file
-copy_file = function(path_src, path_dst)
- ltn12.pump.all(
- ltn12.source.file(assert(io_open(path_src, "rb"))),
- ltn12.sink.file(assert(io_open(path_dst, "wb")))
- )
-end
-
-openFile = function(file)
- f = io.open(file, "r")
- filecontent = f:read("*all")
- local beginDocPosition = filecontent:find('\\begin{document}')
- if not beginDocPosition then
- tex.sprint( [[\begingroup\ExplSyntaxOn
- \msg_fatal:nnn { stripsemantex } { begin_document_not_found } { ]] .. file .. [[ }
- \endgroup]] )
- return
- end
- precontent = filecontent:sub(1,beginDocPosition-1)
- content = filecontent:sub(beginDocPosition,-1)
- f:close()
-end
-
-closeFile = function(file)
- f = io.open(file, "w")
- f:write(precontent .. content)
- f:close()
-end
-
-removeStricttexFormatting = function(str)
- -- We do this in case the package "stricttex" was used
- str = str:gsub('numberZERO','0')
- str = str:gsub('numberONE','1')
- str = str:gsub('numberTWO','2')
- str = str:gsub('numberTHREE','3')
- str = str:gsub('numberFOUR','4')
- str = str:gsub('numberFIVE','5')
- str = str:gsub('numberSIX','6')
- str = str:gsub('numberSEVEN','7')
- str = str:gsub('numberEIGHT','8')
- str = str:gsub('numberNINE','9')
- str = str:gsub('symbolPRIME','\'')
- return str
-end
-
-addIDsToRegisters = function(str)
- str = removeStricttexFormatting(str)
- content = content:gsub('\\' .. str .. '([^%a])' ,'\\SemantexID{}\\' .. str .. '%1')
- -- '%f[^%a]' does not work here, as it will not react if the last character of str is a number,
- -- which stricttex allows.
- -- Because of this choice, there will be an issue if you use stricttex and let
- -- \<command> by a SemanTeX command and \<command>' be a non-SemanTeX command.
- -- So simply *don't do that*.
-end
-
-removeSuperfluousIDs = function()
- local p = content:find('([^\\]%%[^\n]-)\\SemantexID{}([^\n]-\n)')
- while p do
- content = content:gsub('([^\\]%%[^\n]-)\\SemantexID{}([^\n]-\n)','%1%2')
- p = content:find('([^\\]%%[^\n]-)\\SemantexID{}([^\n]-\n)')
- end
- content = content:gsub('parent(%s*)=(%s*)\\SemantexID{}','parent%1=%2')
- content = content:gsub('class(%s*)=(%s*)\\SemantexID{}','class%1=%2')
- content = content:gsub('clone(%s*)=(%s*)\\SemantexID{}','clone%1=%2')
- content = content:gsub('copy(%s*)=(%s*)\\SemantexID{}','copy%1=%2')
- content = content:gsub('\\New(%w+)Class(%s*{?)\\SemantexID{}','\\New%1Class%2')
- content = content:gsub('\\NewObject(%s*{?%s*)\\SemantexID{}(\\%w+%s*}?%s*{?%s*)\\SemantexID{}', '\\NewObject%1%2')
- content = content:gsub('\\SetupClass(%s*{?%s*)\\SemantexID{}', '\\SetupClass%1')
- content = content:gsub('\\SetupObject(%s*{?%s*)\\SemantexID{}', '\\SetupObject%1')
-end
-
-addNumbersToIDs = function()
- local n = 0
- local p,q = string.find(content,'\\SemantexID{}')
- while q do
- n = n + 1
- content = content:sub(1,q-1) .. n .. content:sub(q,-1)
- p, q = string.find(content,'\\SemantexID{}')
- end
-end
-
-semantexIDluacommand = function(id, source, output)
- local p, q = string.find(content, '\\SemantexID{' .. id .. '}')
-
- while p do
- content = content:sub(1,p-1) .. content:sub(q+1,-1)
-
- source = source:gsub('%s+', '')
-
- -- We do this in case the package "stricttex" was used
- source = removeStricttexFormatting(source)
-
- -- This is because #1's in the code becomes ##1
- -- in the .semtex file.
- source = source:gsub('#(%d)', '%1')
-
- local length = source:len()
-
- local i = 1
-
- local s
-
- while i <= length do
- s = content:sub(p,p)
- if s == source:sub(i,i) then
- content = content:sub(1 , p-1) .. content:sub(p+1, -1)
- i = i + 1
- elseif s:match('%s') then
- content = content:sub(1, p-1) .. content:sub(p+1, -1)
- elseif s == '%' then
- content = content:sub(1 , p-1) .. content:sub(p,-1):gsub('%%.-\n','',1)
- elseif s == '{' then
- -- In this case, we remove the corresponding right brace,
- -- once we find it
- local netto = 1 -- The current brace group level
- local q = 0 -- The position we have moved forward so far
- while netto > 0 do
- q = q + 1
- local e = content:sub(p+q,p+q)
- if e == '}' then
- netto = netto - 1
- elseif e == '{' then
- netto = netto + 1
- elseif e == '\\' then
- q = q + 1
- elseif e == '%' then
- content = content:sub(1, p+q-1) .. content:sub(p+q,-1):gsub('%%.-\n','',1)
- q = q - 1
- end
- end
- content = content:sub(1,p-1) .. content:sub(p+1,p+q-1) .. content:sub(p+q+1,-1)
- elseif s == '<' and content:sub(p+1,p+2) == '[>' then
- content = content:sub(1,p-1) .. content:sub(p+3,-1)
- i = i + 1
- elseif s == '<' and content:sub(p+1,p+2) == ']>' then
- content = content:sub(1,p-1) .. content:sub(p+3,-1)
- i = i + 1
- elseif source:sub(i,i) == '{' then
- -- In this case, we remove the corresponding right brace,
- -- once we find it
- local netto = 1 -- The current brace group level
- local q = 0 -- The position we have moved forward so far
- while netto > 0 do
- q = q + 1
- local e = source:sub(i+q,i+q)
- if e == '}' then
- netto = netto - 1
- elseif e == '{' then
- netto = netto + 1
- elseif e == '\\' then
- q = q + 1
- -- there is no chance that the source contains an unescaped %, so we do not
- -- check for this
- end
- end
- source = source:sub(1,i-1) .. source:sub(i+1,i+q-1) .. source:sub(i+q+1,-1)
- length = source:len()
- else
- tex.sprint( [[\begingroup\ExplSyntaxOn
- \msg_fatal:nnnn { stripsemantex } { source_not_expected } { ]] .. source:sub(i,i) .. [[ } { ]] .. s .. [[ }
- \endgroup]] )
- break
- end
- end
-
-
- output = output:gsub('%s*\\sp {', '^{')
- output = output:gsub('%s*\\sb {', '_{')
- output = output:gsub('\\mathopen \\big ', '\\bigl')
- output = output:gsub('\\mathclose \\big ', '\\bigr')
- output = output:gsub('\\mathopen \\Big ', '\\Bigl')
- output = output:gsub('\\mathclose \\Big ', '\\Bigr')
- output = output:gsub('\\mathopen \\bigg ', '\\biggl')
- output = output:gsub('\\mathclose \\bigg ', '\\biggr')
- output = output:gsub('\\mathopen \\Bigg ', '\\Biggl')
- output = output:gsub('\\mathclose \\Bigg ', '\\Biggr')
- output = output:gsub('\\mathopen %(', '(')
- output = output:gsub('\\mathclose %)', ')')
- output = output:gsub('\\mathopen %[', '[')
- output = output:gsub('\\mathclose %]', ']')
- output = output:gsub('\\mathopen \\{', '\\{')
- output = output:gsub('\\mathclose \\}', '\\}')
- output = output:gsub('\\mathopen \\lbrace', '\\lbrace')
- output = output:gsub('\\mathclose \\rbrace', '\\rbrace')
- output = output:gsub('\\mathopen \\lbrack', '\\lbrack')
- output = output:gsub('\\mathclose \\rbrack', '\\rbrack')
- output = output:gsub('\\mathopen \\langle', '\\langle')
- output = output:gsub('\\mathclose \\rangle', '\\rangle')
- output = output:gsub('\\mathopen \\lvert', '\\lvert')
- output = output:gsub('\\mathclose \\rvert', '\\rvert')
- output = output:gsub('\\mathopen \\vert', '\\lvert')
- output = output:gsub('\\mathclose \\vert', '\\rvert')
- output = output:gsub('\\mathopen \\lVert', '\\lVert')
- output = output:gsub('\\mathclose \\rVert', '\\rVert')
- output = output:gsub('\\mathopen \\Vert', '\\lVert')
- output = output:gsub('\\mathclose \\Vert', '\\rVert')
- output = output:gsub('%^{\\prime }', '\'')
- output = output:gsub('%^{\\prime \\prime }', '\'\'')
- output = output:gsub('%^{\\prime \\prime \\prime }', '\'\'\'')
- output = output:gsub('%^{\\prime \\prime \\prime \\prime }', '\'\'\'\'')
- output = output:gsub('%^{\\prime \\prime \\prime \\prime \\prime }', '\'\'\'\'\'')
-
- output = output:gsub('%s+%f[{}%[%]%(%)%$,]','')
- output = output:gsub('([}%]%)])%f[\\%w%+%-%(%[=]', '%1 ')
- output = output:gsub(',',', ')
- output = output:gsub('%s+$', '')
-
-
- -- We now check whether the string we add will follow right
- -- after a control sequence, causing it to be interpreted
- -- as part of that control sequence.
- -- Because we want to allow the user to use stricttex, we
- -- check for alphanumerical control sequences rather than
- -- just alphabetic ones. This could add spaces that
- -- the user might not have intended, but it's a minor issue.
- if output:sub(1,1):match('%w') and content:sub(1, p-1):match('\\%w+$') then
- content = content:sub(1,p-1) .. ' ' .. output .. content:sub(p,-1)
- else
- content = content:sub(1,p-1) .. output .. content:sub(p,-1)
- end
- p, q = string.find(content, '\\SemantexID{' .. id .. '}')
- end
-end
-
-stripRemainingSemantexIDs = function()
- content = content:gsub('\\SemantexID{%d+}', '')
-end
-
-removeParenthesisCommands = function()
- content = content:gsub('\\SemantexMathOpen \\bigg%s?', '\\biggl')
- content = content:gsub('\\SemantexMathClose \\bigg%s?', '\\biggr')
- content = content:gsub('\\SemantexMathOpen \\Bigg%s?', '\\Biggl')
- content = content:gsub('\\SemantexMathClose \\Bigg%s?', '\\Biggr')
- content = content:gsub('\\SemantexMathOpen \\big%s?', '\\bigl')
- content = content:gsub('\\SemantexMathClose \\big%s?', '\\bigr')
- content = content:gsub('\\SemantexMathOpen \\Big%s?', '\\Bigl')
- content = content:gsub('\\SemantexMathClose \\Big%s?', '\\Bigr')
- content = content:gsub('\\SemantexMathOpen{} %(', '(')
- content = content:gsub('%s*\\SemantexMathClose{}%)', ')')
- content = content:gsub('\\SemantexMathOpen{} %[', '[')
- content = content:gsub('%s*\\SemantexMathClose{}%]', ']')
- content = content:gsub('\\SemantexMathOpen{} \\{', '\\{')
- content = content:gsub('%s*\\SemantexMathClose{} \\}', '\\}')
- content = content:gsub('\\SemantexMathOpen{} \\lbrace', '\\lbrace')
- content = content:gsub('\\SemantexMathClose{} \\rbrace', '\\rbrace')
- content = content:gsub('\\SemantexMathOpen{} \\lbrack', '\\rbrack')
- content = content:gsub('\\SemantexMathClose{} \\rbrack', '\\rbrack')
- content = content:gsub('\\SemantexMathOpen{} \\langle', '\\langle')
- content = content:gsub('\\SemantexMathClose{} \\rangle', '\\rangle')
- content = content:gsub('\\SemantexMathOpen{} \\lvert', '\\lvert')
- content = content:gsub('\\SemantexMathClose{} \\rvert', '\\rvert')
- content = content:gsub('\\SemantexMathOpen{} \\vert', '\\lvert')
- content = content:gsub('\\SemantexMathClose{} \\vert', '\\rvert')
- content = content:gsub('\\SemantexMathOpen{} \\lVert', '\\lVert')
- content = content:gsub('\\SemantexMathClose{} \\rVert', '\\rVert')
- content = content:gsub('\\SemantexMathOpen{} \\Vert', '\\lVert')
- content = content:gsub('\\SemantexMathClose{} \\Vert', '\\rVert')
- content = content:gsub('\\SemantexMathOpen{} .%s?', '')
- content = content:gsub('\\SemantexMathClose{} .%s?', '')
- content = content:gsub('\\SemantexMathOpen{}', '\\mathopen ')
- content = content:gsub('\\SemantexMathClose{}', '\\mathclose ')
- content = content:gsub('\\SemantexMathOpenAuto%s?', '\\SemantexLeft')
- content = content:gsub('\\SemantexMathCloseAuto%s?', '\\SemantexRight')
- content = content:gsub('\\SemantexMathOpenNoPar%s?', '')
- content = content:gsub('\\SemantexMathCloseNoPar%s?', '')
- content = content:gsub('\\SemantexMathOpen%s?', '\\mathopen')
- content = content:gsub('\\SemantexMathClose%s?', '\\mathclose')
-end
-
-stripComments = function()
- content = content:gsub('\\%%', '\\StripSemantexEscapedPercent')
- content = content:gsub('(\\%w+)%%.-\n%s*', '%1 ')
- content = content:gsub('%%.-\n%s*', '')
- content = content:gsub('\\StripSemantexEscapedPercent', '\\%%')
-end
-
-addSemtexPackageToFile = function()
- content = [[% The following was added by "stripsemantex":
-
-\usepackage{semtex,leftindex,graphicx}
-
-\providecommand\SemantexLeft{%
- \mathopen{}\mathclose\bgroup\left
-}
-
-\providecommand\SemantexRight{%
- \aftergroup\egroup\right
-}
-
-\makeatletter
-\DeclareRobustCommand\SemantexBullet{%
- \mathord{\mathpalette\SemantexBullet@{0.5}}%
-}
-\newcommand\SemantexBullet@[2]{%
- \vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}%
-}
-\DeclareRobustCommand\SemantexDoubleBullet{\SemantexBullet \SemantexBullet}
-\makeatother
-
-]] .. content
+-- aliases for protected environments
+local assert, io_open
+ = assert, io.open
+
+-- load the ltn12 module
+local ltn12 = require("ltn12")
+
+-- No more global accesses after this point
+if _VERSION == "Lua 5.2" then _ENV = nil end
+
+-- copy a file
+copy_file = function(path_src, path_dst)
+ ltn12.pump.all(
+ ltn12.source.file(assert(io_open(path_src, "rb"))),
+ ltn12.sink.file(assert(io_open(path_dst, "wb")))
+ )
+end
+
+openFile = function(file)
+ f = io.open(file, "r")
+ filecontent = f:read("*all")
+ local beginDocPosition = filecontent:find('\\begin{document}')
+ if not beginDocPosition then
+ tex.sprint( [[\begingroup\ExplSyntaxOn
+ \msg_fatal:nnn { stripsemantex } { begin_document_not_found } { ]] .. file .. [[ }
+ \endgroup]] )
+ return
+ end
+ precontent = filecontent:sub(1,beginDocPosition-1)
+ content = filecontent:sub(beginDocPosition,-1)
+ f:close()
+end
+
+closeFile = function(file)
+ f = io.open(file, "w")
+ f:write(precontent .. content)
+ f:close()
+end
+
+removeStricttexFormatting = function(str)
+ -- We do this in case the package "stricttex" was used
+ str = str:gsub('numberZERO','0')
+ str = str:gsub('numberONE','1')
+ str = str:gsub('numberTWO','2')
+ str = str:gsub('numberTHREE','3')
+ str = str:gsub('numberFOUR','4')
+ str = str:gsub('numberFIVE','5')
+ str = str:gsub('numberSIX','6')
+ str = str:gsub('numberSEVEN','7')
+ str = str:gsub('numberEIGHT','8')
+ str = str:gsub('numberNINE','9')
+ str = str:gsub('symbolPRIME','\'')
+ return str
+end
+
+addIDsToRegisters = function(str)
+ str = removeStricttexFormatting(str)
+ content = content:gsub('\\' .. str .. '([^%a])' ,'\\SemantexID{}\\' .. str .. '%1')
+ -- '%f[^%a]' does not work here, as it will not react if the last character of str is a number,
+ -- which stricttex allows.
+ -- Because of this choice, there will be an issue if you use stricttex and let
+ -- \<command> by a SemanTeX command and \<command>' be a non-SemanTeX command.
+ -- So simply *don't do that*.
+end
+
+removeSuperfluousIDs = function()
+ local p = content:find('([^\\]%%[^\n]-)\\SemantexID{}([^\n]-\n)')
+ while p do
+ content = content:gsub('([^\\]%%[^\n]-)\\SemantexID{}([^\n]-\n)','%1%2')
+ p = content:find('([^\\]%%[^\n]-)\\SemantexID{}([^\n]-\n)')
+ end
+ content = content:gsub('parent(%s*)=(%s*)\\SemantexID{}','parent%1=%2')
+ content = content:gsub('class(%s*)=(%s*)\\SemantexID{}','class%1=%2')
+ content = content:gsub('clone(%s*)=(%s*)\\SemantexID{}','clone%1=%2')
+ content = content:gsub('copy(%s*)=(%s*)\\SemantexID{}','copy%1=%2')
+ content = content:gsub('\\New(%w+)Class(%s*{?)\\SemantexID{}','\\New%1Class%2')
+ content = content:gsub('\\NewObject(%s*{?%s*)\\SemantexID{}(\\%w+%s*}?%s*{?%s*)\\SemantexID{}', '\\NewObject%1%2')
+ content = content:gsub('\\SetupClass(%s*{?%s*)\\SemantexID{}', '\\SetupClass%1')
+ content = content:gsub('\\SetupObject(%s*{?%s*)\\SemantexID{}', '\\SetupObject%1')
+end
+
+addNumbersToIDs = function()
+ local n = 0
+ local p,q = string.find(content,'\\SemantexID{}')
+ while q do
+ n = n + 1
+ content = content:sub(1,q-1) .. n .. content:sub(q,-1)
+ p, q = string.find(content,'\\SemantexID{}')
+ end
+end
+
+semantexIDluacommand = function(id, source, output)
+ local p, q = string.find(content, '\\SemantexID{' .. id .. '}')
+
+ while p do
+ content = content:sub(1,p-1) .. content:sub(q+1,-1)
+
+ source = source:gsub('%s+', '')
+
+ -- We do this in case the package "stricttex" was used
+ source = removeStricttexFormatting(source)
+
+ -- This is because #1's in the code becomes ##1
+ -- in the .semtex file.
+ source = source:gsub('#(%d)', '%1')
+
+ local length = source:len()
+
+ local i = 1
+
+ local s
+
+ while i <= length do
+ s = content:sub(p,p)
+ if s == source:sub(i,i) then
+ content = content:sub(1 , p-1) .. content:sub(p+1, -1)
+ i = i + 1
+ elseif s:match('%s') then
+ content = content:sub(1, p-1) .. content:sub(p+1, -1)
+ elseif s == '%' then
+ content = content:sub(1 , p-1) .. content:sub(p,-1):gsub('%%.-\n','',1)
+ elseif s == '{' then
+ -- In this case, we remove the corresponding right brace,
+ -- once we find it
+ local netto = 1 -- The current brace group level
+ local q = 0 -- The position we have moved forward so far
+ while netto > 0 do
+ q = q + 1
+ local e = content:sub(p+q,p+q)
+ if e == '}' then
+ netto = netto - 1
+ elseif e == '{' then
+ netto = netto + 1
+ elseif e == '\\' then
+ q = q + 1
+ elseif e == '%' then
+ content = content:sub(1, p+q-1) .. content:sub(p+q,-1):gsub('%%.-\n','',1)
+ q = q - 1
+ end
+ end
+ content = content:sub(1,p-1) .. content:sub(p+1,p+q-1) .. content:sub(p+q+1,-1)
+ elseif s == '<' and content:sub(p+1,p+2) == '[>' then
+ content = content:sub(1,p-1) .. content:sub(p+3,-1)
+ i = i + 1
+ elseif s == '<' and content:sub(p+1,p+2) == ']>' then
+ content = content:sub(1,p-1) .. content:sub(p+3,-1)
+ i = i + 1
+ elseif source:sub(i,i) == '{' then
+ -- In this case, we remove the corresponding right brace,
+ -- once we find it
+ local netto = 1 -- The current brace group level
+ local q = 0 -- The position we have moved forward so far
+ while netto > 0 do
+ q = q + 1
+ local e = source:sub(i+q,i+q)
+ if e == '}' then
+ netto = netto - 1
+ elseif e == '{' then
+ netto = netto + 1
+ elseif e == '\\' then
+ q = q + 1
+ -- there is no chance that the source contains an unescaped %, so we do not
+ -- check for this
+ end
+ end
+ source = source:sub(1,i-1) .. source:sub(i+1,i+q-1) .. source:sub(i+q+1,-1)
+ length = source:len()
+ else
+ tex.sprint( [[\begingroup\ExplSyntaxOn
+ \msg_fatal:nnnn { stripsemantex } { source_not_expected } { ]] .. source:sub(i,i) .. [[ } { ]] .. s .. [[ }
+ \endgroup]] )
+ break
+ end
+ end
+
+
+ output = output:gsub('%s*\\sp {', '^{')
+ output = output:gsub('%s*\\sb {', '_{')
+ output = output:gsub('\\mathopen \\big ', '\\bigl')
+ output = output:gsub('\\mathclose \\big ', '\\bigr')
+ output = output:gsub('\\mathopen \\Big ', '\\Bigl')
+ output = output:gsub('\\mathclose \\Big ', '\\Bigr')
+ output = output:gsub('\\mathopen \\bigg ', '\\biggl')
+ output = output:gsub('\\mathclose \\bigg ', '\\biggr')
+ output = output:gsub('\\mathopen \\Bigg ', '\\Biggl')
+ output = output:gsub('\\mathclose \\Bigg ', '\\Biggr')
+ output = output:gsub('\\mathopen %(', '(')
+ output = output:gsub('\\mathclose %)', ')')
+ output = output:gsub('\\mathopen %[', '[')
+ output = output:gsub('\\mathclose %]', ']')
+ output = output:gsub('\\mathopen \\{', '\\{')
+ output = output:gsub('\\mathclose \\}', '\\}')
+ output = output:gsub('\\mathopen \\lbrace', '\\lbrace')
+ output = output:gsub('\\mathclose \\rbrace', '\\rbrace')
+ output = output:gsub('\\mathopen \\lbrack', '\\lbrack')
+ output = output:gsub('\\mathclose \\rbrack', '\\rbrack')
+ output = output:gsub('\\mathopen \\langle', '\\langle')
+ output = output:gsub('\\mathclose \\rangle', '\\rangle')
+ output = output:gsub('\\mathopen \\lvert', '\\lvert')
+ output = output:gsub('\\mathclose \\rvert', '\\rvert')
+ output = output:gsub('\\mathopen \\vert', '\\lvert')
+ output = output:gsub('\\mathclose \\vert', '\\rvert')
+ output = output:gsub('\\mathopen \\lVert', '\\lVert')
+ output = output:gsub('\\mathclose \\rVert', '\\rVert')
+ output = output:gsub('\\mathopen \\Vert', '\\lVert')
+ output = output:gsub('\\mathclose \\Vert', '\\rVert')
+ output = output:gsub('%^{\\prime }', '\'')
+ output = output:gsub('%^{\\prime \\prime }', '\'\'')
+ output = output:gsub('%^{\\prime \\prime \\prime }', '\'\'\'')
+ output = output:gsub('%^{\\prime \\prime \\prime \\prime }', '\'\'\'\'')
+ output = output:gsub('%^{\\prime \\prime \\prime \\prime \\prime }', '\'\'\'\'\'')
+
+ output = output:gsub('%s+%f[{}%[%]%(%)%$,]','')
+ output = output:gsub('([}%]%)])%f[\\%w%+%-%(%[=]', '%1 ')
+ output = output:gsub(',',', ')
+ output = output:gsub('%s+$', '')
+
+
+ -- We now check whether the string we add will follow right
+ -- after a control sequence, causing it to be interpreted
+ -- as part of that control sequence.
+ -- Because we want to allow the user to use stricttex, we
+ -- check for alphanumerical control sequences rather than
+ -- just alphabetic ones. This could add spaces that
+ -- the user might not have intended, but it's a minor issue.
+ if output:sub(1,1):match('%w') and content:sub(1, p-1):match('\\%w+$') then
+ content = content:sub(1,p-1) .. ' ' .. output .. content:sub(p,-1)
+ else
+ content = content:sub(1,p-1) .. output .. content:sub(p,-1)
+ end
+ p, q = string.find(content, '\\SemantexID{' .. id .. '}')
+ end
+end
+
+stripRemainingSemantexIDs = function()
+ content = content:gsub('\\SemantexID{%d+}', '')
+end
+
+removeParenthesisCommands = function()
+ content = content:gsub('\\SemantexMathOpen \\bigg%s?', '\\biggl')
+ content = content:gsub('\\SemantexMathClose \\bigg%s?', '\\biggr')
+ content = content:gsub('\\SemantexMathOpen \\Bigg%s?', '\\Biggl')
+ content = content:gsub('\\SemantexMathClose \\Bigg%s?', '\\Biggr')
+ content = content:gsub('\\SemantexMathOpen \\big%s?', '\\bigl')
+ content = content:gsub('\\SemantexMathClose \\big%s?', '\\bigr')
+ content = content:gsub('\\SemantexMathOpen \\Big%s?', '\\Bigl')
+ content = content:gsub('\\SemantexMathClose \\Big%s?', '\\Bigr')
+ content = content:gsub('\\SemantexMathOpen{} %(', '(')
+ content = content:gsub('%s*\\SemantexMathClose{}%)', ')')
+ content = content:gsub('\\SemantexMathOpen{} %[', '[')
+ content = content:gsub('%s*\\SemantexMathClose{}%]', ']')
+ content = content:gsub('\\SemantexMathOpen{} \\{', '\\{')
+ content = content:gsub('%s*\\SemantexMathClose{} \\}', '\\}')
+ content = content:gsub('\\SemantexMathOpen{} \\lbrace', '\\lbrace')
+ content = content:gsub('\\SemantexMathClose{} \\rbrace', '\\rbrace')
+ content = content:gsub('\\SemantexMathOpen{} \\lbrack', '\\rbrack')
+ content = content:gsub('\\SemantexMathClose{} \\rbrack', '\\rbrack')
+ content = content:gsub('\\SemantexMathOpen{} \\langle', '\\langle')
+ content = content:gsub('\\SemantexMathClose{} \\rangle', '\\rangle')
+ content = content:gsub('\\SemantexMathOpen{} \\lvert', '\\lvert')
+ content = content:gsub('\\SemantexMathClose{} \\rvert', '\\rvert')
+ content = content:gsub('\\SemantexMathOpen{} \\vert', '\\lvert')
+ content = content:gsub('\\SemantexMathClose{} \\vert', '\\rvert')
+ content = content:gsub('\\SemantexMathOpen{} \\lVert', '\\lVert')
+ content = content:gsub('\\SemantexMathClose{} \\rVert', '\\rVert')
+ content = content:gsub('\\SemantexMathOpen{} \\Vert', '\\lVert')
+ content = content:gsub('\\SemantexMathClose{} \\Vert', '\\rVert')
+ content = content:gsub('\\SemantexMathOpen{} .%s?', '')
+ content = content:gsub('\\SemantexMathClose{} .%s?', '')
+ content = content:gsub('\\SemantexMathOpen{}', '\\mathopen ')
+ content = content:gsub('\\SemantexMathClose{}', '\\mathclose ')
+ content = content:gsub('\\SemantexMathOpenAuto%s?', '\\SemantexLeft')
+ content = content:gsub('\\SemantexMathCloseAuto%s?', '\\SemantexRight')
+ content = content:gsub('\\SemantexMathOpenNoPar%s?', '')
+ content = content:gsub('\\SemantexMathCloseNoPar%s?', '')
+ content = content:gsub('\\SemantexMathOpen%s?', '\\mathopen')
+ content = content:gsub('\\SemantexMathClose%s?', '\\mathclose')
+end
+
+stripComments = function()
+ content = content:gsub('\\%%', '\\StripSemantexEscapedPercent')
+ content = content:gsub('(\\%w+)%%.-\n%s*', '%1 ')
+ content = content:gsub('%%.-\n%s*', '')
+ content = content:gsub('\\StripSemantexEscapedPercent', '\\%%')
+end
+
+addSemtexPackageToFile = function()
+ content = [[% The following was added by "stripsemantex":
+
+\usepackage{semtex,leftindex,graphicx}
+
+\providecommand\SemantexLeft{%
+ \mathopen{}\mathclose\bgroup\left
+}
+
+\providecommand\SemantexRight{%
+ \aftergroup\egroup\right
+}
+
+\makeatletter
+\DeclareRobustCommand\SemantexBullet{%
+ \mathord{\mathpalette\SemantexBullet@{0.5}}%
+}
+\newcommand\SemantexBullet@[2]{%
+ \vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}%
+}
+\DeclareRobustCommand\SemantexDoubleBullet{\SemantexBullet \SemantexBullet}
+\makeatother
+
+]] .. content
end \ No newline at end of file
diff --git a/macros/latex/contrib/semantex/stripsemantex.sty b/macros/latex/contrib/semantex/stripsemantex.sty
index cdd6947469..5a98435644 100644
--- a/macros/latex/contrib/semantex/stripsemantex.sty
+++ b/macros/latex/contrib/semantex/stripsemantex.sty
@@ -1,5 +1,5 @@
\RequirePackage{xparse}
-\ProvidesExplPackage{stripsemantex}{2022/09/24}{0.521}{}
+\ProvidesExplPackage{stripsemantex}{2022/10/04}{0.522}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index c4aec21e34..7cdde2cf78 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,12 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.1.8] - 2022-10-04
+
+### Fixed
+- Rounding to order of magnitude (see issue
+ [\#622](https://github.com/josephwright/siunitx/issues/622))
+
## [v3.1.7] - 2022-09-07
### Changed
@@ -1811,7 +1817,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.7...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.8...HEAD
+[v3.1.8]: https://github.com/josephwright/siunitx/compare/v3.1.7...v3.1.8
[v3.1.7]: https://github.com/josephwright/siunitx/compare/v3.1.6...v3.1.7
[v3.1.6]: https://github.com/josephwright/siunitx/compare/v3.1.5...v3.1.6
[v3.1.5]: https://github.com/josephwright/siunitx/compare/v3.1.4...v3.1.5
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index c9dcdaecda..cf6bc8c78c 100644
--- a/macros/latex/contrib/siunitx/siunitx-code.pdf
+++ b/macros/latex/contrib/siunitx/siunitx-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx
index f80684ee9c..1d11f909f0 100644
--- a/macros/latex/contrib/siunitx/siunitx-number.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-number.dtx
@@ -2757,7 +2757,9 @@
% \begin{macrocode}
\cs_new:Npn \@@_round_final_shift:nn #1#2
{
- \str_if_eq:VnTF \l_@@_round_mode_tl { places }
+ \bool_lazy_or:nnTF
+ { \str_if_eq_p:Vn \l_@@_round_mode_tl { figures } }
+ { \str_if_eq_p:Vn \l_@@_round_mode_tl { places } }
{
\use:c
{ @@_round_ \l_@@_exponent_mode_tl :nn }
@@ -2770,7 +2772,11 @@
{
\int_compare:nNnTF { \tl_count:n {#1} } = 4
{
- \@@_round_engineering:NNNNn #1 {#2}
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn \l_@@_round_precision_int = 1 }
+ { \str_if_eq_p:Vn \l_@@_round_mode_tl { figures } }
+ { { 1 } { } }
+ { \@@_round_engineering:NNNNn #1 {#2} }
\@@_round_final_shift:Nw 3
}
{ {#1} {#2} }
@@ -2779,7 +2785,7 @@
{
{#1}
\exp_args:NV \@@_round_engineering:nnN
- { \l_@@_round_precision_int } { }
+ \l_@@_round_precision_int { }
#2#3#4#5 \q_recursion_tail \q_recursion_stop
}
\cs_new:Npn \@@_round_engineering:nnN #1#2#3
@@ -2793,11 +2799,17 @@
\cs_new:Npn \@@_round_input:nn #1#2 { {#1} {#2} }
\cs_new:Npn \@@_round_scientific:nn #1#2
{
- \@@_exponent_shift:nnf
- { 1 } {#1} { \@@_round_truncate_direct:n {#2} }
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn \l_@@_round_precision_int = 1 }
+ { \str_if_eq_p:Vn \l_@@_round_mode_tl { figures } }
+ { { 1 } { } }
+ {
+ \@@_exponent_shift:nnf
+ { 1 } {#1} { \@@_round_truncate_direct:n {#2} }
+ }
\@@_round_final_shift:Nw 1
}
-\cs_new:Npn \@@_round_final_shift:Nw #1#2 \@@_round_places_end:nnn #3#4#5
+\cs_new:Npn \@@_round_final_shift:Nw #1#2 \@@_round_end:nnn #3#4#5
{
\exp_not:n { {#3} }
\@@_exponent_finalise:n { #4#5 + #1 }
@@ -2885,6 +2897,13 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[EXP]{\@@_round_end:nnn}
+% Used as a marker to allow adjustment when we pass a power of ten.
+% \begin{macrocode}
+\cs_new:Npn \@@_round_end:nnn #1#2#3 { \exp_not:n { {#1} {#2} {#3} } }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[EXP]{\@@_round_figures:nnnnnnn, \@@_round_figures_aux:nnnnnnn}
% \begin{macro}[EXP]{\@@_round_figures_count:nnN}
% \begin{macro}[EXP]{\@@_round_figures_count:nnnN}
@@ -2913,7 +2932,7 @@
\exp_not:n { {#1} {#2} }
\@@_round_figures_count:nnN {#3} {#4} #3#4
\q_recursion_tail \q_recursion_stop
- \exp_not:n { { } {#6} {#7} }
+ \@@_round_end:nnn { } {#6} {#7}
}
{ { } { } { 0 } { } { } { } { 0 } }
}
@@ -2955,7 +2974,6 @@
% \end{macro}
%
% \begin{macro}[EXP]{\@@_round_places:nnnnnnn}
-% \begin{macro}[EXP]{\@@_round_places_end:nnn}
% \begin{macro}[EXP]{\@@_round_places_decimal:nn, \@@_round_places_integer:nn}
% \begin{macro}[EXP]{\@@_round_places_finalise:n}
% \begin{macro}[EXP]{\@@_round_places_finalise:nnnnnnn}
@@ -2977,12 +2995,11 @@
{ \@@_round_places_decimal:nn }
{ \@@_round_places_integer:nn }
{#3} {#4}
- \@@_round_places_end:nnn { } {#6} {#7}
+ \@@_round_end:nnn { } {#6} {#7}
}
}
{ \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } }
}
-\cs_new:Npn \@@_round_places_end:nnn #1#2#3 { \exp_not:n { {#1} {#2} {#3} } }
\cs_new:Npn \@@_round_places_decimal:nn #1#2
{
\int_compare:nNnTF
@@ -3056,7 +3073,6 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[EXP]{\@@_round_uncertainty:nnnnnnn}
% \begin{macro}[EXP]{\@@_round_uncertainty_end:nn}
@@ -3249,7 +3265,7 @@
\use:c
{ @@_round_ \l_@@_exponent_mode_tl :nn }
{#2} {#3}
- \@@_round_places_end:nnn { { S } { 1 #1 } } {#4} {#5}
+ \@@_round_end:nnn { { S } { 1 #1 } } {#4} {#5}
}
% \end{macrocode}
% With the data available, adjust the output such that the uncertainty
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 13a76da695..3e61bbb85c 100644
--- a/macros/latex/contrib/siunitx/siunitx.dtx
+++ b/macros/latex/contrib/siunitx/siunitx.dtx
@@ -121,7 +121,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2022-09-07} {3.1.7}
+\ProvidesExplPackage {siunitx} {2022-10-04} {3.1.8}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 4954530a97..15032f9957 100644
--- a/macros/latex/contrib/siunitx/siunitx.pdf
+++ b/macros/latex/contrib/siunitx/siunitx.pdf
Binary files differ
diff --git a/macros/latex/contrib/upmethodology/src/UPMVERSION.def b/macros/latex/contrib/upmethodology/src/UPMVERSION.def
index c944b0c40f..f67a49f440 100644
--- a/macros/latex/contrib/upmethodology/src/UPMVERSION.def
+++ b/macros/latex/contrib/upmethodology/src/UPMVERSION.def
@@ -1 +1 @@
-\def\UPMVERSION{20220210}
+\def\UPMVERSION{20221004}
diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-document.cls b/macros/latex/contrib/upmethodology/src/upmethodology-document.cls
index 0bca5c1b2b..f62d987462 100644
--- a/macros/latex/contrib/upmethodology/src/upmethodology-document.cls
+++ b/macros/latex/contrib/upmethodology/src/upmethodology-document.cls
@@ -17,7 +17,7 @@
% write to the Free Software Foundation, Inc., 59 Temple Place - Suite
% 330, Boston, MA 02111-1307, USA.
-\global\edef\upm@package@docclazz@ver{2022/02/10}
+\global\edef\upm@package@docclazz@ver{2022/10/04}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{upmethodology-document}[\upm@package@docclazz@ver]
diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-fmt.sty b/macros/latex/contrib/upmethodology/src/upmethodology-fmt.sty
index 5952c2b916..52b2adbb5b 100644
--- a/macros/latex/contrib/upmethodology/src/upmethodology-fmt.sty
+++ b/macros/latex/contrib/upmethodology/src/upmethodology-fmt.sty
@@ -17,7 +17,7 @@
% write to the Free Software Foundation, Inc., 59 Temple Place - Suite
% 330, Boston, MA 02111-1307, USA.
-\global\edef\upm@package@fmt@ver{2022/02/10}
+\global\edef\upm@package@fmt@ver{2022/10/04}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{upmethodology-fmt}[\upm@package@fmt@ver]
@@ -1270,18 +1270,44 @@
\let\upm@item@param\upm@fmt@olditem
\let\upm@item@noparam\upm@fmt@olditem
\def\item{\@ifnextchar[\upm@item@param\upm@item@noparam}
- \AtBeginDocument{
+ \newcommand{\overridedescriptionenvironment}{%
\message{*** Overriding the 'description' environment. Pass option 'standardlists' for avoiding this override.}
+ % Override the description environment
\global\let\description\@undefined
\global\let\enddescription\@undefined
\global\NewEnviron{description}[1][\upm@fmt@itemizeddescription@separator]{
\begin{itemize}%
- \renewcommand{\upm@item@param}[1][]{\upm@fmt@olditem \upm@fmt@itemizeddescription@desc{##1}{#1}}%
+ \renewcommand{\upm@item@param}[1][]{\upm@fmt@olditem \upm@fmt@itemizeddescription@desc{####1}{##1}}%
\renewcommand{\upm@item@noparam}{\upm@fmt@olditem }%
\BODY%
\end{itemize}%
}
}
+ \newcommand{\restoredescriptionenvironment}{%
+ \message{*** Restoring the 'description' environment.}
+ \global\let\description\@upm@fmt@overriden@description%
+ \global\let\enddescription\@upm@fmt@overriden@enddescrption%
+ }
+ \AtBeginDocument{
+ % Save the original definition for later restore
+ \global\let\@upm@fmt@overriden@description\description%
+ \global\let\@upm@fmt@overriden@enddescrption\enddescription%
+ \overridedescriptionenvironment%
+ \@ifundefined{printglossary}{}{%
+ \message{*** Overriding the 'printglossary' macro.}
+ \global\let\upm@fmt@printglossary@original\printglossary%
+ \global\newcommand{\upm@fmt@printglossary}[1][]{%
+ \message{*** Evaluating 'printglossary' macro.}%
+ \restoredescriptionenvironment%
+ \upm@fmt@printglossary@original[#1]%
+ \overridedescriptionenvironment%
+ }%
+ \global\let\printglossary\upm@fmt@printglossary%
+ }%
+ }
+\else
+ \newcommand{\overridedescriptionenvironment}{}
+ \newcommand{\restoredescriptionenvironment}{}
\fi
%----------------------------------------
diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md
index ac068b909e..173be3799d 100644
--- a/macros/latex/required/babel/base/README.md
+++ b/macros/latex/required/babel/base/README.md
@@ -1,4 +1,6 @@
-## Babel 3.80
+## Babel 3.81
+
+**Development**
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -8,9 +10,9 @@ is a set of ini files for about 250 languages.
The latest stable version is available on <https://ctan.org/pkg/babel>.
-Changes in version 3.80 are described in:
+Changes in version 3.81 are described in:
-https://latex3.github.io/babel/news/whats-new-in-babel-3.80.html
+https://latex3.github.io/babel/news/whats-new-in-babel-3.81.html
Apart from the manual, you can find information on some aspects of babel at:
@@ -46,21 +48,14 @@ respective authors.
### Summary of latest changes
```
-3.80 2022-09-16
- * Ethiopic calendar.
- * Hungarian date in the superessive case.
- * Captions for Hausa by Abubakar Yusuf (@fatherofcamels)
- * Fixes in dates:
- - Latin: In `pdftex`, numerals were printed in arabic form.
- - Thai: Buddhist and Gregorian were reversed.
- - Persian: The Persian calendar was not loaded.
- * More updates to the CLDR 41: Galician, Swiss German, Gujarati,
- Hausa, Hebrew, Hindi, Croatian, Upper Sorbian, Hungarian,
- Armenian, Interlingua, Indonesian, Igbo, Sichuan Yi, Icelandic,
- Italian, Japanese, Ngomba, Georgian, Kabyle, Kabuverdianu,
- Kazakh, Kako, Kalaallisut, Khmer, Kannada, Korean, Konkani,
- Kashmiri, Colognian, Cornish, Kyrgyz, Lakota, Lao, Northern
- Luri, Lithuanian, Macedonian, Malayalam, Mongolian.
+3.81 2022-10-04
+ * Tibetan line breaking and justification (lines padded with
+ trailing tshegs).
+ * New option 'letters' for 'onchar'.
+ * Conceal 'fontspec' warnings about unknown languages and
+ scripts with \babelfont.
+ * More updates to the CLDR 41: Burmese, Dutch, Kwasio, Malay,
+ Marathi, Mazanderani, Nepali, Norwegian, Norwegian Nynorsk.
```
### Previous changes
diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx
index c633f24b9e..3d8eddc505 100644
--- a/macros/latex/required/babel/base/babel.dtx
+++ b/macros/latex/required/babel/base/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2022/09/17 v3.80 The Babel package]
+\ProvidesFile{babel.dtx}[2022/10/04 v3.81 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -943,11 +943,9 @@ list of characters as their arguments.
The command |\shorthandoff| sets the |\catcode| for each of the
characters in its argument to other (12); the command |\shorthandon|
sets the |\catcode| to active (13). Both commands only work on `known'
-shorthand characters.
-
-% TODO - Is the following true ????
-% If a character is not known to be a shorthand character its category
-% code will be left unchanged.
+shorthand characters, and an error will be raised otherwise. You can
+check if a character is a shorthand with |\ifbabelshorthand| (see
+below).
\New{3.9a} However, |\shorthandoff| does not behave as
you would expect with characters like |~| or |^|, because they
@@ -2311,19 +2309,6 @@ to select fonts in addition to the three basic families.
\end{warning}
\begin{troubleshooting}
- \trouble{Package fontspec Warning: 'Language 'LANG' not available for
- font 'FONT' with script 'SCRIPT' 'Default' language used instead'}
- \textit{Package fontspec Warning: 'Language 'LANG' not available for
- font 'FONT' with script 'SCRIPT' 'Default' language used instead'}.
-
- \textbf{This is \textit{not} an error.} This warning is shown by
- \textsf{fontspec}, not by \babel. It can be irrelevant for English,
- but not for many other languages, including Urdu and Turkish. This is
- a useful and harmless warning, and if everything is fine with your
- document the best thing you can do is just to ignore it altogether.
-\end{troubleshooting}
-
-\begin{troubleshooting}
\trouble{Package babel Info: The following fonts are not babel
standard families} \textit{Package babel Info: The following fonts
are not babel standard families}.
@@ -2623,7 +2608,8 @@ the script, no matter which language is active. Although somewhat
inconsistent, this makes setting a language up easier in most typical
cases.
-\Describe{onchar=}{\texttt{ids} $\string|$ \texttt{fonts}}
+\Describe{onchar=}{\texttt{ids} $\string|$ \texttt{fonts}
+ $\string|$ \texttt{letters}}
\New{3.38} This option is much like an ‘event’ called when a character
belonging to the script of this locale is found (as its name implies,
it acts on characters, not on spaces). There are currently two
@@ -2634,6 +2620,10 @@ locale (as set with |\babelfont|). This option is not compatible with
|mapfont|. Characters can be added or modified with
|\babelcharproperty|.
+\New{3.81} Option |letters| restricts the ‘actions’ to letters, in the
+\TeX{} sense (i.~e., with catcode 11). Digits and punctuation are then
+considered part of current locale (as set by a selector).
+
\begin{note}
An alternative approach with \luatex{} and Harfbuzz is the font
option |RawFeature={multiscript=auto}|. It does not switch the
@@ -2657,7 +2647,8 @@ Currently used only in Southeast Asian scrips, like Thai. Ignored if 0
See section~\ref{transforms}.
\Describe{justification=}{\texttt{kashida} $\string|$
-\texttt{elongated} $\string|$ \texttt{unhyphenated}}
+\texttt{elongated} $\string|$ \texttt{unhyphenated}
+$\string|$ \texttt{padding}}
\New{3.59} There are currently three options, mainly for the Arabic
script. It sets the linebreaking and justification method, which can be
based on the the \textsc{arabic tatweel} character or in the
@@ -2666,6 +2657,11 @@ explanation see the
\href{https://latex3.github.io/babel/news/whats-new-in-babel-3.59.html}%
{\babel\ site}.
+\New{3.81} The option |padding| has been devised primarily for Tibetan.
+It’s still somewhat experimental. Again, there is an explanation in the
+\href{https://latex3.github.io/babel/news/whats-new-in-babel-3.81.html}%
+ {\babel\ site}.
+
\Describe{linebreaking=}{}
\New{3.59} Just a synonymous for \texttt{justification}.
@@ -4107,6 +4103,10 @@ For example:
\babelcharproperty{`)}{linebreak}{cl} % or id, op, cl, ns, ex, in, hy
\end{verbatim}
+Please, refer to the Unicode standard (Annex \#9 and Annex \#14) for
+the meaning of the available codes. For example, |en| is ‘European
+number’ and |id| is ‘ideographic’.
+
\New{3.39} Another property is |locale|, which adds characters to the
list used by |onchar| in |\babelprovide|, or, if the last argument is
empty, removes them. The last argument is the locale name:
@@ -5176,8 +5176,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.80>>
-%<<date=2022/09/17>>
+%<<version=3.81>>
+%<<date=2022/10/04>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -5304,7 +5304,8 @@ help from Bernd Raichle, for which I am grateful.
% To check if a macro is defined, we create a new macro, which does
% the same as |\@ifundefined|. However, in an $\epsilon$-tex engine,
% it is based on |\ifcsname|, which is more efficient, and does not
-% waste memory.
+% waste memory. Defined inside a group, to avoid \cs{ifcsname} being
+% implicitly set to |\relax| by the |\csname| test.
%
% \begin{macrocode}
\begingroup
@@ -5314,7 +5315,7 @@ help from Bernd Raichle, for which I am grateful.
\else
\expandafter\@secondoftwo
\fi}
- \bbl@ifunset{ifcsname}% TODO. A better test?
+ \bbl@ifunset{ifcsname}%
{}%
{\gdef\bbl@ifunset#1{%
\ifcsname#1\endcsname
@@ -6135,7 +6136,6 @@ help from Bernd Raichle, for which I am grateful.
request the languages explicitly}%
{See the manual for further details.}%
\fi
-% TODO. Option to search if loaded, with \LocaleForEach
\let\bbl@auxname\languagename % Still necessary. TODO
\bbl@ifunset{bbl@bcp@map@\languagename}{}% Move uplevel??
{\edef\languagename{\@nameuse{bbl@bcp@map@\languagename}}}%
@@ -6427,19 +6427,8 @@ help from Bernd Raichle, for which I am grateful.
% TODO. name@map must be here?
\bbl@provide@locale
\bbl@iflanguage\languagename{%
- \expandafter\ifx\csname date\languagename\endcsname\relax
- \bbl@error
- {Unknown language '\languagename'. Either you have\\%
- misspelled its name, it has not been installed,\\%
- or you requested it in a previous run. Fix its name,\\%
- install it or just rerun the file, respectively. In\\%
- some cases, you may need to remove the aux file}%
- {You may proceed, but expect wrong results}%
- \else
- % set type
- \let\bbl@select@type\z@
- \expandafter\bbl@switch\expandafter{\languagename}%
- \fi}}
+ \let\bbl@select@type\z@
+ \expandafter\bbl@switch\expandafter{\languagename}}}
\def\babel@aux#1#2{%
\select@language{#1}%
\bbl@foreach\BabelContentsFiles{% \relax -> don't assume vertical mode
@@ -6493,7 +6482,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@id@assign
% switch captions, date
% No text is supposed to be added here, so we remove any
- % spurious spaces.
+ % spurious spaces.
\bbl@bsphack
\ifcase\bbl@select@type
\csname captions#1\endcsname\relax
@@ -6540,9 +6529,10 @@ help from Bernd Raichle, for which I am grateful.
\bbl@xin@{/u}{/\bbl@tempa}%
\ifin@\else\bbl@xin@{/e}{/\bbl@tempa}\fi % elongated forms
\ifin@\else\bbl@xin@{/k}{/\bbl@tempa}\fi % only kashida
+ \ifin@\else\bbl@xin@{/p}{/\bbl@tempa}\fi % padding (eg, Tibetan)
\ifin@\else\bbl@xin@{/v}{/\bbl@tempa}\fi % variable font
\ifin@
- % unhyphenated/kashida/elongated = allow stretching
+ % unhyphenated/kashida/elongated/padding = allow stretching
\language\l@unhyphenated
\babel@savevariable\emergencystretch
\emergencystretch\maxdimen
@@ -6709,17 +6699,6 @@ help from Bernd Raichle, for which I am grateful.
% TODO. name@map here?
\bbl@provide@locale
\bbl@iflanguage\languagename{%
- \expandafter\ifx\csname date\languagename\endcsname\relax
- \bbl@warning % TODO - why a warning, not an error?
- {Unknown language '#1'. Either you have\\%
- misspelled its name, it has not been installed,\\%
- or you requested it in a previous run. Fix its name,\\%
- install it or just rerun the file, respectively. In\\%
- some cases, you may need to remove the aux file.\\%
- I'll proceed, but expect wrong results.\\%
- Reported}%
- \fi
- % set type
\let\bbl@select@type\@ne
\expandafter\bbl@switch\expandafter{\languagename}}}
% \end{macrocode}
@@ -6944,7 +6923,7 @@ help from Bernd Raichle, for which I am grateful.
\@nameuse{#2}%
\edef\bbl@tempa{#1}%
\bbl@sreplace\bbl@tempa{name}{}%
- \bbl@warning{% TODO.
+ \bbl@warning{%
\@backslashchar#1 not set for '\languagename'. Please,\\%
define it after the language has been loaded\\%
(typically in the preamble) with:\\%
@@ -7039,8 +7018,7 @@ help from Bernd Raichle, for which I am grateful.
% The macro |\initiate@active@char| below takes all the necessary
% actions to make its argument a shorthand character. The real work
% is performed once for each character. But first we define a little
-% tool. TODO. Always used with additional expansions. Move them here?
-% Move the macro to basic?
+% tool.
%
% \begin{macrocode}
\def\bbl@withactive#1#2{%
@@ -7175,7 +7153,7 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\bbl@trace{Defining babelensure}
-\newcommand\babelensure[2][]{% TODO - revise test files
+\newcommand\babelensure[2][]{%
\AddBabelHook{babel-ensure}{afterextras}{%
\ifcase\bbl@select@type
\bbl@cl{e}%
@@ -8695,21 +8673,12 @@ help from Bernd Raichle, for which I am grateful.
%
% \paragraph{Tools}
%
-% But first, a couple of tools. The first one makes global a local
-% variable. This is not the best solution, but it works.
+% But first, a tool. It makes global a local variable. This is not the
+% best solution, but it works.
%
% \begin{macrocode}
\bbl@trace{Multiencoding strings}
\def\bbl@toglobal#1{\global\let#1#1}
-\def\bbl@recatcode#1{% TODO. Used only once?
- \@tempcnta="7F
- \def\bbl@tempa{%
- \ifnum\@tempcnta>"FF\else
- \catcode\@tempcnta=#1\relax
- \advance\@tempcnta\@ne
- \expandafter\bbl@tempa
- \fi}%
- \bbl@tempa}
% \end{macrocode}
%
% The second one. We need to patch |\@uclclist|, but it is done once
@@ -8789,7 +8758,14 @@ help from Bernd Raichle, for which I am grateful.
\@onlypreamble\StartBabelCommands
\def\StartBabelCommands{%
\begingroup
- \bbl@recatcode{11}%
+ \@tempcnta="7F
+ \def\bbl@tempa{%
+ \ifnum\@tempcnta>"FF\else
+ \catcode\@tempcnta=11
+ \advance\@tempcnta\@ne
+ \expandafter\bbl@tempa
+ \fi}%
+ \bbl@tempa
<@Macros local to BabelCommands@>
\def\bbl@provstring##1##2{%
\providecommand##1{##2}%
@@ -9119,7 +9095,7 @@ help from Bernd Raichle, for which I am grateful.
% separates these two steps.
%
% \begin{macrocode}
-\newcommand\setlocalecaption{% TODO. Catch typos. What about ensure?
+\newcommand\setlocalecaption{% TODO. Catch typos.
\@ifstar\bbl@setcaption@s\bbl@setcaption@x}
\def\bbl@setcaption@x#1#2#3{% language caption-name string
\bbl@trim@def\bbl@tempa{#2}%
@@ -9855,7 +9831,15 @@ help from Bernd Raichle, for which I am grateful.
Babel.linebreaking.add_before(Babel.locale_map)
Babel.loc_to_scr = {}
Babel.chr_to_loc = Babel.chr_to_loc or {}
- end}%
+ end
+ Babel.locale_props[\the\localeid].letters = false
+ }%
+ \bbl@xin@{ letters }{ \bbl@KVP@onchar\space}%
+ \ifin@
+ \directlua{
+ Babel.locale_props[\the\localeid].letters = true
+ }%
+ \fi
\bbl@xin@{ ids }{ \bbl@KVP@onchar\space}%
\ifin@
\ifx\bbl@starthyphens\@undefined % Needed if no explicit selection
@@ -9958,7 +9942,8 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl@KVP@linebreaking\bbl@KVP@justification
\fi
\ifx\bbl@KVP@linebreaking\@nnil\else
- \bbl@xin@{,\bbl@KVP@linebreaking,}{,elongated,kashida,cjk,unhyphenated,}%
+ \bbl@xin@{,\bbl@KVP@linebreaking,}%
+ {,elongated,kashida,cjk,padding,unhyphenated,}%
\ifin@
\bbl@csarg\xdef
{lnbrk@\languagename}{\expandafter\@car\bbl@KVP@linebreaking\@nil}%
@@ -9967,6 +9952,8 @@ help from Bernd Raichle, for which I am grateful.
\bbl@xin@{/e}{/\bbl@cl{lnbrk}}%
\ifin@\else\bbl@xin@{/k}{/\bbl@cl{lnbrk}}\fi
\ifin@\bbl@arabicjust\fi
+ \bbl@xin@{/p}{/\bbl@cl{lnbrk}}%
+ \ifin@\AtBeginDocument{\bbl@tibetanjust}\fi
% == Line breaking: hyphenate.other.(locale|script) ==
\ifx\bbl@lbkflag\@empty
\bbl@ifunset{bbl@hyotl@\languagename}{}%
@@ -12058,9 +12045,7 @@ help from Bernd Raichle, for which I am grateful.
\ifx\RTLfootnotetext\@undefined
\AtEndOfPackage{%
\EnableBabelHook{babel-bidi}%
- \ifx\fontspec\@undefined
- \bbl@loadfontspec % bidi needs fontspec
- \fi
+ \bbl@loadfontspec % bidi needs fontspec
\usepackage#1{bidi}}%
\fi}
\ifnum\bbl@bidimode>200
@@ -12940,24 +12925,17 @@ help from Bernd Raichle, for which I am grateful.
%<<*Font selection>>
\bbl@trace{Font handling with fontspec}
\ifx\ExplSyntaxOn\@undefined\else
- \ExplSyntaxOn
- \catcode`\ =10
+ \def\bbl@fs@warn@nx#1#2{% \bbl@tempfs is the original macro
+ \in@{,#1,}{,no-script,language-not-exist,}%
+ \ifin@\else\bbl@tempfs@nx{#1}{#2}\fi}
+ \def\bbl@fs@warn@nxx#1#2#3{%
+ \in@{,#1,}{,no-script,language-not-exist,}%
+ \ifin@\else\bbl@tempfs@nxx{#1}{#2}{#3}\fi}
\def\bbl@loadfontspec{%
- \usepackage{fontspec}% TODO. Apply patch always
- \expandafter
- \def\csname msg~text~>~fontspec/language-not-exist\endcsname##1##2##3##4{%
- Font '\l_fontspec_fontname_tl' is using the\\%
- default features for language '##1'.\\%
- That's usually fine, because many languages\\%
- require no specific features, but if the output is\\%
- not as expected, consider selecting another font.}
- \expandafter
- \def\csname msg~text~>~fontspec/no-script\endcsname##1##2##3##4{%
- Font '\l_fontspec_fontname_tl' is using the\\%
- default features for script '##2'.\\%
- That's not always wrong, but if the output is\\%
- not as expected, consider selecting another font.}}
- \ExplSyntaxOff
+ \let\bbl@loadfontspec\relax
+ \ifx\fontspec\@undefined
+ \usepackage{fontspec}%
+ \fi}%
\fi
\@onlypreamble\babelfont
\newcommand\babelfont[2][]{% 1=langs/scripts 2=fam
@@ -12969,9 +12947,7 @@ help from Bernd Raichle, for which I am grateful.
\fi}%
\edef\bbl@tempa{#1}%
\def\bbl@tempb{#2}% Used by \bbl@bblfont
- \ifx\fontspec\@undefined
- \bbl@loadfontspec
- \fi
+ \bbl@loadfontspec
\EnableBabelHook{babel-fontspec}% Just calls \bbl@switchfont
\bbl@bblfont}
\newcommand\bbl@bblfont[2][]{% 1=features 2=fontname, @font=rm|sf|tt
@@ -13126,8 +13102,15 @@ help from Bernd Raichle, for which I am grateful.
{\\\newfontscript{\bbl@cl{sname}}{\bbl@cl{sotf}}}%
\<keys_if_exist:nnF>{fontspec-opentype}{Language/\bbl@cl{lname}}%
{\\\newfontlanguage{\bbl@cl{lname}}{\bbl@cl{lotf}}}%
+ \let\\\bbl@tempfs@nx\<__fontspec_warning:nx>%
+ \let\<__fontspec_warning:nx>\\\bbl@fs@warn@nx
+ \let\\\bbl@tempfs@nxx\<__fontspec_warning:nxx>%
+ \let\<__fontspec_warning:nxx>\\\bbl@fs@warn@nxx
\\\renewfontfamily\\#4%
[\bbl@cl{lsys},#2]}{#3}% ie \bbl@exp{..}{#3}
+ \bbl@exp{%
+ \let\<__fontspec_warning:nx>\\\bbl@tempfs@nx
+ \let\<__fontspec_warning:nxx>\\\bbl@tempfs@nxx}%
\begingroup
#4%
\xdef#1{\f@family}% eg, \bbl@rmdflt@lang{FreeSerif(0)}
@@ -14378,6 +14361,11 @@ function Babel.locale_map(head)
(item.char >= 0x1DC0 and item.char <= 0x1DFF) then
toloc = toloc_save
end
+ if toloc and Babel.locale_props[toloc] and
+ Babel.locale_props[toloc].letters and
+ tex.getcatcode(item.char) \string~= 11 then
+ toloc = nil
+ end
if toloc and toloc > -1 then
if Babel.locale_props[toloc].lg then
item.lang = Babel.locale_props[toloc].lg
@@ -14388,7 +14376,7 @@ function Babel.locale_map(head)
end
toloc_save = toloc
end
- elseif not inmath and item.id == 7 then
+ elseif not inmath and item.id == 7 then % Apply recursively
item.replace = item.replace and Babel.locale_map(item.replace)
item.pre = item.pre and Babel.locale_map(item.pre)
item.post = item.post and Babel.locale_map(item.post)
@@ -14486,10 +14474,11 @@ end
\@ifnextchar[{\bbl@settransform{0}}{\bbl@settransform{0}[]}}
\gdef\babelposthyphenation{&%
\@ifnextchar[{\bbl@settransform{1}}{\bbl@settransform{1}[]}}
+\gdef\bbl@postlinebreak{\bbl@settransform{2}[]} &% WIP
\gdef\bbl@settransform#1[#2]#3#4#5{&%
\ifcase#1
\bbl@activateprehyphen
- \else
+ \or
\bbl@activateposthyphen
\fi
\begingroup
@@ -14505,7 +14494,7 @@ end
rep = rep:gsub('^%s*(remove)%s*$', 'remove = true')
rep = rep:gsub('^%s*(insert)%s*,', 'insert = true, ')
rep = rep:gsub('(string)%s*=%s*([^%s,]*)', Babel.capture_func)
- if #1 == 0 then
+ if #1 == 0 or #1 == 2 then
rep = rep:gsub('(space)%s*=%s*([%d%.]+)%s+([%d%.]+)%s+([%d%.]+)',
'space = {' .. '%2, %3, %4' .. '}')
rep = rep:gsub('(spacefactor)%s*=%s*([%d%.]+)%s+([%d%.]+)%s+([%d%.]+)',
@@ -14518,6 +14507,16 @@ end
end
tex.print([[\string\babeltempa{{]] .. rep .. [[}}]])
}}}&%
+ \bbl@foreach\babeltempb{&%
+ \bbl@forkv{{##1}}{&%
+ \in@{,####1,}{,nil,step,data,remove,insert,string,no,pre,&%
+ no,post,penalty,kashida,space,spacefactor,}&%
+ \ifin@\else
+ \bbl@error
+ {Bad option '####1' in a transform.\\&%
+ I’ll ignore it but expect more errors}&%
+ {See the manual for further info.}&%
+ \fi}}&%
\let\bbl@kv@attribute\relax
\let\bbl@kv@label\relax
\bbl@forkv{#2}{\bbl@csarg\edef{kv@##1}{##2}}&%
@@ -14528,7 +14527,7 @@ end
local lbkr = Babel.linebreaking.replacements[#1]
local u = unicode.utf8
local id, attr, label
- if #1 == 0 then
+ if #1 == 0 or #1 == 2 then
id = \the\csname bbl@id@@#3\endcsname\space
else
id = \the\csname l@#3\endcsname\space
@@ -14543,7 +14542,7 @@ end
\fi
&% Convert pattern:
local patt = string.gsub([==[#4]==], '%s', '')
- if #1 == 0 then
+ if #1 == 0 or #1 == 2 then
patt = string.gsub(patt, '|', ' ')
end
if not u.find(patt, '()', nil, true) then
@@ -15078,8 +15077,9 @@ end
% \begin{macrocode}
%<*transforms>
Babel.linebreaking.replacements = {}
-Babel.linebreaking.replacements[0] = {} -- pre
+Babel.linebreaking.replacements[0] = {} -- pre
Babel.linebreaking.replacements[1] = {} -- post
+Babel.linebreaking.replacements[2] = {} -- post-line WIP
-- Discretionaries contain strings as nodes
function Babel.str_to_nodes(fn, matches, base)
@@ -15231,6 +15231,7 @@ Babel.us_char = string.char(31)
function Babel.hyphenate_replace(head, mode)
local u = unicode.utf8
local lbkr = Babel.linebreaking.replacements[mode]
+ if mode == 2 then mode = 0 end -- WIP
local word_head = head
diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins
index 767fe23eb1..a40cfd79f3 100644
--- a/macros/latex/required/babel/base/babel.ins
+++ b/macros/latex/required/babel/base/babel.ins
@@ -26,7 +26,7 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%%
-\def\filedate{2022/09/17}
+\def\filedate{2022/10/04}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/macros/latex/required/babel/base/babel.pdf b/macros/latex/required/babel/base/babel.pdf
index 6741e73fcc..c667f527ac 100644
--- a/macros/latex/required/babel/base/babel.pdf
+++ b/macros/latex/required/babel/base/babel.pdf
Binary files differ
diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx
index 53b5f46b8e..0bc850a585 100644
--- a/macros/latex/required/babel/base/bbcompat.dtx
+++ b/macros/latex/required/babel/base/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/09/17 v3.80]
+\ProvidesFile{bbcompat.dtx}[2022/10/04 v3.81]
%</dtx>
%
%% File 'bbcompat.dtx'
diff --git a/macros/luatex/generic/lualibs/NEWS b/macros/luatex/generic/lualibs/NEWS
index cf8a853b6c..889232dc47 100644
--- a/macros/luatex/generic/lualibs/NEWS
+++ b/macros/luatex/generic/lualibs/NEWS
@@ -1,6 +1,12 @@
History of the lualibs package
+2022/10/04 v2.75/
+ * sync with Context current as of 2022/10/04.
+ * add util-sac
+ * Replace l-gzip with util-zip
+
2021/05/20 v2.74/
* sync with Context current as of 2021/05/20.
+
2020/12/30 v2.73/
* sync with Context current as of 2020/12/30.
diff --git a/macros/luatex/generic/lualibs/README.md b/macros/luatex/generic/lualibs/README.md
index e2cd6be9bd..09194115ce 100644
--- a/macros/luatex/generic/lualibs/README.md
+++ b/macros/luatex/generic/lualibs/README.md
@@ -1,10 +1,10 @@
# The Lualibs Package
-VERSION: 2.74
+VERSION: 2.75
-DATE: 2021-05-20
+DATE: 2022-10-04
-FONTLOADERDATE: 2021-05-20
+FONTLOADERDATE: 2022-10-04
Lualibs is a collection of Lua modules useful for general programming.
@@ -47,7 +47,6 @@ See the 'NEWS' file for version history.
| lualibs-compat.lua |tex/luatex/lualibs/lualibs-compat.lua
| lualibs-dir.lua |tex/luatex/lualibs/lualibs-dir.lua
| lualibs-file.lua | tex/luatex/lualibs/lualibs-file.lua
-| lualibs-gzip.lua | tex/luatex/lualibs/lualibs-gzip.lua
| lualibs-function.lua | tex/luatex/lualibs/lualibs-function.lua
| lualibs-io.lua | tex/luatex/lualibs/lualibs-io.lua
| lualibs-lpeg.lua | tex/luatex/lualibs/lualibs-lpeg.lua
@@ -68,11 +67,13 @@ See the 'NEWS' file for version history.
| lualibs-util-jsn.lua | tex/luatex/lualibs/lualibs-util-jsn.lua
| lualibs-util-lua.lua | tex/luatex/lualibs/lualibs-util-lua.lua
| lualibs-util-prs.lua | tex/luatex/lualibs/lualibs-util-prs.lua
+| lualibs-util-sac.lua | tex/luatex/lualibs/lualibs-util-sac.lua
| lualibs-util-sta.lua | tex/luatex/lualibs/lualibs-util-sta.lua
| lualibs-util-sto.lua | tex/luatex/lualibs/lualibs-util-sto.lua
| lualibs-util-str.lua | tex/luatex/lualibs/lualibs-util-str.lua
| lualibs-util-tab.lua | tex/luatex/lualibs/lualibs-util-tab.lua
| lualibs-util-tpl.lua | tex/luatex/lualibs/lualibs-util-tpl.lua
+| lualibs-util-zip.lua | tex/luatex/lualibs/lualibs-util-zip.lua
| LICENSE | doc/luatex/lualibs/LICENSE
| NEWS | doc/luatex/lualibs/NEWS
| README | doc/luatex/lualibs/README
diff --git a/macros/luatex/generic/lualibs/lualibs-basic-merged.lua b/macros/luatex/generic/lualibs/lualibs-basic-merged.lua
index ac98df379a..690a3160ac 100644
--- a/macros/luatex/generic/lualibs/lualibs-basic-merged.lua
+++ b/macros/luatex/generic/lualibs/lualibs-basic-merged.lua
@@ -1,6 +1,6 @@
-- merged file : lualibs-basic-merged.lua
-- parent file : lualibs-basic.lua
--- merge date : 2021-05-20 23:14
+-- merge date : 2022-10-04 17:16
do -- begin closure to overcome local limits and interference
@@ -2737,8 +2737,14 @@ if not math.ceiling then
math.ceiling=math.ceil
end
if not math.round then
- local floor=math.floor
- function math.round(x) return floor(x+0.5) end
+ if xmath then
+ math.round=xmath.round
+ else
+ local floor=math.floor
+ function math.round(x)
+ return x<0 and -floor(-x+0.5) or floor(x+0.5)
+ end
+ end
end
if not math.div then
local floor=math.floor
@@ -2808,7 +2814,7 @@ if not math.tointeger then
end
if not math.ult then
local floor=math.floor
- function math.tointeger(m,n)
+ function math.ult(m,n)
return floor(m)<floor(n)
end
end
@@ -2882,9 +2888,12 @@ function io.copydata(source,target,action)
flush()
end
end
-function io.savedata(filename,data,joiner)
- local f=open(filename,"wb")
+function io.savedata(filename,data,joiner,append)
+ local f=open(filename,append and "ab" or "wb")
if f then
+ if append and joiner and f:seek("end")>0 then
+ f:write(joiner)
+ end
if type(data)=="table" then
f:write(concat(data,joiner or ""))
elseif type(data)=="function" then
@@ -3172,10 +3181,10 @@ if not modules then modules={} end modules ['l-os']={
license="see context related readme files"
}
local os=os
-local date,time=os.date,os.time
+local date,time,difftime=os.date,os.time,os.difftime
local find,format,gsub,upper,gmatch=string.find,string.format,string.gsub,string.upper,string.gmatch
local concat=table.concat
-local random,ceil,randomseed=math.random,math.ceil,math.randomseed
+local random,ceil,randomseed,modf=math.random,math.ceil,math.randomseed,math.modf
local type,setmetatable,tonumber,tostring=type,setmetatable,tonumber,tostring
do
local selfdir=os.selfdir
@@ -3273,7 +3282,7 @@ if not os.__getenv__ then
osenv[K]=v
end
function os.getenv(k)
- local K=upper(k)
+ local K=upper(k)
local v=osenv[K] or osgetenv(K) or osgetenv(k)
if v=="" then
return nil
@@ -3291,22 +3300,6 @@ if not os.__getenv__ then
setmetatable(os.env,{ __index=__index,__newindex=__newindex } )
end
end
-local execute=os.execute
-local iopopen=io.popen
-local function resultof(command)
- local handle=iopopen(command,"r")
- if handle then
- local result=handle:read("*all") or ""
- handle:close()
- return result
- else
- return ""
- end
-end
-os.resultof=resultof
-function os.pipeto(command)
- return iopopen(command,"w")
-end
if not io.fileseparator then
if find(os.getenv("PATH"),";",1,true) then
io.fileseparator,io.pathseparator,os.type="\\",";",os.type or "windows"
@@ -3321,228 +3314,231 @@ if os.type=="windows" then
else
os.libsuffix,os.binsuffix,os.binsuffixes='so','',{ '' }
end
-local launchers={
- windows="start %s",
- macosx="open %s",
- unix="xdg-open %s &> /dev/null &",
-}
-function os.launch(str)
- local command=format(launchers[os.name] or launchers.unix,str)
- execute(command)
-end
-local gettimeofday=os.gettimeofday or os.clock
-os.gettimeofday=gettimeofday
-local startuptime=gettimeofday()
-function os.runtime()
- return gettimeofday()-startuptime
-end
-local resolvers=os.resolvers or {}
-os.resolvers=resolvers
-setmetatable(os,{ __index=function(t,k)
- local r=resolvers[k]
- return r and r(t,k) or nil
-end })
-local name,platform=os.name or "linux",os.getenv("MTX_PLATFORM") or ""
-if platform~="" then
- os.platform=platform
-elseif os.type=="windows" then
- function resolvers.platform(t,k)
- local architecture=os.getenv("PROCESSOR_ARCHITECTURE") or ""
- local platform=""
- if find(architecture,"AMD64",1,true) then
- platform="win64"
+do
+ local execute=os.execute
+ local iopopen=io.popen
+ local ostype=os.type
+ local function resultof(command)
+ local handle=iopopen(command,ostype=="windows" and "rb" or "r")
+ if handle then
+ local result=handle:read("*all") or ""
+ handle:close()
+ return result
else
- platform="mswin"
+ return ""
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform=platform
- return platform
end
-elseif name=="linux" then
- function resolvers.platform(t,k)
- local architecture=os.getenv("HOSTTYPE") or resultof("uname -m") or ""
- local platform=os.getenv("MTX_PLATFORM") or ""
+ os.resultof=resultof
+ function os.pipeto(command)
+ return iopopen(command,"w")
+ end
+ local launchers={
+ windows="start %s",
+ macosx="open %s",
+ unix="xdg-open %s &> /dev/null &",
+ }
+ function os.launch(str)
+ local command=format(launchers[os.name] or launchers.unix,str)
+ execute(command)
+ end
+end
+do
+ local gettimeofday=os.gettimeofday or os.clock
+ os.gettimeofday=gettimeofday
+ local startuptime=gettimeofday()
+ function os.runtime()
+ return gettimeofday()-startuptime
+ end
+end
+do
+ local name=os.name or "linux"
+ local platform=os.getenv("MTX_PLATFORM") or ""
+ local architecture=os.uname and os.uname().machine
+ local bits=os.getenv("MTX_BITS") or find(platform,"64") and 64 or 32
+ if platform~="" then
+ elseif os.type=="windows" then
+ architecture=string.lower(architecture or os.getenv("PROCESSOR_ARCHITECTURE") or "")
+ if architecture=="x86_64" then
+ bits,platform=64,"win64"
+ elseif find(architecture,"amd64") then
+ bits,platform=64,"win64"
+ elseif find(architecture,"arm64") then
+ bits,platform=64,"windows-arm64"
+ elseif find(architecture,"arm32") then
+ bits,platform=32,"windows-arm32"
+ else
+ bits,platform=32,"mswin"
+ end
+ elseif name=="linux" then
+ architecture=architecture or os.getenv("HOSTTYPE") or resultof("uname -m") or ""
local musl=find(os.selfdir or "","linuxmusl")
- if platform~="" then
- elseif find(architecture,"x86_64",1,true) then
- platform=musl and "linuxmusl" or "linux-64"
- elseif find(architecture,"ppc",1,true) then
- platform="linux-ppc"
+ if find(architecture,"x86_64") then
+ bits,platform=64,musl and "linuxmusl" or "linux-64"
+ elseif find(architecture,"ppc") then
+ bits,platform=32,"linux-ppc"
else
- platform=musl and "linuxmusl" or "linux"
+ bits,platform=32,musl and "linuxmusl" or "linux"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform=platform
- return platform
- end
-elseif name=="macosx" then
- function resolvers.platform(t,k)
- local architecture=resultof("echo $HOSTTYPE") or ""
- local platform=""
+ elseif name=="macosx" then
+ architecture=architecture or resultof("echo $HOSTTYPE") or ""
if architecture=="" then
- platform="osx-intel"
- elseif find(architecture,"i386",1,true) then
- platform="osx-intel"
- elseif find(architecture,"x86_64",1,true) then
- platform="osx-64"
- elseif find(architecture,"arm64",1,true) then
- platform="osx-arm"
+ bits,platform=64,"osx-intel"
+ elseif find(architecture,"i386") then
+ bits,platform=64,"osx-intel"
+ elseif find(architecture,"x86_64") then
+ bits,platform=64,"osx-64"
+ elseif find(architecture,"arm64") then
+ bits,platform=64,"osx-arm"
else
- platform="osx-ppc"
- end
- os.setenv("MTX_PLATFORM",platform)
- os.platform=platform
- return platform
- end
-elseif name=="sunos" then
- function resolvers.platform(t,k)
- local architecture=resultof("uname -m") or ""
- local platform=""
- if find(architecture,"sparc",1,true) then
- platform="solaris-sparc"
+ bits,platform=32,"osx-ppc"
+ end
+ elseif name=="sunos" then
+ architecture=architecture or resultof("uname -m") or ""
+ if find(architecture,"sparc") then
+ bits,platform=32,"solaris-sparc"
else
- platform="solaris-intel"
- end
- os.setenv("MTX_PLATFORM",platform)
- os.platform=platform
- return platform
- end
-elseif name=="freebsd" then
- function resolvers.platform(t,k)
- local architecture=resultof("uname -m") or ""
- local platform=""
- if find(architecture,"amd64",1,true) then
- platform="freebsd-amd64"
+ bits,platform=32,"solaris-intel"
+ end
+ elseif name=="freebsd" then
+ architecture=architecture or os.getenv("MACHTYPE") or resultof("uname -m") or ""
+ if find(architecture,"amd64") or find(architecture,"AMD64") then
+ bits,platform=64,"freebsd-amd64"
else
- platform="freebsd"
- end
- os.setenv("MTX_PLATFORM",platform)
- os.platform=platform
- return platform
- end
-elseif name=="kfreebsd" then
- function resolvers.platform(t,k)
- local architecture=os.getenv("HOSTTYPE") or resultof("uname -m") or ""
- local platform=""
- if find(architecture,"x86_64",1,true) then
- platform="kfreebsd-amd64"
+ bits,platform=32,"freebsd"
+ end
+ elseif name=="kfreebsd" then
+ architecture=architecture or os.getenv("HOSTTYPE") or resultof("uname -m") or ""
+ if architecture=="x86_64" then
+ bits,platform=64,"kfreebsd-amd64"
+ else
+ bits,platform=32,"kfreebsd-i386"
+ end
+ else
+ architecture=architecture or resultof("uname -m") or ""
+ if find(architecture,"aarch64") then
+ bits,platform="linux-aarch64"
+ elseif find(architecture,"armv7l") then
+ bits,platform=32,"linux-armhf"
+ elseif find(architecture,"mips64") or find(architecture,"mips64el") then
+ bits,platform=64,"linux-mipsel"
+ elseif find(architecture,"mipsel") or find(architecture,"mips") then
+ bits,platform=32,"linux-mipsel"
else
- platform="kfreebsd-i386"
+ bits,platform=64,"linux-64"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform=platform
- return platform
end
-else
- function resolvers.platform(t,k)
- local platform="linux"
- os.setenv("MTX_PLATFORM",platform)
- os.platform=platform
- return platform
+ os.setenv("MTX_PLATFORM",platform)
+ os.setenv("MTX_BITS",bits)
+ os.platform=platform
+ os.bits=bits
+ os.newline=name=="windows" and "\013\010" or "\010"
+end
+do
+ local t={ 8,9,"a","b" }
+ function os.uuid()
+ return format("%04x%04x-4%03x-%s%03x-%04x-%04x%04x%04x",
+ random(0xFFFF),random(0xFFFF),
+ random(0x0FFF),
+ t[ceil(random(4))] or 8,random(0x0FFF),
+ random(0xFFFF),
+ random(0xFFFF),random(0xFFFF),random(0xFFFF)
+ )
end
end
-os.newline=name=="windows" and "\013\010" or "\010"
-function resolvers.bits(t,k)
- local bits=find(os.platform,"64",1,true) and 64 or 32
- os.bits=bits
- return bits
-end
-local t={ 8,9,"a","b" }
-function os.uuid()
- return format("%04x%04x-4%03x-%s%03x-%04x-%04x%04x%04x",
- random(0xFFFF),random(0xFFFF),
- random(0x0FFF),
- t[ceil(random(4))] or 8,random(0x0FFF),
- random(0xFFFF),
- random(0xFFFF),random(0xFFFF),random(0xFFFF)
- )
-end
-local d
-function os.timezone(delta)
- d=d or ((tonumber(date("%H")) or 0)-(tonumber(date("!%H")) or 0))
- if delta then
- if d>0 then
- return format("+%02i:00",d)
+do
+ local hour,min
+ function os.timezone(difference)
+ if not hour then
+ local current=time()
+ local utcdate=date("!*t",current)
+ local localdate=date("*t",current)
+ localdate.isdst=false
+ local timediff=difftime(time(localdate),time(utcdate))
+ hour,min=modf(timediff/3600)
+ min=min*60
+ end
+ if difference then
+ return hour,min
else
- return format("-%02i:00",-d)
+ return format("%+03d:%02d",hour,min)
end
- else
- return 1
- end
-end
-local timeformat=format("%%s%s",os.timezone(true))
-local dateformat="!%Y-%m-%d %H:%M:%S"
-local lasttime=nil
-local lastdate=nil
-function os.fulltime(t,default)
- t=t and tonumber(t) or 0
- if t>0 then
- elseif default then
- return default
- else
- t=time()
- end
- if t~=lasttime then
- lasttime=t
- lastdate=format(timeformat,date(dateformat))
- end
- return lastdate
-end
-local dateformat="%Y-%m-%d %H:%M:%S"
-local lasttime=nil
-local lastdate=nil
-function os.localtime(t,default)
- t=t and tonumber(t) or 0
- if t>0 then
- elseif default then
- return default
- else
- t=time()
end
- if t~=lasttime then
- lasttime=t
- lastdate=date(dateformat,t)
+ local timeformat=format("%%s%s",os.timezone())
+ local dateformat="%Y-%m-%d %H:%M:%S"
+ local lasttime=nil
+ local lastdate=nil
+ function os.fulltime(t,default)
+ t=t and tonumber(t) or 0
+ if t>0 then
+ elseif default then
+ return default
+ else
+ t=time()
+ end
+ if t~=lasttime then
+ lasttime=t
+ lastdate=format(timeformat,date(dateformat))
+ end
+ return lastdate
+ end
+ local dateformat="%Y-%m-%d %H:%M:%S"
+ local lasttime=nil
+ local lastdate=nil
+ function os.localtime(t,default)
+ t=t and tonumber(t) or 0
+ if t>0 then
+ elseif default then
+ return default
+ else
+ t=time()
+ end
+ if t~=lasttime then
+ lasttime=t
+ lastdate=date(dateformat,t)
+ end
+ return lastdate
+ end
+ function os.converttime(t,default)
+ local t=tonumber(t)
+ if t and t>0 then
+ return date(dateformat,t)
+ else
+ return default or "-"
+ end
+ end
+ function os.today()
+ return date("!*t")
+ end
+ function os.now()
+ return date("!%Y-%m-%d %H:%M:%S")
end
- return lastdate
end
-function os.converttime(t,default)
- local t=tonumber(t)
- if t and t>0 then
- return date(dateformat,t)
- else
- return default or "-"
- end
-end
-local memory={}
-local function which(filename)
- local fullname=memory[filename]
- if fullname==nil then
- local suffix=file.suffix(filename)
- local suffixes=suffix=="" and os.binsuffixes or { suffix }
- for directory in gmatch(os.getenv("PATH"),"[^"..io.pathseparator.."]+") do
- local df=file.join(directory,filename)
- for i=1,#suffixes do
- local dfs=file.addsuffix(df,suffixes[i])
- if io.exists(dfs) then
- fullname=dfs
- break
+do
+ local cache={}
+ local function which(filename)
+ local fullname=cache[filename]
+ if fullname==nil then
+ local suffix=file.suffix(filename)
+ local suffixes=suffix=="" and os.binsuffixes or { suffix }
+ for directory in gmatch(os.getenv("PATH"),"[^"..io.pathseparator.."]+") do
+ local df=file.join(directory,filename)
+ for i=1,#suffixes do
+ local dfs=file.addsuffix(df,suffixes[i])
+ if io.exists(dfs) then
+ fullname=dfs
+ break
+ end
end
end
+ if not fullname then
+ fullname=false
+ end
+ cache[filename]=fullname
end
- if not fullname then
- fullname=false
- end
- memory[filename]=fullname
+ return fullname
end
- return fullname
-end
-os.which=which
-os.where=which
-function os.today()
- return date("!*t")
-end
-function os.now()
- return date("!%Y-%m-%d %H:%M:%S")
+ os.which=which
+ os.where=which
end
if not os.sleep then
local socket=socket
@@ -3553,65 +3549,69 @@ if not os.sleep then
socket.sleep(n)
end
end
-local function isleapyear(year)
- return (year%4==0) and (year%100~=0 or year%400==0)
-end
-os.isleapyear=isleapyear
-local days={ 31,28,31,30,31,30,31,31,30,31,30,31 }
-local function nofdays(year,month,day)
- if not month then
- return isleapyear(year) and 365 or 364
- elseif not day then
- return month==2 and isleapyear(year) and 29 or days[month]
- else
- for i=1,month-1 do
- day=day+days[i]
- end
- if month>2 and isleapyear(year) then
- day=day+1
+do
+ local function isleapyear(year)
+ return (year%4==0) and (year%100~=0 or year%400==0)
+ end
+ os.isleapyear=isleapyear
+ local days={ 31,28,31,30,31,30,31,31,30,31,30,31 }
+ local function nofdays(year,month,day)
+ if not month then
+ return isleapyear(year) and 365 or 364
+ elseif not day then
+ return month==2 and isleapyear(year) and 29 or days[month]
+ else
+ for i=1,month-1 do
+ day=day+days[i]
+ end
+ if month>2 and isleapyear(year) then
+ day=day+1
+ end
+ return day
end
- return day
end
-end
-os.nofdays=nofdays
-function os.weekday(day,month,year)
- return date("%w",time { year=year,month=month,day=day })+1
-end
-function os.validdate(year,month,day)
- if month<1 then
- month=1
- elseif month>12 then
- month=12
+ os.nofdays=nofdays
+ function os.weekday(day,month,year)
+ return date("%w",time { year=year,month=month,day=day })+1
end
- if day<1 then
- day=1
- else
- local max=nofdays(year,month)
- if day>max then
- day=max
+ function os.validdate(year,month,day)
+ if month<1 then
+ month=1
+ elseif month>12 then
+ month=12
+ end
+ if day<1 then
+ day=1
+ else
+ local max=nofdays(year,month)
+ if day>max then
+ day=max
+ end
end
+ return year,month,day
end
- return year,month,day
-end
-function os.date(fmt,...)
- if not fmt then
- fmt="%Y-%m-%d %H:%M"
+ function os.date(fmt,...)
+ if not fmt then
+ fmt="%Y-%m-%d %H:%M"
+ end
+ return date(fmt,...)
end
- return date(fmt,...)
end
-local osexit=os.exit
-local exitcode=nil
-function os.setexitcode(code)
- exitcode=code
-end
-function os.exit(c)
- if exitcode~=nil then
- return osexit(exitcode)
+do
+ local osexit=os.exit
+ local exitcode=nil
+ function os.setexitcode(code)
+ exitcode=code
end
- if c~=nil then
- return osexit(c)
+ function os.exit(c)
+ if exitcode~=nil then
+ return osexit(exitcode)
+ end
+ if c~=nil then
+ return osexit(c)
+ end
+ return osexit()
end
- return osexit()
end
end -- closure
@@ -3872,7 +3872,7 @@ function file.join(one,two,three,...)
if not two then
return one=="" and one or lpegmatch(reslasher,one)
end
- if one=="" then
+ if not one or one=="" then
return lpegmatch(stripper,three and concat({ two,three,... },"/") or two)
end
if lpegmatch(isnetwork,one) then
@@ -4031,87 +4031,6 @@ end -- closure
do -- begin closure to overcome local limits and interference
-if not modules then modules={} end modules ['l-gzip']={
- version=1.001,
- author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright="PRAGMA ADE / ConTeXt Development Team",
- license="see context related readme files"
-}
-gzip=gzip or {}
-if not zlib then
- zlib=xzip
-elseif not xzip then
- xzip=zlib
-end
-if zlib then
- local suffix=file.suffix
- local suffixes=file.suffixes
- local find=string.find
- local openfile=io.open
- local gzipwindow=15+16
- local gziplevel=3
- local identifier="^\x1F\x8B\x08"
- local compress=zlib.compress
- local decompress=zlib.decompress
- function gzip.load(filename)
- local f=openfile(filename,"rb")
- if not f then
- else
- local data=f:read("*all")
- f:close()
- if data and data~="" then
- if suffix(filename)=="gz" then
- data=decompress(data,gzipwindow)
- end
- return data
- end
- end
- end
- function gzip.save(filename,data,level)
- if suffix(filename)~="gz" then
- filename=filename..".gz"
- end
- local f=openfile(filename,"wb")
- if f then
- data=compress(data or "",level or gziplevel,nil,gzipwindow)
- f:write(data)
- f:close()
- return #data
- end
- end
- function gzip.suffix(filename)
- local suffix,extra=suffixes(filename)
- local gzipped=extra=="gz"
- return suffix,gzipped
- end
- function gzip.compressed(s)
- return s and find(s,identifier)
- end
- function gzip.compress(s,level)
- if s and not find(s,identifier) then
- if not level then
- level=gziplevel
- elseif level<=0 then
- return s
- elseif level>9 then
- level=9
- end
- return compress(s,level or gziplevel,nil,gzipwindow) or s
- end
- end
- function gzip.decompress(s)
- if s and find(s,identifier) then
- return decompress(s,gzipwindow)
- else
- return s
- end
- end
-end
-
-end -- closure
-
-do -- begin closure to overcome local limits and interference
-
if not modules then modules={} end modules ['l-md5']={
version=1.001,
author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -4389,15 +4308,15 @@ local separator,pattern
if onwindows then
local slash=S("/\\")/"/"
pattern={
- [1]=(Cs(P(".")+slash^1)+Cs(R("az","AZ")*P(":")*slash^0)+Cc("./"))*V(2)*V(3),
- [2]=Cs(((1-S("*?/\\"))^0*slash)^0),
- [3]=Cs(P(1)^0)
+ (Cs(P(".")+slash^1)+Cs(R("az","AZ")*P(":")*slash^0)+Cc("./"))*V(2)*V(3),
+ Cs(((1-S("*?/\\"))^0*slash)^0),
+ Cs(P(1)^0)
}
else
pattern={
- [1]=(C(P(".")+P("/")^1)+Cc("./"))*V(2)*V(3),
- [2]=C(((1-S("*?/"))^0*P("/"))^0),
- [3]=C(P(1)^0)
+ (C(P(".")+P("/")^1)+Cc("./"))*V(2)*V(3),
+ C(((1-S("*?/"))^0*P("/"))^0),
+ C(P(1)^0)
}
end
local filter=Cs ((
diff --git a/macros/luatex/generic/lualibs/lualibs-dir.lua b/macros/luatex/generic/lualibs/lualibs-dir.lua
index 325039cb1e..ac8e2f4e8e 100644
--- a/macros/luatex/generic/lualibs/lualibs-dir.lua
+++ b/macros/luatex/generic/lualibs/lualibs-dir.lua
@@ -230,18 +230,18 @@ if onwindows then -- we could sanitize here
-- pattern = Ct {
pattern = {
- [1] = (Cs(P(".") + slash^1) + Cs(R("az","AZ") * P(":") * slash^0) + Cc("./")) * V(2) * V(3),
- [2] = Cs(((1-S("*?/\\"))^0 * slash)^0),
- [3] = Cs(P(1)^0)
+ (Cs(P(".") + slash^1) + Cs(R("az","AZ") * P(":") * slash^0) + Cc("./")) * V(2) * V(3),
+ Cs(((1-S("*?/\\"))^0 * slash)^0),
+ Cs(P(1)^0)
}
else -- assume unix
-- pattern = Ct {
pattern = {
- [1] = (C(P(".") + P("/")^1) + Cc("./")) * V(2) * V(3),
- [2] = C(((1-S("*?/"))^0 * P("/"))^0),
- [3] = C(P(1)^0)
+ (C(P(".") + P("/")^1) + Cc("./")) * V(2) * V(3),
+ C(((1-S("*?/"))^0 * P("/"))^0),
+ C(P(1)^0)
}
end
diff --git a/macros/luatex/generic/lualibs/lualibs-extended-merged.lua b/macros/luatex/generic/lualibs/lualibs-extended-merged.lua
index 9cd4487bf2..08428c51ac 100644
--- a/macros/luatex/generic/lualibs/lualibs-extended-merged.lua
+++ b/macros/luatex/generic/lualibs/lualibs-extended-merged.lua
@@ -1,6 +1,511 @@
-- merged file : lualibs-extended-merged.lua
-- parent file : lualibs-extended.lua
--- merge date : 2021-05-20 23:14
+-- merge date : 2022-10-04 17:16
+
+do -- begin closure to overcome local limits and interference
+
+if not modules then modules={} end modules ['util-sac']={
+ version=1.001,
+ optimize=true,
+ comment="companion to luat-lib.mkiv",
+ author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright="PRAGMA ADE / ConTeXt Development Team",
+ license="see context related readme files"
+}
+local byte,sub=string.byte,string.sub
+local tonumber=tonumber
+utilities=utilities or {}
+local streams={}
+utilities.streams=streams
+function streams.open(filename,zerobased)
+ local f=filename and io.loaddata(filename)
+ if f then
+ return { f,1,#f,zerobased or false }
+ end
+end
+function streams.openstring(f,zerobased)
+ if f then
+ return { f,1,#f,zerobased or false }
+ end
+end
+function streams.getstring(f)
+ if f then
+ return f[1]
+ end
+end
+function streams.close()
+end
+function streams.size(f)
+ return f and f[3] or 0
+end
+streams.getsize=streams.size
+function streams.setposition(f,i)
+ if f[4] then
+ if i<=0 then
+ f[2]=1
+ else
+ f[2]=i+1
+ end
+ else
+ if i<=1 then
+ f[2]=1
+ else
+ f[2]=i
+ end
+ end
+end
+function streams.getposition(f)
+ if f[4] then
+ return f[2]-1
+ else
+ return f[2]
+ end
+end
+function streams.look(f,n,chars)
+ local b=f[2]
+ local e=b+n-1
+ if chars then
+ return sub(f[1],b,e)
+ else
+ return byte(f[1],b,e)
+ end
+end
+function streams.skip(f,n)
+ f[2]=f[2]+n
+end
+function streams.readbyte(f)
+ local i=f[2]
+ f[2]=i+1
+ return byte(f[1],i)
+end
+function streams.readbytes(f,n)
+ local i=f[2]
+ local j=i+n
+ f[2]=j
+ return byte(f[1],i,j-1)
+end
+function streams.readbytetable(f,n)
+ local i=f[2]
+ local j=i+n
+ f[2]=j
+ return { byte(f[1],i,j-1) }
+end
+function streams.skipbytes(f,n)
+ f[2]=f[2]+n
+end
+function streams.readchar(f)
+ local i=f[2]
+ f[2]=i+1
+ return sub(f[1],i,i)
+end
+function streams.readstring(f,n)
+ local i=f[2]
+ local j=i+n
+ f[2]=j
+ return sub(f[1],i,j-1)
+end
+function streams.readinteger1(f)
+ local i=f[2]
+ f[2]=i+1
+ local n=byte(f[1],i)
+ if n>=0x80 then
+ return n-0x100
+ else
+ return n
+ end
+end
+streams.readcardinal1=streams.readbyte
+streams.readcardinal=streams.readcardinal1
+streams.readinteger=streams.readinteger1
+function streams.readcardinal2(f)
+ local i=f[2]
+ local j=i+1
+ f[2]=j+1
+ local a,b=byte(f[1],i,j)
+ return 0x100*a+b
+end
+function streams.readcardinal2le(f)
+ local i=f[2]
+ local j=i+1
+ f[2]=j+1
+ local b,a=byte(f[1],i,j)
+ return 0x100*a+b
+end
+function streams.readinteger2(f)
+ local i=f[2]
+ local j=i+1
+ f[2]=j+1
+ local a,b=byte(f[1],i,j)
+ if a>=0x80 then
+ return 0x100*a+b-0x10000
+ else
+ return 0x100*a+b
+ end
+end
+function streams.readinteger2le(f)
+ local i=f[2]
+ local j=i+1
+ f[2]=j+1
+ local b,a=byte(f[1],i,j)
+ if a>=0x80 then
+ return 0x100*a+b-0x10000
+ else
+ return 0x100*a+b
+ end
+end
+function streams.readcardinal3(f)
+ local i=f[2]
+ local j=i+2
+ f[2]=j+1
+ local a,b,c=byte(f[1],i,j)
+ return 0x10000*a+0x100*b+c
+end
+function streams.readcardinal3le(f)
+ local i=f[2]
+ local j=i+2
+ f[2]=j+1
+ local c,b,a=byte(f[1],i,j)
+ return 0x10000*a+0x100*b+c
+end
+function streams.readinteger3(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local a,b,c=byte(f[1],i,j)
+ if a>=0x80 then
+ return 0x10000*a+0x100*b+c-0x1000000
+ else
+ return 0x10000*a+0x100*b+c
+ end
+end
+function streams.readinteger3le(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local c,b,a=byte(f[1],i,j)
+ if a>=0x80 then
+ return 0x10000*a+0x100*b+c-0x1000000
+ else
+ return 0x10000*a+0x100*b+c
+ end
+end
+function streams.readcardinal4(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local a,b,c,d=byte(f[1],i,j)
+ return 0x1000000*a+0x10000*b+0x100*c+d
+end
+function streams.readcardinal4le(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local d,c,b,a=byte(f[1],i,j)
+ return 0x1000000*a+0x10000*b+0x100*c+d
+end
+function streams.readinteger4(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local a,b,c,d=byte(f[1],i,j)
+ if a>=0x80 then
+ return 0x1000000*a+0x10000*b+0x100*c+d-0x100000000
+ else
+ return 0x1000000*a+0x10000*b+0x100*c+d
+ end
+end
+function streams.readinteger4le(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local d,c,b,a=byte(f[1],i,j)
+ if a>=0x80 then
+ return 0x1000000*a+0x10000*b+0x100*c+d-0x100000000
+ else
+ return 0x1000000*a+0x10000*b+0x100*c+d
+ end
+end
+function streams.readfixed2(f)
+ local i=f[2]
+ local j=i+1
+ f[2]=j+1
+ local n1,n2=byte(f[1],i,j)
+ if n1>=0x80 then
+ n1=n1-0x100
+ end
+ return n1+n2/0xFF
+end
+function streams.readfixed4(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local a,b,c,d=byte(f[1],i,j)
+ local n1=0x100*a+b
+ local n2=0x100*c+d
+ if n1>=0x8000 then
+ n1=n1-0x10000
+ end
+ return n1+n2/0xFFFF
+end
+if bit32 then
+ local extract=bit32.extract
+ local band=bit32.band
+ function streams.read2dot14(f)
+ local i=f[2]
+ local j=i+1
+ f[2]=j+1
+ local a,b=byte(f[1],i,j)
+ if a>=0x80 then
+ local n=-(0x100*a+b)
+ return-(extract(n,14,2)+(band(n,0x3FFF)/16384.0))
+ else
+ local n=0x100*a+b
+ return (extract(n,14,2)+(band(n,0x3FFF)/16384.0))
+ end
+ end
+end
+function streams.skipshort(f,n)
+ f[2]=f[2]+2*(n or 1)
+end
+function streams.skiplong(f,n)
+ f[2]=f[2]+4*(n or 1)
+end
+if sio and sio.readcardinal2 then
+ local readcardinal1=sio.readcardinal1
+ local readcardinal2=sio.readcardinal2
+ local readcardinal3=sio.readcardinal3
+ local readcardinal4=sio.readcardinal4
+ local readinteger1=sio.readinteger1
+ local readinteger2=sio.readinteger2
+ local readinteger3=sio.readinteger3
+ local readinteger4=sio.readinteger4
+ local readfixed2=sio.readfixed2
+ local readfixed4=sio.readfixed4
+ local read2dot14=sio.read2dot14
+ local readbytes=sio.readbytes
+ local readbytetable=sio.readbytetable
+ function streams.readcardinal1(f)
+ local i=f[2]
+ f[2]=i+1
+ return readcardinal1(f[1],i)
+ end
+ function streams.readcardinal2(f)
+ local i=f[2]
+ f[2]=i+2
+ return readcardinal2(f[1],i)
+ end
+ function streams.readcardinal3(f)
+ local i=f[2]
+ f[2]=i+3
+ return readcardinal3(f[1],i)
+ end
+ function streams.readcardinal4(f)
+ local i=f[2]
+ f[2]=i+4
+ return readcardinal4(f[1],i)
+ end
+ function streams.readinteger1(f)
+ local i=f[2]
+ f[2]=i+1
+ return readinteger1(f[1],i)
+ end
+ function streams.readinteger2(f)
+ local i=f[2]
+ f[2]=i+2
+ return readinteger2(f[1],i)
+ end
+ function streams.readinteger3(f)
+ local i=f[2]
+ f[2]=i+3
+ return readinteger3(f[1],i)
+ end
+ function streams.readinteger4(f)
+ local i=f[2]
+ f[2]=i+4
+ return readinteger4(f[1],i)
+ end
+ function streams.readfixed2(f)
+ local i=f[2]
+ f[2]=i+2
+ return readfixed2(f[1],i)
+ end
+ function streams.readfixed4(f)
+ local i=f[2]
+ f[2]=i+4
+ return readfixed4(f[1],i)
+ end
+ function streams.read2dot14(f)
+ local i=f[2]
+ f[2]=i+2
+ return read2dot14(f[1],i)
+ end
+ function streams.readbytes(f,n)
+ local i=f[2]
+ local s=f[3]
+ local p=i+n
+ if p>s then
+ f[2]=s+1
+ else
+ f[2]=p
+ end
+ return readbytes(f[1],i,n)
+ end
+ function streams.readbytetable(f,n)
+ local i=f[2]
+ local s=f[3]
+ local p=i+n
+ if p>s then
+ f[2]=s+1
+ else
+ f[2]=p
+ end
+ return readbytetable(f[1],i,n)
+ end
+ streams.readbyte=streams.readcardinal1
+ streams.readsignedbyte=streams.readinteger1
+ streams.readcardinal=streams.readcardinal1
+ streams.readinteger=streams.readinteger1
+end
+if sio and sio.readcardinaltable then
+ local readcardinaltable=sio.readcardinaltable
+ local readintegertable=sio.readintegertable
+ function utilities.streams.readcardinaltable(f,n,b)
+ local i=f[2]
+ local s=f[3]
+ local p=i+n*b
+ if p>s then
+ f[2]=s+1
+ else
+ f[2]=p
+ end
+ return readcardinaltable(f[1],i,n,b)
+ end
+ function utilities.streams.readintegertable(f,n,b)
+ local i=f[2]
+ local s=f[3]
+ local p=i+n*b
+ if p>s then
+ f[2]=s+1
+ else
+ f[2]=p
+ end
+ return readintegertable(f[1],i,n,b)
+ end
+else
+ local readcardinal1=streams.readcardinal1
+ local readcardinal2=streams.readcardinal2
+ local readcardinal3=streams.readcardinal3
+ local readcardinal4=streams.readcardinal4
+ function streams.readcardinaltable(f,n,b)
+ local i=f[2]
+ local s=f[3]
+ local p=i+n*b
+ if p>s then
+ f[2]=s+1
+ else
+ f[2]=p
+ end
+ local t={}
+ if b==1 then for i=1,n do t[i]=readcardinal1(f[1],i) end
+ elseif b==2 then for i=1,n do t[i]=readcardinal2(f[1],i) end
+ elseif b==3 then for i=1,n do t[i]=readcardinal3(f[1],i) end
+ elseif b==4 then for i=1,n do t[i]=readcardinal4(f[1],i) end end
+ return t
+ end
+ local readinteger1=streams.readinteger1
+ local readinteger2=streams.readinteger2
+ local readinteger3=streams.readinteger3
+ local readinteger4=streams.readinteger4
+ function streams.readintegertable(f,n,b)
+ local i=f[2]
+ local s=f[3]
+ local p=i+n*b
+ if p>s then
+ f[2]=s+1
+ else
+ f[2]=p
+ end
+ local t={}
+ if b==1 then for i=1,n do t[i]=readinteger1(f[1],i) end
+ elseif b==2 then for i=1,n do t[i]=readinteger2(f[1],i) end
+ elseif b==3 then for i=1,n do t[i]=readinteger3(f[1],i) end
+ elseif b==4 then for i=1,n do t[i]=readinteger4(f[1],i) end end
+ return t
+ end
+end
+do
+ local files=utilities.files
+ if files then
+ local openfile=files.open
+ local openstream=streams.open
+ local openstring=streams.openstring
+ local setmetatable=setmetatable
+ function io.newreader(str,method)
+ local f,m
+ if method=="string" then
+ f=openstring(str,true)
+ m=streams
+ elseif method=="stream" then
+ f=openstream(str,true)
+ m=streams
+ else
+ f=openfile(str,"rb")
+ m=files
+ end
+ if f then
+ local t={}
+ setmetatable(t,{
+ __index=function(t,k)
+ local r=m[k]
+ if k=="close" then
+ if f then
+ m.close(f)
+ f=nil
+ end
+ return function() end
+ elseif r then
+ local v=function(_,a,b) return r(f,a,b) end
+ t[k]=v
+ return v
+ else
+ print("unknown key",k)
+ end
+ end
+ } )
+ return t
+ end
+ end
+ end
+end
+if bit32 and not streams.tocardinal1 then
+ local extract=bit32.extract
+ local char=string.char
+ streams.tocardinal1=char
+ function streams.tocardinal2(n) return char(extract(8,8),extract(0,8)) end
+ function streams.tocardinal3(n) return char(extract(16,8),extract(8,8),extract(0,8)) end
+ function streams.tocardinal4(n) return char(extract(24,8),extract(16,8),extract(8,8),extract(0,8)) end
+ streams.tocardinal1le=char
+ function streams.tocardinal2le(n) return char(extract(0,8),extract(8,8)) end
+ function streams.tocardinal3le(n) return char(extract(0,8),extract(8,8),extract(16,8)) end
+ function streams.tocardinal4le(n) return char(extract(0,8),extract(8,8),extract(16,8),extract(24,8)) end
+end
+if not streams.readcstring then
+ local readchar=streams.readchar
+ local concat=table.concat
+ function streams.readcstring(f)
+ local t={}
+ while true do
+ local c=readchar(f)
+ if c and c~="\0" then
+ t[#t+1]=c
+ else
+ return concat(t)
+ end
+ end
+ end
+end
+
+end -- closure
do -- begin closure to overcome local limits and interference
@@ -14,12 +519,13 @@ if not modules then modules={} end modules ['util-str']={
utilities=utilities or {}
utilities.strings=utilities.strings or {}
local strings=utilities.strings
-local format,gsub,rep,sub,find=string.format,string.gsub,string.rep,string.sub,string.find
+local format,gsub,rep,sub,find,char=string.format,string.gsub,string.rep,string.sub,string.find,string.char
local load,dump=load,string.dump
local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable
local unpack,concat=table.unpack,table.concat
local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
local patterns,lpegmatch=lpeg.patterns,lpeg.match
+local tsplitat=lpeg.tsplitat
local utfchar,utfbyte,utflen=utf.char,utf.byte,utf.len
local loadstripped=function(str,shortcuts)
if shortcuts then
@@ -373,6 +879,14 @@ patterns.escapedquotes=pattern
function string.escapedquotes(s)
return lpegmatch(pattern,s)
end
+local pattern=(1-P("\\"))^1;pattern=Cs (
+ pattern*((P("\\")/""*(digit^-3/function(s) return char(tonumber(s)) end))+pattern )^1
+)
+patterns.unescapedquotes=pattern
+function string.unescapedquotes(s)
+ return lpegmatch(pattern,s) or s
+end
+string.texnewlines=lpeg.replacer(patterns.newline,"\r",true)
local preamble=""
local environment={
global=global or _G,
@@ -908,7 +1422,6 @@ function number.to16dot16(n)
return f_16_16(n/65536.0)
end
if not string.explode then
- local tsplitat=lpeg.tsplitat
local p_utf=patterns.utf8character
local p_check=C(p_utf)*(P("+")*Cc(true))^0
local p_split=Ct(C(p_utf)^0)
@@ -928,6 +1441,20 @@ if not string.explode then
end
end
end
+do
+ local p_whitespace=patterns.whitespace^1
+ local cache=setmetatable({},{ __index=function(t,k)
+ local p=tsplitat(p_whitespace*P(k)*p_whitespace)
+ local v=function(s)
+ return lpegmatch(p,s)
+ end
+ t[k]=v
+ return v
+ end })
+ function string.wordsplitter(s)
+ return cache[s]
+ end
+end
end -- closure
@@ -1552,9 +2079,6 @@ if JITSUPPORTED then
return concat(fastserialize(t,true))
end
else
- local f_v=formatters["[%q]=%q,"]
- local f_t=formatters["[%q]="]
- local f_q=formatters["%q,"]
function table.fastserialize(t,prefix)
local r={ type(prefix)=="string" and prefix or "return" }
local m=1
@@ -1963,6 +2487,21 @@ function table.ordered(t)
return function() end
end
end
+function combine(target,source)
+ if target then
+ for k,v in next,source do
+ if type(v)=="table" then
+ target[k]=combine(target[k],source[k])
+ else
+ target[k]=v
+ end
+ end
+ return target
+ else
+ return source
+ end
+end
+table.combine=combine
end -- closure
@@ -2181,8 +2720,8 @@ local noparent=1-(lparent+rparent)
local nobracket=1-(lbracket+rbracket)
local escape,left,right=P("\\"),P('{'),P('}')
lpegpatterns.balanced=P {
- [1]=((escape*(left+right))+(1-(left+right))+V(2))^0,
- [2]=left*V(1)*right
+ ((escape*(left+right))+(1-(left+right))+V(2))^0,
+ left*V(1)*right
}
local nestedbraces=P { lbrace*(nobrace+V(1))^0*rbrace }
local nestedparents=P { lparent*(noparent+V(1))^0*rparent }
@@ -2190,11 +2729,12 @@ local nestedbrackets=P { lbracket*(nobracket+V(1))^0*rbracket }
local spaces=space^0
local argument=Cs((lbrace/"")*((nobrace+nestedbraces)^0)*(rbrace/""))
local content=(1-endofstring)^0
-lpegpatterns.nestedbraces=nestedbraces
-lpegpatterns.nestedparents=nestedparents
-lpegpatterns.nested=nestedbraces
-lpegpatterns.argument=argument
-lpegpatterns.content=content
+lpegpatterns.nestedbraces=nestedbraces
+lpegpatterns.nestedparents=nestedparents
+lpegpatterns.nestedbrackets=nestedbrackets
+lpegpatterns.nested=nestedbraces
+lpegpatterns.argument=argument
+lpegpatterns.content=content
local value=lbrace*C((nobrace+nestedbraces)^0)*rbrace+C((nestedbraces+(1-comma))^0)
local key=C((1-equal-comma)^1)
local pattern_a=(space+comma)^0*(key*equal*value+key*C(""))
@@ -2600,15 +3140,24 @@ local function ranger(first,last,n,action)
action(first)
end
end
-local cardinal=lpegpatterns.cardinal/tonumber
+local cardinal=(lpegpatterns.hexadecimal+lpegpatterns.cardinal)/tonumber
local spacers=lpegpatterns.spacer^0
local endofstring=lpegpatterns.endofstring
local stepper=spacers*(cardinal*(spacers*S(":-")*spacers*(cardinal+Cc(true) )+Cc(false) )*Carg(1)*Carg(2)/ranger*S(", ")^0 )^1
local stepper=spacers*(cardinal*(spacers*S(":-")*spacers*(cardinal+(P("*")+endofstring)*Cc(true) )+Cc(false) )*Carg(1)*Carg(2)/ranger*S(", ")^0 )^1*endofstring
function parsers.stepper(str,n,action)
+ local ts=type(str)
if type(n)=="function" then
- lpegmatch(stepper,str,1,false,n or print)
- else
+ if ts=="number" then
+ n(str)
+ elseif ts=="table" then
+ for i=1,#str do
+ n(str[i])
+ end
+ else
+ lpegmatch(stepper,str,1,false,n or print)
+ end
+ elseif ts=="string" then
lpegmatch(stepper,str,1,n,action or print)
end
end
@@ -2626,7 +3175,7 @@ local cache={}
local spaces=lpegpatterns.space^0
local dummy=function() end
setmetatableindex(cache,function(t,k)
- local separator=P(k)
+ local separator=S(k)
local value=(1-separator)^0
local pattern=spaces*C(value)*separator^0*Cp()
t[k]=pattern
@@ -2706,8 +3255,11 @@ local p_year=lpegpatterns.digit^4/tonumber
local pattern=Cf(Ct("")*(
(Cg(Cc("year")*p_year)*S("-/")*Cg(Cc("month")*cardinal)*S("-/")*Cg(Cc("day")*cardinal)
)+(Cg(Cc("day")*cardinal)*S("-/")*Cg(Cc("month")*cardinal)*S("-/")*Cg(Cc("year")*p_year)
+ )+(Cg(Cc("year")*p_year)*S("-/")*Cg(Cc("month")*cardinal)
+ )+(Cg(Cc("month")*cardinal)*S("-/")*Cg(Cc("year")*p_year)
)
- )*P(" ")*Cg(Cc("hour")*cardinal)*P(":")*Cg(Cc("min")*cardinal)*(P(":")*Cg(Cc("sec")*cardinal))^-1
+ )*(
+ P(" ")*Cg(Cc("hour")*cardinal)*P(":")*Cg(Cc("min")*cardinal)*(P(":")*Cg(Cc("sec")*cardinal))^-1+P(-1) )
,rawset)
lpegpatterns.splittime=pattern
function parsers.totime(str)
@@ -2914,6 +3466,9 @@ if not modules then modules={} end modules ['util-jsn']={
copyright="PRAGMA ADE / ConTeXt Development Team",
license="see context related readme files"
}
+if utilities and utilities.json then
+ return json
+end
local P,V,R,S,C,Cc,Cs,Ct,Cf,Cg=lpeg.P,lpeg.V,lpeg.R,lpeg.S,lpeg.C,lpeg.Cc,lpeg.Cs,lpeg.Ct,lpeg.Cf,lpeg.Cg
local lpegmatch=lpeg.match
local format,gsub=string.format,string.gsub
@@ -3118,6 +3673,8 @@ do
k=lpegmatch(escaper,k) or k
v=lpegmatch(escaper,v) or v
n=n+1 t[n]=f_key_val_str(depth,k,v)
+ elseif i>1 then
+ n=n-1
end
elseif tv=="table" then
local l=#v
@@ -3133,6 +3690,8 @@ do
end
elseif next(v) then
tojsonpp(v,k,depth,level+1,0)
+ elseif i>1 then
+ n=n-1
end
elseif tv=="boolean" then
if tk=="number" then
@@ -3150,6 +3709,8 @@ do
else
t[n]=f_key_val_nop(depth,k)
end
+ elseif i>1 then
+ n=n-1
end
else
if tk=="number" then
@@ -3159,6 +3720,8 @@ do
k=lpegmatch(escaper,k) or k
n=n+1
t[n]=f_key_val_null(depth,k)
+ elseif i>1 then
+ n=n-1
end
end
end
@@ -3260,7 +3823,6 @@ do
return jsontostring(value,true)
end
end
-return json
end -- closure
@@ -3990,6 +4552,22 @@ local function showtraceback(rep)
end
end
debugger.showtraceback=showtraceback
+if luac then
+ local show,dump=luac.print,string.dump
+ function luac.inspect(v)
+ if type(v)=="function" then
+ local ok,str=xpcall(dump,function() end,v)
+ if ok then
+ v=str
+ end
+ end
+ if type(v)=="string" then
+ show(v,true)
+ else
+ print(v)
+ end
+ end
+end
end -- closure
@@ -4379,3 +4957,560 @@ function stacker.new(name)
end
end -- closure
+
+do -- begin closure to overcome local limits and interference
+
+if not modules then modules={} end modules ['util-zip']={
+ version=1.001,
+ author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright="PRAGMA ADE / ConTeXt Development Team",
+ license="see context related readme files"
+}
+local type,tostring,tonumber=type,tostring,tonumber
+local sort,concat=table.sort,table.concat
+local find,format,sub,gsub=string.find,string.format,string.sub,string.gsub
+local osdate,ostime,osclock=os.date,os.time,os.clock
+local ioopen=io.open
+local loaddata,savedata=io.loaddata,io.savedata
+local filejoin,isdir,dirname,mkdirs=file.join,lfs.isdir,file.dirname,dir.mkdirs
+local suffix,suffixes=file.suffix,file.suffixes
+local openfile=io.open
+gzip=gzip or {}
+if not zlib then
+ zlib=xzip
+elseif not xzip then
+ xzip=zlib
+end
+local files=utilities.files
+local openfile=files.open
+local closefile=files.close
+local readstring=files.readstring
+local readcardinal2=files.readcardinal2le
+local readcardinal4=files.readcardinal4le
+local setposition=files.setposition
+local getposition=files.getposition
+local band=bit32.band
+local rshift=bit32.rshift
+local lshift=bit32.lshift
+local zlibdecompress=zlib.decompress
+local zlibdecompresssize=zlib.decompresssize
+local zlibchecksum=zlib.crc32
+if not CONTEXTLMTXMODE or CONTEXTLMTXMODE==0 then
+ local cs=zlibchecksum
+ zlibchecksum=function(str,n) return cs(n or 0,str) end
+end
+local decompress=function(source) return zlibdecompress (source,-15) end
+local decompresssize=function(source,targetsize) return zlibdecompresssize(source,targetsize,-15) end
+local calculatecrc=function(buffer,initial) return zlibchecksum (initial or 0,buffer) end
+local zipfiles={}
+utilities.zipfiles=zipfiles
+local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist do
+ function openzipfile(name)
+ return {
+ name=name,
+ handle=openfile(name,0),
+ }
+ end
+ local function collect(z)
+ if not z.list then
+ local list={}
+ local hash={}
+ local position=0
+ local index=0
+ local handle=z.handle
+ while true do
+ setposition(handle,position)
+ local signature=readstring(handle,4)
+ if signature=="PK\3\4" then
+ local version=readcardinal2(handle)
+ local flag=readcardinal2(handle)
+ local method=readcardinal2(handle)
+ local filetime=readcardinal2(handle)
+ local filedate=readcardinal2(handle)
+ local crc32=readcardinal4(handle)
+ local compressed=readcardinal4(handle)
+ local uncompressed=readcardinal4(handle)
+ local namelength=readcardinal2(handle)
+ local extralength=readcardinal2(handle)
+ local filename=readstring(handle,namelength)
+ local descriptor=band(flag,8)~=0
+ local encrypted=band(flag,1)~=0
+ local acceptable=method==0 or method==8
+ local skipped=0
+ local size=0
+ if encrypted then
+ size=readcardinal2(handle)
+ skipbytes(size)
+ skipped=skipped+size+2
+ skipbytes(8)
+ skipped=skipped+8
+ size=readcardinal2(handle)
+ skipbytes(size)
+ skipped=skipped+size+2
+ size=readcardinal4(handle)
+ skipbytes(size)
+ skipped=skipped+size+4
+ size=readcardinal2(handle)
+ skipbytes(size)
+ skipped=skipped+size+2
+ end
+ position=position+30+namelength+extralength+skipped
+ if descriptor then
+ setposition(handle,position+compressed)
+ crc32=readcardinal4(handle)
+ compressed=readcardinal4(handle)
+ uncompressed=readcardinal4(handle)
+ end
+ if acceptable then
+ index=index+1
+ local data={
+ filename=filename,
+ index=index,
+ position=position,
+ method=method,
+ compressed=compressed,
+ uncompressed=uncompressed,
+ crc32=crc32,
+ encrypted=encrypted,
+ }
+ hash[filename]=data
+ list[index]=data
+ else
+ end
+ position=position+compressed
+ else
+ break
+ end
+ z.list=list
+ z.hash=hash
+ end
+ end
+ end
+ function getziplist(z)
+ local list=z.list
+ if not list then
+ collect(z)
+ end
+ return z.list
+ end
+ function getziphash(z)
+ local hash=z.hash
+ if not hash then
+ collect(z)
+ end
+ return z.hash
+ end
+ function foundzipfile(z,name)
+ return getziphash(z)[name]
+ end
+ function closezipfile(z)
+ local f=z.handle
+ if f then
+ closefile(f)
+ z.handle=nil
+ end
+ end
+ function unzipfile(z,filename,check)
+ local hash=z.hash
+ if not hash then
+ hash=zipfiles.hash(z)
+ end
+ local data=hash[filename]
+ if not data then
+ end
+ if data then
+ local handle=z.handle
+ local position=data.position
+ local compressed=data.compressed
+ if compressed>0 then
+ setposition(handle,position)
+ local result=readstring(handle,compressed)
+ if data.method==8 then
+ if decompresssize then
+ result=decompresssize(result,data.uncompressed)
+ else
+ result=decompress(result)
+ end
+ end
+ if check and data.crc32~=calculatecrc(result) then
+ print("checksum mismatch")
+ return ""
+ end
+ return result
+ else
+ return ""
+ end
+ end
+ end
+ zipfiles.open=openzipfile
+ zipfiles.close=closezipfile
+ zipfiles.unzip=unzipfile
+ zipfiles.hash=getziphash
+ zipfiles.list=getziplist
+ zipfiles.found=foundzipfile
+end
+if xzip then
+ local writecardinal1=files.writebyte
+ local writecardinal2=files.writecardinal2le
+ local writecardinal4=files.writecardinal4le
+ local logwriter=logs.writer
+ local globpattern=dir.globpattern
+ local compress=xzip.compress
+ local checksum=xzip.crc32
+ local function fromdostime(dostime,dosdate)
+ return ostime {
+ year=rshift(dosdate,9)+1980,
+ month=band(rshift(dosdate,5),0x0F),
+ day=band((dosdate ),0x1F),
+ hour=band(rshift(dostime,11) ),
+ min=band(rshift(dostime,5),0x3F),
+ sec=band((dostime ),0x1F),
+ }
+ end
+ local function todostime(time)
+ local t=osdate("*t",time)
+ return
+ lshift(t.year-1980,9)+lshift(t.month,5)+t.day,
+ lshift(t.hour,11)+lshift(t.min,5)+rshift(t.sec,1)
+ end
+ local function openzip(filename,level,comment,verbose)
+ local f=ioopen(filename,"wb")
+ if f then
+ return {
+ filename=filename,
+ handle=f,
+ list={},
+ level=tonumber(level) or 3,
+ comment=tostring(comment),
+ verbose=verbose,
+ uncompressed=0,
+ compressed=0,
+ }
+ end
+ end
+ local function writezip(z,name,data,level,time)
+ local f=z.handle
+ local list=z.list
+ local level=tonumber(level) or z.level or 3
+ local method=8
+ local zipped=compress(data,level)
+ local checksum=checksum(data)
+ local verbose=z.verbose
+ if not zipped then
+ method=0
+ zipped=data
+ end
+ local start=f:seek()
+ local compressed=#zipped
+ local uncompressed=#data
+ z.compressed=z.compressed+compressed
+ z.uncompressed=z.uncompressed+uncompressed
+ if verbose then
+ local pct=100*compressed/uncompressed
+ if pct>=100 then
+ logwriter(format("%10i %s",uncompressed,name))
+ else
+ logwriter(format("%10i %02.1f %s",uncompressed,pct,name))
+ end
+ end
+ f:write("\x50\x4b\x03\x04")
+ writecardinal2(f,0)
+ writecardinal2(f,0)
+ writecardinal2(f,method)
+ writecardinal2(f,0)
+ writecardinal2(f,0)
+ writecardinal4(f,checksum)
+ writecardinal4(f,compressed)
+ writecardinal4(f,uncompressed)
+ writecardinal2(f,#name)
+ writecardinal2(f,0)
+ f:write(name)
+ f:write(zipped)
+ list[#list+1]={ #zipped,#data,name,checksum,start,time or 0 }
+ end
+ local function closezip(z)
+ local f=z.handle
+ local list=z.list
+ local comment=z.comment
+ local verbose=z.verbose
+ local count=#list
+ local start=f:seek()
+ for i=1,count do
+ local l=list[i]
+ local compressed=l[1]
+ local uncompressed=l[2]
+ local name=l[3]
+ local checksum=l[4]
+ local start=l[5]
+ local time=l[6]
+ local date,time=todostime(time)
+ f:write('\x50\x4b\x01\x02')
+ writecardinal2(f,0)
+ writecardinal2(f,0)
+ writecardinal2(f,0)
+ writecardinal2(f,8)
+ writecardinal2(f,time)
+ writecardinal2(f,date)
+ writecardinal4(f,checksum)
+ writecardinal4(f,compressed)
+ writecardinal4(f,uncompressed)
+ writecardinal2(f,#name)
+ writecardinal2(f,0)
+ writecardinal2(f,0)
+ writecardinal2(f,0)
+ writecardinal2(f,0)
+ writecardinal4(f,0)
+ writecardinal4(f,start)
+ f:write(name)
+ end
+ local stop=f:seek()
+ local size=stop-start
+ f:write('\x50\x4b\x05\x06')
+ writecardinal2(f,0)
+ writecardinal2(f,0)
+ writecardinal2(f,count)
+ writecardinal2(f,count)
+ writecardinal4(f,size)
+ writecardinal4(f,start)
+ if type(comment)=="string" and comment~="" then
+ writecardinal2(f,#comment)
+ f:write(comment)
+ else
+ writecardinal2(f,0)
+ end
+ if verbose then
+ local compressed=z.compressed
+ local uncompressed=z.uncompressed
+ local filename=z.filename
+ local pct=100*compressed/uncompressed
+ logwriter("")
+ if pct>=100 then
+ logwriter(format("%10i %s",uncompressed,filename))
+ else
+ logwriter(format("%10i %02.1f %s",uncompressed,pct,filename))
+ end
+ end
+ f:close()
+ end
+ local function zipdir(zipname,path,level,verbose)
+ if type(zipname)=="table" then
+ verbose=zipname.verbose
+ level=zipname.level
+ path=zipname.path
+ zipname=zipname.zipname
+ end
+ if not zipname or zipname=="" then
+ return
+ end
+ if not path or path=="" then
+ path="."
+ end
+ if not isdir(path) then
+ return
+ end
+ path=gsub(path,"\\+","/")
+ path=gsub(path,"/+","/")
+ local list={}
+ local count=0
+ globpattern(path,"",true,function(name,size,time)
+ count=count+1
+ list[count]={ name,time }
+ end)
+ sort(list,function(a,b)
+ return a[1]<b[1]
+ end)
+ local zipf=openzip(zipname,level,comment,verbose)
+ if zipf then
+ local p=#path+2
+ for i=1,count do
+ local li=list[i]
+ local name=li[1]
+ local time=li[2]
+ local data=loaddata(name)
+ local name=sub(name,p,#name)
+ writezip(zipf,name,data,level,time,verbose)
+ end
+ closezip(zipf)
+ end
+ end
+ local function unzipdir(zipname,path,verbose)
+ if type(zipname)=="table" then
+ verbose=zipname.verbose
+ path=zipname.path
+ zipname=zipname.zipname
+ end
+ if not zipname or zipname=="" then
+ return
+ end
+ if not path or path=="" then
+ path="."
+ end
+ local z=openzipfile(zipname)
+ if z then
+ local list=getziplist(z)
+ if list then
+ local total=0
+ local count=#list
+ local step=number.idiv(count,10)
+ local done=0
+ local steps=verbose=="steps"
+ local time=steps and osclock()
+ for i=1,count do
+ local l=list[i]
+ local n=l.filename
+ local d=unzipfile(z,n)
+ if d then
+ local p=filejoin(path,n)
+ if mkdirs(dirname(p)) then
+ if steps then
+ total=total+#d
+ done=done+1
+ if done>=step then
+ done=0
+ logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",i,count,total,osclock()-time))
+ end
+ elseif verbose then
+ logwriter(n)
+ end
+ savedata(p,d)
+ end
+ else
+ logwriter(format("problem with file %s",n))
+ end
+ end
+ if steps then
+ logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",count,count,total,osclock()-time))
+ end
+ closezipfile(z)
+ return true
+ else
+ closezipfile(z)
+ end
+ end
+ end
+ zipfiles.zipdir=zipdir
+ zipfiles.unzipdir=unzipdir
+end
+local pattern="^\x1F\x8B\x08"
+local gziplevel=3
+function gzip.suffix(filename)
+ local suffix,extra=suffixes(filename)
+ local gzipped=extra=="gz"
+ return suffix,gzipped
+end
+function gzip.compressed(s)
+ return s and find(s,pattern)
+end
+local getdecompressed
+local putcompressed
+if gzip.compress then
+ local gzipwindow=15+16
+ local compress=zlib.compress
+ local decompress=zlib.decompress
+ getdecompressed=function(str)
+ return decompress(str,gzipwindow)
+ end
+ putcompressed=function(str,level)
+ return compress(str,level or gziplevel,nil,gzipwindow)
+ end
+else
+ local gzipwindow=-15
+ local identifier="\x1F\x8B"
+ local compress=zlib.compress
+ local decompress=zlib.decompress
+ local zlibchecksum=zlib.crc32
+ if not CONTEXTLMTXMODE or CONTEXTLMTXMODE==0 then
+ local cs=zlibchecksum
+ zlibchecksum=function(str,n) return cs(n or 0,str) end
+ end
+ local streams=utilities.streams
+ local openstream=streams.openstring
+ local closestream=streams.close
+ local getposition=streams.getposition
+ local readbyte=streams.readbyte
+ local readcardinal4=streams.readcardinal4le
+ local readcardinal2=streams.readcardinal2le
+ local readstring=streams.readstring
+ local readcstring=streams.readcstring
+ local skipbytes=streams.skip
+ local tocardinal1=streams.tocardinal1
+ local tocardinal4=streams.tocardinal4le
+ getdecompressed=function(str)
+ local s=openstream(str)
+ local identifier=readstring(s,2)
+ local method=readbyte(s,1)
+ local flags=readbyte(s,1)
+ local timestamp=readcardinal4(s)
+ local compression=readbyte(s,1)
+ local operating=readbyte(s,1)
+ local isjusttext=band(flags,0x01)~=0 and true or false
+ local extrasize=band(flags,0x04)~=0 and readcardinal2(s) or 0
+ local filename=band(flags,0x08)~=0 and readcstring(s) or ""
+ local comment=band(flags,0x10)~=0 and readcstring(s) or ""
+ local checksum=band(flags,0x02)~=0 and readcardinal2(s) or 0
+ local compressed=readstring(s,#str)
+ local data=decompress(compressed,gzipwindow)
+ return data
+ end
+ putcompressed=function(str,level,originalname)
+ return concat {
+ identifier,
+ tocardinal1(0x08),
+ tocardinal1(0x08),
+ tocardinal4(os.time()),
+ tocardinal1(0x02),
+ tocardinal1(0xFF),
+ (originalname or "unknownname").."\0",
+ compress(str,level,nil,gzipwindow),
+ tocardinal4(zlibchecksum(str)),
+ tocardinal4(#str),
+ }
+ end
+end
+function gzip.load(filename)
+ local f=openfile(filename,"rb")
+ if not f then
+ else
+ local data=f:read("*all")
+ f:close()
+ if data and data~="" then
+ if suffix(filename)=="gz" then
+ data=getdecompressed(data)
+ end
+ return data
+ end
+ end
+end
+function gzip.save(filename,data,level,originalname)
+ if suffix(filename)~="gz" then
+ filename=filename..".gz"
+ end
+ local f=openfile(filename,"wb")
+ if f then
+ data=putcompressed(data or "",level or gziplevel,originalname)
+ f:write(data)
+ f:close()
+ return #data
+ end
+end
+function gzip.compress(s,level)
+ if s and not find(s,pattern) then
+ if not level then
+ level=gziplevel
+ elseif level<=0 then
+ return s
+ elseif level>9 then
+ level=9
+ end
+ return putcompressed(s,level or gziplevel) or s
+ end
+end
+function gzip.decompress(s)
+ if s and find(s,pattern) then
+ return getdecompressed(s)
+ else
+ return s
+ end
+end
+
+end -- closure
diff --git a/macros/luatex/generic/lualibs/lualibs-file.lua b/macros/luatex/generic/lualibs/lualibs-file.lua
index d0af94f09d..9f8fd65483 100644
--- a/macros/luatex/generic/lualibs/lualibs-file.lua
+++ b/macros/luatex/generic/lualibs/lualibs-file.lua
@@ -456,7 +456,7 @@ function file.join(one, two, three, ...)
if not two then
return one == "" and one or lpegmatch(reslasher,one)
end
- if one == "" then
+ if not one or one == "" then
return lpegmatch(stripper,three and concat({ two, three, ... },"/") or two)
end
if lpegmatch(isnetwork,one) then
diff --git a/macros/luatex/generic/lualibs/lualibs-gzip.lua b/macros/luatex/generic/lualibs/lualibs-gzip.lua
deleted file mode 100644
index f141b5ebbb..0000000000
--- a/macros/luatex/generic/lualibs/lualibs-gzip.lua
+++ /dev/null
@@ -1,180 +0,0 @@
-if not modules then modules = { } end modules ['l-gzip'] = {
- version = 1.001,
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- We only have a few official methods here:
---
--- local decompressed = gzip.load (filename)
--- local resultsize = gzip.save (filename,compresslevel)
--- local compressed = gzip.compress (str,compresslevel)
--- local decompressed = gzip.decompress (str)
--- local iscompressed = gzip.compressed (str)
--- local suffix, okay = gzip.suffix (filename)
---
--- In LuaMetaTeX we have only xzip which implements a very few methods:
---
--- compress (str,level,method,window,memory,strategy)
--- decompress (str,window)
--- adler32 (str,checksum)
--- crc32 (str,checksum)
---
--- Special window values are:
---
--- flate : - 15
--- zlib : 15
--- gzip : 15 | 16
--- auto : 15 | 32
-
-gzip = gzip or { } -- so in luatex we keep the old ones too
-
-if not zlib then
- zlib = xzip -- in luametatex we shadow the old one
-elseif not xzip then
- xzip = zlib
-end
-
-if zlib then
-
- local suffix = file.suffix
- local suffixes = file.suffixes
- local find = string.find
- local openfile = io.open
-
- local gzipwindow = 15 + 16 -- +16: gzip, +32: gzip|zlib
- local gziplevel = 3
- local identifier = "^\x1F\x8B\x08"
-
- local compress = zlib.compress
- local decompress = zlib.decompress
-
- function gzip.load(filename)
- local f = openfile(filename,"rb")
- if not f then
- -- invalid file
- else
- local data = f:read("*all")
- f:close()
- if data and data ~= "" then
- if suffix(filename) == "gz" then
- data = decompress(data,gzipwindow)
- end
- return data
- end
- end
- end
-
- function gzip.save(filename,data,level)
- if suffix(filename) ~= "gz" then
- filename = filename .. ".gz"
- end
- local f = openfile(filename,"wb")
- if f then
- data = compress(data or "",level or gziplevel,nil,gzipwindow)
- f:write(data)
- f:close()
- return #data
- end
- end
-
- function gzip.suffix(filename)
- local suffix, extra = suffixes(filename)
- local gzipped = extra == "gz"
- return suffix, gzipped
- end
-
- function gzip.compressed(s)
- return s and find(s,identifier)
- end
-
- function gzip.compress(s,level)
- if s and not find(s,identifier) then -- the find check might go away
- if not level then
- level = gziplevel
- elseif level <= 0 then
- return s
- elseif level > 9 then
- level = 9
- end
- return compress(s,level or gziplevel,nil,gzipwindow) or s
- end
- end
-
- function gzip.decompress(s)
- if s and find(s,identifier) then
- return decompress(s,gzipwindow)
- else
- return s
- end
- end
-
-end
-
--- In luametatex we can use this one but it doesn't look like there wil be stream
--- support so for now we still use zlib (the performance difference is not that
--- spectacular in our usage.
-
--- if flate then
---
--- local type = type
--- local find = string.find
---
--- local compress = flate.gz_compress
--- local decompress = flate.gz_decompress
---
--- local absmax = 128*1024*1024
--- local initial = 64*1024
--- local identifier = "^\x1F\x8B\x08"
---
--- function gzip.compressed(s)
--- return s and find(s,identifier)
--- end
---
--- function gzip.compress(s,level)
--- if s and not find(s,identifier) then -- the find check might go away
--- if not level then
--- level = 3
--- elseif level <= 0 then
--- return s
--- elseif level > 9 then
--- level = 9
--- end
--- return compress(s,level) or s
--- end
--- end
---
--- function gzip.decompress(s,size,iterate)
--- if s and find(s,identifier) then
--- if type(size) ~= "number" then
--- size = initial
--- end
--- if size > absmax then
--- size = absmax
--- end
--- if type(iterate) == "number" then
--- max = size * iterate
--- elseif iterate == nil or iterate == true then
--- iterate = true
--- max = absmax
--- end
--- if max > absmax then
--- max = absmax
--- end
--- while true do
--- local d = decompress(s,size)
--- if d then
--- return d
--- end
--- size = 2 * size
--- if not iterate or size > max then
--- return false
--- end
--- end
--- else
--- return s
--- end
--- end
---
--- end
diff --git a/macros/luatex/generic/lualibs/lualibs-io.lua b/macros/luatex/generic/lualibs/lualibs-io.lua
index a955262a31..6bf7a97bda 100644
--- a/macros/luatex/generic/lualibs/lualibs-io.lua
+++ b/macros/luatex/generic/lualibs/lualibs-io.lua
@@ -147,9 +147,12 @@ function io.copydata(source,target,action)
end
end
-function io.savedata(filename,data,joiner)
- local f = open(filename,"wb")
+function io.savedata(filename,data,joiner,append)
+ local f = open(filename,append and "ab" or "wb")
if f then
+ if append and joiner and f:seek("end") > 0 then
+ f:write(joiner)
+ end
if type(data) == "table" then
f:write(concat(data,joiner or ""))
elseif type(data) == "function" then
@@ -288,7 +291,8 @@ end
io.noflines = noflines
--- inlined is faster ... beware, better use util-fil
+-- inlined is faster ... beware, better use util-fil so these are obsolete
+-- and will go
local nextchar = {
[ 4] = function(f)
diff --git a/macros/luatex/generic/lualibs/lualibs-lpeg.lua b/macros/luatex/generic/lualibs/lualibs-lpeg.lua
index 50306e4ab6..5f3bea08ca 100644
--- a/macros/luatex/generic/lualibs/lualibs-lpeg.lua
+++ b/macros/luatex/generic/lualibs/lualibs-lpeg.lua
@@ -665,12 +665,12 @@ end
-- lpeg.print(lpeg.P("a","b","c"))
-- lpeg.print(lpeg.S("a","b","c"))
--- print(lpeg.count("äáàa",lpeg.P("á") + lpeg.P("à")))
--- print(lpeg.count("äáàa",lpeg.UP("áà")))
--- print(lpeg.count("äáàa",lpeg.US("àá")))
--- print(lpeg.count("äáàa",lpeg.UR("aá")))
--- print(lpeg.count("äáàa",lpeg.UR("àá")))
--- print(lpeg.count("äáàa",lpeg.UR(0x0000,0xFFFF)))
+-- print(lpeg.counter(lpeg.P("á") + lpeg.P("à"))("äáàa"))
+-- print(lpeg.counter(lpeg.UP("áà"))("äáàa"))
+-- print(lpeg.counter(lpeg.US("àá"))("äáàa"))
+-- print(lpeg.counter(lpeg.UR("aá"))("äáàa"))
+-- print(lpeg.counter(lpeg.UR("àá"))("äáàa"))
+-- print(lpeg.counter(lpeg.UR(0x0000,0xFFFF)))
function lpeg.is_lpeg(p)
return p and lpegtype(p) == "pattern"
diff --git a/macros/luatex/generic/lualibs/lualibs-math.lua b/macros/luatex/generic/lualibs/lualibs-math.lua
index e5668a5db0..6105bc3c2d 100644
--- a/macros/luatex/generic/lualibs/lualibs-math.lua
+++ b/macros/luatex/generic/lualibs/lualibs-math.lua
@@ -14,9 +14,19 @@ end
if not math.round then
- local floor = math.floor
+ if xmath then
+
+ math.round = xmath.round
+
+ else
- function math.round(x) return floor(x + 0.5) end
+ local floor = math.floor
+
+ function math.round(x)
+ return x < 0 and -floor(-x + 0.5) or floor(x + 0.5)
+ end
+
+ end
end
@@ -141,7 +151,7 @@ if not math.ult then
local floor = math.floor
- function math.tointeger(m,n)
+ function math.ult(m,n)
-- not ok but i'm not motivated to look into it now
return floor(m) < floor(n) -- unsigned comparison needed
end
diff --git a/macros/luatex/generic/lualibs/lualibs-os.lua b/macros/luatex/generic/lualibs/lualibs-os.lua
index c7584ccce9..faae76881a 100644
--- a/macros/luatex/generic/lualibs/lualibs-os.lua
+++ b/macros/luatex/generic/lualibs/lualibs-os.lua
@@ -26,22 +26,27 @@ if not modules then modules = { } end modules ['l-os'] = {
-- math.randomseed(tonumber(string.sub(string.reverse(tostring(math.floor(socket.gettime()*10000))),1,6)))
local os = os
-local date, time = os.date, os.time
+local date, time, difftime = os.date, os.time, os.difftime
local find, format, gsub, upper, gmatch = string.find, string.format, string.gsub, string.upper, string.gmatch
local concat = table.concat
-local random, ceil, randomseed = math.random, math.ceil, math.randomseed
+local random, ceil, randomseed, modf = math.random, math.ceil, math.randomseed, math.modf
local type, setmetatable, tonumber, tostring = type, setmetatable, tonumber, tostring
-- This check needs to happen real early on. Todo: we can pick it up from the commandline
-- if we pass --binpath= (which is useful anyway)
do
+
local selfdir = os.selfdir
+
if selfdir == "" then
selfdir = nil
end
+
if not selfdir then
+
-- We need a fallback plan so let's see what we get.
+
if arg then
-- passed by mtx-context ... saves network access
for i=1,#arg do
@@ -52,6 +57,7 @@ do
end
end
end
+
if not selfdir then
selfdir = os.selfbin or "luatex"
if find(selfdir,"[/\\]") then
@@ -92,11 +98,16 @@ do
end
end
end
+
-- let's hope we're okay now
+
os.selfdir = selfdir or "."
+
end
+
+ -- print(os.selfdir) os.exit()
+
end
--- print(os.selfdir) os.exit()
-- The following code permits traversing the environment table, at least in luatex. Internally all
-- environment names are uppercase.
@@ -157,7 +168,7 @@ if not os.__getenv__ then
end
function os.getenv(k)
- local K = upper(k)
+ local K = upper(k) -- hm utf
local v = osenv[K] or osgetenv(K) or osgetenv(k)
if v == "" then
return nil
@@ -183,32 +194,14 @@ end
-- end of environment hack
-local execute = os.execute
-local iopopen = io.popen
-
-local function resultof(command)
- local handle = iopopen(command,"r") -- already has flush
- if handle then
- local result = handle:read("*all") or ""
- handle:close()
- return result
- else
- return ""
- end
-end
-
-os.resultof = resultof
-
-function os.pipeto(command)
- return iopopen(command,"w") -- already has flush
-end
-
if not io.fileseparator then
+
if find(os.getenv("PATH"),";",1,true) then
io.fileseparator, io.pathseparator, os.type = "\\", ";", os.type or "windows"
else
io.fileseparator, io.pathseparator, os.type = "/" , ":", os.type or "unix"
end
+
end
os.type = os.type or (io.pathseparator == ";" and "windows") or "unix"
@@ -220,351 +213,370 @@ else
os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' }
end
-local launchers = {
- windows = "start %s",
- macosx = "open %s",
- unix = "xdg-open %s &> /dev/null &",
-}
+do
-function os.launch(str)
- local command = format(launchers[os.name] or launchers.unix,str)
- -- todo: pcall
--- print(command)
- execute(command)
-end
+ local execute = os.execute
+ local iopopen = io.popen
+ local ostype = os.type
+
+ local function resultof(command)
+ -- already has flush, b is new and we need it to pipe xz output
+ local handle = iopopen(command,ostype == "windows" and "rb" or "r")
+ if handle then
+ local result = handle:read("*all") or ""
+ handle:close()
+ return result
+ else
+ return ""
+ end
+ end
-local gettimeofday = os.gettimeofday or os.clock
-os.gettimeofday = gettimeofday
+ os.resultof = resultof
-local startuptime = gettimeofday()
+ function os.pipeto(command)
+ return iopopen(command,"w") -- already has flush
+ end
-function os.runtime()
- return gettimeofday() - startuptime
-end
+ local launchers = {
+ windows = "start %s",
+ macosx = "open %s",
+ unix = "xdg-open %s &> /dev/null &",
+ }
+
+ function os.launch(str)
+ local command = format(launchers[os.name] or launchers.unix,str)
+ -- todo: pcall
+ -- print(command)
+ execute(command)
+ end
--- print(os.gettimeofday()-os.time())
--- os.sleep(1.234)
--- print (">>",os.runtime())
--- print(os.date("%H:%M:%S",os.gettimeofday()))
--- print(os.date("%H:%M:%S",os.time()))
+end
--- no need for function anymore as we have more clever code and helpers now
--- this metatable trickery might as well disappear
+do
-local resolvers = os.resolvers or { }
-os.resolvers = resolvers
+ local gettimeofday = os.gettimeofday or os.clock
+ os.gettimeofday = gettimeofday
-setmetatable(os, { __index = function(t,k)
- local r = resolvers[k]
- return r and r(t,k) or nil -- no memoize
-end })
+ local startuptime = gettimeofday()
--- we can use HOSTTYPE on some platforms
+ function os.runtime()
+ return gettimeofday() - startuptime
+ end
-local name, platform = os.name or "linux", os.getenv("MTX_PLATFORM") or ""
+ -- print(os.gettimeofday()-os.time())
+ -- os.sleep(1.234)
+ -- print (">>",os.runtime())
+ -- print(os.date("%H:%M:%S",os.gettimeofday()))
+ -- print(os.date("%H:%M:%S",os.time()))
--- local function guess()
--- local architecture = resultof("uname -m") or ""
--- if architecture ~= "" then
--- return architecture
--- end
--- architecture = os.getenv("HOSTTYPE") or ""
--- if architecture ~= "" then
--- return architecture
--- end
--- return resultof("echo $HOSTTYPE") or ""
--- end
+end
+-- We can use HOSTTYPE on some platforms (but not consistently on e.g. Linux).
+--
-- os.bits = 32 | 64
+--
+-- os.uname() : return {
+-- machine = "x86_64",
+-- nodename = "MYLAPTOP",
+-- release = "build 9200",
+-- sysname = "Windows",
+-- version = "6.02",
+-- }
--- os.uname()
--- sysname
--- machine
--- release
--- version
--- nodename
-
-if platform ~= "" then
+do
- os.platform = platform
+ local name = os.name or "linux"
+ local platform = os.getenv("MTX_PLATFORM") or ""
+ local architecture = os.uname and os.uname().machine -- lmtx
+ local bits = os.getenv("MTX_BITS") or find(platform,"64") and 64 or 32
-elseif os.type == "windows" then
+ if platform ~= "" then
- -- we could set the variable directly, no function needed here
+ -- we're okay already
- -- PROCESSOR_ARCHITECTURE : binary platform
- -- PROCESSOR_ARCHITEW6432 : OS platform
+ elseif os.type == "windows" then
- -- mswin-64 is now win64
+ -- PROCESSOR_ARCHITECTURE : binary platform
+ -- PROCESSOR_ARCHITEW6432 : OS platform
- function resolvers.platform(t,k)
- local architecture = os.getenv("PROCESSOR_ARCHITECTURE") or ""
- local platform = ""
- if find(architecture,"AMD64",1,true) then
- platform = "win64"
+ architecture = string.lower(architecture or os.getenv("PROCESSOR_ARCHITECTURE") or "")
+ if architecture == "x86_64" then
+ bits, platform = 64, "win64"
+ elseif find(architecture,"amd64") then
+ bits, platform = 64, "win64"
+ elseif find(architecture,"arm64") then
+ bits, platform = 64, "windows-arm64"
+ elseif find(architecture,"arm32") then
+ bits, platform = 32, "windows-arm32"
else
- platform = "mswin"
+ bits, platform = 32, "mswin"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "linux" then
-
- function resolvers.platform(t,k)
- -- we sometimes have HOSTTYPE set so let's check that first
- local architecture = os.getenv("HOSTTYPE") or resultof("uname -m") or ""
- local platform = os.getenv("MTX_PLATFORM") or ""
- local musl = find(os.selfdir or "","linuxmusl")
- if platform ~= "" then
- -- we're done
- elseif find(architecture,"x86_64",1,true) then
- platform = musl and "linuxmusl" or "linux-64"
- elseif find(architecture,"ppc",1,true) then
- platform = "linux-ppc"
+ elseif name == "linux" then
+
+ -- There is no way to detect if musl is used because there is no __MUSL__
+ -- and it looks like there never will be. Folks don't care about cases where
+ -- one ships multipe binaries (as with TeX distibutions) and want to select
+ -- the right one. So probably it expects users to compile locally in which
+ -- case we don't care to much as they can then sort it out.
+
+ architecture = architecture or os.getenv("HOSTTYPE") or resultof("uname -m") or ""
+ local musl = find(os.selfdir or "","linuxmusl")
+ if find(architecture,"x86_64") then
+ bits, platform = 64, musl and "linuxmusl" or "linux-64"
+ elseif find(architecture,"ppc") then
+ bits, platform = 32, "linux-ppc" -- this will be dropped
else
- platform = musl and "linuxmusl" or "linux"
+ bits, platform = 32, musl and "linuxmusl" or "linux"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "macosx" then
-
- --[[
- Identifying the architecture of OSX is quite a mess and this
- is the best we can come up with. For some reason $HOSTTYPE is
- a kind of pseudo environment variable, not known to the current
- environment. And yes, uname cannot be trusted either, so there
- is a change that you end up with a 32 bit run on a 64 bit system.
- Also, some proper 64 bit intel macs are too cheap (low-end) and
- therefore not permitted to run the 64 bit kernel.
- ]]--
-
- function resolvers.platform(t,k)
- -- local platform = ""
- -- local architecture = os.getenv("HOSTTYPE") or ""
- -- if architecture == "" then
- -- architecture = resultof("echo $HOSTTYPE") or ""
- -- end
- local architecture = resultof("echo $HOSTTYPE") or ""
- local platform = ""
+ elseif name == "macosx" then
+
+ -- Identifying the architecture of OSX is quite a mess and this is the best
+ -- we can come up with. For some reason $HOSTTYPE is a kind of pseudo
+ -- environment variable, not known to the current environment. And yes,
+ -- uname cannot be trusted either, so there is a change that you end up with
+ -- a 32 bit run on a 64 bit system. Also, some proper 64 bit intel macs are
+ -- too cheap (low-end) and therefore not permitted to run the 64 bit kernel.
+
+ architecture = architecture or resultof("echo $HOSTTYPE") or ""
if architecture == "" then
- -- print("\nI have no clue what kind of OSX you're running so let's assume an 32 bit intel.\n")
- platform = "osx-intel"
- elseif find(architecture,"i386",1,true) then
- platform = "osx-intel"
- elseif find(architecture,"x86_64",1,true) then
- platform = "osx-64"
- elseif find(architecture,"arm64",1,true) then
- platform = "osx-arm"
+ bits, platform = 64, "osx-intel"
+ elseif find(architecture,"i386") then
+ bits, platform = 64, "osx-intel"
+ elseif find(architecture,"x86_64") then
+ bits, platform = 64, "osx-64"
+ elseif find(architecture,"arm64") then
+ bits, platform = 64, "osx-arm"
else
- platform = "osx-ppc"
+ bits, platform = 32, "osx-ppc"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "sunos" then
+ elseif name == "sunos" then
- function resolvers.platform(t,k)
- local architecture = resultof("uname -m") or ""
- local platform = ""
- if find(architecture,"sparc",1,true) then
- platform = "solaris-sparc"
+ architecture = architecture or resultof("uname -m") or ""
+ if find(architecture,"sparc") then
+ bits, platform = 32, "solaris-sparc"
else -- if architecture == 'i86pc'
- platform = "solaris-intel"
+ bits, platform = 32, "solaris-intel"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "freebsd" then
+ elseif name == "freebsd" then
- function resolvers.platform(t,k)
- local architecture = resultof("uname -m") or ""
- local platform = ""
- if find(architecture,"amd64",1,true) then
- platform = "freebsd-amd64"
+ architecture = architecture or os.getenv("MACHTYPE") or resultof("uname -m") or ""
+ if find(architecture,"amd64") or find(architecture,"AMD64") then
+ bits, platform = 64, "freebsd-amd64"
else
- platform = "freebsd"
+ bits, platform = 32, "freebsd"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "kfreebsd" then
+ elseif name == "kfreebsd" then
- function resolvers.platform(t,k)
- -- we sometimes have HOSTTYPE set so let's check that first
- local architecture = os.getenv("HOSTTYPE") or resultof("uname -m") or ""
- local platform = ""
- if find(architecture,"x86_64",1,true) then
- platform = "kfreebsd-amd64"
+ architecture = architecture or os.getenv("HOSTTYPE") or resultof("uname -m") or ""
+ if architecture == "x86_64" then
+ bits, platform = 64, "kfreebsd-amd64"
else
- platform = "kfreebsd-i386"
+ bits, platform = 32, "kfreebsd-i386"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-else
+ else
- -- platform = "linux"
- -- os.setenv("MTX_PLATFORM",platform)
- -- os.platform = platform
+ architecture = architecture or resultof("uname -m") or ""
+
+ if find(architecture,"aarch64") then
+ bits, platform = "linux-aarch64"
+ elseif find(architecture,"armv7l") then
+ -- linux-armel
+ bits, platform = 32, "linux-armhf"
+ elseif find(architecture,"mips64") or find(architecture,"mips64el") then
+ bits, platform = 64, "linux-mipsel"
+ elseif find(architecture,"mipsel") or find(architecture,"mips") then
+ bits, platform = 32, "linux-mipsel"
+ else
+ bits, platform = 64, "linux-64" -- was 32, "linux"
+ end
- function resolvers.platform(t,k)
- local platform = "linux"
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
end
-end
+ os.setenv("MTX_PLATFORM",platform)
+ os.setenv("MTX_BITS", bits)
-os.newline = name == "windows" and "\013\010" or "\010" -- crlf or lf
+ os.platform = platform
+ os.bits = bits
+ os.newline = name == "windows" and "\013\010" or "\010" -- crlf or lf
-function resolvers.bits(t,k)
- local bits = find(os.platform,"64",1,true) and 64 or 32
- os.bits = bits
- return bits
end
-- beware, we set the randomseed
--- from wikipedia: Version 4 UUIDs use a scheme relying only on random numbers. This algorithm sets the
--- version number as well as two reserved bits. All other bits are set using a random or pseudorandom
--- data source. Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal
--- digits x and hexadecimal digits 8, 9, A, or B for y. e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479.
---
--- as we don't call this function too often there is not so much risk on repetition
-
-local t = { 8, 9, "a", "b" }
-
-function os.uuid()
- return format("%04x%04x-4%03x-%s%03x-%04x-%04x%04x%04x",
- random(0xFFFF),random(0xFFFF),
- random(0x0FFF),
- t[ceil(random(4))] or 8,random(0x0FFF),
- random(0xFFFF),
- random(0xFFFF),random(0xFFFF),random(0xFFFF)
- )
+-- From wikipedia: Version 4 UUIDs use a scheme relying only on random numbers. This
+-- algorithm sets the version number as well as two reserved bits. All other bits
+-- are set using a random or pseudorandom data source. Version 4 UUIDs have the form
+-- xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal digits x and hexadecimal
+-- digits 8, 9, A, or B for y. e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479. As we don't
+-- call this function too often there is not so much risk on repetition.
+
+do
+
+ local t = { 8, 9, "a", "b" }
+
+ function os.uuid()
+ return format("%04x%04x-4%03x-%s%03x-%04x-%04x%04x%04x",
+ random(0xFFFF),random(0xFFFF),
+ random(0x0FFF),
+ t[ceil(random(4))] or 8,random(0x0FFF),
+ random(0xFFFF),
+ random(0xFFFF),random(0xFFFF),random(0xFFFF)
+ )
+ end
+
end
-local d
+do
-function os.timezone(delta)
- d = d or ((tonumber(date("%H")) or 0) - (tonumber(date("!%H")) or 0))
- if delta then
- if d > 0 then
- return format("+%02i:00",d)
+ -- this is fragile because it depends on time and so we only check once during
+ -- a run (the computer doesn't move zones) .. Michal Vlasák made a better one
+
+ -- local d
+ --
+ -- function os.timezone()
+ -- d = d or ((tonumber(date("%H")) or 0) - (tonumber(date("!%H")) or 0))
+ -- if d > 0 then
+ -- return format("+%02i:00",d)
+ -- else
+ -- return format("-%02i:00",-d)
+ -- end
+ -- end
+
+ local hour, min
+
+ function os.timezone(difference)
+ if not hour then
+ -- somehow looks too complex:
+ local current = time()
+ local utcdate = date("!*t", current)
+ local localdate = date("*t", current)
+ localdate.isdst = false
+ local timediff = difftime(time(localdate), time(utcdate))
+ hour, min = modf(timediff / 3600)
+ min = min * 60
+ end
+ if difference then
+ return hour, min
else
- return format("-%02i:00",-d)
+ return format("%+03d:%02d",hour,min) -- %+ means: always show sign
end
- else
- return 1
end
-end
-local timeformat = format("%%s%s",os.timezone(true))
-local dateformat = "!%Y-%m-%d %H:%M:%S"
-local lasttime = nil
-local lastdate = nil
-
-function os.fulltime(t,default)
- t = t and tonumber(t) or 0
- if t > 0 then
- -- valid time
- elseif default then
- return default
- else
- t = time()
- end
- if t ~= lasttime then
- lasttime = t
- lastdate = format(timeformat,date(dateformat))
+ -- localtime with timezone: 2021-10-22 10:22:54+02:00
+
+ local timeformat = format("%%s%s",os.timezone())
+ local dateformat = "%Y-%m-%d %H:%M:%S"
+ local lasttime = nil
+ local lastdate = nil
+
+ function os.fulltime(t,default)
+ t = t and tonumber(t) or 0
+ if t > 0 then
+ -- valid time
+ elseif default then
+ return default
+ else
+ t = time()
+ end
+ if t ~= lasttime then
+ lasttime = t
+ lastdate = format(timeformat,date(dateformat))
+ end
+ return lastdate
end
- return lastdate
-end
-local dateformat = "%Y-%m-%d %H:%M:%S"
-local lasttime = nil
-local lastdate = nil
+ -- localtime without timezone: 2021-10-22 10:22:54
-function os.localtime(t,default)
- t = t and tonumber(t) or 0
- if t > 0 then
- -- valid time
- elseif default then
- return default
- else
- t = time()
+ local dateformat = "%Y-%m-%d %H:%M:%S"
+ local lasttime = nil
+ local lastdate = nil
+
+ function os.localtime(t,default)
+ t = t and tonumber(t) or 0
+ if t > 0 then
+ -- valid time
+ elseif default then
+ return default
+ else
+ t = time()
+ end
+ if t ~= lasttime then
+ lasttime = t
+ lastdate = date(dateformat,t)
+ end
+ return lastdate
end
- if t ~= lasttime then
- lasttime = t
- lastdate = date(dateformat,t)
+
+ function os.converttime(t,default)
+ local t = tonumber(t)
+ if t and t > 0 then
+ return date(dateformat,t)
+ else
+ return default or "-"
+ end
end
- return lastdate
-end
-function os.converttime(t,default)
- local t = tonumber(t)
- if t and t > 0 then
- return date(dateformat,t)
- else
- return default or "-"
+ -- table with values
+
+ function os.today()
+ return date("!*t")
+ end
+
+ -- utc time without timezone: 2021-10-22 08:22:54
+
+ function os.now()
+ return date("!%Y-%m-%d %H:%M:%S")
end
+
end
-local memory = { }
-
-local function which(filename)
- local fullname = memory[filename]
- if fullname == nil then
- local suffix = file.suffix(filename)
- local suffixes = suffix == "" and os.binsuffixes or { suffix }
- for directory in gmatch(os.getenv("PATH"),"[^" .. io.pathseparator .."]+") do
- local df = file.join(directory,filename)
- for i=1,#suffixes do
- local dfs = file.addsuffix(df,suffixes[i])
- if io.exists(dfs) then
- fullname = dfs
- break
+do
+
+ local cache = { }
+
+ local function which(filename)
+ local fullname = cache[filename]
+ if fullname == nil then
+ local suffix = file.suffix(filename)
+ local suffixes = suffix == "" and os.binsuffixes or { suffix }
+ for directory in gmatch(os.getenv("PATH"),"[^" .. io.pathseparator .."]+") do
+ local df = file.join(directory,filename)
+ for i=1,#suffixes do
+ local dfs = file.addsuffix(df,suffixes[i])
+ if io.exists(dfs) then
+ fullname = dfs
+ break
+ end
end
end
+ if not fullname then
+ fullname = false
+ end
+ cache[filename] = fullname
end
- if not fullname then
- fullname = false
- end
- memory[filename] = fullname
+ return fullname
end
- return fullname
-end
-os.which = which
-os.where = which
+ os.which = which
+ os.where = which
-function os.today()
- return date("!*t") -- table with values
-end
+ -- print(os.which("inkscape.exe"))
+ -- print(os.which("inkscape"))
+ -- print(os.which("gs.exe"))
+ -- print(os.which("ps2pdf"))
-function os.now()
- return date("!%Y-%m-%d %H:%M:%S") -- 2011-12-04 14:59:12
end
--- if not os.sleep and socket then
--- os.sleep = socket.sleep
--- end
-
if not os.sleep then
+
local socket = socket
+
function os.sleep(n)
if not socket then
-- so we delay ... if os.sleep is really needed then one should also
@@ -573,101 +585,105 @@ if not os.sleep then
end
socket.sleep(n)
end
-end
-
--- print(os.which("inkscape.exe"))
--- print(os.which("inkscape"))
--- print(os.which("gs.exe"))
--- print(os.which("ps2pdf"))
-
--- These are moved from core-con.lua (as I needed them elsewhere).
-local function isleapyear(year) -- timed for bram's cs practicum
- -- return (year % 400 == 0) or (year % 100 ~= 0 and year % 4 == 0) -- 3:4:1600:1900 = 9.9 : 8.2 : 5.0 : 6.8 (29.9)
- return (year % 4 == 0) and (year % 100 ~= 0 or year % 400 == 0) -- 3:4:1600:1900 = 5.1 : 6.5 : 8.1 : 10.2 (29.9)
- -- return (year % 4 == 0) and (year % 400 == 0 or year % 100 ~= 0) -- 3:4:1600:1900 = 5.2 : 8.5 : 6.8 : 10.1 (30.6)
end
-os.isleapyear = isleapyear
+-- These are moved from core-con.lua (as I needed them elsewhere).
--- nicer:
---
--- local days = {
--- [false] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
--- [true] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
--- }
---
--- local function nofdays(year,month)
--- return days[isleapyear(year)][month]
--- return month == 2 and isleapyear(year) and 29 or days[month]
--- end
---
--- more efficient:
+do
-local days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+ local function isleapyear(year) -- timed for bram's cs practicum
+ -- return (year % 400 == 0) or (year % 100 ~= 0 and year % 4 == 0) -- 3:4:1600:1900 = 9.9 : 8.2 : 5.0 : 6.8 (29.9)
+ return (year % 4 == 0) and (year % 100 ~= 0 or year % 400 == 0) -- 3:4:1600:1900 = 5.1 : 6.5 : 8.1 : 10.2 (29.9)
+ -- return (year % 4 == 0) and (year % 400 == 0 or year % 100 ~= 0) -- 3:4:1600:1900 = 5.2 : 8.5 : 6.8 : 10.1 (30.6)
+ end
-local function nofdays(year,month,day)
- if not month then
- return isleapyear(year) and 365 or 364
- elseif not day then
- return month == 2 and isleapyear(year) and 29 or days[month]
- else
- for i=1,month-1 do
- day = day + days[i]
- end
- if month > 2 and isleapyear(year) then
- day = day + 1
+ os.isleapyear = isleapyear
+
+ -- nicer:
+ --
+ -- local days = {
+ -- [false] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
+ -- [true] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+ -- }
+ --
+ -- local function nofdays(year,month)
+ -- return days[isleapyear(year)][month]
+ -- return month == 2 and isleapyear(year) and 29 or days[month]
+ -- end
+ --
+ -- more efficient:
+
+ local days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+
+ local function nofdays(year,month,day)
+ if not month then
+ return isleapyear(year) and 365 or 364
+ elseif not day then
+ return month == 2 and isleapyear(year) and 29 or days[month]
+ else
+ for i=1,month-1 do
+ day = day + days[i]
+ end
+ if month > 2 and isleapyear(year) then
+ day = day + 1
+ end
+ return day
end
- return day
end
-end
-
-os.nofdays = nofdays
-function os.weekday(day,month,year)
- return date("%w",time { year = year, month = month, day = day }) + 1
-end
+ os.nofdays = nofdays
-function os.validdate(year,month,day)
- -- we assume that all three values are set
- -- year is always ok, even if lua has a 1970 time limit
- if month < 1 then
- month = 1
- elseif month > 12 then
- month = 12
+ function os.weekday(day,month,year)
+ return date("%w",time { year = year, month = month, day = day }) + 1
end
- if day < 1 then
- day = 1
- else
- local max = nofdays(year,month)
- if day > max then
- day = max
+
+ function os.validdate(year,month,day)
+ -- we assume that all three values are set
+ -- year is always ok, even if lua has a 1970 time limit
+ if month < 1 then
+ month = 1
+ elseif month > 12 then
+ month = 12
end
+ if day < 1 then
+ day = 1
+ else
+ local max = nofdays(year,month)
+ if day > max then
+ day = max
+ end
+ end
+ return year, month, day
end
- return year, month, day
-end
-function os.date(fmt,...)
- if not fmt then
- -- otherwise differences between unix, mingw and msvc
- fmt = "%Y-%m-%d %H:%M"
+ function os.date(fmt,...)
+ if not fmt then
+ -- otherwise differences between unix, mingw and msvc
+ fmt = "%Y-%m-%d %H:%M"
+ end
+ return date(fmt,...)
end
- return date(fmt,...)
+
end
-local osexit = os.exit
-local exitcode = nil
+do
-function os.setexitcode(code)
- exitcode = code
-end
+ local osexit = os.exit
+ local exitcode = nil
-function os.exit(c)
- if exitcode ~= nil then
- return osexit(exitcode)
+ function os.setexitcode(code)
+ exitcode = code
end
- if c ~= nil then
- return osexit(c)
+
+ function os.exit(c)
+ if exitcode ~= nil then
+ return osexit(exitcode)
+ end
+ if c ~= nil then
+ return osexit(c)
+ end
+ return osexit()
end
- return osexit()
+
end
diff --git a/macros/luatex/generic/lualibs/lualibs-util-deb.lua b/macros/luatex/generic/lualibs/lualibs-util-deb.lua
index bd94b6d01e..10e5731b03 100644
--- a/macros/luatex/generic/lualibs/lualibs-util-deb.lua
+++ b/macros/luatex/generic/lualibs/lualibs-util-deb.lua
@@ -346,3 +346,25 @@ debugger.showtraceback = showtraceback
-- debug.showtraceback = showtraceback
-- showtraceback()
+
+-- For now also here because we want it in mtxrun (taken from lmt file):
+
+if luac then
+
+ local show, dump = luac.print, string.dump
+
+ function luac.inspect(v)
+ if type(v) == "function" then
+ local ok, str = xpcall(dump,function() end,v)
+ if ok then
+ v = str
+ end
+ end
+ if type(v) == "string" then
+ show(v,true)
+ else
+ print(v)
+ end
+ end
+
+end
diff --git a/macros/luatex/generic/lualibs/lualibs-util-jsn.lua b/macros/luatex/generic/lualibs/lualibs-util-jsn.lua
index 8da3518979..2d78561971 100644
--- a/macros/luatex/generic/lualibs/lualibs-util-jsn.lua
+++ b/macros/luatex/generic/lualibs/lualibs-util-jsn.lua
@@ -17,6 +17,10 @@ if not modules then modules = { } end modules ['util-jsn'] = {
--
-- Upgraded for handling the somewhat more fax server templates.
+if utilities and utilities.json then
+ return json
+end
+
local P, V, R, S, C, Cc, Cs, Ct, Cf, Cg = lpeg.P, lpeg.V, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Ct, lpeg.Cf, lpeg.Cg
local lpegmatch = lpeg.match
local format, gsub = string.format, string.gsub
@@ -265,6 +269,8 @@ do
k = lpegmatch(escaper,k) or k
v = lpegmatch(escaper,v) or v
n = n + 1 t[n] = f_key_val_str(depth,k,v)
+ elseif i > 1 then
+ n = n - 1
end
elseif tv == "table" then
local l = #v
@@ -280,6 +286,9 @@ do
end
elseif next(v) then
tojsonpp(v,k,depth,level+1,0)
+ elseif i > 1 then
+ n = n - 1
+ -- we don't know if we have a hash or string
end
elseif tv == "boolean" then
if tk == "number" then
@@ -297,6 +306,8 @@ do
else
t[n] = f_key_val_nop(depth,k)
end
+ elseif i > 1 then
+ n = n - 1
end
else
if tk == "number" then
@@ -306,6 +317,8 @@ do
k = lpegmatch(escaper,k) or k
n = n + 1
t[n] = f_key_val_null(depth,k)
+ elseif i > 1 then
+ n = n - 1
end
end
end
@@ -440,4 +453,8 @@ end
-- inspect(l)
-- print(s==l.s)
-return json
+-- if not package.loaded.json then
+-- package.loaded.json = json
+-- end
+
+-- return json
diff --git a/macros/luatex/generic/lualibs/lualibs-util-prs.lua b/macros/luatex/generic/lualibs/lualibs-util-prs.lua
index 6d2f8c19e0..635b610e07 100644
--- a/macros/luatex/generic/lualibs/lualibs-util-prs.lua
+++ b/macros/luatex/generic/lualibs/lualibs-util-prs.lua
@@ -55,9 +55,13 @@ local nobracket = 1 - (lbracket + rbracket)
local escape, left, right = P("\\"), P('{'), P('}')
+-- lpegpatterns.balanced = P {
+-- [1] = ((escape * (left+right)) + (1 - (left+right)) + V(2))^0,
+-- [2] = left * V(1) * right
+-- }
lpegpatterns.balanced = P {
- [1] = ((escape * (left+right)) + (1 - (left+right)) + V(2))^0,
- [2] = left * V(1) * right
+ ((escape * (left+right)) + (1 - (left+right)) + V(2))^0,
+ left * V(1) * right
}
local nestedbraces = P { lbrace * (nobrace + V(1))^0 * rbrace }
@@ -67,11 +71,12 @@ local spaces = space^0
local argument = Cs((lbrace/"") * ((nobrace + nestedbraces)^0) * (rbrace/""))
local content = (1-endofstring)^0
-lpegpatterns.nestedbraces = nestedbraces -- no capture
-lpegpatterns.nestedparents = nestedparents -- no capture
-lpegpatterns.nested = nestedbraces -- no capture
-lpegpatterns.argument = argument -- argument after e.g. =
-lpegpatterns.content = content -- rest after e.g =
+lpegpatterns.nestedbraces = nestedbraces -- no capture
+lpegpatterns.nestedparents = nestedparents -- no capture
+lpegpatterns.nestedbrackets = nestedbrackets -- no capture
+lpegpatterns.nested = nestedbraces -- no capture
+lpegpatterns.argument = argument -- argument after e.g. =
+lpegpatterns.content = content -- rest after e.g =
local value = lbrace * C((nobrace + nestedbraces)^0) * rbrace
+ C((nestedbraces + (1-comma))^0)
@@ -568,9 +573,9 @@ end
-- "1","2","3","4"
-- "5","6","7","8"
-- ]]
---
+
-- local mycsvsplitter = parsers.csvsplitter { numbers = true }
---
+
-- local list = mycsvsplitter(crap) inspect(list)
-- and this is a slightly patched version of a version posted by Philipp Gesang
@@ -617,12 +622,6 @@ end
-- local list, names = mycsvsplitter(crap,true) inspect(list) inspect(names)
-- local list, names = mycsvsplitter(crap) inspect(list) inspect(names)
--- parsers.stepper("1,7-",9,function(i) print(">>>",i) end)
--- parsers.stepper("1-3,7,8,9")
--- parsers.stepper("1-3,6,7",function(i) print(">>>",i) end)
--- parsers.stepper(" 1 : 3, ,7 ")
--- parsers.stepper("1:4,9:13,24:*",30)
-
local function ranger(first,last,n,action)
if not first then
-- forget about it
@@ -639,7 +638,7 @@ local function ranger(first,last,n,action)
end
end
-local cardinal = lpegpatterns.cardinal / tonumber
+local cardinal = (lpegpatterns.hexadecimal + lpegpatterns.cardinal) / tonumber
local spacers = lpegpatterns.spacer^0
local endofstring = lpegpatterns.endofstring
@@ -650,14 +649,29 @@ local stepper = spacers * ( cardinal * ( spacers * S(":-") * spacers * ( cardin
* Carg(1) * Carg(2) / ranger * S(", ")^0 )^1 * endofstring -- we're sort of strict (could do without endofstring)
function parsers.stepper(str,n,action)
+ local ts = type(str)
if type(n) == "function" then
- lpegmatch(stepper,str,1,false,n or print)
- else
+ if ts == "number" then
+ n(str)
+ elseif ts == "table" then
+ for i=1,#str do
+ n(str[i])
+ end
+ else
+ lpegmatch(stepper,str,1,false,n or print)
+ end
+ elseif ts == "string" then
lpegmatch(stepper,str,1,n,action or print)
end
end
---
+-- parsers.stepper("1,7-",9,function(i) print(">>>",i) end)
+-- parsers.stepper("1-3,7,8,9")
+-- parsers.stepper("1-3,6,7",function(i) print(">>>",i) end)
+-- parsers.stepper(" 1 : 3, ,7 ")
+-- parsers.stepper("1:4,9:13,24:*",30)
+-- parsers.stepper(1,print)
+-- parsers.stepper({1,3,4},print)
local pattern_math = Cs((P("%")/"\\percent " + P("^") * Cc("{") * lpegpatterns.integer * Cc("}") + anything)^0)
local pattern_text = Cs((P("%")/"\\percent " + (P("^")/"\\high") * Cc("{") * lpegpatterns.integer * Cc("}") + anything)^0)
@@ -681,7 +695,7 @@ local spaces = lpegpatterns.space^0
local dummy = function() end
setmetatableindex(cache,function(t,k)
- local separator = P(k)
+ local separator = S(k) -- was P
local value = (1-separator)^0
local pattern = spaces * C(value) * separator^0 * Cp()
t[k] = pattern
@@ -801,11 +815,20 @@ local pattern = Cf( Ct("") *
( Cg(Cc("day") * cardinal)
* S("-/") * Cg(Cc("month") * cardinal)
* S("-/") * Cg(Cc("year") * p_year)
+ ) +
+ ( Cg(Cc("year") * p_year)
+ * S("-/") * Cg(Cc("month") * cardinal)
+ ) +
+ ( Cg(Cc("month") * cardinal)
+ * S("-/") * Cg(Cc("year") * p_year)
)
)
- * P(" ") * Cg(Cc("hour") * cardinal)
+ * (
+ P(" ") * Cg(Cc("hour") * cardinal)
* P(":") * Cg(Cc("min") * cardinal)
* (P(":") * Cg(Cc("sec") * cardinal))^-1
+ + P(-1) )
+
, rawset)
lpegpatterns.splittime = pattern
@@ -814,6 +837,8 @@ function parsers.totime(str)
return lpegmatch(pattern,str)
end
+-- inspect(parsers.totime("2019-03-05"))
+-- inspect(parsers.totime("2019-03-05 12:12:12"))
-- print(os.time(parsers.totime("2019-03-05 12:12:12")))
-- print(os.time(parsers.totime("2019/03/05 12:12:12")))
-- print(os.time(parsers.totime("05-03-2019 12:12:12")))
diff --git a/macros/luatex/generic/lualibs/lualibs-util-sac.lua b/macros/luatex/generic/lualibs/lualibs-util-sac.lua
new file mode 100644
index 0000000000..36daef8167
--- /dev/null
+++ b/macros/luatex/generic/lualibs/lualibs-util-sac.lua
@@ -0,0 +1,582 @@
+if not modules then modules = { } end modules ['util-sac'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- experimental string access (some 3 times faster than file access when messing
+-- with bytes)
+
+local byte, sub = string.byte, string.sub
+local tonumber = tonumber
+
+utilities = utilities or { }
+local streams = { }
+utilities.streams = streams
+
+function streams.open(filename,zerobased)
+ local f = filename and io.loaddata(filename)
+ if f then
+ return { f, 1, #f, zerobased or false }
+ end
+end
+
+function streams.openstring(f,zerobased)
+ if f then
+ return { f, 1, #f, zerobased or false }
+ end
+end
+
+function streams.getstring(f)
+ if f then
+ return f[1]
+ end
+end
+
+function streams.close()
+ -- dummy
+end
+
+function streams.size(f)
+ return f and f[3] or 0
+end
+
+streams.getsize = streams.size
+
+function streams.setposition(f,i)
+ if f[4] then
+ -- zerobased
+ if i <= 0 then
+ f[2] = 1
+ else
+ f[2] = i + 1
+ end
+ else
+ if i <= 1 then
+ f[2] = 1
+ else
+ f[2] = i
+ end
+ end
+end
+
+function streams.getposition(f)
+ if f[4] then
+ -- zerobased
+ return f[2] - 1
+ else
+ return f[2]
+ end
+end
+
+function streams.look(f,n,chars)
+ local b = f[2]
+ local e = b + n - 1
+ if chars then
+ return sub(f[1],b,e)
+ else
+ return byte(f[1],b,e)
+ end
+end
+
+function streams.skip(f,n)
+ f[2] = f[2] + n
+end
+
+function streams.readbyte(f)
+ local i = f[2]
+ f[2] = i + 1
+ return byte(f[1],i)
+end
+
+function streams.readbytes(f,n)
+ local i = f[2]
+ local j = i + n
+ f[2] = j
+ return byte(f[1],i,j-1)
+end
+
+function streams.readbytetable(f,n)
+ local i = f[2]
+ local j = i + n
+ f[2] = j
+ return { byte(f[1],i,j-1) }
+end
+
+function streams.skipbytes(f,n)
+ f[2] = f[2] + n
+end
+
+function streams.readchar(f)
+ local i = f[2]
+ f[2] = i + 1
+ return sub(f[1],i,i)
+end
+
+function streams.readstring(f,n)
+ local i = f[2]
+ local j = i + n
+ f[2] = j
+ return sub(f[1],i,j-1)
+end
+
+function streams.readinteger1(f) -- one byte
+ local i = f[2]
+ f[2] = i + 1
+ local n = byte(f[1],i)
+ if n >= 0x80 then
+ return n - 0x100
+ else
+ return n
+ end
+end
+
+streams.readcardinal1 = streams.readbyte -- one byte
+streams.readcardinal = streams.readcardinal1
+streams.readinteger = streams.readinteger1
+
+function streams.readcardinal2(f)
+ local i = f[2]
+ local j = i + 1
+ f[2] = j + 1
+ local a, b = byte(f[1],i,j)
+ return 0x100 * a + b
+end
+
+function streams.readcardinal2le(f)
+ local i = f[2]
+ local j = i + 1
+ f[2] = j + 1
+ local b, a = byte(f[1],i,j)
+ return 0x100 * a + b
+end
+
+function streams.readinteger2(f)
+ local i = f[2]
+ local j = i + 1
+ f[2] = j + 1
+ local a, b = byte(f[1],i,j)
+ if a >= 0x80 then
+ return 0x100 * a + b - 0x10000
+ else
+ return 0x100 * a + b
+ end
+end
+
+function streams.readinteger2le(f)
+ local i = f[2]
+ local j = i + 1
+ f[2] = j + 1
+ local b, a = byte(f[1],i,j)
+ if a >= 0x80 then
+ return 0x100 * a + b - 0x10000
+ else
+ return 0x100 * a + b
+ end
+end
+
+function streams.readcardinal3(f)
+ local i = f[2]
+ local j = i + 2
+ f[2] = j + 1
+ local a, b, c = byte(f[1],i,j)
+ return 0x10000 * a + 0x100 * b + c
+end
+
+function streams.readcardinal3le(f)
+ local i = f[2]
+ local j = i + 2
+ f[2] = j + 1
+ local c, b, a = byte(f[1],i,j)
+ return 0x10000 * a + 0x100 * b + c
+end
+
+function streams.readinteger3(f)
+ local i = f[2]
+ local j = i + 3
+ f[2] = j + 1
+ local a, b, c = byte(f[1],i,j)
+ if a >= 0x80 then
+ return 0x10000 * a + 0x100 * b + c - 0x1000000
+ else
+ return 0x10000 * a + 0x100 * b + c
+ end
+end
+
+function streams.readinteger3le(f)
+ local i = f[2]
+ local j = i + 3
+ f[2] = j + 1
+ local c, b, a = byte(f[1],i,j)
+ if a >= 0x80 then
+ return 0x10000 * a + 0x100 * b + c - 0x1000000
+ else
+ return 0x10000 * a + 0x100 * b + c
+ end
+end
+
+function streams.readcardinal4(f)
+ local i = f[2]
+ local j = i + 3
+ f[2] = j + 1
+ local a, b, c, d = byte(f[1],i,j)
+ return 0x1000000 * a + 0x10000 * b + 0x100 * c + d
+end
+
+function streams.readcardinal4le(f)
+ local i = f[2]
+ local j = i + 3
+ f[2] = j + 1
+ local d, c, b, a = byte(f[1],i,j)
+ return 0x1000000 * a + 0x10000 * b + 0x100 * c + d
+end
+
+function streams.readinteger4(f)
+ local i = f[2]
+ local j = i + 3
+ f[2] = j + 1
+ local a, b, c, d = byte(f[1],i,j)
+ if a >= 0x80 then
+ return 0x1000000 * a + 0x10000 * b + 0x100 * c + d - 0x100000000
+ else
+ return 0x1000000 * a + 0x10000 * b + 0x100 * c + d
+ end
+end
+
+function streams.readinteger4le(f)
+ local i = f[2]
+ local j = i + 3
+ f[2] = j + 1
+ local d, c, b, a = byte(f[1],i,j)
+ if a >= 0x80 then
+ return 0x1000000 * a + 0x10000 * b + 0x100 * c + d - 0x100000000
+ else
+ return 0x1000000 * a + 0x10000 * b + 0x100 * c + d
+ end
+end
+
+function streams.readfixed2(f)
+ local i = f[2]
+ local j = i + 1
+ f[2] = j + 1
+ local n1, n2 = byte(f[1],i,j)
+ if n1 >= 0x80 then
+ n1 = n1 - 0x100
+ end
+ return n1 + n2/0xFF
+end
+
+function streams.readfixed4(f)
+ local i = f[2]
+ local j = i + 3
+ f[2] = j + 1
+ local a, b, c, d = byte(f[1],i,j)
+ local n1 = 0x100 * a + b
+ local n2 = 0x100 * c + d
+ if n1 >= 0x8000 then
+ n1 = n1 - 0x10000
+ end
+ return n1 + n2/0xFFFF
+end
+
+if bit32 then
+
+ local extract = bit32.extract
+ local band = bit32.band
+
+ function streams.read2dot14(f)
+ local i = f[2]
+ local j = i + 1
+ f[2] = j + 1
+ local a, b = byte(f[1],i,j)
+ if a >= 0x80 then
+ local n = -(0x100 * a + b)
+ return - (extract(n,14,2) + (band(n,0x3FFF) / 16384.0))
+ else
+ local n = 0x100 * a + b
+ return (extract(n,14,2) + (band(n,0x3FFF) / 16384.0))
+ end
+ end
+
+end
+
+function streams.skipshort(f,n)
+ f[2] = f[2] + 2*(n or 1)
+end
+
+function streams.skiplong(f,n)
+ f[2] = f[2] + 4*(n or 1)
+end
+
+if sio and sio.readcardinal2 then
+
+ local readcardinal1 = sio.readcardinal1
+ local readcardinal2 = sio.readcardinal2
+ local readcardinal3 = sio.readcardinal3
+ local readcardinal4 = sio.readcardinal4
+ local readinteger1 = sio.readinteger1
+ local readinteger2 = sio.readinteger2
+ local readinteger3 = sio.readinteger3
+ local readinteger4 = sio.readinteger4
+ local readfixed2 = sio.readfixed2
+ local readfixed4 = sio.readfixed4
+ local read2dot14 = sio.read2dot14
+ local readbytes = sio.readbytes
+ local readbytetable = sio.readbytetable
+
+ function streams.readcardinal1(f)
+ local i = f[2]
+ f[2] = i + 1
+ return readcardinal1(f[1],i)
+ end
+ function streams.readcardinal2(f)
+ local i = f[2]
+ f[2] = i + 2
+ return readcardinal2(f[1],i)
+ end
+ function streams.readcardinal3(f)
+ local i = f[2]
+ f[2] = i + 3
+ return readcardinal3(f[1],i)
+ end
+ function streams.readcardinal4(f)
+ local i = f[2]
+ f[2] = i + 4
+ return readcardinal4(f[1],i)
+ end
+ function streams.readinteger1(f)
+ local i = f[2]
+ f[2] = i + 1
+ return readinteger1(f[1],i)
+ end
+ function streams.readinteger2(f)
+ local i = f[2]
+ f[2] = i + 2
+ return readinteger2(f[1],i)
+ end
+ function streams.readinteger3(f)
+ local i = f[2]
+ f[2] = i + 3
+ return readinteger3(f[1],i)
+ end
+ function streams.readinteger4(f)
+ local i = f[2]
+ f[2] = i + 4
+ return readinteger4(f[1],i)
+ end
+ function streams.readfixed2(f) -- needs recent luatex
+ local i = f[2]
+ f[2] = i + 2
+ return readfixed2(f[1],i)
+ end
+ function streams.readfixed4(f) -- needs recent luatex
+ local i = f[2]
+ f[2] = i + 4
+ return readfixed4(f[1],i)
+ end
+ function streams.read2dot14(f)
+ local i = f[2]
+ f[2] = i + 2
+ return read2dot14(f[1],i)
+ end
+ function streams.readbytes(f,n)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ return readbytes(f[1],i,n)
+ end
+ function streams.readbytetable(f,n)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ return readbytetable(f[1],i,n)
+ end
+
+ streams.readbyte = streams.readcardinal1
+ streams.readsignedbyte = streams.readinteger1
+ streams.readcardinal = streams.readcardinal1
+ streams.readinteger = streams.readinteger1
+
+end
+
+if sio and sio.readcardinaltable then
+
+ local readcardinaltable = sio.readcardinaltable
+ local readintegertable = sio.readintegertable
+
+ function utilities.streams.readcardinaltable(f,n,b)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n * b
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ return readcardinaltable(f[1],i,n,b)
+ end
+
+ function utilities.streams.readintegertable(f,n,b)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n * b
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ return readintegertable(f[1],i,n,b)
+ end
+
+else
+
+ local readcardinal1 = streams.readcardinal1
+ local readcardinal2 = streams.readcardinal2
+ local readcardinal3 = streams.readcardinal3
+ local readcardinal4 = streams.readcardinal4
+
+ function streams.readcardinaltable(f,n,b)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n * b
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ local t = { }
+ if b == 1 then for i=1,n do t[i] = readcardinal1(f[1],i) end
+ elseif b == 2 then for i=1,n do t[i] = readcardinal2(f[1],i) end
+ elseif b == 3 then for i=1,n do t[i] = readcardinal3(f[1],i) end
+ elseif b == 4 then for i=1,n do t[i] = readcardinal4(f[1],i) end end
+ return t
+ end
+
+ local readinteger1 = streams.readinteger1
+ local readinteger2 = streams.readinteger2
+ local readinteger3 = streams.readinteger3
+ local readinteger4 = streams.readinteger4
+
+ function streams.readintegertable(f,n,b)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n * b
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ local t = { }
+ if b == 1 then for i=1,n do t[i] = readinteger1(f[1],i) end
+ elseif b == 2 then for i=1,n do t[i] = readinteger2(f[1],i) end
+ elseif b == 3 then for i=1,n do t[i] = readinteger3(f[1],i) end
+ elseif b == 4 then for i=1,n do t[i] = readinteger4(f[1],i) end end
+ return t
+ end
+
+end
+
+-- For practical reasons we put this here. It's less efficient but ok when we don't
+-- have much access.
+
+do
+
+ local files = utilities.files
+
+ if files then
+
+ local openfile = files.open
+ local openstream = streams.open
+ local openstring = streams.openstring
+
+ local setmetatable = setmetatable
+
+ function io.newreader(str,method)
+ local f, m
+ if method == "string" then
+ f = openstring(str,true)
+ m = streams
+ elseif method == "stream" then
+ f = openstream(str,true)
+ m = streams
+ else
+ f = openfile(str,"rb")
+ m = files
+ end
+ if f then
+ local t = { }
+ setmetatable(t, {
+ __index = function(t,k)
+ local r = m[k]
+ if k == "close" then
+ -- maybe use __toclose
+ if f then
+ m.close(f)
+ f = nil
+ end
+ return function() end
+ elseif r then
+ local v = function(_,a,b) return r(f,a,b) end
+ t[k] = v
+ return v
+ else
+ print("unknown key",k)
+ end
+ end
+ } )
+ return t
+ end
+ end
+
+ end
+
+end
+
+if bit32 and not streams.tocardinal1 then
+
+ local extract = bit32.extract
+ local char = string.char
+
+ streams.tocardinal1 = char
+ function streams.tocardinal2(n) return char(extract( 8,8),extract( 0,8)) end
+ function streams.tocardinal3(n) return char(extract(16,8),extract( 8,8),extract(0,8)) end
+ function streams.tocardinal4(n) return char(extract(24,8),extract(16,8),extract(8,8),extract(0,8)) end
+
+ streams.tocardinal1le = char
+ function streams.tocardinal2le(n) return char(extract(0,8),extract(8,8)) end
+ function streams.tocardinal3le(n) return char(extract(0,8),extract(8,8),extract(16,8)) end
+ function streams.tocardinal4le(n) return char(extract(0,8),extract(8,8),extract(16,8),extract(24,8)) end
+
+end
+
+if not streams.readcstring then
+
+ local readchar = streams.readchar
+ local concat = table.concat
+
+ function streams.readcstring(f)
+ local t = { }
+ while true do
+ local c = readchar(f)
+ if c and c ~= "\0" then
+ t[#t+1] = c
+ else
+ return concat(t)
+ end
+ end
+ end
+
+end
diff --git a/macros/luatex/generic/lualibs/lualibs-util-str.lua b/macros/luatex/generic/lualibs/lualibs-util-str.lua
index 0d1f39de9d..b5c721a41d 100644
--- a/macros/luatex/generic/lualibs/lualibs-util-str.lua
+++ b/macros/luatex/generic/lualibs/lualibs-util-str.lua
@@ -10,12 +10,13 @@ utilities = utilities or { }
utilities.strings = utilities.strings or { }
local strings = utilities.strings
-local format, gsub, rep, sub, find = string.format, string.gsub, string.rep, string.sub, string.find
+local format, gsub, rep, sub, find, char = string.format, string.gsub, string.rep, string.sub, string.find, string.char
local load, dump = load, string.dump
local tonumber, type, tostring, next, setmetatable = tonumber, type, tostring, next, setmetatable
local unpack, concat = table.unpack, table.concat
local P, V, C, S, R, Ct, Cs, Cp, Carg, Cc = lpeg.P, lpeg.V, lpeg.C, lpeg.S, lpeg.R, lpeg.Ct, lpeg.Cs, lpeg.Cp, lpeg.Carg, lpeg.Cc
local patterns, lpegmatch = lpeg.patterns, lpeg.match
+local tsplitat = lpeg.tsplitat
local utfchar, utfbyte, utflen = utf.char, utf.byte, utf.len
----- loadstripped = utilities.lua.loadstripped
@@ -622,7 +623,7 @@ local template = [[
return function(%s) return %s end
]]
--- this might move
+-- We only use fast serialize in controlled cases.
local pattern = Cs(Cc('"') * (
(1-S('"\\\n\r'))^1
@@ -632,12 +633,43 @@ local pattern = Cs(Cc('"') * (
+ P('\r') / '\\r'
)^0 * Cc('"'))
+-- -- I need to do more experiments with this:
+--
+-- local pattern = Cs(Cc('"') * (
+-- (1-S('"\\\n\r'))^1
+-- + P('"') / '\\034'
+-- + P('\\') / '\\092'
+-- + P('\n') / '\\013'
+-- + P('\r') / '\\010'
+-- )^0 * Cc('"'))
+
patterns.escapedquotes = pattern
function string.escapedquotes(s)
return lpegmatch(pattern,s)
end
+local pattern = (1 - P("\\"))^1 ; pattern = Cs (
+ pattern
+ * ( (P("\\") / "" * (digit^-3 / function(s) return char(tonumber(s)) end)) + pattern )^1
+)
+
+patterns.unescapedquotes = pattern
+
+function string.unescapedquotes(s)
+ return lpegmatch(pattern,s) or s
+end
+
+-- function string.longifneeded(s)
+-- if find(s,'["\\\n\r]') then
+-- return "[===[" .. s .. "]===]"
+-- else
+-- return '"' .. s ..'"'
+-- end
+-- end
+
+string.texnewlines = lpeg.replacer(patterns.newline,"\r",true)
+
-- print(string.escapedquotes('1\\23\n"'))
-- but for now here
@@ -1476,7 +1508,7 @@ end
if not string.explode then
- local tsplitat = lpeg.tsplitat
+ -- local tsplitat = lpeg.tsplitat
local p_utf = patterns.utf8character
local p_check = C(p_utf) * (P("+") * Cc(true))^0
@@ -1499,3 +1531,24 @@ if not string.explode then
end
end
+
+
+do
+
+ local p_whitespace = patterns.whitespace^1
+
+ local cache = setmetatable({ }, { __index = function(t,k)
+ local p = tsplitat(p_whitespace * P(k) * p_whitespace)
+ local v = function(s)
+ return lpegmatch(p,s)
+ end
+ t[k] = v
+ return v
+ end })
+
+ function string.wordsplitter(s)
+ return cache[s]
+ end
+
+end
+
diff --git a/macros/luatex/generic/lualibs/lualibs-util-tab.lua b/macros/luatex/generic/lualibs/lualibs-util-tab.lua
index 9f7112eb91..64fa1af4fb 100644
--- a/macros/luatex/generic/lualibs/lualibs-util-tab.lua
+++ b/macros/luatex/generic/lualibs/lualibs-util-tab.lua
@@ -417,9 +417,9 @@ if JITSUPPORTED then
else
- local f_v = formatters["[%q]=%q,"]
- local f_t = formatters["[%q]="]
- local f_q = formatters["%q,"]
+ -- local f_v = formatters["[%q]=%q,"]
+ -- local f_t = formatters["[%q]="]
+ -- local f_q = formatters["%q,"]
function table.fastserialize(t,prefix) -- todo, move local function out
local r = { type(prefix) == "string" and prefix or "return" }
@@ -720,6 +720,7 @@ local function serialize(root,name,specification)
local t -- = { }
local n = 1
+ -- local m = 0 -- no gain
local unknown = false
local function do_serialize(root,name,depth,level,indexed)
@@ -850,6 +851,12 @@ local function serialize(root,name,specification)
n = n + 1 t[n] = f_key_str_value_str(depth,tostring(k),tostring(v))
end
end
+ -- if n > 100000 then -- no gain
+ -- local k = m + 1
+ -- t[k] = concat(t,"\n",k,n)
+ -- n = k
+ -- m = k
+ -- end
end
end
if level > 0 then
@@ -898,6 +905,7 @@ local function serialize(root,name,specification)
n = n + 1
t[n] = f_table_finish()
return concat(t,"\n")
+ -- return concat(t,"\n",1,n) -- no gain
end
table.serialize = serialize
@@ -970,3 +978,43 @@ end
-- return remove(t,random(1,n))
-- end
-- end
+
+function combine(target,source)
+ -- no copy so if that is needed one needs to deepcopy source first
+ if target then
+ for k, v in next, source do
+ if type(v) == "table" then
+ target[k] = combine(target[k],source[k])
+ else
+ target[k] = v
+ end
+ end
+ return target
+ else
+ return source
+ end
+end
+
+table.combine = combine
+
+-- If needed we can add something (some discussion on the list but I'm not sure if
+-- it makes sense because merging such mixed tables is quite unusual.
+--
+-- function table.himerged(...)
+-- local result = { }
+-- local r = 0
+-- for i=1,select("#",...) do
+-- local s = select(i,...)
+-- if s then
+-- for k, v in next, s do
+-- if type(k) == "number" then
+-- r = r + 1
+-- result[r] = v
+-- else
+-- result[k] = v
+-- end
+-- end
+-- end
+-- end
+-- return result
+-- end
diff --git a/macros/luatex/generic/lualibs/lualibs-util-zip.lua b/macros/luatex/generic/lualibs/lualibs-util-zip.lua
new file mode 100644
index 0000000000..bd8fdf287f
--- /dev/null
+++ b/macros/luatex/generic/lualibs/lualibs-util-zip.lua
@@ -0,0 +1,684 @@
+if not modules then modules = { } end modules ['util-zip'] = {
+ version = 1.001,
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This module is mostly meant for relative simple zip and unzip tasks. We can read
+-- and write zip files but with limitations. Performance is quite good and it makes
+-- us independent of zip tools, which (for some reason) are not always installed.
+--
+-- This is an lmtx module and at some point will be lmtx only but for a while we
+-- keep some hybrid functionality.
+
+local type, tostring, tonumber = type, tostring, tonumber
+local sort, concat = table.sort, table.concat
+
+local find, format, sub, gsub = string.find, string.format, string.sub, string.gsub
+local osdate, ostime, osclock = os.date, os.time, os.clock
+local ioopen = io.open
+local loaddata, savedata = io.loaddata, io.savedata
+local filejoin, isdir, dirname, mkdirs = file.join, lfs.isdir, file.dirname, dir.mkdirs
+local suffix, suffixes = file.suffix, file.suffixes
+local openfile = io.open
+
+gzip = gzip or { } -- so in luatex we keep the old ones too
+
+if not zlib then
+ zlib = xzip -- in luametatex we shadow the old one
+elseif not xzip then
+ xzip = zlib
+end
+
+local files = utilities.files
+local openfile = files.open
+local closefile = files.close
+local readstring = files.readstring
+local readcardinal2 = files.readcardinal2le
+local readcardinal4 = files.readcardinal4le
+local setposition = files.setposition
+local getposition = files.getposition
+
+local band = bit32.band
+local rshift = bit32.rshift
+local lshift = bit32.lshift
+
+local zlibdecompress = zlib.decompress
+local zlibdecompresssize = zlib.decompresssize
+local zlibchecksum = zlib.crc32
+
+if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
+ local cs = zlibchecksum
+ zlibchecksum = function(str,n) return cs(n or 0, str) end
+end
+
+local decompress = function(source) return zlibdecompress (source,-15) end -- auto
+local decompresssize = function(source,targetsize) return zlibdecompresssize(source,targetsize,-15) end -- auto
+local calculatecrc = function(buffer,initial) return zlibchecksum (initial or 0,buffer) end
+
+local zipfiles = { }
+utilities.zipfiles = zipfiles
+
+local openzipfile, closezipfile, unzipfile, foundzipfile, getziphash, getziplist do
+
+ function openzipfile(name)
+ return {
+ name = name,
+ handle = openfile(name,0),
+ }
+ end
+
+ local function collect(z)
+ if not z.list then
+ local list = { }
+ local hash = { }
+ local position = 0
+ local index = 0
+ local handle = z.handle
+ while true do
+ setposition(handle,position)
+ local signature = readstring(handle,4)
+ if signature == "PK\3\4" then
+ -- [local file header 1]
+ -- [encryption header 1]
+ -- [file data 1]
+ -- [data descriptor 1]
+ local version = readcardinal2(handle)
+ local flag = readcardinal2(handle)
+ local method = readcardinal2(handle)
+ local filetime = readcardinal2(handle)
+ local filedate = readcardinal2(handle)
+ local crc32 = readcardinal4(handle)
+ local compressed = readcardinal4(handle)
+ local uncompressed = readcardinal4(handle)
+ local namelength = readcardinal2(handle)
+ local extralength = readcardinal2(handle)
+ local filename = readstring(handle,namelength)
+ local descriptor = band(flag,8) ~= 0
+ local encrypted = band(flag,1) ~= 0
+ local acceptable = method == 0 or method == 8
+ -- 30 bytes of header including the signature
+ local skipped = 0
+ local size = 0
+ if encrypted then
+ size = readcardinal2(handle)
+ skipbytes(size)
+ skipped = skipped + size + 2
+ skipbytes(8)
+ skipped = skipped + 8
+ size = readcardinal2(handle)
+ skipbytes(size)
+ skipped = skipped + size + 2
+ size = readcardinal4(handle)
+ skipbytes(size)
+ skipped = skipped + size + 4
+ size = readcardinal2(handle)
+ skipbytes(size)
+ skipped = skipped + size + 2
+ end
+ position = position + 30 + namelength + extralength + skipped
+ if descriptor then
+ setposition(handle,position + compressed)
+ crc32 = readcardinal4(handle)
+ compressed = readcardinal4(handle)
+ uncompressed = readcardinal4(handle)
+ end
+ if acceptable then
+ index = index + 1
+ local data = {
+ filename = filename,
+ index = index,
+ position = position,
+ method = method,
+ compressed = compressed,
+ uncompressed = uncompressed,
+ crc32 = crc32,
+ encrypted = encrypted,
+ }
+ hash[filename] = data
+ list[index] = data
+ else
+ -- maybe a warning when encrypted
+ end
+ position = position + compressed
+ else
+ break
+ end
+ z.list = list
+ z.hash = hash
+ end
+ end
+ end
+
+ function getziplist(z)
+ local list = z.list
+ if not list then
+ collect(z)
+ end
+ return z.list
+ end
+
+ function getziphash(z)
+ local hash = z.hash
+ if not hash then
+ collect(z)
+ end
+ return z.hash
+ end
+
+ function foundzipfile(z,name)
+ return getziphash(z)[name]
+ end
+
+ function closezipfile(z)
+ local f = z.handle
+ if f then
+ closefile(f)
+ z.handle = nil
+ end
+ end
+
+ function unzipfile(z,filename,check)
+ local hash = z.hash
+ if not hash then
+ hash = zipfiles.hash(z)
+ end
+ local data = hash[filename] -- normalize
+ if not data then
+ -- lower and cleanup
+ -- only name
+ end
+ if data then
+ local handle = z.handle
+ local position = data.position
+ local compressed = data.compressed
+ if compressed > 0 then
+ setposition(handle,position)
+ local result = readstring(handle,compressed)
+ if data.method == 8 then
+ if decompresssize then
+ result = decompresssize(result,data.uncompressed)
+ else
+ result = decompress(result)
+ end
+ end
+ if check and data.crc32 ~= calculatecrc(result) then
+ print("checksum mismatch")
+ return ""
+ end
+ return result
+ else
+ return ""
+ end
+ end
+ end
+
+ zipfiles.open = openzipfile
+ zipfiles.close = closezipfile
+ zipfiles.unzip = unzipfile
+ zipfiles.hash = getziphash
+ zipfiles.list = getziplist
+ zipfiles.found = foundzipfile
+
+end
+
+if xzip then -- flate then do
+
+ local writecardinal1 = files.writebyte
+ local writecardinal2 = files.writecardinal2le
+ local writecardinal4 = files.writecardinal4le
+
+ local logwriter = logs.writer
+
+ local globpattern = dir.globpattern
+-- local compress = flate.flate_compress
+-- local checksum = flate.update_crc32
+ local compress = xzip.compress
+ local checksum = xzip.crc32
+
+ -- local function fromdostime(dostime,dosdate)
+ -- return ostime {
+ -- year = (dosdate >> 9) + 1980, -- 25 .. 31
+ -- month = (dosdate >> 5) & 0x0F, -- 21 .. 24
+ -- day = (dosdate ) & 0x1F, -- 16 .. 20
+ -- hour = (dostime >> 11) , -- 11 .. 15
+ -- min = (dostime >> 5) & 0x3F, -- 5 .. 10
+ -- sec = (dostime ) & 0x1F, -- 0 .. 4
+ -- }
+ -- end
+ --
+ -- local function todostime(time)
+ -- local t = osdate("*t",time)
+ -- return
+ -- ((t.year - 1980) << 9) + (t.month << 5) + t.day,
+ -- (t.hour << 11) + (t.min << 5) + (t.sec >> 1)
+ -- end
+
+ local function fromdostime(dostime,dosdate)
+ return ostime {
+ year = rshift(dosdate, 9) + 1980, -- 25 .. 31
+ month = band(rshift(dosdate, 5), 0x0F), -- 21 .. 24
+ day = band( (dosdate ), 0x1F), -- 16 .. 20
+ hour = band(rshift(dostime,11) ), -- 11 .. 15
+ min = band(rshift(dostime, 5), 0x3F), -- 5 .. 10
+ sec = band( (dostime ), 0x1F), -- 0 .. 4
+ }
+ end
+
+ local function todostime(time)
+ local t = osdate("*t",time)
+ return
+ lshift(t.year - 1980, 9) + lshift(t.month,5) + t.day,
+ lshift(t.hour ,11) + lshift(t.min ,5) + rshift(t.sec,1)
+ end
+
+ local function openzip(filename,level,comment,verbose)
+ local f = ioopen(filename,"wb")
+ if f then
+ return {
+ filename = filename,
+ handle = f,
+ list = { },
+ level = tonumber(level) or 3,
+ comment = tostring(comment),
+ verbose = verbose,
+ uncompressed = 0,
+ compressed = 0,
+ }
+ end
+ end
+
+ local function writezip(z,name,data,level,time)
+ local f = z.handle
+ local list = z.list
+ local level = tonumber(level) or z.level or 3
+ local method = 8
+ local zipped = compress(data,level)
+ local checksum = checksum(data)
+ local verbose = z.verbose
+ --
+ if not zipped then
+ method = 0
+ zipped = data
+ end
+ --
+ local start = f:seek()
+ local compressed = #zipped
+ local uncompressed = #data
+ --
+ z.compressed = z.compressed + compressed
+ z.uncompressed = z.uncompressed + uncompressed
+ --
+ if verbose then
+ local pct = 100 * compressed/uncompressed
+ if pct >= 100 then
+ logwriter(format("%10i %s",uncompressed,name))
+ else
+ logwriter(format("%10i %02.1f %s",uncompressed,pct,name))
+ end
+ end
+ --
+ f:write("\x50\x4b\x03\x04") -- PK.. 0x04034b50
+ --
+ writecardinal2(f,0) -- minimum version
+ writecardinal2(f,0) -- flag
+ writecardinal2(f,method) -- method
+ writecardinal2(f,0) -- time
+ writecardinal2(f,0) -- date
+ writecardinal4(f,checksum) -- crc32
+ writecardinal4(f,compressed) -- compressed
+ writecardinal4(f,uncompressed) -- uncompressed
+ writecardinal2(f,#name) -- namelength
+ writecardinal2(f,0) -- extralength
+ --
+ f:write(name) -- name
+ f:write(zipped)
+ --
+ list[#list+1] = { #zipped, #data, name, checksum, start, time or 0 }
+ end
+
+ local function closezip(z)
+ local f = z.handle
+ local list = z.list
+ local comment = z.comment
+ local verbose = z.verbose
+ local count = #list
+ local start = f:seek()
+ --
+ for i=1,count do
+ local l = list[i]
+ local compressed = l[1]
+ local uncompressed = l[2]
+ local name = l[3]
+ local checksum = l[4]
+ local start = l[5]
+ local time = l[6]
+ local date, time = todostime(time)
+ f:write('\x50\x4b\x01\x02')
+ writecardinal2(f,0) -- version made by
+ writecardinal2(f,0) -- version needed to extract
+ writecardinal2(f,0) -- flags
+ writecardinal2(f,8) -- method
+ writecardinal2(f,time) -- time
+ writecardinal2(f,date) -- date
+ writecardinal4(f,checksum) -- crc32
+ writecardinal4(f,compressed) -- compressed
+ writecardinal4(f,uncompressed) -- uncompressed
+ writecardinal2(f,#name) -- namelength
+ writecardinal2(f,0) -- extralength
+ writecardinal2(f,0) -- commentlength
+ writecardinal2(f,0) -- nofdisks -- ?
+ writecardinal2(f,0) -- internal attr (type)
+ writecardinal4(f,0) -- external attr (mode)
+ writecardinal4(f,start) -- local offset
+ f:write(name) -- name
+ end
+ --
+ local stop = f:seek()
+ local size = stop - start
+ --
+ f:write('\x50\x4b\x05\x06')
+ writecardinal2(f,0) -- disk
+ writecardinal2(f,0) -- disks
+ writecardinal2(f,count) -- entries
+ writecardinal2(f,count) -- entries
+ writecardinal4(f,size) -- dir size
+ writecardinal4(f,start) -- dir offset
+ if type(comment) == "string" and comment ~= "" then
+ writecardinal2(f,#comment) -- comment length
+ f:write(comment) -- comemnt
+ else
+ writecardinal2(f,0)
+ end
+ --
+ if verbose then
+ local compressed = z.compressed
+ local uncompressed = z.uncompressed
+ local filename = z.filename
+ --
+ local pct = 100 * compressed/uncompressed
+ logwriter("")
+ if pct >= 100 then
+ logwriter(format("%10i %s",uncompressed,filename))
+ else
+ logwriter(format("%10i %02.1f %s",uncompressed,pct,filename))
+ end
+ end
+ --
+ f:close()
+ end
+
+ local function zipdir(zipname,path,level,verbose)
+ if type(zipname) == "table" then
+ verbose = zipname.verbose
+ level = zipname.level
+ path = zipname.path
+ zipname = zipname.zipname
+ end
+ if not zipname or zipname == "" then
+ return
+ end
+ if not path or path == "" then
+ path = "."
+ end
+ if not isdir(path) then
+ return
+ end
+ path = gsub(path,"\\+","/")
+ path = gsub(path,"/+","/")
+ local list = { }
+ local count = 0
+ globpattern(path,"",true,function(name,size,time)
+ count = count + 1
+ list[count] = { name, time }
+ end)
+ sort(list,function(a,b)
+ return a[1] < b[1]
+ end)
+ local zipf = openzip(zipname,level,comment,verbose)
+ if zipf then
+ local p = #path + 2
+ for i=1,count do
+ local li = list[i]
+ local name = li[1]
+ local time = li[2]
+ local data = loaddata(name)
+ local name = sub(name,p,#name)
+ writezip(zipf,name,data,level,time,verbose)
+ end
+ closezip(zipf)
+ end
+ end
+
+ local function unzipdir(zipname,path,verbose)
+ if type(zipname) == "table" then
+ verbose = zipname.verbose
+ path = zipname.path
+ zipname = zipname.zipname
+ end
+ if not zipname or zipname == "" then
+ return
+ end
+ if not path or path == "" then
+ path = "."
+ end
+ local z = openzipfile(zipname)
+ if z then
+ local list = getziplist(z)
+ if list then
+ local total = 0
+ local count = #list
+ local step = number.idiv(count,10)
+ local done = 0
+ local steps = verbose == "steps"
+ local time = steps and osclock()
+ for i=1,count do
+ local l = list[i]
+ local n = l.filename
+ local d = unzipfile(z,n) -- true for check
+ if d then
+ local p = filejoin(path,n)
+ if mkdirs(dirname(p)) then
+ if steps then
+ total = total + #d
+ done = done + 1
+ if done >= step then
+ done = 0
+ logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",i,count,total,osclock()-time))
+ end
+ elseif verbose then
+ logwriter(n)
+ end
+ savedata(p,d)
+ end
+ else
+ logwriter(format("problem with file %s",n))
+ end
+ end
+ if steps then
+ logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",count,count,total,osclock()-time))
+ end
+ closezipfile(z)
+ return true
+ else
+ closezipfile(z)
+ end
+ end
+ end
+
+ zipfiles.zipdir = zipdir
+ zipfiles.unzipdir = unzipdir
+
+end
+
+-- todo: compress/decompress that work with offset in string
+
+-- We only have a few official methods here:
+--
+-- local decompressed = gzip.load (filename)
+-- local resultsize = gzip.save (filename,compresslevel)
+-- local compressed = gzip.compress (str,compresslevel)
+-- local decompressed = gzip.decompress (str)
+-- local iscompressed = gzip.compressed (str)
+-- local suffix, okay = gzip.suffix (filename)
+--
+-- In LuaMetaTeX we have only xzip which implements a very few methods:
+--
+-- compress (str,level,method,window,memory,strategy)
+-- decompress (str,window)
+-- adler32 (str,checksum)
+-- crc32 (str,checksum)
+
+local pattern = "^\x1F\x8B\x08"
+local gziplevel = 3
+
+function gzip.suffix(filename)
+ local suffix, extra = suffixes(filename)
+ local gzipped = extra == "gz"
+ return suffix, gzipped
+end
+
+function gzip.compressed(s)
+ return s and find(s,pattern)
+end
+
+local getdecompressed
+local putcompressed
+
+if gzip.compress then
+
+ local gzipwindow = 15 + 16 -- +16: gzip, +32: gzip|zlib
+
+ local compress = zlib.compress
+ local decompress = zlib.decompress
+
+ getdecompressed = function(str)
+ return decompress(str,gzipwindow) -- pass offset
+ end
+
+ putcompressed = function(str,level)
+ return compress(str,level or gziplevel,nil,gzipwindow)
+ end
+
+else
+
+ -- Special window values are: flate: -15, zlib: 15, gzip : -15
+
+ local gzipwindow = -15 -- miniz needs this
+ local identifier = "\x1F\x8B"
+
+ local compress = zlib.compress
+ local decompress = zlib.decompress
+ local zlibchecksum = zlib.crc32
+
+ if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
+ local cs = zlibchecksum
+ zlibchecksum = function(str,n) return cs(n or 0, str) end
+ end
+
+ local streams = utilities.streams
+ local openstream = streams.openstring
+ local closestream = streams.close
+ local getposition = streams.getposition
+ local readbyte = streams.readbyte
+ local readcardinal4 = streams.readcardinal4le
+ local readcardinal2 = streams.readcardinal2le
+ local readstring = streams.readstring
+ local readcstring = streams.readcstring
+ local skipbytes = streams.skip
+
+ local tocardinal1 = streams.tocardinal1
+ local tocardinal4 = streams.tocardinal4le
+
+ getdecompressed = function(str)
+ local s = openstream(str)
+ local identifier = readstring(s,2)
+ local method = readbyte(s,1)
+ local flags = readbyte(s,1)
+ local timestamp = readcardinal4(s)
+ local compression = readbyte(s,1)
+ local operating = readbyte(s,1)
+ -- local isjusttext = (flags & 0x01 ~= 0) and true or false
+ -- local extrasize = (flags & 0x04 ~= 0) and readcardinal2(s) or 0
+ -- local filename = (flags & 0x08 ~= 0) and readcstring(s) or ""
+ -- local comment = (flags & 0x10 ~= 0) and readcstring(s) or ""
+ -- local checksum = (flags & 0x02 ~= 0) and readcardinal2(s) or 0
+ local isjusttext = band(flags,0x01) ~= 0 and true or false
+ local extrasize = band(flags,0x04) ~= 0 and readcardinal2(s) or 0
+ local filename = band(flags,0x08) ~= 0 and readcstring(s) or ""
+ local comment = band(flags,0x10) ~= 0 and readcstring(s) or ""
+ local checksum = band(flags,0x02) ~= 0 and readcardinal2(s) or 0
+ local compressed = readstring(s,#str)
+ local data = decompress(compressed,gzipwindow) -- pass offset
+ return data
+ end
+
+ putcompressed = function(str,level,originalname)
+ return concat {
+ identifier, -- 2 identifier
+ tocardinal1(0x08), -- 1 method
+ tocardinal1(0x08), -- 1 flags
+ tocardinal4(os.time()), -- 4 mtime
+ tocardinal1(0x02), -- 1 compression (2 or 4)
+ tocardinal1(0xFF), -- 1 operating
+ (originalname or "unknownname") .. "\0",
+ compress(str,level,nil,gzipwindow),
+ tocardinal4(zlibchecksum(str)), -- 4
+ tocardinal4(#str), -- 4
+ }
+ end
+
+end
+
+function gzip.load(filename)
+ local f = openfile(filename,"rb")
+ if not f then
+ -- invalid file
+ else
+ local data = f:read("*all")
+ f:close()
+ if data and data ~= "" then
+ if suffix(filename) == "gz" then
+ data = getdecompressed(data)
+ end
+ return data
+ end
+ end
+end
+
+function gzip.save(filename,data,level,originalname)
+ if suffix(filename) ~= "gz" then
+ filename = filename .. ".gz"
+ end
+ local f = openfile(filename,"wb")
+ if f then
+ data = putcompressed(data or "",level or gziplevel,originalname)
+ f:write(data)
+ f:close()
+ return #data
+ end
+end
+
+function gzip.compress(s,level)
+ if s and not find(s,pattern) then
+ if not level then
+ level = gziplevel
+ elseif level <= 0 then
+ return s
+ elseif level > 9 then
+ level = 9
+ end
+ return putcompressed(s,level or gziplevel) or s
+ end
+end
+
+function gzip.decompress(s)
+ if s and find(s,pattern) then
+ return getdecompressed(s)
+ else
+ return s
+ end
+end
+
+-- return zipfiles
diff --git a/macros/luatex/generic/lualibs/lualibs.dtx b/macros/luatex/generic/lualibs/lualibs.dtx
index 73c5aafcc1..ebdba58424 100644
--- a/macros/luatex/generic/lualibs/lualibs.dtx
+++ b/macros/luatex/generic/lualibs/lualibs.dtx
@@ -37,7 +37,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: lualibs 2021-05-20 v2.74 Lua additional functions.}
+\Msg{* Package: lualibs 2022-10-04 v2.75 Lua additional functions.}
\Msg{************************************************************************}
\keepsilent
@@ -107,7 +107,7 @@ and lualibs-extended.lua.
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{lualibs.drv}
- [2021/05/20 v2.74 Lua Libraries.]
+ [2022/10/04 v2.75 Lua Libraries.]
\documentclass{ltxdoc}
\usepackage{fancyvrb,xspace}
\usepackage[x11names]{xcolor}
@@ -115,6 +115,7 @@ and lualibs-extended.lua.
\def\primarycolor{DodgerBlue4} %%-> rgb 16 78 139 | #104e8b
\def\secondarycolor{Goldenrod4} %%-> rgb 139 105 200 | #8b6914
%
+\AddToHook{package/hyperref/after}{%
\hypersetup{
colorlinks=true,
linkcolor=\primarycolor,
@@ -123,7 +124,7 @@ and lualibs-extended.lua.
pdftitle={The lualibs package},
pdfsubject={Port of the ConTeXt Lua libraries},
pdfauthor={Elie Roux & Philipp Gesang},
- pdfkeywords={luatex, lualatex, unicode, opentype}}
+ pdfkeywords={luatex, lualatex, unicode, opentype}}}
\newcommand*\email[1]{\href{mailto:#1}{#1}}
\usepackage{fontspec}
@@ -207,7 +208,7 @@ and lualibs-extended.lua.
% \GetFileInfo{lualibs.drv}
%
% \title{The \identifier{lualibs} package}
-% \date{2021/05/20 v2.74}
+% \date{2022/10/04 v2.75}
% \author{Élie Roux · \email{elie.roux@telecom-bretagne.eu}\\
% Philipp Gesang · \email{phg@phi-gamma.net}\\
% The \LaTeX{} Project · \email{https://github.com/latex3/lualibs/}\\
@@ -322,12 +323,11 @@ and lualibs-extended.lua.
% lualibs-io.lua & l-io.lua & reading and writing files \\
% lualibs-os.lua & l-os.lua & platform specific code \\
% lualibs-file.lua & l-file.lua & filesystem operations \\
-% lualibs-gzip.lua & l-gzip.lua & wrapper for \identifier{lgzip} \\
% lualibs-md5.lua & l-md5.lua & checksum functions \\
% lualibs-dir.lua & l-dir.lua & directory handling \\
% lualibs-unicode.lua & l-unicode.lua & utf and unicode \\
% lualibs-url.lua & l-url.lua & url handling \\
-% lualibs-set.lua & l-set.lua & sets \\[1ex]
+% lualibs-set.lua & l-set.lua & sets \\
% \end{tabular}
% \label{tab:basic}
% \hrule
@@ -346,6 +346,7 @@ and lualibs-extended.lua.
% \vskip1em
% \begin{tabular}{l l l}
% \identifier{lualibs} name & \CONTEXT name & primary purpose \\[1ex]
+% lualibs-util-sac.lua & util-sac.lua & string based file readers \\
% lualibs-util-str.lua & util-str.lua & extra |string| functions \\
% lualibs-util-fil.lua & util-fil.lua & extra |file| functions \\
% lualibs-util-tab.lua & util-tab.lua & extra |table| functions \\
@@ -357,7 +358,8 @@ and lualibs-extended.lua.
% lualibs-util-deb.lua & util-deb.lua & extra |debug| functionality \\
% lualibs-util-tpl.lua & util-tpl.lua & templating \\
% lualibs-util-sta.lua & util-sta.lua & stacker (e.~g. for \abbrev{pdf}) \\
-% lualibs-util-jsn.lua & util-jsn.lua & conversion to and from json \\[1ex]
+% lualibs-util-jsn.lua & util-jsn.lua & conversion to and from json \\
+% lualibs-util-zip.lua & util-zip.lua & compression and zip files \\[1ex]
% \end{tabular}
% \label{tab:extended}
% \hrule
@@ -428,8 +430,8 @@ lualibs = lualibs or { }
lualibs.module_info = {
name = "lualibs",
- version = "2.74", --TAGVERSION
- date = "2021-05-20", --TAGDATE
+ version = "2.75", --TAGVERSION
+ date = "2022-10-04", --TAGDATE
description = "ConTeXt Lua standard libraries.",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -582,8 +584,8 @@ local loadmodule = lualibs.loadmodule
local lualibs_basic_module = {
name = "lualibs-basic",
- version = "2.74", --TAGVERSION
- date = "2021-05-20", --TAGDATE
+ version = "2.75", --TAGVERSION
+ date = "2022-10-04", --TAGDATE
description = "ConTeXt Lua libraries -- basic collection.",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -621,7 +623,6 @@ if loaded == false then
loadmodule("lualibs-io.lua")
loadmodule("lualibs-os.lua")
loadmodule("lualibs-file.lua")
- loadmodule("lualibs-gzip.lua")
loadmodule("lualibs-md5.lua")
loadmodule("lualibs-dir.lua")
loadmodule("lualibs-unicode.lua")
@@ -664,8 +665,8 @@ lualibs = lualibs or { }
local lualibs_extended_module = {
name = "lualibs-extended",
- version = "2.74", --TAGVERSION
- date = "2021-05-20", --TAGDATE
+ version = "2.75", --TAGVERSION
+ date = "2022-10-04", --TAGDATE
description = "ConTeXt Lua libraries -- extended collection.",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -776,6 +777,7 @@ else
end
if loaded == false then
+ loadmodule("lualibs-util-sac.lua")--- streams: string based file parsers
loadmodule("lualibs-util-str.lua")--- string formatters (fast)
loadmodule("lualibs-util-fil.lua")--- extra file helpers
loadmodule("lualibs-util-tab.lua")--- extended table operations
@@ -795,6 +797,7 @@ if loaded == false then
loadmodule("lualibs-util-deb.lua")--- extra debugging
loadmodule("lualibs-util-tpl.lua")--- templating
loadmodule("lualibs-util-sta.lua")--- stacker (for writing pdf)
+ loadmodule("lualibs-util-zip.lua")--- compression and zip files
end
unfake_context() --- TODO check if this works at runtime
diff --git a/macros/luatex/generic/lualibs/lualibs.pdf b/macros/luatex/generic/lualibs/lualibs.pdf
index 23df3045e6..175e7e9f01 100644
--- a/macros/luatex/generic/lualibs/lualibs.pdf
+++ b/macros/luatex/generic/lualibs/lualibs.pdf
Binary files differ
diff --git a/macros/luatex/latex/japanese-mathformulas/README.txt b/macros/luatex/latex/japanese-mathformulas/README.txt
index b936573615..8f5c0199b8 100644
--- a/macros/luatex/latex/japanese-mathformulas/README.txt
+++ b/macros/luatex/latex/japanese-mathformulas/README.txt
@@ -1,5 +1,5 @@
japanese-mathformulas - mathematical formula using amsmath and tikz==================================
-version 1.0.0
+version 1.0.1
Licence----------------------------------------------------------------------------------------------
lppl1.3c
diff --git a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.pdf b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.pdf
index 6657bbf2e4..a1af2c5b67 100644
--- a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.pdf
+++ b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.pdf
Binary files differ
diff --git a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.tex b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.tex
index 08786e5a34..4eb0ec70a2 100644
--- a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.tex
+++ b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas-sample.tex
@@ -2,7 +2,7 @@
\usepackage{iwona}%
\usepackage{bookmark,xurl}
-\usepackage{mathformula,ascolorbox,enumerate,environ,tcolorbox,color}%
+\usepackage{japanese-mathformulas,ascolorbox,enumerate,environ,tcolorbox,color}%
\usepackage[hiragino-pron,deluxe,expert,bold]{luatexja-preset}%
\usepackage[usetype1]{uline--}
\usepackage[margin=15mm]{geometry}
diff --git a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.pdf b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.pdf
index e0b9699357..8514e8de6a 100644
--- a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.pdf
+++ b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.pdf
Binary files differ
diff --git a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.sty b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.sty
index 201d70314e..5038049b59 100644
--- a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.sty
+++ b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.sty
@@ -1,6 +1,6 @@
\NeedsTeXFormat{LaTeX2e}%
-\ProvidesPackage{mathformula}[2022/9/30,Version 1.0.0]%
+\ProvidesPackage{japanese-mathformulas}[2022/10/3,Version 1.0.1]%
\RequirePackage{luatexja}%
\RequirePackage{luatexja-fontspec}%
@@ -9,11 +9,36 @@
\RequirePackage{amsmath,amssymb,siunitx,ifthen,xparse,tikz,mathtools,graphics}%
\usetikzlibrary{arrows,shapes,intersections,calc,angles,decorations.shapes,arrows.meta,quotes,through,decorations.text}%
-\newcommand{\空行}{\vskip\baselineskip}%
+\newcommand{\空行}{\vskip0.00001\baselineskip}%
+%\def\空行{\br{.1}}
+\newlength{\@tempdimf@math}%
+\def\br{\@ifstar{\@br}{\@@br}}%
+\def\@br#1{%
+\allowbreak
+\setlength{\@tempdimf@math}{\baselineskip * \real{#1}}%
+\vspace*{\@tempdimf@math}%
+}%
+\def\@@br#1{%
+\setlength{\@tempdimf@math}{\baselineskip * \real{#1}}%
+\vspace{\@tempdimf@math}%
+}%
\newcommand{\半空行}{\vskip.5\baselineskip}%
\newcommand{\証明開始}{\noindent\textgt{【証明】}\par}%
-\newcommand{\証明終了}{\@rightalign{\ (Q.E.D.)}\par}%
+\newcommand{\証明終了}{\@rightalign{\ (Q.E.D.)}\par}%
\newcommand{\数式カンマスペース}{,\ }%
+\NewDocumentCommand\根号{ O{} m }%
+ {\ifthenelse{\equal{#1}{}}{\sqrt{#2\,}}{\sqrt[#1]{#2\,}}}%
+\newcommand{\ベクトル}[1]{\vec{\mathstrut #1}}%
+\newcommand{\overrightarrowtext}[1]{\overrightarrow{\text{#1}}}%
+\newcommand{\overarc}[1]%
+ {%
+ \tikz[baseline = (N.base),every node/.style={}]%
+ {%
+ \node[inner sep = 0pt](N){\text{#1}};%
+ \draw[line width = 0.4pt] plot [smooth, tension=1.3]coordinates%
+ {($(N.north west)+(0.1ex,0)$)($(N.north)+(0,0.5ex)$)($(N.north east)+(0,0)$)};%
+ }%
+ }%
\newcommand*{\@rightalign}[1]%
{%
\hspace{\parfillskip}%
@@ -23,7 +48,7 @@
\newcommand{\Ttyuukakko}[1]{\left(#1\right)}%
\newcommand{\Ttyuubracket}[1]{\left[#1\right]}%
\newcommand{\Tdaikakko}[1]{\left\{#1\right\}}%
-\newcommand{\Tzettaiti}[1]{\left|#1\right|}%
+\newcommand{\Tzettaiti}[1]{\left|\,#1\,\right|}%
\def\shikimaru#1{\text{\quad$\cdots\cdots$\,\ajMaru{#1}}}
\let\originalbigtriangleup\bigtriangleup
\def\bigtriangleup#1{\originalbigtriangleup{\mathrm{#1}}}
@@ -148,55 +173,55 @@
\NewDocumentCommand{\平方根}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
- {$a$は実数として,$\sqrt{a^2}=\Tzettaiti{a}$}%
+ {$a$は実数として,$\根号{a^2}=\Tzettaiti{a}$}%
{\relax}%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{b}}%
{%
$a$は実数として,%
- \[\sqrt{a^2}=\Tzettaiti{a}\]%
+ \[\根号{a^2}=\Tzettaiti{a}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{性質A}\AND\equal{#2}{i}}%
{%
$a\geqq0$のとき,%
- $\Ttyuukakko{\sqrt{a}}^2=\Ttyuukakko{-\sqrt{a}}^2=a\数式カンマスペース\sqrt{a}\leqq0$%
+ $\Ttyuukakko{\根号{a}}^2=\Ttyuukakko{-\根号{a}}^2=a\数式カンマスペース\根号{a}\leqq0$%
}%
{\relax}%
\ifthenelse{\equal{#1}{性質A}\AND\equal{#2}{b}}%
{%
$a\leqq0$のとき,%
- \[\Ttyuukakko{\sqrt{a}}^2=\Ttyuukakko{-\sqrt{a}}^2=a\数式カンマスペース\sqrt{a}\leqq0\]%
+ \[\Ttyuukakko{\根号{a}}^2=\Ttyuukakko{-\根号{a}}^2=a\数式カンマスペース\根号{a}\leqq0\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{性質B}\AND\equal{#2}{i}}%
- {$\sqrt{a}=\Tzettaiti{a}$}%
+ {$\根号{a}=\Tzettaiti{a}$}%
{\relax}%
\ifthenelse{\equal{#1}{性質B}\AND\equal{#2}{b}}%
- {\[\sqrt{a}=\Tzettaiti{a}\]}%
+ {\[\根号{a}=\Tzettaiti{a}\]}%
{\relax}%
\ifthenelse{\equal{#1}{性質C}\AND\equal{#2}{i}}%
{%
$a>0\数式カンマスペース b>0\数式カンマスペース a\neq b$のとき,%
- $\sqrt{a}\sqrt{b}=\sqrt{ab}$%
+ $\根号{a}\根号{b}=\根号{ab}$%
}%
{\relax}
\ifthenelse{\equal{#1}{性質C}\AND\equal{#2}{b}}%
{%
$a>0\数式カンマスペース b>0\数式カンマスペース a\neq b$のとき,%
- \[\sqrt{a}\sqrt{b}=\sqrt{ab}\]%
+ \[\根号{a}\根号{b}=\根号{ab}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{性質D}\AND\equal{#2}{i}}%
- {$\bunsuu{\sqrt{a}}{\sqrt{b}}=\sqrt{\bunsuu{a}{b}}$}%
+ {$\bunsuu{\根号{a}}{\根号{b}}=\根号{\bunsuu{a}{b}}$}%
{\relax}%
\ifthenelse{\equal{#1}{性質D}\AND\equal{#2}{b}}%
- {\[\bunsuu{\sqrt{a}}{\sqrt{b}}=\sqrt{\bunsuu{a}{b}}\]}%
+ {\[\bunsuu{\根号{a}}{\根号{b}}=\根号{\bunsuu{a}{b}}\]}%
{\relax}%
\ifthenelse{\equal{#1}{性質E}\AND\equal{#2}{i}}%
- {$\sqrt{k^2a}=k\sqrt{a}$}%
+ {$\根号{k^2a}=k\根号{a}$}%
{\relax}%
\ifthenelse{\equal{#1}{性質E}\AND\equal{#2}{b}}%
- {\[\sqrt{k^2a}=k\sqrt{a}\]}%
+ {\[\根号{k^2a}=k\根号{a}\]}%
{\relax}%
}%
@@ -311,24 +336,24 @@
\NewDocumentCommand{\二次方程式の解の公式}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {$ax^2+bx+c=0 \Ttyuukakko{a\neq0}$に対して,$x=\bunsuu{-b\pm\sqrt{b^2-4ac}}{2a}$}{\relax}%
+ {$ax^2+bx+c=0 \Ttyuukakko{a\neq0}$に対して,$x=\bunsuu{-b\pm\根号{b^2-4ac}}{2a}$}{\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
$ax^2+bx+c=0 \Ttyuukakko{a\neq0}$に対して,%
- \[x=\bunsuu{-b\pm\sqrt{b^2-4ac}}{2a}\]%
+ \[x=\bunsuu{-b\pm\根号{b^2-4ac}}{2a}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{証明A}}%
{%
\証明開始%
- \vspace{-1\zw}%
+ \vspace{-2.5\zw}%
\begin{align*}%
ax^2+bx+c&=0&\\%
a\Ttyuukakko{x^2+\bunsuu{b}{a}x}+c&=0&\\%
a\Tdaikakko{\Ttyuukakko{x+\bunsuu{b}{2a}}^2-\bunsuu{b^2}{4a^2}}+c&=0&\\%
a\Ttyuukakko{x+\bunsuu{b}{2a}}^2-\bunsuu{b^2}{4a}+c&=0&\\%
\Ttyuukakko{x+\bunsuu{b}{2a}}^2&=\bunsuu{b^2-4ac}{4a^2}&\\%
- x&=\bunsuu{-b\pm\sqrt{b^2-4ac}}{2a}%
+ x&=\bunsuu{-b\pm\根号{b^2-4ac}}{2a}%
\end{align*}%
\証明終了%
}%
@@ -336,13 +361,13 @@
\ifthenelse{\equal{#1}{証明B}}%
{%
\証明開始%
- \vspace{-1\zw}%
+ \vspace{-2.5\zw}%
\begin{align*}%
ax^2+bx+c&=0&\\%
4a^2x^2+4abx+4ac&=0&\\%
\Ttyuukakko{2ax+b}^2-b^2+4ac&=0&\\%
- 2ax+b&=\pm\sqrt{b^2-4ac}&\\%
- x&=\bunsuu{-b\pm\sqrt{b^2-4ac}}{2a}%
+ 2ax+b&=\pm\根号{b^2-4ac}&\\%
+ x&=\bunsuu{-b\pm\根号{b^2-4ac}}{2a}%
\end{align*}%
\証明終了%
}%
@@ -366,7 +391,7 @@
\draw pic["$\theta$",draw=black,->,thin,angle eccentricity=1.4,angle radius=0.4cm]{angle=B--A--C};%
\end{tikzpicture}%
\空行%
- 図の様な直角三角形ABCにおいて$\angle\mathrm{CAB}=\theta$のとき,%
+ 図の様な直角$\triangle{\text{ABC}}$において$\angle\mathrm{CAB}=\theta$のとき,%
\[%
\sin\theta=\bunsuu{\text{BC}}{\text{AC}}\数式カンマスペース%
\cos\theta=\bunsuu{\text{AB}}{\text{AC}}\数式カンマスペース%
@@ -467,15 +492,15 @@
\newcommand{\直線}{両方向に限りなく伸びたまっすぐな線。}%
-\newcommand{\線分}{直線ABのうち,二点A\数式カンマスペース Bを端とする部分。}%
+\newcommand{\線分}{直線$\text{AB}$のうち,二点$\text{A}\数式カンマスペース\text{B}$を端とする部分。}%
-\newcommand{\半直線}{直線ABのうち,一方の点を端とし,もう一方に限りなく伸びた部分。}%
+\newcommand{\半直線}{直線$\text{AB}$のうち,一方の点を端とし,もう一方に限りなく伸びた部分。}%
\newcommand{\距離}
{%
- 空でない集合Xの元$x\数式カンマスペース y$にたいして,実数値$d(x\数式カンマスペース y)$が定義され,%
+ 空でない集合Xの元$x\数式カンマスペース y$に対して,実数値$d(x\数式カンマスペース y)$が定義され,%
\[d(x\数式カンマスペース y)=0\Leftrightarrow x=y\数式カンマスペース\quad(x\数式カンマスペース y)=d(y\数式カンマスペース x)\数式カンマスペース\quad(x\数式カンマスペース y)\leqq d(x\数式カンマスペース y)+d(y\数式カンマスペース x)\]%
の三つの性質を満たす$d$をX上の距離といい,$(\text{X}\数式カンマスペース d)$を距離空間という。 %
}%
@@ -484,7 +509,7 @@
\newcommand{\円}{平面上の一点から等しい距離にある点の集合。}%
-\newcommand{\弧}{円周上の二点A\数式カンマスペース Bに対して,A\数式カンマスペース Bによって分けられた円周の各々の部分を弧ABといい,$\overarc{AB}$と表す。}%
+\newcommand{\弧}{円周上の二点$\text{A}\数式カンマスペース\text{B}$に対して,A\数式カンマスペース Bによって分けられた円周の各々の部分を弧$\text{AB}$といい,$\overarc{AB}$と表す。}%
\newcommand{\弦}{弧の両端を結んだ線分。}%
@@ -495,9 +520,9 @@
\NewDocumentCommand{\対頂角}{ m O{i} }%
{%
- \ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{定義}}%
{%
- \begin{tikzpicture}%
+ \begin{tikzpicture}%
\draw(0,0)--(2,2);%
\draw(2,0)--(0,2);%
\draw(0,0)coordinate(O);%
@@ -512,23 +537,23 @@
図において,$\angle\mathrm{A}$と$\angle\mathrm{B}$を対頂角という。%
}%
{\relax}%
- \ifthenelse{\equal{#1}{性質}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{性質}}%
{対頂角は等しい。}{\relax}%
\ifthenelse{\equal{#1}{証明}}%
{%
\証明開始%
\begin{tikzpicture}%
- \draw(0,0)--(2,2);%
- \draw(2,0)--(0,2);%
- \draw(0,0)coordinate(O);%
- \draw(2,2)coordinate(A);%
- \draw(2,0)coordinate(B);%
- \draw(0,2)coordinate(C);%
- \draw(1,1)coordinate(D);%
- \draw pic["A",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=A--D--C};%
- \draw pic["\,C",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.3cm] {angle=B--D--A};%
- \draw pic["B",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=O--D--B};%
- \end{tikzpicture}%
+ \draw(0,0)--(2,2);%
+ \draw(2,0)--(0,2);%
+ \draw(0,0)coordinate(O);%
+ \draw(2,2)coordinate(A);%
+ \draw(2,0)coordinate(B);%
+ \draw(0,2)coordinate(C);%
+ \draw(1,1)coordinate(D);%
+ \draw pic["A",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=A--D--C};%
+ \draw pic["\,C",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.3cm] {angle=B--D--A};%
+ \draw pic["B",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=O--D--B};%
+ \end{tikzpicture}%
\空行%
\[180^\circ =\angle\mathrm{A}+\angle\mathrm{C}\]%
\[180^\circ=\angle\mathrm{B}+\angle\mathrm{C}\]%
@@ -541,29 +566,29 @@
\NewDocumentCommand{\錯角}{ m O{i} }%
{%
- \ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{定義}}%
{%
\begin{tikzpicture}%
- \draw(-1,-0.5)--(2,1);%
- \draw(-1,-1)--(2,-1);%
- \draw(0,-2)--(2,2);%
- \draw(2,2)coordinate(A);%
- \draw(1.3333,0.66666)coordinate(B);%
- \draw(2,1)coordinate(C);%
- \draw(2,-1)coordinate(D);%
- \draw(0.5,-1)coordinate(E);%
- \draw(0,-2)coordinate(F);%
- \draw(-1,-1)coordinate(G);%
- \draw(-1,-0.5)coordinate(H);%
- \draw pic["\,A",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.3cm] {angle=E--B--C};%
- \draw pic["B\,\,\,",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.3cm] {angle=B--E--G};%
+ \draw(-1,-0.5)--(2,1);%
+ \draw(-1,-1)--(2,-1);%
+ \draw(0,-2)--(2,2);%
+ \draw(2,2)coordinate(A);%
+ \draw(1.3333,0.66666)coordinate(B);%
+ \draw(2,1)coordinate(C);%
+ \draw(2,-1)coordinate(D);%
+ \draw(0.5,-1)coordinate(E);%
+ \draw(0,-2)coordinate(F);%
+ \draw(-1,-1)coordinate(G);%
+ \draw(-1,-0.5)coordinate(H);%
+ \draw pic["\,A",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.3cm] {angle=E--B--C};%
+ \draw pic["B\,\,\,",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.3cm] {angle=B--E--G};%
\end{tikzpicture}
\空行%
図において,$\angle\mathrm{A}$と$\angle\mathrm{B}$を錯角という。%
}%
{\relax}%
- \ifthenelse{\equal{#1}{性質}\AND\equal{#2}{i}}%
- {直線$l\数式カンマスペース m$において,錯角が等しい$\Leftrightarrow$直線$l,m$は平行。}{\relax}%
+ \ifthenelse{\equal{#1}{性質}}%
+ {直線$l\数式カンマスペース m$において,錯角が等しい$\Leftrightarrow$直線$l\数式カンマスペース m$は平行。}{\relax}%
\ifthenelse{\equal{#1}{証明}}%
{%
\証明開始%
@@ -607,28 +632,28 @@
\NewDocumentCommand{\同位角}{ m O{i} }%
{%
- \ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{定義}}%
{%
\begin{tikzpicture}%
- \draw(-1,-0.5)--(2,1);%
- \draw(-1,-1)--(2,-1);%
- \draw(0,-2)--(2,2);%
- \draw(2,2)coordinate(A);%
- \draw(1.3333,0.66666)coordinate(B);%
- \draw(2,1)coordinate(C);%
- \draw(2,-1)coordinate(D);%
- \draw(0.5,-1)coordinate(E);%
- \draw(0,-2)coordinate(F);%
- \draw(-1,-1)coordinate(G);%
- \draw(-1,-0.5)coordinate(H);%
- \draw pic["\,\,A",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=C--B--A};%
- \draw pic["\,\,B",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=D--E--B};%
+ \draw(-1,-0.5)--(2,1);%
+ \draw(-1,-1)--(2,-1);%
+ \draw(0,-2)--(2,2);%
+ \draw(2,2)coordinate(A);%
+ \draw(1.3333,0.66666)coordinate(B);%
+ \draw(2,1)coordinate(C);%
+ \draw(2,-1)coordinate(D);%
+ \draw(0.5,-1)coordinate(E);%
+ \draw(0,-2)coordinate(F);%
+ \draw(-1,-1)coordinate(G);%
+ \draw(-1,-0.5)coordinate(H);%
+ \draw pic["\,\,A",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=C--B--A};%
+ \draw pic["\,\,B",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=D--E--B};%
\end{tikzpicture}
\空行%
図において,$\angle\mathrm{A}$と$\angle\mathrm{B}$を同位角という。
}%
{\relax}%
- \ifthenelse{\equal{#1}{公理}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{公理}}%
{直線$l,m$において,同位角が等しい$\Leftrightarrow$直線$l\数式カンマスペース m$は平行。}{\relax}%
}%
@@ -636,13 +661,12 @@
\NewDocumentCommand{\正弦定理}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {三角形ABCの外接円の半径をRとして,$\bunsuu{a}{\sin\text{A}}=2\text{R}\text{\ (}b\数式カンマスペース\text{B
+ {$\triangle{\text{ABC}}$の外接円の半径を$R$として,$\bunsuu{a}{\sin\text{A}}=2\text{R}\text{\ (}b\数式カンマスペース\text{B
}\数式カンマスペース c\数式カンマスペース\text{Cについても同様に成立})$}{\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
- 三角形ABCの外接円の半径をRとして,%
- \[\bunsuu{a}{sin\text{A}}=2\text{R}\]%
- ($b,B,c,C$についても同様に成立)%
+ $\triangle{\text{ABC}}$の外接円の半径を$R$として,%
+ \[\bunsuu{a}{sin\text{A}}=2R\text{\ (\,$b\数式カンマスペース\text{B}\数式カンマスペース c\数式カンマスペース\text{C}$についても同様に成立)}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{証明}}%
@@ -651,9 +675,9 @@
\空行%
\begin{tikzpicture}%
\draw(0,1.25)coordinate(A)-- (1,-0.75)coordinate(C)-- (-1,-0.75)coordinate(B);%
- \draw pic["A",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=B--A--C};%
+ \draw pic[draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=B--A--C};%
\draw(-1,0.75)coordinate(D);%
- \draw pic["D",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=B--D--C};%
+ \draw pic[draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=B--D--C};%
\draw(0,1.25)--(1,-0.75)--(-1,-0.75)--cycle;%
\draw(0,1.25)node[above]{A};%
\draw(1,-0.75)node[below]{C};%
@@ -681,10 +705,10 @@
\NewDocumentCommand{\余弦定理}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {三角形ABCにおいて,$a^2=b^2+c^2-2bc\cos\text{A}$}{\relax}%
+ {$\triangle{\text{ABC}}$において,$a^2=b^2+c^2-2bc\cos\text{A}$}{\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
- 三角形ABCにおいて,%
+ $\triangle{\text{ABC}}$において,%
\[a^2=b^2+c^2-2bc\cos\text{A}\]%
}%
{\relax}%
@@ -703,12 +727,12 @@
\draw(1.5,2)coordinate(B);%
\draw(1.5,0)--(1.5,2);%
\draw pic[draw,black,thin,angle radius=0.3cm] {right angle=A--H--B};%
- \draw pic["$A$",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=H--A--B};%
+ \draw pic[draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=H--A--B};%
\end{tikzpicture}%
\空行%
図において$\text{BC}=a,\text{CA}=b,\text{AC}=c$として,%
\[\text{BH}=c\sin\text{A},\quad\text{AH}=c\cos\text{A}\]%
- また,三角形BHCに三平方の定理を用いることにより%
+ また,$\triangle{\text{BHC}}$に三平方の定理を用いることにより%
\[\text{CB}^2=\text{BH}^2+\text{HC}^2\]%
ここで,$\text{HC}=\text{AC}-\text{AH}=b-c\cos\text{A},\quad\text{BH}=c\sin\text{A}$より%
\begin{align*}%
@@ -728,10 +752,10 @@
\NewDocumentCommand{\三角形の面積}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {三角形ABCの面積を$S$として,$S=\bunsuu{1}{2}bc\sin\text{A}$}{\relax}%
+ {$\triangle{\text{ABC}}$の面積を$S$として,$S=\bunsuu{1}{2}bc\sin\text{A}$}{\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
- 三角形ABCの面積を$S$として,%
+ $\triangle{\text{ABC}}$の面積を$S$として,%
\[S=\bunsuu{1}{2}bc\sin\text{A}\]%
}%
{\relax}%
@@ -749,12 +773,12 @@
\draw(1.5,2)coordinate(B);%
\draw(1.5,0)--(1.5,2);%
\draw pic[draw,black,thin,angle radius=0.3cm] {right angle=A--H--B};%
- \draw pic["$A$",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=H--A--B};%
+ \draw pic[draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=H--A--B};%
\end{tikzpicture}%
\空行%
図において%
\[\text{BC}=a\数式カンマスペース\text{CA}=B\数式カンマスペース\text{AC}=c\]%
- また,三角形ABCの面積を$S$として$S=\bunsuu{1}{2}\text{AC}\times\text{BH}$と,$AB\sin\text{A}=\text{BH}$から,%
+ また,$\triangle{\text{ABC}}$の面積を$S$として$S=\bunsuu{1}{2}\text{AC}\times\text{BH}$と,$\text{AB}\sin\text{A}=\text{BH}$から,%
\[S=\bunsuu{1}{2}bc\sin\text{A}\]%
\証明終了%
}%
@@ -773,13 +797,13 @@
\ifthenelse{\equal{#1}{補集合の要素の個数}\AND\equal{#2}{b}}%
{全体集合を$U$として,\[n\Ttyuukakko{\overline{A}}=n\Ttyuukakko{U}-n\Ttyuukakko{A}\]}{\relax}%
\ifthenelse{\equal{#1}{和の法則}\AND\equal{#2}{i}}%
- {二つの事象A\数式カンマスペース Bにたいして,Aの起こりかたが$a$通り,Bの起こりかたが$b$通りのとき,AまたはBの起こる場合の数は$a+b$通り}{\relax}%
+ {二つの事象$\text{A}$\数式カンマスペース Bにたいして,Aの起こりかたが$a$通り,Bの起こりかたが$b$通りのとき,AまたはBの起こる場合の数は$a+b$通り}{\relax}%
\ifthenelse{\equal{#1}{和の法則}\AND\equal{#2}{b}}%
- {二つの事象A\数式カンマスペース Bにたいして,Aの起こりかたが$a$通り,Bの起こりかたが$b$通りのとき,AまたはBの起こる場合の数は$a+b$通り}{\relax}%
+ {二つの事象$\text{A}$\数式カンマスペース Bにたいして,Aの起こりかたが$a$通り,Bの起こりかたが$b$通りのとき,AまたはBの起こる場合の数は$a+b$通り}{\relax}%
\ifthenelse{\equal{#1}{積の法則}\AND\equal{#2}{i}}%
- {二つの事象A\数式カンマスペース Bにたいして,Aの起こりかたが$a$通り,Bの起こりかたが$b$通りのとき,AかつBの起こる場合の数は$ab$通り}{\relax}%
+ {二つの事象$\text{A}$\数式カンマスペース Bにたいして,Aの起こりかたが$a$通り,Bの起こりかたが$b$通りのとき,AかつBの起こる場合の数は$ab$通り}{\relax}%
\ifthenelse{\equal{#1}{積の法則}\AND\equal{#2}{b}}%
- {二つの事象A\数式カンマスペース Bにたいして,Aの起こりかたが$a$通り,Bの起こりかたが$b$通りのとき,AかつBの起こる場合の数は$ab$通り}{\relax}%
+ {二つの事象$\text{A}$\数式カンマスペース Bにたいして,Aの起こりかたが$a$通り,Bの起こりかたが$b$通りのとき,AかつBの起こる場合の数は$ab$通り}{\relax}%
\ifthenelse{\equal{#1}{順列}\AND\equal{#2}{i}}%
{異なる$n$個のものから$r$個選んで並べる場合の数は${}_{n}P_{r}=\bunsuu{n!}{\Ttyuukakko{n-r}!}$}{\relax}%
\ifthenelse{\equal{#1}{順列}\AND\equal{#2}{b}}%
@@ -788,7 +812,7 @@
\[{}_{n}P_{r}=\bunsuu{n!}{\Ttyuukakko{n-r}!}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{順列の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{順列の証明}}%
{%
\証明開始%
異なる$n$個のものから$r$個選んで並べる場合の数は,%
@@ -801,7 +825,7 @@
{異なる$n$個のものを円に並べる場合の数は$\Ttyuukakko{n-1}!$}{\relax}%
\ifthenelse{\equal{#1}{円順列}\AND\equal{#2}{b}}%
{異なる$n$個のものを円に並べる場合の数は\[\Ttyuukakko{n-1}!\]}{\relax}%
- \ifthenelse{\equal{#1}{円順列の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{円順列の証明}}%
{%
\証明開始%
$n$個のものを円形に並べるとき,1つを固定して考えると,残り$n-1$個を並べる順列の個数に等しい。よって$\Ttyuukakko{n-1}!$通りとなる。%
@@ -819,7 +843,7 @@
\[{}_{n}C_{r}=\bunsuu{n!}{r!\Ttyuukakko{n-r}!}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{組み合わせの証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{組み合わせの証明}}%
{%
\証明開始%
異なる$n$個のものから$r$個選ぶ場合の数は,順列を重複度で割ったものなので%
@@ -829,14 +853,14 @@
}%
{\relax}%
\ifthenelse{\equal{#1}{同じものを含む順列}\AND\equal{#2}{i}}%
- {aが$p$個,bが$q$個,cが$r$個,とある時,それら全部を並べる場合の数は,$\bunsuu{n!}{p!q!r!}$(ただし,$p+q+r=n$)}{\relax}%
+ {$a$が$p$個,$b$が$q$個,$c$が$r$個,とあるとき,それら全部を並べる場合の数は,$\bunsuu{n!}{p!q!r!}$(ただし,$p+q+r=n$)}{\relax}%
\ifthenelse{\equal{#1}{同じものを含む順列}\AND\equal{#2}{b}}%
{%
- aが$p$個,bが$q$個,cが$r$個,とある時,それら全部を並べる場合の数は,%
+ $a$が$p$個,$b$が$q$個,$c$が$r$個,とあるとき,それら全部を並べる場合の数は,%
\[\bunsuu{n!}{p!q!r!}\text{\ (ただし,$p+q+r=n$)}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{同じものを含む順列の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{同じものを含む順列の証明}}%
{%
\証明開始%
$n$個のものを並べる場合の数は$n!$通りだが,$n$個の中に同じものが含まれているので,重複度で割ることで$\bunsuu{n!}{p!q!r!}$を得る。%
@@ -845,30 +869,30 @@
{\relax}%
\ifthenelse{\equal{#1}{確率の定義}\AND\equal{#2}{i}}%
- {全事象$U$のどの根元事象も同様に確からしいとき,事象Aの起こる確率は,$P\Ttyuukakko{A}=\bunsuu{n\Ttyuukakko{A}}{n\Ttyuukakko{U}}$}{\relax}%
+ {全事象$\text{U}$のどの根元事象も同様に確からしいとき,事象$\text{A}$の起こる確率は,$P\Ttyuukakko{A}=\bunsuu{n\Ttyuukakko{A}}{n\Ttyuukakko{U}}$}{\relax}%
\ifthenelse{\equal{#1}{確率の定義}\AND\equal{#2}{b}}%
{%
- 全事象$U$のどの根元事象も同様に確からしいとき,事象Aの起こる確率は,%
+ 全事象$\text{U}$のどの根元事象も同様に確からしいとき,事象$\text{A}$の起こる確率は,%
\[P\Ttyuukakko{A}=\bunsuu{n\Ttyuukakko{A}}{n\Ttyuukakko{U}}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{排反の定義}\AND\equal{#2}{i}}%
- {事象A\数式カンマスペース Bが同時に起こりえないとき}{\relax}%
+ {事象$\text{A}$\数式カンマスペース$\text{B}$が同時に起こりえないとき,AとBは互いに排反であるという。}{\relax}%
\ifthenelse{\equal{#1}{排反の定義}\AND\equal{#2}{b}}%
- {事象A\数式カンマスペース Bが同時に起こりえないとき}{\relax}%
+ {事象$\text{A}$\数式カンマスペース$\text{B}$が同時に起こりえないとき,AとBは互いに排反であるという。}{\relax}%
\ifthenelse{\equal{#1}{確率の性質A}\AND\equal{#2}{i}}%
- {任意の事象Aに対して,$0\leqq A\leqq1$}{\relax}%
+ {任意の事象$\text{A}$に対して,$0\leqq A\leqq1$}{\relax}%
\ifthenelse{\equal{#1}{確率の性質A}\AND\equal{#2}{b}}%
{%
- 任意の事象Aに対して,%
+ 任意の事象$\text{A}$に対して,%
\[0\leqq A\leqq1\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{確率の性質B}\AND\equal{#2}{i}}%
- {全事象Uの確率$P\Ttyuukakko{U}=1$}{\relax}%
+ {全事象$\text{U}$の確率$P\Ttyuukakko{U}=1$}{\relax}%
\ifthenelse{\equal{#1}{確率の性質B}\AND\equal{#2}{b}}%
{%
- 全事象Uの確率%
+ 全事象$\text{U}$の確率%
\[P\Ttyuukakko{U}=1\]%
}%
{\relax}%
@@ -881,35 +905,35 @@
\ifthenelse{\equal{#1}{余事象の確率}\AND\equal{#2}{b}}%
{\[P\Ttyuukakko{\overline{A}}=1-P\Ttyuukakko{A}\]}{\relax}%
\ifthenelse{\equal{#1}{独立な事象の確率}\AND\equal{#2}{i}}%
- {事象AとBが独立のとき,事象Aが起こりかつ事象Bが起こる確率$p$は,$p=P\Ttyuukakko{A}P\Ttyuukakko{B}$}{\relax}%
+ {事象$\text{A}$とBが独立のとき,事象$\text{A}$が起こりかつ事象$\text{B}$が起こる確率$p$は,$p=P\Ttyuukakko{A}P\Ttyuukakko{B}$}{\relax}%
\ifthenelse{\equal{#1}{独立な事象の確率}\AND\equal{#2}{b}}%
{%
- 事象AとBが独立のとき,事象Aが起こりかつ事象Bが起こる確率$p$は,%
+ 事象$\text{A}$とBが独立のとき,事象$\text{A}$が起こりかつ事象$\text{B}$が起こる確率$p$は,%
\[p=P\Ttyuukakko{A}P\Ttyuukakko{B}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{反復試行の確率}\AND\equal{#2}{i}}%
- {一回の試行で事象Aの起こる確率を$p$として,この試行を$n$回行う反復試行でAが$r$回起こる確率は,${}_{n}C_{r}\Ttyuukakko{p}^r\Ttyuukakko{1-p}^{n-r}$}{\relax}%
+ {一回の試行で事象$\text{A}$の起こる確率を$p$として,この試行を$n$回行う反復試行でAが$r$回起こる確率は,${}_{n}C_{r}\Ttyuukakko{p}^r\Ttyuukakko{1-p}^{n-r}$}{\relax}%
\ifthenelse{\equal{#1}{反復試行の確率}\AND\equal{#2}{b}}%
{%
- 一回の試行で事象Aの起こる確率を$p$として,この試行を$n$回行う反復試行でAが$r$回起こる確率は,%
+ 一回の試行で事象$\text{A}$の起こる確率を$p$として,この試行を$n$回行う反復試行でAが$r$回起こる確率は,%
\[{}_{n}C_{r}\Ttyuukakko{p}^r\Ttyuukakko{1-p}^{n-r}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{反復試行の確率の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{反復試行の確率の証明}}%
{%
\証明開始%
- $n$回の試行のうち事象Aが$r$回起こる順番の場合の数は${}_{n} C_{r}$通り。さらに,Aが起こる確率は$p$で$r$回起こり,Aの余事象が起こる確率は$p-1$で$n-r$回起こるので,%
+ $n$回の試行のうち事象$\text{A}$が$r$回起こる順番の場合の数は${}_{n} C_{r}$通り。さらに,Aが起こる確率は$p$で$r$回起こり,Aの余事象が起こる確率は$p-1$で$n-r$回起こるので,%
\[{}_{n}C_{r}\Ttyuukakko{p}^r\Ttyuukakko{1-p}^{n-r}\]%
となる。
\証明終了%
}%
{\relax}%
\ifthenelse{\equal{#1}{条件付き確率}\AND\equal{#2}{i}}%
- {事象Aが起こったときの事象Bの起こる確率は,$P_{A}\Ttyuukakko{B}=\bunsuu{P\Ttyuukakko{A\cap B}}{P\Ttyuukakko{A}}$}{\relax}%
+ {事象$\text{A}$が起こったときの事象$\text{B}$の起こる確率は,$P_{A}\Ttyuukakko{B}=\bunsuu{P\Ttyuukakko{A\cap B}}{P\Ttyuukakko{A}}$}{\relax}%
\ifthenelse{\equal{#1}{条件付き確率}\AND\equal{#2}{b}}%
{%
- 事象Aが起こったときの事象Bの起こる確率は,%
+ 事象$\text{A}$が起こったときの事象$\text{B}$の起こる確率は,%
\[P_{A}\Ttyuukakko{B}=\bunsuu{P\Ttyuukakko{A\cap B}}{P\Ttyuukakko{A}}\]%
}%
{\relax}%
@@ -1128,9 +1152,9 @@
\draw(0,0)circle[radius=2];%
\end{tikzpicture}%
\空行%
- 三角形AOP,BOPは二等辺三角形なので,%
+ $\triangle{\text{AOP}}$\数式カンマスペース$\triangle{\text{BOP}}$は二等辺三角形なので,%
\[\angle\mathrm{APO}=\angle\mathrm{OAP}\数式カンマスペース\angle\mathrm{BPO}=\angle\mathrm{OBP}\]%
- 三角形の外角より,%
+ 外角定理より,%
\[\angle\mathrm{AOD}=2\angle\mathrm{APO}\数式カンマスペース\angle\mathrm{BOD}=2\angle\mathrm{BPO}\]%
\[\Leftrightarrow\angle\mathrm{AOB}=2\angle\mathrm{APB}\]%
\空行%
@@ -1144,9 +1168,9 @@
\draw(0,0)circle[radius=2];%
\end{tikzpicture}%
\空行%
- 三角形OPBは二等辺三角形なので,%
+ $\triangle{\text{OPB}}$は二等辺三角形なので,%
\[\angle\mathrm{OPB}=\angle\mathrm{OBP}\]%
- 三角形の外角より%
+ 外角定理より%
\[\angle\mathrm{AOB}=2\angle\mathrm{OPB}\]%
\空行%
\begin{tikzpicture}%
@@ -1161,15 +1185,13 @@
\draw(0,0)circle[radius=2];%
\end{tikzpicture}%
\空行%
- 三角形QOA,OQBは二等辺三角形なので,%
+ $\triangle{\text{QOA}}\数式カンマスペース\triangle{\text{OQB}}$は二等辺三角形なので,%
\[\angle\mathrm{OQA}=\angle\mathrm{OAQ}\数式カンマスペース\angle\mathrm{OQB}=\angle\mathrm{OBQ}\]%
- となる,\par%
- 三角形の外角より,%
+ 外角定理より,%
\[\angle\mathrm{OQA}+\angle\mathrm{OAQ}=\angle\mathrm{DOA}\数式カンマスペース\angle\mathrm{OQB}+\angle\mathrm{OBQ}=\angle\mathrm{DOB}\]%
\[\Leftrightarrow\angle\mathrm{DOA}-\angle\mathrm{DOB}=2\Ttyuukakko{\angle\mathrm{OQA}-\angle\mathrm{BQO}}\]%
\[\Leftrightarrow\angle\mathrm{AOB}=2\angle\mathrm{AQB}\]%
- \空行%
- 従って,円に内接する三角形について,円周角の$2$倍が中心角である。\par%
+ 従って,円に内接する三角形について,円周角の$2$倍が中心角である。%
\空行%
\begin{tikzpicture}%
\draw(-1.6,-1.2)--(1.2,-1.6)--(1.2,1.6)--cycle;%
@@ -1182,7 +1204,6 @@
\draw(0,0)node[above]{O};%
\draw(0,0)circle[radius=2];%
\end{tikzpicture}%
- \空行%
\[\angle\mathrm{APB}=2\angle\mathrm{AOB},\angle\mathrm{AQB}=2\angle\mathrm{AOB}\]%
\[\Leftrightarrow\angle\mathrm{AQB}=\angle\mathrm{APB}\]が成立。
\証明終了%
@@ -1250,6 +1271,7 @@
\ifthenelse{\equal{#1}{接弦定理の証明}}%
{%
\証明開始%
+ \vspace{-1\zw}%
\begin{enumerate}%
\item 鋭角のとき%
\空行%
@@ -1270,9 +1292,9 @@
\draw pic[draw,black,thin,angle radius=0.3cm] {right angle=E--B--A};%
\end{tikzpicture}%
\空行%
- 三角形ACBとABEについて円周角の定理より,%
+ $\triangle{\text{ACB}}$と$\triangle{\text{ABE}}$について円周角の定理より,%
\[\angle\mathrm{ACB}=\angle\mathrm{AEB}\]%
- ここで,三角形ABEについて%
+ ここで,$\triangle{\text{ABE}}$について%
\[\angle\mathrm{BEA}+\angle\mathrm{BAE}=90^\circ\]%
また,ATが円の接線なので$\angle\mathrm{BAE}+\angle\mathrm{BAT}=90^\circ$から,%
\[\angle\mathrm{BAT}=\angle\mathrm{AEB}\]%
@@ -1314,7 +1336,7 @@
\空行%
鋭角のときの接弦定理より,%
\[\angle\mathrm{BCA}=\angle\mathrm{BAS}\]%
- また,三角形ABCにおいて%
+ また,$\triangle{\text{ABC}}$において%
\[\angle\mathrm{ABC}=\angle\mathrm{ACB}+\angle\mathrm{BAC}\]%
\[\Leftrightarrow\angle\mathrm{ABC}=\angle\mathrm{CAT}\]%
\空行%
@@ -1376,7 +1398,7 @@
\空行%
円周角の定理より,%
\[\angle\mathrm{CAP}=\angle\mathrm{BDP},\quad\angle\mathrm{ACP}=\angle\mathrm{DBP}\]%
- 三角形ACPと三角形DBPは相似なので,\par%
+ $\triangle{\text{ACP}}$と$\triangle{\text{DBP}}$は相似なので,%
\[\text{PA}\cdot\text{PB}=\text{PC}\cdot\text{PD}\]%
\証明終了%
}%
@@ -1414,7 +1436,7 @@
\空行%
内接四角形の証明より,%
\[\angle\mathrm{CDB}=\angle\mathrm{CAP}\数式カンマスペース\angle\mathrm{DBA}=\angle\mathrm{PCA}\]%
- 三角形ACPと三角形DPBは相似なので,%
+ $\triangle{\text{ACP}}$と$\triangle{\text{DPB}}$は相似なので,%
\[\text{PA}\cdot\text{PB}=\text{PC}\cdot\text{PD}\]%
\証明終了%
}%
@@ -1451,7 +1473,7 @@
\空行%
接弦定理より,%
\[\angle\mathrm{TBA}=\angle\mathrm{PTA}\]%
- これと,$\angle\mathrm{P}$共通なので三角形PTAと三角形PBTは相似より,%
+ これと,$\angle\mathrm{P}$共通なので$\triangle{\text{PTA}}$と$\triangle{\text{PBT}}$は相似より,%
\[\text{PA}\cdot\text{PB}=\text{PT}^2\]%
\証明終了%
}%
@@ -1548,22 +1570,22 @@
\NewDocumentCommand{\相加相乗平均}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {$a>0\数式カンマスペース b>0$のとき,$\bunsuu{a+b}{2}\geqq\sqrt{ab}$}{\relax}%
+ {$a>0\数式カンマスペース b>0$のとき,$\bunsuu{a+b}{2}\geqq\根号{ab}$}{\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
$a>0\数式カンマスペース b>0$のとき,%
- \[\bunsuu{a+b}{2}\geqq\sqrt{ab}\]%
+ \[\bunsuu{a+b}{2}\geqq\根号{ab}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{証明}}%
{%
\証明開始%
- $a+b-2\sqrt{ab}\geqq0$を示す。%
- \[a+b-2\sqrt{ab}=\Ttyuukakko{\sqrt{a}-\sqrt{b}}^2\]%
- より,$\sqrt{a}-\sqrt{b}$は実数なので,%
- \[\Ttyuukakko{\sqrt{a}-\sqrt{b}}^2\geqq0\]%
+ $a+b-2\根号{ab}\geqq0$を示す。%
+ \[a+b-2\根号{ab}=\Ttyuukakko{\根号{a}-\根号{b}}^2\]%
+ より,$\根号{a}-\根号{b}$は実数なので,%
+ \[\Ttyuukakko{\根号{a}-\根号{b}}^2\geqq0\]%
よって,$a>0\数式カンマスペース b>0$のとき,%
- \[\bunsuu{a+b}{2}\geqq\sqrt{ab}\text{\ (等号成立条件は$a=b$)}\]%
+ \[\bunsuu{a+b}{2}\geqq\根号{ab}\text{\ (等号成立条件は$a=b$)}\]%
\証明終了%
}%
{\relax}%
@@ -1573,9 +1595,9 @@
\NewDocumentCommand{\虚数の定義}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
- {$i=\sqrt{-1}$}{\relax}%
+ {$i=\根号{-1}$}{\relax}%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{b}}%
- {\[i=\sqrt{-1}\]}{\relax}%
+ {\[i=\根号{-1}\]}{\relax}%
}%
@@ -1623,9 +1645,10 @@
\[\alpha\beta=\bunsuu{c}{a}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{二次方程式の解と係数の関係の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{二次方程式の解と係数の関係の証明}}%
{%
\証明開始%
+ \vspace{-2.5\zw}%
\[ax^2+bx+c=a\Ttyuukakko{x-\alpha}\Ttyuukakko{x-\beta}=a\Tdaikakko{x^2-\Ttyuukakko{\alpha+\beta}x+\alpha\beta}\]%
\[\Leftrightarrow ax^2+bx+c=a\Ttyuukakko{x^2+\bunsuu{b}{a}x+\bunsuu{c}{a}}\]%
係数比較することで,%
@@ -1657,10 +1680,10 @@
\[\alpha\beta\gamma=-\bunsuu{d}{a}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{三次方程式の解と係数の関係の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{三次方程式の解と係数の関係の証明}}%
{%
\証明開始%
- \vspace{-1\zw}
+ \vspace{-2.5\zw}%
\[ax^{3}+bx^2+cx+d=a\Ttyuukakko{x-\alpha}\Ttyuukakko{x-\beta}\Ttyuukakko{x-\gamma}=a\Tdaikakko{x^3-\Ttyuukakko{\alpha+\beta+\gamma}x^2+\Ttyuukakko{\alpha\beta+\beta\gamma+\gamma\alpha}x-\alpha\beta\gamma}\]%
\[\Leftrightarrow ax^{3}+bx^2+cx+d=a\Ttyuukakko{x^3+\bunsuu{b}{a}x^2+\bunsuu{c}{a}x+\bunsuu{d}{a}}\]%
係数比較することで,\par%
@@ -1732,48 +1755,49 @@
\NewDocumentCommand{\点の座標}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{二点間の距離}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$AB$間の距離は,$\sqrt{\Ttyuukakko{x_{2}-x_{1}}^2-\Ttyuukakko{y_{2}-y_{1}}^2}$}{\relax}%
+ {$\text{A}\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース \text{B}\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$\text{AB}$間の距離は,$\根号{\Ttyuukakko{x_{2}-x_{1}}^2-\Ttyuukakko{y_{2}-y_{1}}^2}$}{\relax}%
\ifthenelse{\equal{#1}{二点間の距離}\AND\equal{#2}{b}}%
{%
- $A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$AB$間の距離は,%
- \[\sqrt{\Ttyuukakko{x_{2}-x_{1}}^2-\Ttyuukakko{y_{2}-y_{1}}^2}\]%
+ $\text{A}\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース \text{B}\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$\text{AB}$間の距離は,%
+ \[\根号{\Ttyuukakko{x_{2}-x_{1}}^2-\Ttyuukakko{y_{2}-y_{1}}^2}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{内分点の座標}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$AB$を$m:n$に内分する点の座標は,$\Ttyuukakko{\bunsuu{nx_{1}+mx_{2}}{n+m}\数式カンマスペース\bunsuu{ny_{1}+my_{2}}{n+m}}$}{\relax}%
+ {$\text{A}\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース \text{B}\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$\text{AB}$を$m:n$に内分する点の座標は,$\Ttyuukakko{\bunsuu{nx_{1}+mx_{2}}{n+m}\数式カンマスペース\bunsuu{ny_{1}+my_{2}}{n+m}}$}{\relax}%
\ifthenelse{\equal{#1}{内分点の座標}\AND\equal{#2}{b}}%
{%
- $A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$AB$を$m:n$に内分する点の座標は,%
+ $\text{A}\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース \text{B}\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$\text{AB}$を$m:n$に内分する点の座標は,%
\[\Ttyuukakko{\bunsuu{nx_{1}+mx_{2}}{n+m}\数式カンマスペース\bunsuu{ny_{1}+my_{2}}{n+m}}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{内分点の座標の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{内分点の座標の証明}}%
{%
\証明開始%
- $m:n$に内分する点の座標を$P\Ttyuukakko{x\数式カンマスペース y}$として,%
+ $m:n$に内分する点の座標を$\text{P}\Ttyuukakko{x\数式カンマスペース y}$として,%
\[m:n=x-x_{1}:x_{2}-x\]%
\[\Leftrightarrow\Ttyuukakko{\bunsuu{nx_{1}+mx_{2}}{n+m}\数式カンマスペース\bunsuu{ny_{1}+my_{2}}{n+m}}\]%
\証明終了%
}%
{\relax}%
\ifthenelse{\equal{#1}{外分点の座標}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$AB$を$m:n$に外分する点の座標は,$\Ttyuukakko{\bunsuu{-nx_{1}+mx_{2}}{m-n}\数式カンマスペース \bunsuu{-ny_{1}+my_{2}}{m-n}}$}{\relax}%
+ {$\text{A}\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース \text{B}\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$\text{AB}$を$m:n$に外分する点の座標は,$\Ttyuukakko{\bunsuu{-nx_{1}+mx_{2}}{m-n}\数式カンマスペース \bunsuu{-ny_{1}+my_{2}}{m-n}}$}{\relax}%
\ifthenelse{\equal{#1}{外分点の座標}\AND\equal{#2}{b}}%
{%
- $A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$AB$を$m:n$に外分する点の座標は,%
+ $\text{A}\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース \text{B}\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$\text{AB}$を$m:n$に外分する点の座標は,%
\[\Ttyuukakko{\bunsuu{-nx_{1}+mx_{2}}{m-n}\数式カンマスペース \bunsuu{-ny_{1}+my_{2}}{m-n}}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{外分点の座標の証明}\AND\equal{#2}{b}}%
+ \ifthenelse{\equal{#1}{外分点の座標の証明}}%
{%
\証明開始%
+ \vspace{-1\zw}%
\begin{enumerate}%
\item $m>n$のとき\par%
- $n:m$に外分する点の座標を$P\Ttyuukakko{x\数式カンマスペース y}$として,%
+ $n:m$に外分する点の座標を$\text{P}\Ttyuukakko{x\数式カンマスペース y}$として,%
\[m:n=x-x_{1}:x-x_{2}\]%
\[\Leftrightarrow\Ttyuukakko{\bunsuu{-nx_{1}+mx_{2}}{m-n}\数式カンマスペース \bunsuu{-ny_{1}+my_{2}}{m-n}}\]%
\item $m<n$のとき\par%
- $n:m$に外分する点の座標を$P\Ttyuukakko{x\数式カンマスペース y}$として,%
+ $n:m$に外分する点の座標を$\text{P}\Ttyuukakko{x\数式カンマスペース y}$として,%
\[m:n=x-x_{2}:x-x_{1}\]%
\[\Leftrightarrow\Ttyuukakko{\bunsuu{-nx_{1}+mx_{2}}{m-n}\数式カンマスペース \bunsuu{-ny_{1}+my_{2}}{m-n}}\]%
\end{enumerate}%
@@ -1784,14 +1808,14 @@
}%
{\relax}%
\ifthenelse{\equal{#1}{中点の座標}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$AB$の中点は,$\Ttyuukakko{\bunsuu{x_{1}+x_{2}}{2}\数式カンマスペース\bunsuu{y_{1}+y_{2}}{2}}$}{\relax}%
+ {$\text{A}\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース \text{B}\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$\text{AB}$の中点は,$\Ttyuukakko{\bunsuu{x_{1}+x_{2}}{2}\数式カンマスペース\bunsuu{y_{1}+y_{2}}{2}}$}{\relax}%
\ifthenelse{\equal{#1}{中点の座標}\AND\equal{#2}{b}}%
{%
- $A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$AB$の中点は,%
+ $\text{A}\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース \text{B}\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}$として,線分$\text{AB}$の中点は,%
\[\Ttyuukakko{\bunsuu{x_{1}+x_{2}}{2}\数式カンマスペース\bunsuu{y_{1}+y_{2}}{2}}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{中点の座標の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{中点の座標の証明}}%
{%
\証明開始%
内分点の公式において$m=n$のとき,%
@@ -1800,14 +1824,14 @@
}%
{\relax}%
\ifthenelse{\equal{#1}{重心の座標}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}\数式カンマスペース C\Ttyuukakko{x_{3}\数式カンマスペース y_{3}}$として,三角形$ABC$の重心の座標は,$\Ttyuukakko{\bunsuu{x_{1}+x_{2}+x_{3}}{3}\数式カンマスペース\bunsuu{y_{1}+y_{2}+y_{3}}{3}}$}{\relax}%
+ {$A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}\数式カンマスペース C\Ttyuukakko{x_{3}\数式カンマスペース y_{3}}$として,$\triangle{\text{ABC}}$の重心の座標は,$\Ttyuukakko{\bunsuu{x_{1}+x_{2}+x_{3}}{3}\数式カンマスペース\bunsuu{y_{1}+y_{2}+y_{3}}{3}}$}{\relax}%
\ifthenelse{\equal{#1}{重心の座標}\AND\equal{#2}{b}}%
{%
- $A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}\数式カンマスペース C\Ttyuukakko{x_{3}\数式カンマスペース y_{3}}$として,三角形$ABC$の重心の座標は,%
+ $A\Ttyuukakko{x_{1}\数式カンマスペース y_{1}}\数式カンマスペース B\Ttyuukakko{x_{2}\数式カンマスペース y_{2}}\数式カンマスペース C\Ttyuukakko{x_{3}\数式カンマスペース y_{3}}$として,$\triangle{\text{ABC}}$の重心の座標は,%
\[\Ttyuukakko{\bunsuu{x_{1}+x_{2}+x_{3}}{3}\数式カンマスペース\bunsuu{y_{1}+y_{2}+y_{3}}{3}}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{重心の座標の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{重心の座標の証明}}%
{%
\証明開始%
$A$と$B$の中点$M$の座標は$\Ttyuukakko{\bunsuu{x_{1}+x_{2}}{2}\数式カンマスペース\bunsuu{y_{1}+y_{2}}{2}}$\par%
@@ -1844,7 +1868,7 @@
\ifthenelse{\equal{#1}{公式Bの証明}}%
{%
\証明開始%
- 傾き$m$なので,$y=mx+a$と置ける($a$は切片)。\par%
+ 傾き$m$なので,$y=mx+a$と置ける(\,$a$は切片)。\par%
ここで,$\Ttyuukakko{x_{1\数式カンマスペース x_{2}}}$を通るので,$y_{1}=mx_{1}+a$となり,連立することで%
\[y-y_{1}=m\Ttyuukakko{x-x_{1}}\]%
を得る。%
@@ -1872,7 +1896,7 @@
\[\Leftrightarrow m_{1}m_{2}=-1\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{公式Bの証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{公式Bの証明}}%
{%
\証明開始%
$y=mx_{1}$上に点A$\Ttyuukakko{1\数式カンマスペース m_{1}}$\数式カンマスペース $y=mx_{2}$上にB$\Ttyuukakko{-m_{1}\数式カンマスペース 1}$をとる。\par%
@@ -1888,12 +1912,12 @@
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
{%
- 点$\Ttyuukakko{x_{1}\数式カンマスペース y_{2}}$と直線$ax+bx+c=0$の距離は,$\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\sqrt{a^2+b^2}}$%
+ 点$\Ttyuukakko{x_{1}\数式カンマスペース y_{2}}$と直線$ax+bx+c=0$の距離は,$\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\根号{a^2+b^2}}$%
}{\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
点$\Ttyuukakko{x_{1}\数式カンマスペース y_{2}}$と直線$ax+bx+c=0$の距離は,%
- \[\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\sqrt{a^2+b^2}}\]%
+ \[\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\根号{a^2+b^2}}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{証明}}%
@@ -1901,14 +1925,15 @@
\証明開始%
全体を$x$軸方向に$-x_{1}$\数式カンマスペース $y$軸方向に$-y_{1}$平行移動するとき,直線$l$は$a\Ttyuukakko{x+x_{1}}+b\Ttyuukakko{y+y_{1}}+c=0$となる。\par%
また,直線$l$に原点Oからおろした垂線との交点をHとする。ここでOH間の距離を$d$と置くと,%
+ \vspace{-1\zw}%
\begin{enumerate}%
\item $a\neq0$のとき\par%
直線$l$の垂線の傾きは$b$の値に依らず,$y=\bunsuu{b}{a}$となる。\par%
よって,Hの座標は二式を連立することで得られ,%
\[\Ttyuukakko{\bunsuu{-a\Ttyuukakko{ax_{1}+by_{1}+c}}{a^2+b^2}\数式カンマスペース\bunsuu{-b\Ttyuukakko{ax_{1}+by_{1}+c}}{a^2+b^2}}\]%
\begin{align*}%
- \Leftrightarrow d&=\sqrt{\Tdaikakko{\Ttyuukakko{\bunsuu{-a\Ttyuukakko{ax_{1}+by_{1}+c}}{a^2+b^2}}^2+\Tdaikakko{\bunsuu{-b\Ttyuukakko{ax_{1}+by_{1}+c}}{a^2+b^2}}}^2}&\\%
- &=\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\sqrt{a^2+b^2}} %
+ \Leftrightarrow d&=\根号{\Tdaikakko{\Ttyuukakko{\bunsuu{-a\Ttyuukakko{ax_{1}+by_{1}+c}}{a^2+b^2}}^2+\Tdaikakko{\bunsuu{-b\Ttyuukakko{ax_{1}+by_{1}+c}}{a^2+b^2}}}^2}&\\%
+ &=\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\根号{a^2+b^2}} %
\end{align*}%
\item $a=0$のとき\par%
直線$l$は$y=-\bunsuu{by_{1}+c}{b}$となるので,%
@@ -1916,10 +1941,10 @@
d&=\Tzettaiti{-\bunsuu{by_{1}+c}{b}}&\\%
&=\bunsuu{\Tzettaiti{by_{1}+c}}{\Tzettaiti{b}}&\\%
\end{align*}%
- これは,$\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\sqrt{a^2+b^2}}$に$a=0$を代入したものである。
+ これは,$\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\根号{a^2+b^2}}$に$a=0$を代入したものである。
\end{enumerate}%
よって,いずれの場合も%
- \[\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\sqrt{a^2+b^2}}\]%
+ \[\bunsuu{\Tzettaiti{ax_{1}+by_{2}+c}}{\根号{a^2+b^2}}\]%
を得る。%
\証明終了%
}%
@@ -1930,8 +1955,8 @@
\NewDocumentCommand{\円の方程式}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {中心$\Ttyuukakko{a\数式カンマスペース b}$で半径$r$の円は,$\Ttyuukakko{x-a}^2+\Ttyuukakko{y-b}^2=r^2$と表す($x^2+y^2+Ax+By+C=0\Ttyuukakko{l^2+m^2-4n>0}$の形でもよい)。}{\relax}%
- \ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
+ {中心$\Ttyuukakko{a\数式カンマスペース b}$で半径$r$の円は,$\Ttyuukakko{x-a}^2+\Ttyuukakko{y-b}^2=r^2$と表す(\,$x^2+y^2+Ax+By+C=0\Ttyuukakko{A^2+B^2-4C>0}$の形でもよい)。}{\relax}%
+ \ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
中心$\Ttyuukakko{a\数式カンマスペース b}$で半径$r$の円は,%
\[\Ttyuukakko{x-a}^2+\Ttyuukakko{y-b}^2=r^2\]%
@@ -1943,7 +1968,7 @@
\ifthenelse{\equal{#1}{証明}}%
{%
\証明開始%
- 円の中心をO\数式カンマスペース 円周上の任意の点を$P\Ttyuukakko{x\数式カンマスペース y}$として,三平方の定理より%
+ 円の中心をO\数式カンマスペース 円周上の任意の点を$\text{P}\Ttyuukakko{x\数式カンマスペース y}$として,三平方の定理より%
\[\Ttyuukakko{x-a}^2+\Ttyuukakko{y-b}^2=r^2\]%
\証明終了%
}%
@@ -1964,15 +1989,16 @@
\ifthenelse{\equal{#1}{証明}}%
{%
\証明開始%
+ \vspace{-1\zw}%
\begin{enumerate}%
\item $x_{0}\neq0\数式カンマスペース y_{0}\neq0$のとき\par%
$A\Ttyuukakko{x_{0}\数式カンマスペース y_{0}}$と置いて,OAの傾きは$\bunsuu{y_{0}}{x_{0}}$となる。接線の傾きはこれに垂直なので,$-\bunsuu{x_{0}}{y_{0}}$また接線は点$\Ttyuukakko{x_{0}\数式カンマスペース y_{0}}$を通るので%
\[y=-\bunsuu{x_{0}}{y_{0}}\Ttyuukakko{x-x_{0}}+y_{0}\]%
より,$\Ttyuukakko{x_{0}\数式カンマスペース y_{0}}$が$x^2+y^2=r^2$上に存在することに留意して,$x_{0}x+y_{0}y=r^2$となる。\par%
\item $x_{0}\neq0$のとき\par%
- $y_{0}=\pm r$より接線は$y=\pm r\text{\ (複合同順)}$\par%
+ $y_{0}=\pm r$より接線は$y=\pm r\text{\ (複号同順)}$\par%
\item $y_{0}=0$のとき\par%
- $x_{0}=\pm r$より接線は$x=\pm r\text{\ (複合同順)}$%
+ $x_{0}=\pm r$より接線は$x=\pm r\text{\ (複号同順)}$%
\end{enumerate}%
よって,接線の方程式は%
\[xx_{1}+yy_{1}=r^2\]%
@@ -2103,17 +2129,17 @@
\NewDocumentCommand{\三角関数の加法定理}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$\sin\Ttyuukakko{\alpha\pm\beta}=\sin\alpha \cos\beta\pm \cos\alpha \sin\beta$}{\relax}%
+ {$\sin\Ttyuukakko{\alpha\pm\beta}=\sin\alpha \cos\beta\pm \cos\alpha \sin\beta\text{\ (複号同順)}$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
- {\[\sin\Ttyuukakko{\alpha\pm\beta}=\sin\alpha \cos\beta\pm \cos\alpha \sin\beta\]}{\relax}%
+ {\[\sin\Ttyuukakko{\alpha\pm\beta}=\sin\alpha \cos\beta\pm \cos\alpha \sin\beta\text{\ (複号同順)}\]}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$\cos\Ttyuukakko{\alpha\pm\beta}=\cos\alpha \cos\beta\mp \sin\alpha \sin\beta$}{\relax}%
+ {$\cos\Ttyuukakko{\alpha\pm\beta}=\cos\alpha \cos\beta\mp \sin\alpha \sin\beta\text{\ (複号同順)}$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
- {\[\cos\Ttyuukakko{\alpha\pm\beta}=\cos\alpha \cos\beta\mp \sin\alpha \sin\beta\]}{\relax}%
+ {\[\cos\Ttyuukakko{\alpha\pm\beta}=\cos\alpha \cos\beta\mp \sin\alpha \sin\beta\]\text{\ (複号同順)}}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{i}}%
- {$\tan\Ttyuukakko{\alpha\pm\beta}=\bunsuu{\tan\alpha \pm \tan\beta}{1\mp \tan\alpha \tan\beta}$}{\relax}%
+ {$\tan\Ttyuukakko{\alpha\pm\beta}=\bunsuu{\tan\alpha \pm \tan\beta}{1\mp \tan\alpha \tan\beta}\text{\ (複号同順)}$}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{b}}%
- {\[\tan\Ttyuukakko{\alpha\pm\beta}=\bunsuu{\tan\alpha \pm \tan\beta}{1\mp \tan\alpha \tan\beta}\]}{\relax}%
+ {\[\tan\Ttyuukakko{\alpha\pm\beta}=\bunsuu{\tan\alpha \pm \tan\beta}{1\mp \tan\alpha \tan\beta}\text{\ (複号同順)}\]}{\relax}%
\ifthenelse{\equal{#1}{証明}}%
{%
\証明開始%
@@ -2137,7 +2163,7 @@
\draw pic["$\beta$",draw=black,-,thin,angle eccentricity=1.4,angle radius=0.4cm] {angle=R--O--Q};%
\end{tikzpicture}%
\空行%
- 図において,三角関数の性質より$\cos\Ttyuukakko{\beta-\alpha}=\cos\Ttyuukakko{\alpha-\beta}$なので,三角形QOPについて余弦定理より%
+ 図において,三角関数の性質より$\cos\Ttyuukakko{\beta-\alpha}=\cos\Ttyuukakko{\alpha-\beta}$なので,$\triangle{\text{QOP}}$について余弦定理より%
\[\mathrm{QP}^2=1^2+1^2-2\cdot1\cdot1\cdot\cos\Ttyuukakko{\alpha-\beta}\]%
また,QP間の距離について三平方の定理を用いて%
\[\mathrm{QP}^2=\Ttyuukakko{\cos\beta-\cos\alpha}^2+\Ttyuukakko{\sin\alpha-\sin\beta}^2\]%
@@ -2155,9 +2181,9 @@
\[\sin\Ttyuukakko{\alpha-\beta}=\sin\alpha \cos\beta-\cos\alpha \sin\beta\]%
\空行%
$\tan\theta=\bunsuu{\sin\theta}{\cos\theta}$より,%
- \[\tan\Ttyuukakko{\alpha\pm\beta}=\bunsuu{\sin\alpha \cos\beta\pm \cos\alpha \sin\beta}{\cos\alpha \cos\beta\mp \sin\alpha \sin\beta}\]%
+ \[\tan\Ttyuukakko{\alpha\pm\beta}=\bunsuu{\sin\alpha \cos\beta\pm \cos\alpha \sin\beta}{\cos\alpha \cos\beta\mp \sin\alpha \sin\beta}\text{\ (複号同順)}\]%
両辺を$\cos\alpha\cos\beta$でわることで,%
- \[\tan\Ttyuukakko{\alpha\pm\beta}=\bunsuu{\tan\alpha \pm \tan\beta}{1\mp \tan\alpha \tan\beta}\]%
+ \[\tan\Ttyuukakko{\alpha\pm\beta}=\bunsuu{\tan\alpha \pm \tan\beta}{1\mp \tan\alpha \tan\beta}\text{\ (複号同順)}\]%
を得る。%
\証明終了%
}%
@@ -2184,20 +2210,26 @@
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{b}}%
{\[\cos2\alpha=1-2\sin^{2}\alpha\]}{\relax}%
\ifthenelse{\equal{#1}{公式E}\AND\equal{#2}{i}}%
- {$\tan2\alpha=\frac{2\tan\alpha}{1-\tan^{2}\alpha}$}{\relax}%
+ {$\tan2\alpha=\bunsuu{2\tan\alpha}{1-\tan^{2}\alpha}$}{\relax}%
\ifthenelse{\equal{#1}{公式E}\AND\equal{#2}{b}}%
- {\[\tan2\alpha=\frac{2\tan\alpha}{1-\tan^{2}\alpha}\]}{\relax}%
+ {\[\tan2\alpha=\bunsuu{2\tan\alpha}{1-\tan^{2}\alpha}\]}{\relax}%
\ifthenelse{\equal{#1}{証明}}%
{%
\証明開始%
- 三角関数の加法定理\par%
- \[\sin\Ttyuukakko{\alpha+\beta}=\sin\alpha \cos\beta+ \cos\alpha \sin\beta\]%
- \[\cos\Ttyuukakko{\alpha+\beta}=\cos\alpha \cos\beta- \sin\alpha \sin\beta\]%
- \[\tan\Ttyuukakko{\alpha+\beta}=\bunsuu{\tan\alpha + \tan\beta}{1- \tan\alpha \tan\beta}\]%
- において,$\alpha=\beta=\theta$として,%
- \[\sin2\theta=2\sin\theta\cos\theta\]%
- \[\cos2\theta=\cos^{2}\theta-\sin^{2}\theta\]%
- \[\tan2\theta=\bunsuu{2\tan\theta}{1-\tan^{2}\theta}\]%
+ 三角関数の加法定理%
+ \phrases@math[c]%
+ {%
+ $\sin\Ttyuukakko{\alpha+\beta}=\sin\alpha \cos\beta+\cos\alpha \sin\beta$\\%
+ $\cos\Ttyuukakko{\alpha+\beta}=\cos\alpha \cos\beta-\sin\alpha \sin\beta$\\%
+ $\tan\Ttyuukakko{\alpha+\beta}=\bunsuu{\tan\alpha+\tan\beta}{1-\tan\alpha \tan\beta}$%
+ }%
+ において,$\alpha=\beta=\theta$として,\par%
+ \hspace{3\zw}\phrases@math[c]%
+ {%
+ $\sin2\theta=2\sin\theta\cos\theta$\\%
+ $\cos2\theta=\cos^{2}\theta-\sin^{2}\theta$\\%
+ $\tan2\theta=\bunsuu{2\tan\theta}{1-\tan^{2}\theta}$%
+ }%
を得る。\par%
また,$\cos2\theta=\cos^{2}\theta-\sin^{2}\theta$において,三角関数の相互関係$\sin^2\theta+\cos^2\theta=1$を用いて,%
\[\cos2\theta=2\cos^{2}\theta-1\]%
@@ -2321,10 +2353,25 @@
\NewDocumentCommand{\三角関数の合成}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {$a\sin\theta+b\cos\theta=\sqrt{a^2+b^2}\sin\Ttyuukakko{\theta+\alpha}\text{\ (ただし,$\sin\alpha=\bunsuu{b}{\sqrt{a^2+b^2}}\数式カンマスペース\cos\alpha=\bunsuu{a}{\sqrt{a^2+b^2}}$)}$}{\relax}%
+ {%
+ $%
+ a\sin\theta+b\cos\theta=\根号{a^2+b^2}\sin\Ttyuukakko{\theta+\alpha}\ %
+ \Ttyuukakko%
+ {%
+ \text%
+ {%
+ ただし,%
+ $%
+ \sin\alpha=\bunsuu{b}{\根号{a^2+b^2}}\数式カンマスペース\cos\alpha=\bunsuu{a}{\根号{a^2+b^2}}%
+ $%
+ }%
+ }%
+ $%
+ }%
+ {\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
- \[a\sin\theta+b\cos\theta=\sqrt{a^2+b^2}\sin\Ttyuukakko{\theta+\alpha}\text{\ (ただし,$\sin\alpha=\bunsuu{b}{\sqrt{a^2+b^2}}\数式カンマスペース\cos\alpha=\bunsuu{a}{\sqrt{a^2+b^2}}$)}\]%
+ \[a\sin\theta+b\cos\theta=\根号{a^2+b^2}\sin\Ttyuukakko{\theta+\alpha}\text{\ $\Ttyuukakko{\text{ただし,$\sin\alpha=\bunsuu{b}{\根号{a^2+b^2}}\数式カンマスペース\cos\alpha=\bunsuu{a}{\根号{a^2+b^2}}$}}$}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{証明}}%
@@ -2332,9 +2379,9 @@
\証明開始%
三角関数の加法定理\par%
$\sin\Ttyuukakko{\alpha+\beta}=\sin\alpha \cos\beta+ \cos\alpha \sin\beta$について,%
- \[\bunsuu{a}{\sqrt{a^2+b^2}}=\cos\alpha\数式カンマスペース\bunsuu{b}{\sqrt{a^2+b^2}}=\sin\alpha\]%
+ \[\bunsuu{a}{\根号{a^2+b^2}}=\cos\alpha\数式カンマスペース\bunsuu{b}{\根号{a^2+b^2}}=\sin\alpha\]%
とすることで,\par%
- \[a\sin\theta+b\cos\theta=\sqrt{a^2+b^2}\sin\Ttyuukakko{\theta+\alpha}\]%
+ \[a\sin\theta+b\cos\theta=\根号{a^2+b^2}\sin\Ttyuukakko{\theta+\alpha}\]%
となる。%
\証明終了%
}%
@@ -2345,19 +2392,19 @@
\NewDocumentCommand{\有理数の指数}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$a>0$また$m\数式カンマスペース n$が正の整数,$r$が正の有理数のとき,$a^{\bunsuu{m}{n}}=\sqrt[n]{a^{m}}$}{\relax}%
+ {$a>0$また$m\数式カンマスペース n$が正の整数,$r$が正の有理数のとき,$a^{\frac{m}{n}}=\sqrt[n]{a^{m}}$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
{%
$a>0$また$m\数式カンマスペース n$が正の整数,$r$が正の有理数のとき,%
- \[a^{\bunsuu{m}{n}}=\sqrt[n]{a^{m}}\]%
+ \[a^{\frac{m}{n}}=\sqrt[n]{a^{m}}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$a>0$また$n$が正の整数のとき,$a^{\bunsuu{1}{n}}=\sqrt[n]{a}$}{\relax}%
+ {$a>0$また$n$が正の整数のとき,$a^{\frac{1}{n}}=\根号[n]{a}$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
{%
$a>0$また$n$が正の整数のとき,%
- \[a^{\bunsuu{1}{n}}=\sqrt[n]{a}\]%
+ \[a^{\frac{1}{n}}=\根号[n]{a}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{i}}%
@@ -2420,13 +2467,13 @@
{%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
{%
- $a>0\数式カンマスペース b>0$また,$r\数式カンマスペース s$は有理数とする。\par%
+ $a>0\数式カンマスペース b>0$で,$r\数式カンマスペース s$は有理数とする。\par%
$a^{p}=M$ならば,$\log_{a}M$,$\log_{a}M \log_{a}M$ならば,$a^{p}=M$%
}%
{\relax}%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{b}}%
{%
- $a>0\数式カンマスペース b>0$また,$r\数式カンマスペース s$は有理数とする。\par%
+ $a>0\数式カンマスペース b>0$で,$r\数式カンマスペース s$は有理数とする。\par%
$a^{p}=M$ならば,$\log_{a}M$\par%
$\log_{a}M$ならば,$a^{p}=M$%
}%
@@ -2612,12 +2659,11 @@
\NewDocumentCommand{\不定積分の定義}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
- {$F'\Ttyuukakko{x}=f\Ttyuukakko{x}$のとき,$\int_{}^{} f\Ttyuukakko{x}dx=F\Ttyuukakko{x}+C$($C$は積分定数)}{\relax}%
+ {$F'\Ttyuukakko{x}=f\Ttyuukakko{x}$のとき,$\displaystyle\int_{}^{} f\Ttyuukakko{x}dx=F\Ttyuukakko{x}+C\text{($C$は積分定数)}$}{\relax}%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{b}}%
{%
$F'\Ttyuukakko{x}=f\Ttyuukakko{x}$のとき,%
- \[\int_{}^{} f\Ttyuukakko{x}dx=F\Ttyuukakko{x}+C\]%
- ($C$は積分定数)%
+ \[\int_{}^{} f\Ttyuukakko{x}dx=F\Ttyuukakko{x}+C\text{\ (\,$C$は積分定数)}\]%
}%
{\relax}%
}%
@@ -2626,10 +2672,10 @@
\NewDocumentCommand{\べき乗関数の不定積分}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {$\int_{}^{} x^{n}dx=\bunsuu{1}{n+1}x^{n+1}+C\text{\ ($C$は積分定数)}$}{\relax}%
+ {$\displaystyle\int_{}^{} x^{n}dx=\bunsuu{1}{n+1}x^{n+1}+C\text{\ (\,$C$は積分定数)}$}{\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
- \[\int_{}^{} x^{n}dx=\bunsuu{1}{n+1}x^{n+1}+C\text{\ ($C$は積分定数)}\]%
+ \[\int_{}^{} x^{n}dx=\bunsuu{1}{n+1}x^{n+1}+C\text{\ (\,$C$は積分定数)}\]%
}%
{\relax}%
}%
@@ -2638,15 +2684,15 @@
\NewDocumentCommand{\不定積分の性質}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$\displaystyle \int_{}^{} kf\Ttyuukakko{x}dx=k\displaystyle \int_{}^{} f\Ttyuukakko{x}dx$}{\relax}%
+ {$\displaystyle\int_{}^{} kf\Ttyuukakko{x}dx=k\displaystyle \int_{}^{} f\Ttyuukakko{x}dx$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
{\[\int_{}^{} kf\Ttyuukakko{x}dx=k\int_{}^{} f\Ttyuukakko{x}dx\]}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$\displaystyle \int_{}^{} {f\Ttyuukakko{x}\pm g\Ttyuukakko{x}}dx=\displaystyle \int_{}^{} f\Ttyuukakko{x}dx\pm\displaystyle \int_{}^{} g\Ttyuukakko{x}dx$}{\relax}%
+ {$\displaystyle\int_{}^{} {f\Ttyuukakko{x}\pm g\Ttyuukakko{x}}dx=\displaystyle \int_{}^{} f\Ttyuukakko{x}dx\pm\displaystyle \int_{}^{} g\Ttyuukakko{x}dx$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
{\[\int_{}^{} {f\Ttyuukakko{x}\pm g\Ttyuukakko{x}}dx=\int_{}^{} f\Ttyuukakko{x}dx\pm\int_{}^{} g\Ttyuukakko{x}dx\]}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{i}}%
- {$\displaystyle \int_{}^{} {kf\Ttyuukakko{x}+lg\Ttyuukakko{x}}dx=k\displaystyle \int_{}^{} f\Ttyuukakko{x}dx+l\displaystyle \int_{}^{} g\Ttyuukakko{x}$}{\relax}%
+ {$\displaystyle\int_{}^{} {kf\Ttyuukakko{x}+lg\Ttyuukakko{x}}dx=k\displaystyle \int_{}^{} f\Ttyuukakko{x}dx+l\displaystyle \int_{}^{} g\Ttyuukakko{x}$}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{b}}%
{\[\int_{}^{} {kf\Ttyuukakko{x}+lg\Ttyuukakko{x}}dx=k\int_{}^{} f\Ttyuukakko{x}dx+l\int_{}^{} g\Ttyuukakko{x}\]}{\relax}%
}%
@@ -2668,23 +2714,23 @@
\NewDocumentCommand{\定積分の性質}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$\int_{b}^{a} kf\Ttyuukakko{x}dx=k\int_{b}^{a} f\Ttyuukakko{x}dx$}{\relax}%
+ {$\displaystyle\int_{b}^{a} kf\Ttyuukakko{x}dx=k\int_{b}^{a} f\Ttyuukakko{x}dx$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
{\[\int_{b}^{a} kf\Ttyuukakko{x}dx=k\int_{b}^{a} f\Ttyuukakko{x}dx\]}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$\int_{b}^{a} {f\Ttyuukakko{x}\pm g\Ttyuukakko{x}}dx=\int_{b}^{a} f\Ttyuukakko{x}dx\pm\int_{b}^{a} g\Ttyuukakko{x}dx$}{\relax}%
+ {$\displaystyle\int_{b}^{a} {f\Ttyuukakko{x}\pm g\Ttyuukakko{x}}dx=\int_{b}^{a} f\Ttyuukakko{x}dx\pm\int_{b}^{a} g\Ttyuukakko{x}dx$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
{\[\int_{b}^{a} {f\Ttyuukakko{x}\pm g\Ttyuukakko{x}}dx=\int_{b}^{a} f\Ttyuukakko{x}dx\pm\int_{b}^{a} g\Ttyuukakko{x}dx\]}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{i}}%
- {$\int_{a}^{a} f\Ttyuukakko{x}dx=0$}{\relax}%
+ {$\displaystyle\int_{a}^{a} f\Ttyuukakko{x}dx=0$}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{b}}%
{\[\int_{a}^{a} f\Ttyuukakko{x}dx=0\]}{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{i}}%
- {$\int_{b}^{a} f\Ttyuukakko{x}dx=-\int_{a}^{b} f\Ttyuukakko{x}dx$}{\relax}%
+ {$\displaystyle\int_{b}^{a} f\Ttyuukakko{x}dx=-\int_{a}^{b} f\Ttyuukakko{x}dx$}{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{b}}%
{\[\int_{b}^{a} f\Ttyuukakko{x}dx=-\int_{a}^{b} f\Ttyuukakko{x}dx\]}{\relax}%
\ifthenelse{\equal{#1}{公式E}\AND\equal{#2}{i}}%
- {$\int_{b}^{a} f\Ttyuukakko{x}dx=\int_{a}^{c} f\Ttyuukakko{x}dx+\int_{c}^{b} f\Ttyuukakko{x}dx$}{\relax}%
+ {$\displaystyle\int_{b}^{a} f\Ttyuukakko{x}dx=\int_{a}^{c} f\Ttyuukakko{x}dx+\int_{c}^{b} f\Ttyuukakko{x}dx$}{\relax}%
\ifthenelse{\equal{#1}{公式E}\AND\equal{#2}{b}}%
{\[\int_{b}^{a} f\Ttyuukakko{x}dx=\int_{a}^{c} f\Ttyuukakko{x}dx+\int_{c}^{b} f\Ttyuukakko{x}dx\]}{\relax}%
}%
@@ -2693,84 +2739,84 @@
\NewDocumentCommand{\ベクトルの演算}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$k\数式カンマスペース l$が実数のとき,$\vec{a}+\vec{b}=\vec{b}+\vec{a}$}{\relax}%
+ {$k\数式カンマスペース l$が実数のとき,$\ベクトル{a}+\ベクトル{b}=\ベクトル{b}+\ベクトル{a}$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
{%
$k\数式カンマスペース l$が実数のとき%
- \[\vec{a}+\vec{b}=\vec{b}+\vec{a}\]%
+ \[\ベクトル{a}+\ベクトル{b}=\ベクトル{b}+\ベクトル{a}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$k\数式カンマスペース l$が実数のとき,$\Ttyuukakko{\vec{a}+\vec{b}}+\vec{c}=\vec{a}+\Ttyuukakko{\vec{b}+\vec{c}}$}{\relax}%
+ {$k\数式カンマスペース l$が実数のとき,$\Ttyuukakko{\ベクトル{a}+\ベクトル{b}}+\ベクトル{c}=\ベクトル{a}+\Ttyuukakko{\ベクトル{b}+\ベクトル{c}}$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
{%
$k\数式カンマスペース l$が実数のとき%
- \[\Ttyuukakko{\vec{a}+\vec{b}}+\vec{c}=\vec{a}+\Ttyuukakko{\vec{b}+\vec{c}}\]%
+ \[\Ttyuukakko{\ベクトル{a}+\ベクトル{b}}+\ベクトル{c}=\ベクトル{a}+\Ttyuukakko{\ベクトル{b}+\ベクトル{c}}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{i}}%
- {$\vec{a}+\Ttyuukakko{a\vec{a}}=\vec{0}$}{\relax}%
+ {$\ベクトル{a}+\Ttyuukakko{a\ベクトル{a}}=\ベクトル{0}$}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{b}}%
- {\[\vec{a}+\Ttyuukakko{a\vec{a}}=\vec{0}\]}{\relax}%
+ {\[\ベクトル{a}+\Ttyuukakko{a\ベクトル{a}}=\ベクトル{0}\]}{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{i}}%
- {$\vec{a}+\vec{0}=\vec{a}$}{\relax}%
+ {$\ベクトル{a}+\ベクトル{0}=\ベクトル{a}$}{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{b}}%
- {\[\vec{a}+\vec{0}=\vec{a}\]}{\relax}%
+ {\[\ベクトル{a}+\ベクトル{0}=\ベクトル{a}\]}{\relax}%
\ifthenelse{\equal{#1}{公式E}\AND\equal{#2}{i}}%
- {$\vec{a}-\vec{b}=\vec{a}+\Ttyuukakko{-\vec{b}}$}{\relax}%
+ {$\ベクトル{a}-\ベクトル{b}=\ベクトル{a}+\Ttyuukakko{-\ベクトル{b}}$}{\relax}%
\ifthenelse{\equal{#1}{公式E}\AND\equal{#2}{b}}%
- {\[\vec{a}-\vec{b}=\vec{a}+\Ttyuukakko{-\vec{b}}\]}{\relax}%
+ {\[\ベクトル{a}-\ベクトル{b}=\ベクトル{a}+\Ttyuukakko{-\ベクトル{b}}\]}{\relax}%
\ifthenelse{\equal{#1}{公式F}\AND\equal{#2}{i}}%
- {$k\数式カンマスペース l$が実数のとき,$k\Ttyuukakko{l\vec{a}}=l\Ttyuukakko{k\vec{b}}$}{\relax}%
+ {$k\数式カンマスペース l$が実数のとき,$k\Ttyuukakko{l\ベクトル{a}}=l\Ttyuukakko{k\ベクトル{b}}$}{\relax}%
\ifthenelse{\equal{#1}{公式F}\AND\equal{#2}{b}}%
{%
$k\数式カンマスペース l$が実数のとき%
- \[k\Ttyuukakko{l\vec{a}}=l\Ttyuukakko{k\vec{b}}\]%
+ \[k\Ttyuukakko{l\ベクトル{a}}=l\Ttyuukakko{k\ベクトル{b}}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式G}\AND\equal{#2}{i}}%
- {$k\数式カンマスペース l$が実数のとき,$\Ttyuukakko{k+l}\vec{a}=k\vec{a}+l\vec{a}$}{\relax}%
+ {$k\数式カンマスペース l$が実数のとき,$\Ttyuukakko{k+l}\ベクトル{a}=k\ベクトル{a}+l\ベクトル{a}$}{\relax}%
\ifthenelse{\equal{#1}{公式G}\AND\equal{#2}{b}}%
{%
$k\数式カンマスペース l$が実数のとき%
- \[\Ttyuukakko{k+l}\vec{a}=k\vec{a}+l\vec{a}\]%
+ \[\Ttyuukakko{k+l}\ベクトル{a}=k\ベクトル{a}+l\ベクトル{a}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式H}\AND\equal{#2}{i}}%
- {$k$が実数のとき,$k\Ttyuukakko{\vec{a}+\vec{b}}=k\vec{a}+k\vec{b}$}{\relax}%
+ {$k$が実数のとき,$k\Ttyuukakko{\ベクトル{a}+\ベクトル{b}}=k\ベクトル{a}+k\ベクトル{b}$}{\relax}%
\ifthenelse{\equal{#1}{公式H}\AND\equal{#2}{b}}%
{%
$k$が実数のとき%
- \[k\Ttyuukakko{\vec{a}+\vec{b}}=k\vec{a}+k\vec{b}\]%
+ \[k\Ttyuukakko{\ベクトル{a}+\ベクトル{b}}=k\ベクトル{a}+k\ベクトル{b}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式I}\AND\equal{#2}{i}}%
- {$\overrightarrow{AB}+\overrightarrow{BC}=\overrightarrow{AC}$}{\relax}%
+ {$\overrightarrowtext{AB}+\overrightarrowtext{BC}=\overrightarrowtext{AC}$}{\relax}%
\ifthenelse{\equal{#1}{公式I}\AND\equal{#2}{b}}%
- {\[\overrightarrow{AB}+\overrightarrow{BC}=\overrightarrow{AC}\]}{\relax}%
+ {\[\overrightarrowtext{AB}+\overrightarrowtext{BC}=\overrightarrowtext{AC}\]}{\relax}%
\ifthenelse{\equal{#1}{公式J}\AND\equal{#2}{i}}%
- {$\overrightarrow{OA}-\overrightarrow{OB}=\overrightarrow{BA}$}{\relax}%
+ {$\overrightarrowtext{OA}-\overrightarrowtext{OB}=\overrightarrowtext{BA}$}{\relax}%
\ifthenelse{\equal{#1}{公式J}\AND\equal{#2}{b}}%
- {\[\overrightarrow{OA}-\overrightarrow{OB}=\overrightarrow{BA}\]}{\relax}%
+ {\[\overrightarrowtext{OA}-\overrightarrowtext{OB}=\overrightarrowtext{BA}\]}{\relax}%
\ifthenelse{\equal{#1}{公式K}\AND\equal{#2}{i}}%
- {$\overrightarrow{AA}=\vec{0}$}{\relax}%
+ {$\overrightarrowtext{AA}=\ベクトル{0}$}{\relax}%
\ifthenelse{\equal{#1}{公式K}\AND\equal{#2}{b}}%
- {\[\overrightarrow{AA}=\vec{0}\]}{\relax}%
+ {\[\overrightarrowtext{AA}=\ベクトル{0}\]}{\relax}%
\ifthenelse{\equal{#1}{公式L}\AND\equal{#2}{i}}%
- {$\overrightarrow{BA}=\overrightarrow{AB}$}{\relax}%
+ {$\overrightarrowtext{BA}=\overrightarrowtext{AB}$}{\relax}%
\ifthenelse{\equal{#1}{公式L}\AND\equal{#2}{b}}%
- {\[\overrightarrow{BA}=\overrightarrow{AB}\]}{\relax}%
+ {\[\overrightarrowtext{BA}=\overrightarrowtext{AB}\]}{\relax}%
}%
\NewDocumentCommand{\平面ベクトルの分解}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {$\vec{a}\neq0\数式カンマスペース\vec{b}\neq0$で,$\vec{a}$と$\vec{b}$が平行でないとき,任意の$\vec{p}$はただ一通りに,$\vec{p}=s\vec{a}+t\vec{b}$の形に表せられる。}{\relax}%
+ {$\ベクトル{a}\neq0\数式カンマスペース\ベクトル{b}\neq0$で,$\ベクトル{a}$と$\ベクトル{b}$が平行でないとき,任意の$\ベクトル{p}$はただ一通りに,$\ベクトル{p}=s\ベクトル{a}+t\ベクトル{b}$の形に表せられる。}{\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
- $\vec{a}\neq0\数式カンマスペース\vec{b}\neq0$で,$\vec{a}$と$\vec{b}$が平行でないとき,任意の$\vec{p}$はただ一通りに,%
- \[\vec{p}=s\vec{a}+t\vec{b}\]%
+ $\ベクトル{a}\neq0\数式カンマスペース\ベクトル{b}\neq0$で,$\ベクトル{a}$と$\ベクトル{b}$が平行でないとき,任意の$\ベクトル{p}$はただ一通りに,%
+ \[\ベクトル{p}=s\ベクトル{a}+t\ベクトル{b}\]%
の形に表せられる。%
}%
{\relax}%
@@ -2780,37 +2826,37 @@
\NewDocumentCommand{\平面ベクトルの成分}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$\vec{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\vec{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,$\vec{a}=\vec{b}\Leftrightarrow a_{1}=b_{1}\数式カンマスペース a_{2}=b_{2}$}{\relax}%
+ {$\ベクトル{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\ベクトル{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,$\ベクトル{a}=\ベクトル{b}\Leftrightarrow a_{1}=b_{1}\数式カンマスペース a_{2}=b_{2}$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
{%
- $\vec{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\vec{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,%
- $\vec{a}=\vec{b}$%
+ $\ベクトル{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\ベクトル{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,%
+ $\ベクトル{a}=\ベクトル{b}$%
\[\Leftrightarrow a_{1}=b_{1}\数式カンマスペース a_{2}=b_{2}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$\vec{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\vec{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,$a_{1}=b_{1}\数式カンマスペース a_{2}=b_{2}\Leftrightarrow\vec{a}=\vec{b}$}{\relax}%
+ {$\ベクトル{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\ベクトル{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,$a_{1}=b_{1}\数式カンマスペース a_{2}=b_{2}\Leftrightarrow\ベクトル{a}=\ベクトル{b}$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
{%
- $\vec{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\vec{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,%
+ $\ベクトル{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\ベクトル{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,%
$a_{1}=b_{1}\数式カンマスペース a_{2}=b_{2}$%
- \[\Leftrightarrow\vec{a}=\vec{b}\]%
+ \[\Leftrightarrow\ベクトル{a}=\ベクトル{b}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{i}}%
- {$\vec{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}$とすると,$\Tzettaiti{\vec{a}}=\sqrt{a_{1}^2+a_{2}^2}$}{\relax}%
+ {$\ベクトル{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}$とすると,$\Tzettaiti{\ベクトル{a}}=\根号{a_{1}^2+a_{2}^2}$}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{b}}%
{%
- $\vec{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}$とすると,%
- \[\Tzettaiti{\vec{a}}=\sqrt{a_{1}^2+a_{2}^2}\]%
+ $\ベクトル{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}$とすると,%
+ \[\Tzettaiti{\ベクトル{a}}=\根号{a_{1}^2+a_{2}^2}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{i}}%
- {$\vec{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\vec{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$また,$k\数式カンマスペース l$を実数として,$k\vec{a}+l\vec{b}=k\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}+l\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}=\Ttyuukakko{ka_{1}+lb_{1}\数式カンマスペース ka_{2}+lb_{2}}$}{\relax}%
+ {$\ベクトル{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\ベクトル{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$また,$k\数式カンマスペース l$を実数として,$k\ベクトル{a}+l\ベクトル{b}=k\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}+l\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}=\Ttyuukakko{ka_{1}+lb_{1}\数式カンマスペース ka_{2}+lb_{2}}$}{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{b}}%
{%
- $\vec{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\vec{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$また,$k\数式カンマスペース l$を実数として,%
- \[k\vec{a}+l\vec{b}=k\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}+l\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}=\Ttyuukakko{ka_{1}+lb_{1}\数式カンマスペース ka_{2}+lb_{2}}\]%
+ $\ベクトル{a}=\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース\ベクトル{b}=\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$また,$k\数式カンマスペース l$を実数として,%
+ \[k\ベクトル{a}+l\ベクトル{b}=k\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}+l\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}=\Ttyuukakko{ka_{1}+lb_{1}\数式カンマスペース ka_{2}+lb_{2}}\]%
}%
{\relax}%
}%
@@ -2819,26 +2865,26 @@
\NewDocumentCommand{\ベクトルの成分と大きさ}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース B\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,$\overrightarrow{AB}=\Ttyuukakko{b_{1}-a_{1}\数式カンマスペース b_{2}-a_{2}}$}{\relax}%
+ {$A\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース B\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,$\overrightarrowtext{AB}=\Ttyuukakko{b_{1}-a_{1}\数式カンマスペース b_{2}-a_{2}}$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
{%
$A\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース B\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,%
- \[\overrightarrow{AB}=\Ttyuukakko{b_{1}-a_{1}\数式カンマスペース b_{2}-a_{2}}\]%
+ \[\overrightarrowtext{AB}=\Ttyuukakko{b_{1}-a_{1}\数式カンマスペース b_{2}-a_{2}}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース B\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,$\Tzettaiti{\overrightarrow{AB}}=\sqrt{\Ttyuukakko{b_{1}-a_{1}}^2+\Ttyuukakko{b_{2}-a_{2}}^2}$}{\relax}%
+ {$A\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース B\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,$\Tzettaiti{\overrightarrowtext{AB}}=\根号{\Ttyuukakko{b_{1}-a_{1}}^2+\Ttyuukakko{b_{2}-a_{2}}^2}$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
{%
$A\Ttyuukakko{a_{1}\数式カンマスペース a_{2}}\数式カンマスペース B\Ttyuukakko{b_{1}\数式カンマスペース b_{2}}$とすると,%
- \[\Tzettaiti{\overrightarrow{AB}}=\sqrt{\Ttyuukakko{b_{1}-a_{1}}^2+\Ttyuukakko{b_{2}-a_{2}}^2}\]%
+ \[\Tzettaiti{\overrightarrowtext{AB}}=\根号{\Ttyuukakko{b_{1}-a_{1}}^2+\Ttyuukakko{b_{2}-a_{2}}^2}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{証明}}%
{%
\証明開始%
三平方の定理より,%
- \[\Tzettaiti{\overrightarrow{AB}}=\sqrt{\Ttyuukakko{b_{1}-a_{1}}^2+\Ttyuukakko{b_{2}-a_{2}}^2}\]%
+ \[\Tzettaiti{\overrightarrowtext{AB}}=\根号{\Ttyuukakko{b_{1}-a_{1}}^2+\Ttyuukakko{b_{2}-a_{2}}^2}\]%
\証明終了%
}%
{\relax}%
@@ -2848,11 +2894,11 @@
\NewDocumentCommand{\平面ベクトルの内積}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{i}}%
- {ベクトルの内積は,$\vec{a} \cdot\vec{b}=|\vec{a}||\vec{b}|\cos\theta \Ttyuukakko{0^{\circ} \leqq \theta \leqq 180^{\circ}}\text{\ (ただし,$\theta$は$\vec{a}$と$\vec{b}$のなす角}$}{\relax}%
+ {ベクトルの内積は,$\ベクトル{a} \cdot\ベクトル{b}=|\ベクトル{a}||\ベクトル{b}|\cos\theta \Ttyuukakko{0^{\circ} \leqq \theta \leqq 180^{\circ}}\text{\ (ただし,$\theta$は$\ベクトル{a}$と$\ベクトル{b}$のなす角)}$}{\relax}%
\ifthenelse{\equal{#1}{公式}\AND\equal{#2}{b}}%
{%
ベクトルの内積は,%
- \[\vec{a} \cdot\vec{b}=|\vec{a}||\vec{b}|\cos\theta \Ttyuukakko{0^{\circ} \leqq \theta \leqq 180^{\circ}}\text{\ (ただし,$\theta$は$\vec{a}$と$\vec{b}$のなす角}\]%
+ \[\ベクトル{a} \cdot\ベクトル{b}=|\ベクトル{a}||\ベクトル{b}|\cos\theta \Ttyuukakko{0^{\circ} \leqq \theta \leqq 180^{\circ}}\text{\ (ただし,$\theta$は$\ベクトル{a}$と$\ベクトル{b}$のなす角)}\]%
}%
{\relax}%
}%
@@ -2861,33 +2907,33 @@
\NewDocumentCommand{\内積の性質}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$\vec{a} \cdot\vec{b}=\vec{b} \cdot\vec{a}$}{\relax}%
+ {$\ベクトル{a} \cdot\ベクトル{b}=\ベクトル{b} \cdot\ベクトル{a}$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
- {\[\vec{a} \cdot\vec{b}=\vec{b} \cdot\vec{a}\]}{\relax}%
+ {\[\ベクトル{a} \cdot\ベクトル{b}=\ベクトル{b} \cdot\ベクトル{a}\]}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$\Ttyuukakko{\vec{a}+\vec{b}} \cdot\vec{c}=\vec{a} \cdot\vec{c}+\vec{b} \cdot\vec{c}$}{\relax}%
+ {$\Ttyuukakko{\ベクトル{a}+\ベクトル{b}} \cdot\ベクトル{c}=\ベクトル{a} \cdot\ベクトル{c}+\ベクトル{b} \cdot\ベクトル{c}$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
- {\[\Ttyuukakko{\vec{a}+\vec{b}} \cdot\vec{c}=\vec{a} \cdot\vec{c}+\vec{b} \cdot\vec{c}\]}{\relax}%
+ {\[\Ttyuukakko{\ベクトル{a}+\ベクトル{b}} \cdot\ベクトル{c}=\ベクトル{a} \cdot\ベクトル{c}+\ベクトル{b} \cdot\ベクトル{c}\]}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{i}}%
- {$\vec{c} \cdot\Ttyuukakko{\vec{b}+\vec{c}}=\vec{a} \cdot\vec{c}+\vec{b} \cdot\vec{c}$}{\relax}%
+ {$\ベクトル{c} \cdot\Ttyuukakko{\ベクトル{b}+\ベクトル{c}}=\ベクトル{a} \cdot\ベクトル{c}+\ベクトル{b} \cdot\ベクトル{c}$}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{b}}%
- {\[\vec{c} \cdot\Ttyuukakko{\vec{b}+\vec{c}}=\vec{a} \cdot\vec{c}+\vec{b} \cdot\vec{c}\]}{\relax}%
+ {\[\ベクトル{c} \cdot\Ttyuukakko{\ベクトル{b}+\ベクトル{c}}=\ベクトル{a} \cdot\ベクトル{c}+\ベクトル{b} \cdot\ベクトル{c}\]}{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{i}}%
- {$k$が実数のとき,$\Ttyuukakko{k\vec{a}} \cdot\vec{b}=\vec{a} \cdot\Ttyuukakko{k\vec{b}}=k\Ttyuukakko{\vec{a} \cdot\vec{b}}$}{\relax}%
+ {$k$が実数のとき,$\Ttyuukakko{k\ベクトル{a}} \cdot\ベクトル{b}=\ベクトル{a} \cdot\Ttyuukakko{k\ベクトル{b}}=k\Ttyuukakko{\ベクトル{a} \cdot\ベクトル{b}}$}{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{b}}%
{%
$k$が実数のとき,%
- \[\Ttyuukakko{k\vec{a}} \cdot\vec{b}=\vec{a} \cdot\Ttyuukakko{k\vec{b}}=k\Ttyuukakko{\vec{a} \cdot\vec{b}}\]%
+ \[\Ttyuukakko{k\ベクトル{a}} \cdot\ベクトル{b}=\ベクトル{a} \cdot\Ttyuukakko{k\ベクトル{b}}=k\Ttyuukakko{\ベクトル{a} \cdot\ベクトル{b}}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式E}\AND\equal{#2}{i}}%
- {$\vec{a} \cdot\vec{a}=\Tzettaiti{\vec{a}}^2$}{\relax}%
+ {$\ベクトル{a} \cdot\ベクトル{a}=\Tzettaiti{\ベクトル{a}}^2$}{\relax}%
\ifthenelse{\equal{#1}{公式E}\AND\equal{#2}{b}}%
- {\[\vec{a} \cdot\vec{a}=\Tzettaiti{\vec{a}}^2\]}{\relax}%
+ {\[\ベクトル{a} \cdot\ベクトル{a}=\Tzettaiti{\ベクトル{a}}^2\]}{\relax}%
\ifthenelse{\equal{#1}{公式F}\AND\equal{#2}{i}}%
- {$\Tzettaiti{\vec{a}}=\sqrt{\vec{a} \cdot\vec{a}}$}{\relax}%
+ {$\Tzettaiti{\ベクトル{a}}=\根号{\ベクトル{a} \cdot\ベクトル{a}}$}{\relax}%
\ifthenelse{\equal{#1}{公式F}\AND\equal{#2}{b}}%
- {\[\Tzettaiti{\vec{a}}=\sqrt{\vec{a} \cdot\vec{a}}\]}{\relax}%
+ {\[\Tzettaiti{\ベクトル{a}}=\根号{\ベクトル{a} \cdot\ベクトル{a}}\]}{\relax}%
}%
@@ -2895,15 +2941,15 @@
{%
\ifthenelse{\equal{#1}{条件}\AND\equal{#2}{i}}%
{%
- $\vec{a}\neq\vec{0}\数式カンマスペース\vec{b}\neq\vec{0}$また,$k$は実数とする,\par%
- $\vec{a}/ \!/ \vec{b}\Leftrightarrow\vec{b}=k\vec{a}$,$\vec{b}=k\vec{a}$%
+ $\ベクトル{a}\neq\ベクトル{0}\数式カンマスペース\ベクトル{b}\neq\ベクトル{0}$また,$k$は実数とする,\par%
+ $\ベクトル{a}/ \!/ \ベクトル{b}\Leftrightarrow\ベクトル{b}=k\ベクトル{a}$,$\ベクトル{b}=k\ベクトル{a}$%
}%
{\relax}%
\ifthenelse{\equal{#1}{条件}\AND\equal{#2}{b}}%
{%
- $\vec{a}\neq\vec{0}\数式カンマスペース\vec{b}\neq\vec{0}$また,$k$は実数とする,\par%
- $\vec{a}/ \!/ \vec{b}$%
- \[\Leftrightarrow\vec{b}=k\vec{a}\]%
+ $\ベクトル{a}\neq\ベクトル{0}\数式カンマスペース\ベクトル{b}\neq\ベクトル{0}$また,$k$は実数とする,\par%
+ $\ベクトル{a}/ \!/ \ベクトル{b}$%
+ \[\Leftrightarrow\ベクトル{b}=k\ベクトル{a}\]%
}%
{\relax}%
}%
@@ -2913,15 +2959,14 @@
{%
\ifthenelse{\equal{#1}{条件}\AND\equal{#2}{i}}%
{%
- $\vec{a}\neq\vec{0}\数式カンマスペース\vec{b}\neq\vec{0}$また,$k$は実数とする,\par%
- $\vec{a} \perp \vec{b}\Leftrightarrow\vec{a} \cdot\vec{b}=0$%
+ $\ベクトル{a}\neq\ベクトル{0}\数式カンマスペース\ベクトル{b}\neq\ベクトル{0}$で,$k$は実数とすると,%
+ $\ベクトル{a} \perp \ベクトル{b}\Leftrightarrow\ベクトル{a} \cdot\ベクトル{b}=0$%
}%
{\relax}%
\ifthenelse{\equal{#1}{条件}\AND\equal{#2}{b}}%
{%
- $\vec{a}\neq\vec{0}\数式カンマスペース\vec{b}\neq\vec{0}$また,$k$は実数とする,\par%
- $\vec{a} \perp \vec{b}$%
- \[\Leftrightarrow\vec{a} \cdot\vec{b}=0\]%
+ $\ベクトル{a}\neq\ベクトル{0}\数式カンマスペース\ベクトル{b}\neq\ベクトル{0}$で,$k$は実数とすると,%
+ \[\ベクトル{a} \perp \ベクトル{b}\Leftrightarrow\ベクトル{a} \cdot\ベクトル{b}=0\]%
}%
{\relax}%
}%
@@ -2930,53 +2975,53 @@
\NewDocumentCommand{\位置ベクトル}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}$とする,線分$AB$を$m:n$に内分する点は,$\bunsuu{n\vec{a}+m\vec{b}}{m+n}$}{\relax}%
+ {$A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}$とすると,線分$\text{AB}$を$m:n$に内分する点は,$\bunsuu{n\ベクトル{a}+m\ベクトル{b}}{m+n}$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
{%
- $A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}$とする,線分$AB$を$m:n$に内分する点は,%
- \[\bunsuu{n\vec{a}+m\vec{b}}{m+n}\]%
+ $A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}$とすると,線分$\text{AB}$を$m:n$に内分する点は,%
+ \[\bunsuu{n\ベクトル{a}+m\ベクトル{b}}{m+n}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{内分点の位置ベクトルの証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{内分点の位置ベクトルの証明}}%
{%
\証明開始%
- $P\Ttyuukakko{\vec{p}}$が$A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}$を$m:n$に内分するとき,%
+ $P\Ttyuukakko{\ベクトル{p}}$が$A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}$を$m:n$に内分するとき,%
\begin{align*}%
- \vec{p}&=\vec{a}+\bunsuu{m}{m+n}\Ttyuukakko{\vec{b}-\vec{a}}&\\%
- &=\bunsuu{n\vec{a}+m\vec{b}}{m+n}&\\%
+ \ベクトル{p}&=\ベクトル{a}+\bunsuu{m}{m+n}\Ttyuukakko{\ベクトル{b}-\ベクトル{a}}&\\%
+ &=\bunsuu{n\ベクトル{a}+m\ベクトル{b}}{m+n}&\\%
\end{align*}%
\証明終了%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}$とする,線分$AB$を$m:n$に外分する点は,$\bunsuu{-n\vec{a}+m\vec{b}}{m-n}$}{\relax}%
+ {$A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}$とする,線分$\text{AB}$を$m:n$に外分する点は,$\bunsuu{-n\ベクトル{a}+m\ベクトル{b}}{m-n}$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
{%
- $A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}$とする,線分$AB$を$m:n$に外分する点は,%
- \[\bunsuu{-n\vec{a}+m\vec{b}}{m-n}\]%
+ $A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}$とする,線分$\text{AB}$を$m:n$に外分する点は,%
+ \[\bunsuu{-n\ベクトル{a}+m\ベクトル{b}}{m-n}\]%
}%
{\relax}%
- \ifthenelse{\equal{#1}{外分点の位置ベクトルの証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{外分点の位置ベクトルの証明}}%
{%
\証明開始%
- $m:n$に外分ということは$m:-n$に内分ということなので,$\bunsuu{-n\vec{a}+m\vec{b}}{m-n}$%
+ $m:n$に外分ということは$m:-n$に内分ということなので,$\bunsuu{-n\ベクトル{a}+m\ベクトル{b}}{m-n}$%
\証明終了%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}$とする,線分$AB$の中点は,$\bunsuu{\vec{a}+\vec{b}}{2}$}{\relax}%
+ {$A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}$とする,線分$\text{AB}$の中点は,$\bunsuu{\ベクトル{a}+\ベクトル{b}}{2}$}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{b}}%
{%
- $A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}$とする,線分$AB$の中点は,%
- \[\bunsuu{\vec{a}+\vec{b}}{2}\]%
+ $A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}$とする,線分$\text{AB}$の中点は,%
+ \[\bunsuu{\ベクトル{a}+\ベクトル{b}}{2}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{i}}%
- {$A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}\数式カンマスペース C\Ttyuukakko{\vec{c}}$とする,三角形$ABC$の重心は,$\bunsuu{\vec{a}+\vec{b}+\vec{c}}{3}$}{\relax}%
+ {$A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}\数式カンマスペース C\Ttyuukakko{\ベクトル{c}}$とする,$\triangle{\text{ABC}}$の重心は,$\bunsuu{\ベクトル{a}+\ベクトル{b}+\ベクトル{c}}{3}$}{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{b}}%
{%
- $A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}\数式カンマスペース C\Ttyuukakko{\vec{c}}$とする,三角形$ABC$の重心は,%
- \[\bunsuu{\vec{a}+\vec{b}+\vec{c}}{3}\]%
+ $A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}\数式カンマスペース C\Ttyuukakko{\ベクトル{c}}$とする,$\triangle{\text{ABC}}$の重心は,%
+ \[\bunsuu{\ベクトル{a}+\ベクトル{b}+\ベクトル{c}}{3}\]%
}%
{\relax}%
}%
@@ -2985,36 +3030,36 @@
\NewDocumentCommand{\ベクトル方程式}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{i}}%
- {$s\数式カンマスペース t$を実数とする。点$A\Ttyuukakko{\vec{a}}$をとおり,$\vec{d}$に平行な直線は,$\vec{p}=\vec{a}+t\vec{b}$}{\relax}%
+ {$s\数式カンマスペース t$を実数とする。点$A\Ttyuukakko{\ベクトル{a}}$をとおり,$\ベクトル{d}$に平行な直線は,$\ベクトル{p}=\ベクトル{a}+t\ベクトル{b}$}{\relax}%
\ifthenelse{\equal{#1}{公式A}\AND\equal{#2}{b}}%
{%
- $s\数式カンマスペース t$を実数とする。点$A\Ttyuukakko{\vec{a}}$をとおり,$\vec{d}$に平行な直線は,%
- \[\vec{p}=\vec{a}+t\vec{b}\]%
+ $s\数式カンマスペース t$を実数とする。点$A\Ttyuukakko{\ベクトル{a}}$をとおり,$\ベクトル{d}$に平行な直線は,%
+ \[\ベクトル{p}=\ベクトル{a}+t\ベクトル{b}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{i}}%
- {$s\数式カンマスペース t$を実数とする。二点$A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}$を通る直線は,$\vec{p}=\Ttyuukakko{1-t}\vec{a}+t\vec{b}\数式カンマスペース\vec{p}=a\vec{a}+t\vec{b}\text{\ (ただし,$s+t=1$)}$}{\relax}%
+ {$s\数式カンマスペース t$を実数とする。二点$A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}$を通る直線は,$\ベクトル{p}=\Ttyuukakko{1-t}\ベクトル{a}+t\ベクトル{b}\数式カンマスペース\ベクトル{p}=a\ベクトル{a}+t\ベクトル{b}\text{\ (ただし,$s+t=1$)}$}{\relax}%
\ifthenelse{\equal{#1}{公式B}\AND\equal{#2}{b}}%
{%
- $s\数式カンマスペース t$を実数とする。二点$A\Ttyuukakko{\vec{a}}\数式カンマスペース B\Ttyuukakko{\vec{b}}$を通る直線は,%
- \[\vec{p}=\Ttyuukakko{1-t}\vec{a}+t\vec{b}\数式カンマスペース\vec{p}=a\vec{a}+t\vec{b}\text{\ (ただし,$s+t=1$)}\]%
+ $s\数式カンマスペース t$を実数とする。二点$A\Ttyuukakko{\ベクトル{a}}\数式カンマスペース B\Ttyuukakko{\ベクトル{b}}$を通る直線は,%
+ \[\ベクトル{p}=\Ttyuukakko{1-t}\ベクトル{a}+t\ベクトル{b}\数式カンマスペース\ベクトル{p}=a\ベクトル{a}+t\ベクトル{b}\text{\ (ただし,$s+t=1$)}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{i}}%
- {点$A\Ttyuukakko{\vec{a}}$を通り,$\vec{n}$に垂直な直線$\vec{p}$について,$\vec{n}\cdot\Ttyuukakko{\vec{p}-\vec{a}}=0$}{\relax}%
+ {点$A\Ttyuukakko{\ベクトル{a}}$を通り,$\ベクトル{n}$に垂直な直線$\ベクトル{p}$について,$\ベクトル{n}\cdot\Ttyuukakko{\ベクトル{p}-\ベクトル{a}}=0$}{\relax}%
\ifthenelse{\equal{#1}{公式C}\AND\equal{#2}{b}}%
{%
- 点$A\Ttyuukakko{\vec{a}}$を通り,$\vec{n}$に垂直な直線$\vec{p}$について,%
- \[\vec{n}\cdot\Ttyuukakko{\vec{p}-\vec{a}}=0\]%
+ 点$A\Ttyuukakko{\ベクトル{a}}$を通り,$\ベクトル{n}$に垂直な直線$\ベクトル{p}$について,%
+ \[\ベクトル{n}\cdot\Ttyuukakko{\ベクトル{p}-\ベクトル{a}}=0\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{i}}%
- {中心$C\Ttyuukakko{\vec{c}}$,半径$r$の円は,$\Tzettaiti{\vec{p}-\vec{c}}=r\数式カンマスペース\Ttyuukakko{\vec{p}-\vec{c}}\cdot\Ttyuukakko{\vec{p}-\vec{c}}=r^2$}{\relax}%
+ {中心$C\Ttyuukakko{\ベクトル{c}}$,半径$r$の円は,$\Tzettaiti{\ベクトル{p}-\ベクトル{c}}=r\数式カンマスペース\Ttyuukakko{\ベクトル{p}-\ベクトル{c}}\cdot\Ttyuukakko{\ベクトル{p}-\ベクトル{c}}=r^2$}{\relax}%
\ifthenelse{\equal{#1}{公式D}\AND\equal{#2}{b}}%
{%
- 中心$C\Ttyuukakko{\vec{c}}$,半径$r$の円は,%
- \[\Tzettaiti{\vec{p}-\vec{c}}=r\]%
- \[\Ttyuukakko{\vec{p}-\vec{c}}\cdot\Ttyuukakko{\vec{p}-\vec{c}}=r^2\]%
+ 中心$C\Ttyuukakko{\ベクトル{c}}$,半径$r$の円は,%
+ \[\Tzettaiti{\ベクトル{p}-\ベクトル{c}}=r\]%
+ \[\Ttyuukakko{\ベクトル{p}-\ベクトル{c}}\cdot\Ttyuukakko{\ベクトル{p}-\ベクトル{c}}=r^2\]%
}%
{\relax}%
}%
@@ -3266,11 +3311,11 @@
\NewDocumentCommand{\複素数の絶対値}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
- {複素数$z=a+bi$に対して,$\Tzettaiti{z}=\Tzettaiti{a+bi}=\sqrt{a^2+b^2}$}{\relax}%
+ {複素数$z=a+bi$に対して,$\Tzettaiti{z}=\Tzettaiti{a+bi}=\根号{a^2+b^2}$}{\relax}%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{b}}%
{%
複素数$z=a+bi$に対して,%
- \[\Tzettaiti{z}=\Tzettaiti{a+bi}=\sqrt{a^2+b^2}\]%
+ \[\Tzettaiti{z}=\Tzettaiti{a+bi}=\根号{a^2+b^2}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{性質A}\AND\equal{#2}{i}}%
@@ -3287,12 +3332,12 @@
\NewDocumentCommand{\極形式}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
- {複素数$\alpha=a+bi$について,$\alpha=r\Ttyuukakko{\cos\theta+i\sin\theta}\text{\ (ただし$z>0$)}$また,$r=\Tzettaiti{\alpha}=\sqrt{a^2+b^2}\数式カンマスペース\cos\theta=\bunsuu{a}{r}\数式カンマスペース\sin\theta=\bunsuu{b}{r}$を極形式という。}{\relax}%
+ {複素数$\alpha=a+bi$について,$\alpha=r\Ttyuukakko{\cos\theta+i\sin\theta}\text{\ (ただし$z>0$)}$また,$r=\Tzettaiti{\alpha}=\根号{a^2+b^2}\数式カンマスペース\cos\theta=\bunsuu{a}{r}\数式カンマスペース\sin\theta=\bunsuu{b}{r}$を極形式という。}{\relax}%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{b}}%
{%
複素数$\alpha=a+bi$について,%
\[\alpha=r\Ttyuukakko{\cos\theta+i\sin\theta}\text{\ (ただし$z>0$)}\]%
- また,$r=\Tzettaiti{\alpha}=\sqrt{a^2+b^2}\数式カンマスペース\cos\theta=\bunsuu{a}{r}\数式カンマスペース\sin\theta=\bunsuu{b}{r}$を極形式という。%
+ また,$r=\Tzettaiti{\alpha}=\根号{a^2+b^2}\数式カンマスペース\cos\theta=\bunsuu{a}{r}\数式カンマスペース\sin\theta=\bunsuu{b}{r}$を極形式という。%
}%
{\relax}%
\ifthenelse{\equal{#1}{性質A}\AND\equal{#2}{i}}%
@@ -3440,11 +3485,11 @@
}%
{\relax}%
\ifthenelse{\equal{#1}{性質B}\AND\equal{#2}{i}}%
- {楕円の焦点は$F\Ttyuukakko{\sqrt{a^2-b^2}\数式カンマスペース 0}$と,$F'\Ttyuukakko{\sqrt{a^2-b^2}\数式カンマスペース 0}$}{\relax}%
+ {楕円の焦点は$F\Ttyuukakko{\根号{a^2-b^2}\数式カンマスペース 0}$と,$F'\Ttyuukakko{\根号{a^2-b^2}\数式カンマスペース 0}$}{\relax}%
\ifthenelse{\equal{#1}{性質B}\AND\equal{#2}{b}}%
{%
楕円の焦点は%
- \[F\Ttyuukakko{\sqrt{a^2-b^2}\数式カンマスペース 0} F'\Ttyuukakko{\sqrt{a^2-b^2}\数式カンマスペース 0}\]%
+ \[F\Ttyuukakko{\根号{a^2-b^2}\数式カンマスペース 0} F'\Ttyuukakko{\根号{a^2-b^2}\数式カンマスペース 0}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{性質C}\AND\equal{#2}{i}}%
@@ -3474,11 +3519,11 @@
}%
{\relax}%
\ifthenelse{\equal{#1}{性質B}\AND\equal{#2}{i}}%
- {双曲線の焦点は$F\Ttyuukakko{\sqrt{a^2+b^2}\数式カンマスペース 0}$と,$F'\Ttyuukakko{\sqrt{a^2+b^2}\数式カンマスペース 0}$}{\relax}%
+ {双曲線の焦点は$F\Ttyuukakko{\根号{a^2+b^2}\数式カンマスペース 0}$と,$F'\Ttyuukakko{\根号{a^2+b^2}\数式カンマスペース 0}$}{\relax}%
\ifthenelse{\equal{#1}{性質B}\AND\equal{#2}{b}}%
{%
双曲線の焦点は%
- \[F\Ttyuukakko{\sqrt{a^2+b^2}\数式カンマスペース 0} F'\Ttyuukakko{\sqrt{a^2+b^2}\数式カンマスペース 0}\]%
+ \[F\Ttyuukakko{\根号{a^2+b^2}\数式カンマスペース 0} F'\Ttyuukakko{\根号{a^2+b^2}\数式カンマスペース 0}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{性質C}\AND\equal{#2}{i}}%
@@ -3600,7 +3645,7 @@
{$\Ttyuukakko{a^{x}}'=a^{x}\log a$}{\relax}%
\ifthenelse{\equal{#1}{初等関数の微分公式I}\AND\equal{#2}{b}}%
{\[\Ttyuukakko{a^{x}}'=a^{x}\log a\]}{\relax}%
- \ifthenelse{\equal{#1}{三角関数の微分公式の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{三角関数の微分公式の証明}}%
{%
\証明開始%
\begin{align*}%
@@ -3617,7 +3662,7 @@
\証明終了%
}%
{\relax}%
- \ifthenelse{\equal{#1}{対数関数の微分公式の証明}\AND\equal{#2}{i}}%
+ \ifthenelse{\equal{#1}{対数関数の微分公式の証明}}%
{%
\証明開始%
\begin{align*}%
@@ -3628,7 +3673,7 @@
\begin{align*}%
\Ttyuukakko{\log x}'&=\displaystyle\lim_{h \to 0} \bunsuu{\log\Ttyuukakko{1+t}}{xt}&\\%
&=\displaystyle\lim_{h \to 0} \Tdaikakko{\bunsuu{\log\Ttyuukakko{1+t}}{t}\cdot\bunsuu{1}{x}}&\\%
- &=\displaystyle\lim_{h \to 0} \log\Ttyuukakko{1+t}^{\bunsuu{1}{t}}\cdot\bunsuu{1}{x}&\\%
+ &=\displaystyle\lim_{h \to 0} \log\Ttyuukakko{1+t}^{\frac{1}{t}}\cdot\bunsuu{1}{x}&\\%
&=\log e\cdot\bunsuu{1}{x}&\\%
&=\bunsuu{1}{x}
\end{align*}%
@@ -3667,12 +3712,11 @@
\NewDocumentCommand{\不定積分}{ m O{i} }%
{%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{i}}%
- {$F'\Ttyuukakko{x}=f\Ttyuukakko{x}$とすると,$\displaystyle \int_{}^{} f\Ttyuukakko{x}dx=F\Ttyuukakko{x}+C$ ($C$は積分定数)}{\relax}%
+ {$F'\Ttyuukakko{x}=f\Ttyuukakko{x}$とすると,$\displaystyle \int_{}^{} f\Ttyuukakko{x}dx=F\Ttyuukakko{x}+C\text{\ (\,$C$は積分定数)}$}{\relax}%
\ifthenelse{\equal{#1}{定義}\AND\equal{#2}{b}}%
{%
$F'\Ttyuukakko{x}=f\Ttyuukakko{x}$とすると,%
- \[\displaystyle \int_{}^{} f\Ttyuukakko{x}dx=F\Ttyuukakko{x}+C\]%
- ($C$は積分定数)%
+ \[\displaystyle \int_{}^{} f\Ttyuukakko{x}dx=F\Ttyuukakko{x}+C\text{\ (\,$C$は積分定数)}\]%
}%
{\relax}%
\ifthenelse{\equal{#1}{置換積分}\AND\equal{#2}{i}}%
diff --git a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.tex b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.tex
index f63a375bb5..7c68dffbd7 100644
--- a/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.tex
+++ b/macros/luatex/latex/japanese-mathformulas/japanese-mathformulas.tex
@@ -1,8 +1,8 @@
\documentclass[fleqn]{ltjsarticle}% !lualatex
\usepackage[hiragino-pron,deluxe,expert,bold]{luatexja-preset}%
-\usepackage{mathformula,framed,comment}%
-\usepackage[usetype1]{uline--}
+\usepackage{japanese-mathformulas,framed,comment}%
+\usepackage[usetype1]{uline--}%
\title{\LARGE\uline{japanese-mathformulas.sty}\Large\\manual pdf\\(mainly for Japanese, lulatex)}%
\author{\Large Hugh / Ponkichi}%
\date{\today}
@@ -15,8 +15,10 @@
\newlength{\@tempdimi}
\let\@@vspace@@\vspace
\def\vspace{\@ifstar{\@@vspace@}{\@vspace@}}
-\def\@vspace@#1{\par\setlength{\@tempdimi}{#1}\@@vspace@@{\@tempdimi}}
-\def\@@vspace@#1{\par\setlength{\@tempdimi}{#1}\@@vspace@@*{\@tempdimi}}
+\def\@vspace@#1{
+\setlength{\@tempdimi}{#1}\@@vspace@@{\@tempdimi}}
+\def\@@vspace@#1{
+\setlength{\@tempdimi}{#1}\@@vspace@@*{\@tempdimi}}
\newlength{\pseprule} % 段仕切り線の太さ
\setlength{\pseprule}{.5truept}
@@ -70,38 +72,38 @@
\maketitle
\begin{multicolparx}{2}
-\parbox[t]{\hsize}{\begin{center}%
+\noindent\parbox[t]{\hsize}{\begin{center}%
-機能紹介と注記-
\end{center}}%
-\parbox[t]{\hsize}{\begin{center}%
+\noindent\parbox[t]{\hsize}{\begin{center}%
- Function Introduction and Notes -
\end{center}}%
-\parbox[t]{\hsize}{\begin{center}%
+\noindent\parbox[t]{\hsize}{\begin{center}%
中学高校で習う数学の定理や公式を出力するためのstyファイル。\\
\detokenize{\NewDocumentCommand}によって,インデント数式か別行立て数式かを指定できる。
\end{center}}%
-\parbox[t]{\hsize}{\begin{center}%
+\noindent\parbox[t]{\hsize}{\begin{center}%
This is a style file for compiling basic math formulas.\\
\detokenize{\NewDocumentCommand} allows you to specify whether the formula should be used within a sentence or on a new line.
\end{center}}%
-\parbox[t]{\hsize}{\begin{center}%
+\noindent\parbox[t]{\hsize}{\begin{center}%
後の例では記述がないが,$\Ttyuubracket{\mathrm{i}}$か$\Ttyuubracket{\mathrm{b}}$かの指定をしない場合は自動的に$\Ttyuubracket{\mathrm{i}}$とみなされる。
\end{center}}%
-\parbox[t]{\hsize}{\begin{center}%
+\noindent\parbox[t]{\hsize}{\begin{center}%
Although not shown in the examples below, if $\Ttyuubracket{\mathrm{i}}$ or $\Ttyuubracket{\mathrm{b}}$ is not specified, it is automatically assumed to be $\Ttyuubracket{\mathrm{i}}$.
\end{center}}%
-\parbox[t]{\hsize}{\begin{center}%
+\noindent\parbox[t]{\hsize}{\begin{center}%
二段組の文書を作成するときは,数式の上下間スペースを減らすために,以下をpreambleに記述するとよい。
\end{center}}%
-\parbox[t]{\hsize}{\begin{center}%
-When making two-column document, you are recommended to put these lines at preamble.\par
+\noindent\parbox[t]{\hsize}{\begin{center}%
+When making two-column document, you are recommended to put these lines at preamble.\\
These reduce the space above and below math expressions.
\end{center}}%
\end{multicolparx}
@@ -117,149 +119,253 @@ These reduce the space above and below math expressions.
\end{framed}
\begin{multicolparx}{2}
-\parbox[t]{\hsize}{\begin{center}%
+
+\noindent\parbox[t]{\hsize}{\begin{center}%
以下が実例。
\end{center}}%
-\parbox[t]{\hsize}{\begin{center}%
+
+\noindent\parbox[t]{\hsize}{\begin{center}%
Now, here are the actual examples!
\end{center}}%
\end{multicolparx}
-\auto{1}{\detokenize{\二次式展開{公式A}[i]}}\par
-\二次式展開{公式A}[i]\par
+\auto{1}{\detokenize{\二次式展開{公式A}[i]}}
+
+\二次式展開{公式A}[i]
+
\auto{2}{\detokenize{\二次式展開{公式A}[b]}}
+
\二次式展開{公式A}[b]
-\auto{33}{\detokenize{\二次式因数分解{公式A}[i]}}\par
-\二次式因数分解{公式A}[i]\par
+
+\auto{33}{\detokenize{\二次式因数分解{公式A}[i]}}
+
+\二次式因数分解{公式A}[i]
+
\auto{34}{\detokenize{\二次式因数分解{公式A}[b]}}
+
\二次式因数分解{公式A}[b]
+
%\begin{simplesquarebox}{二次式展開}
%\begin{description}
-\auto{1}{\detokenize{\二次式展開{公式A}[i]}}\par
-\二次式展開{公式A}[i]\par
+\auto{1}{\detokenize{\二次式展開{公式A}[i]}}
+
+\二次式展開{公式A}[i]
+
\auto{2}{\detokenize{\二次式展開{公式A}[b]}}
+
\二次式展開{公式A}[b]
-\auto{3}{\detokenize{\二次式展開{公式B}[i]}}\par
-\二次式展開{公式B}[i]\par
+
+\auto{3}{\detokenize{\二次式展開{公式B}[i]}}
+
+\二次式展開{公式B}[i]
+
\auto{4}{\detokenize{\二次式展開{公式B}[b]}}
+
\二次式展開{公式B}[b]
-\auto{5}{\detokenize{\二次式展開{公式C}[i]}}\par
-\二次式展開{公式C}[i]\par
+
+\auto{5}{\detokenize{\二次式展開{公式C}[i]}}
+
+\二次式展開{公式C}[i]
+
\auto{6}{\detokenize{\二次式展開{公式C}[b]}}
+
\二次式展開{公式C}[b]
-\auto{7}{\detokenize{\二次式展開{公式D}[i]}}\par
-\二次式展開{公式D}[i]\par
+
+\auto{7}{\detokenize{\二次式展開{公式D}[i]}}
+
+\二次式展開{公式D}[i]
+
\auto{8}{\detokenize{\二次式展開{公式D}[b]}}
+
\二次式展開{公式D}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{二次式因数分解}
%\begin{description}
-\auto{9}{\detokenize{\二次式因数分解{公式A}[i]}}\par
-\二次式因数分解{公式A}[i]\par
+\auto{9}{\detokenize{\二次式因数分解{公式A}[i]}}
+
+\二次式因数分解{公式A}[i]
+
\auto{10}{\detokenize{\二次式因数分解{公式A}[b]}}
+
\二次式因数分解{公式A}[b]
-\auto{11}{\detokenize{\二次式因数分解{公式B}[i]}}\par
-\二次式因数分解{公式B}[i]\par
+
+\auto{11}{\detokenize{\二次式因数分解{公式B}[i]}}
+
+\二次式因数分解{公式B}[i]
+
\auto{12}{\detokenize{\二次式因数分解{公式B}[b]}}
+
\二次式因数分解{公式B}[b]
-\auto{13}{\detokenize{\二次式因数分解{公式C}[i]}}\par
-\二次式因数分解{公式C}[i]\par
+
+\auto{13}{\detokenize{\二次式因数分解{公式C}[i]}}
+
+\二次式因数分解{公式C}[i]
+
\auto{14}{\detokenize{\二次式因数分解{公式C}[b]}}
+
\二次式因数分解{公式C}[b]
-\auto{15}{\detokenize{\二次式因数分解{公式D}[i]}}\par
-\二次式因数分解{公式D}[i]\par
+
+\auto{15}{\detokenize{\二次式因数分解{公式D}[i]}}
+
+\二次式因数分解{公式D}[i]
+
\auto{16}{\detokenize{\二次式因数分解{公式D}[b]}}
+
\二次式因数分解{公式D}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{平方根}
%\begin{description}
-\auto{17}{\detokenize{\平方根{定義}[i]}}\par
-\平方根{定義}[i]\par
-\auto{18}{\detokenize{\平方根{定義}[b]}}\par
+\auto{17}{\detokenize{\平方根{定義}[i]}}
+
+\平方根{定義}[i]
+
+\auto{18}{\detokenize{\平方根{定義}[b]}}
+
+
\平方根{定義}[b]
-\auto{19}{\detokenize{\平方根{性質A}[i]}}\par
-\平方根{性質A}[i]\par
-\auto{20}{\detokenize{\平方根{性質A}[b]}}\par
+
+\auto{19}{\detokenize{\平方根{性質A}[i]}}
+
+\平方根{性質A}[i]
+
+\auto{20}{\detokenize{\平方根{性質A}[b]}}
+
+
\平方根{性質A}[b]
-\auto{21}{\detokenize{\平方根{性質B}[i]}}\par
-\平方根{性質B}[i]\par
+
+\auto{21}{\detokenize{\平方根{性質B}[i]}}
+
+\平方根{性質B}[i]
+
\auto{22}{\detokenize{\平方根{性質B}[b]}}
+
\平方根{性質B}[b]
-\auto{23}{\detokenize{\平方根{性質C}[i]}}\par
-\平方根{性質C}[i]\par
+
+\auto{23}{\detokenize{\平方根{性質C}[i]}}
+
+\平方根{性質C}[i]
+
\auto{24}{\detokenize{\平方根{性質C}[b]}}
+
\平方根{性質C}[b]
-\auto{25}{\detokenize{\平方根{性質D}[i]}}\par
-\平方根{性質D}[i]\par
+
+\auto{25}{\detokenize{\平方根{性質D}[i]}}
+
+\平方根{性質D}[i]
+
\auto{26}{\detokenize{\平方根{性質D}[b]}}
+
\平方根{性質D}[b]
-\auto{27}{\detokenize{\平方根{性質E}[i]}}\par
-\平方根{性質E}[i]\par
+
+\auto{27}{\detokenize{\平方根{性質E}[i]}}
+
+\平方根{性質E}[i]
+
\auto{28}{\detokenize{\平方根{性質E}[b]}}
+
\平方根{性質E}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{一次不等式}
%\begin{description}
-\auto{29}{\detokenize{\一次不等式{性質A}[i]}}\par
-\一次不等式{性質A}[i]\par
-\auto{30}{\detokenize{\一次不等式{性質A}[b]}}\par
+\auto{29}{\detokenize{\一次不等式{性質A}[i]}}
+
+\一次不等式{性質A}[i]
+
+\auto{30}{\detokenize{\一次不等式{性質A}[b]}}
+
+
\一次不等式{性質A}[b]
-\auto{31}{\detokenize{\一次不等式{性質B}[i]}}\par
-\一次不等式{性質B}[i]\par
-\auto{32}{\detokenize{\一次不等式{性質B}[b]}}\par
+
+\auto{31}{\detokenize{\一次不等式{性質B}[i]}}
+
+\一次不等式{性質B}[i]
+
+\auto{32}{\detokenize{\一次不等式{性質B}[b]}}
+
+
\一次不等式{性質B}[b]
-\auto{33}{\detokenize{\一次不等式{性質C}[i]}}\par
-\一次不等式{性質C}[i]\par
-\auto{34}{\detokenize{\一次不等式{性質C}[b]}}\par
+
+\auto{33}{\detokenize{\一次不等式{性質C}[i]}}
+
+\一次不等式{性質C}[i]
+
+\auto{34}{\detokenize{\一次不等式{性質C}[b]}}
+
+
\一次不等式{性質C}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{集合}
%\begin{description}
-\auto{35}{\detokenize{\集合{積集合}[i]}}\par
-\集合{積集合}[i]\par
+\auto{35}{\detokenize{\集合{積集合}[i]}}
+
+\集合{積集合}[i]
+
\auto{36}{\detokenize{\集合{積集合}[b]}}
+
\集合{積集合}[b]
-\auto{37}{\detokenize{\集合{和集合}[i]}}\par
-\集合{和集合}[i]\par
+
+\auto{37}{\detokenize{\集合{和集合}[i]}}
+
+\集合{和集合}[i]
+
\auto{38}{\detokenize{\集合{和集合}[b]}}
+
\集合{和集合}[b]
-\auto{39}{\detokenize{\集合{補集合}[i]}}\par
-\集合{補集合}[i]\par
+
+\auto{39}{\detokenize{\集合{補集合}[i]}}
+
+\集合{補集合}[i]
+
\auto{40}{\detokenize{\集合{補集合}[b]}}
+
\集合{補集合}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{対偶}
%\begin{description}
-\auto{41}{\detokenize{\対偶{定理}[i]}}\par
-\対偶{定理}[i]\par
-\auto{41}{\detokenize{\対偶{定理}[b]}}\par
-\対偶{定理}[b]\par
-\auto{41}{\detokenize{\対偶{証明}}}\par
-\対偶{証明}\par
+\auto{41}{\detokenize{\対偶{定理}[i]}}
+
+\対偶{定理}[i]
+
+\auto{41}{\detokenize{\対偶{定理}[b]}}
+
+
+\対偶{定理}[b]
+
+
+\auto{41}{\detokenize{\対偶{証明}}}
+
+\対偶{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{背理法}
%\begin{description}
-\auto{42}{\detokenize{\背理法}}\par
+\auto{42}{\detokenize{\背理法}}
+
\背理法
%\end{description}
@@ -267,239 +373,433 @@ Now, here are the actual examples!
%\begin{simplesquarebox}{二次関数}
%\begin{description}
-\auto{43}{\detokenize{\二次関数{標準形}[i]}}\par
-\二次関数{標準形}[i]\par
+\auto{43}{\detokenize{\二次関数{標準形}[i]}}
+
+\二次関数{標準形}[i]
+
\auto{44}{\detokenize{\二次関数{標準形}[b]}}
+
\二次関数{標準形}[b]
-\auto{45}{\detokenize{\二次関数{一般形}[i]}}\par
-\二次関数{一般形}[i]\par
+
+\auto{45}{\detokenize{\二次関数{一般形}[i]}}
+
+\二次関数{一般形}[i]
+
\auto{46}{\detokenize{\二次関数{一般形}[b]}}
+
\二次関数{一般形}[b]
-\auto{47}{\detokenize{\二次関数{切片形}[i]}}\par
-\二次関数{切片形}[i]\par
+
+\auto{47}{\detokenize{\二次関数{切片形}[i]}}
+
+\二次関数{切片形}[i]
+
\auto{48}{\detokenize{\二次関数{切片形}[b]}}
+
\二次関数{切片形}[b]
-\auto{49}{\detokenize{\二次関数{平方完成}[i]}}\par
-\二次関数{平方完成}[i]\par
-\auto{50}{\detokenize{\二次関数{平方完成}[b]}}\par
+
+\auto{49}{\detokenize{\二次関数{平方完成}[i]}}
+
+\二次関数{平方完成}[i]
+
+\auto{50}{\detokenize{\二次関数{平方完成}[b]}}
+
+
\二次関数{平方完成}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{二次方程式の解の公式}
%\begin{description}
-\auto{51}{\detokenize{\二次方程式の解の公式{公式}[i]}}\par
-\二次方程式の解の公式{公式}[i]\par
-\auto{52}{\detokenize{\二次方程式の解の公式{公式}[b]}}\par
+\auto{51}{\detokenize{\二次方程式の解の公式{公式}[i]}}
+
+\二次方程式の解の公式{公式}[i]
+
+\auto{52}{\detokenize{\二次方程式の解の公式{公式}[b]}}
+
+
\二次方程式の解の公式{公式}[b]
-\auto{52}{\detokenize{\二次方程式の解の公式{証明A}[i]}}\par
-\二次方程式の解の公式{証明A}[i]\par
-\auto{52}{\detokenize{\二次方程式の解の公式{証明B}[i]}}\par
-\二次方程式の解の公式{証明B}[i]\par
+
+\auto{52}{\detokenize{\二次方程式の解の公式{証明A}[i]}}
+
+\二次方程式の解の公式{証明A}[i]
+
+\auto{52}{\detokenize{\二次方程式の解の公式{証明B}[i]}}
+
+\二次方程式の解の公式{証明B}[i]
+
%\end{description}
%\end{simplesquarebox}
-\auto{52}{\detokenize{\三角比の定義{定義A}[i]}}\par
-\三角比の定義{定義A}[i]\par
-\auto{52}{\detokenize{\三角比の定義{定義B}[i]}}\par
-\三角比の定義{定義B}[i]\par
+\auto{52}{\detokenize{\三角比の定義{定義A}[i]}}
+
+\三角比の定義{定義A}[i]
+
+\auto{52}{\detokenize{\三角比の定義{定義B}[i]}}
+
+\三角比の定義{定義B}[i]
+
%\begin{simplesquarebox}{三角比の相互関係}
%\begin{description}
-\auto{53}{\detokenize{\三角比の相互関係{公式A}[i]}}\par
-\三角比の相互関係{公式A}[i]\par
+\auto{53}{\detokenize{\三角比の相互関係{公式A}[i]}}
+
+\三角比の相互関係{公式A}[i]
+
\auto{54}{\detokenize{\三角比の相互関係{公式A}[b]}}
+
\三角比の相互関係{公式A}[b]
-\auto{55}{\detokenize{\三角比の相互関係{公式B}[i]}}\par
-\三角比の相互関係{公式B}[i]\par
+
+\auto{55}{\detokenize{\三角比の相互関係{公式B}[i]}}
+
+\三角比の相互関係{公式B}[i]
+
\auto{56}{\detokenize{\三角比の相互関係{公式B}[b]}}
+
\三角比の相互関係{公式B}[b]
-\auto{57}{\detokenize{\三角比の相互関係{公式C}[i]}}\par
-\三角比の相互関係{公式C}[i]\par
+
+\auto{57}{\detokenize{\三角比の相互関係{公式C}[i]}}
+
+\三角比の相互関係{公式C}[i]
+
\auto{58}{\detokenize{\三角比の相互関係{公式C}[b]}}
+
\三角比の相互関係{公式C}[b]
-\auto{57}{\detokenize{\三角比の相互関係{証明}}}\par
-\三角比の相互関係{証明}\par
+
+\auto{57}{\detokenize{\三角比の相互関係{証明}}}
+
+\三角比の相互関係{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{正弦定理}
%\begin{description}
-\auto{59}{\detokenize{\正弦定理{公式}[i]}}\par
-\正弦定理{公式}[i]\par
+\auto{59}{\detokenize{\正弦定理{公式}[i]}}
+
+\正弦定理{公式}[i]
+
\auto{60}{\detokenize{\正弦定理{公式}[b]}}
-\正弦定理{公式}[b]\par
-\auto{59}{\detokenize{\正弦定理{証明}}}\par
-\正弦定理{証明}\par
+
+\正弦定理{公式}[b]
+
+
+\auto{59}{\detokenize{\正弦定理{証明}}}
+
+\正弦定理{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{余弦定理}
%\begin{description}
-\auto{61}{\detokenize{\余弦定理{公式}[i]}}\par
-\余弦定理{公式}[i]\par
+\auto{61}{\detokenize{\余弦定理{公式}[i]}}
+
+\余弦定理{公式}[i]
+
\auto{62}{\detokenize{\余弦定理{公式}[b]}}
+
\余弦定理{公式}[b]
-\auto{61}{\detokenize{\余弦定理{証明}}}\par
-\余弦定理{証明}\par
+
+\auto{61}{\detokenize{\余弦定理{証明}}}
+
+\余弦定理{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{三角形の面積}
%\begin{description}
-\auto{63}{\detokenize{\三角形の面積{公式}[i]}}\par
-\三角形の面積{公式}[i]\par
+\auto{63}{\detokenize{\三角形の面積{公式}[i]}}
+
+\三角形の面積{公式}[i]
+
\auto{64}{\detokenize{\三角形の面積{公式}[b]}}
+
\三角形の面積{公式}[b]
-\auto{63}{\detokenize{\三角形の面積{証明}}}\par
-\三角形の面積{証明}\par
+
+\auto{63}{\detokenize{\三角形の面積{証明}}}
+
+\三角形の面積{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{場合の数と確率}
%\begin{description}
-\auto{65}{\detokenize{\場合の数と確率{和集合の要素の個数}[i]}}\par
-\場合の数と確率{和集合の要素の個数}[i]\par
+\auto{65}{\detokenize{\場合の数と確率{和集合の要素の個数}[i]}}
+
+\場合の数と確率{和集合の要素の個数}[i]
+
\auto{66}{\detokenize{\場合の数と確率{和集合の要素の個数}[b]}}
+
\場合の数と確率{和集合の要素の個数}[b]
-%\auto{67}{\detokenize{\場合の数と確率{積集合の要素の個数}[i]}}\par
-%\場合の数と確率{積集合の要素の個数}[i]\par
+
+%\auto{67}{\detokenize{\場合の数と確率{積集合の要素の個数}[i]}}
+
+%\場合の数と確率{積集合の要素の個数}[i]
+
%\auto{68}{\detokenize{\場合の数と確率{積集合の要素の個数}[b]}}
+
%\場合の数と確率{積集合の要素の個数}[b]
-\auto{69}{\detokenize{\場合の数と確率{補集合の要素の個数}[i]}}\par
-\場合の数と確率{補集合の要素の個数}[i]\par
+
+\auto{69}{\detokenize{\場合の数と確率{補集合の要素の個数}[i]}}
+
+\場合の数と確率{補集合の要素の個数}[i]
+
\auto{70}{\detokenize{\場合の数と確率{補集合の要素の個数}[b]}}
+
\場合の数と確率{補集合の要素の個数}[b]
-\auto{71}{\detokenize{\場合の数と確率{和の法則}[i]}}\par
-\場合の数と確率{和の法則}[i]\par
+
+\auto{71}{\detokenize{\場合の数と確率{和の法則}[i]}}
+
+\場合の数と確率{和の法則}[i]
+
\auto{72}{\detokenize{\場合の数と確率{和の法則}[b]}}
+
\場合の数と確率{和の法則}[b]
-\auto{73}{\detokenize{\場合の数と確率{積の法則}[i]}}\par
-\場合の数と確率{積の法則}[i]\par
+
+\auto{73}{\detokenize{\場合の数と確率{積の法則}[i]}}
+
+\場合の数と確率{積の法則}[i]
+
\auto{74}{\detokenize{\場合の数と確率{積の法則}[b]}}
+
\場合の数と確率{積の法則}[b]
-\auto{75}{\detokenize{\場合の数と確率{順列}[i]}}\par
-\場合の数と確率{順列}[i]\par
+
+\auto{75}{\detokenize{\場合の数と確率{順列}[i]}}
+
+\場合の数と確率{順列}[i]
+
\auto{76}{\detokenize{\場合の数と確率{順列}[b]}}
+
\場合の数と確率{順列}[b]
-\auto{75}{\detokenize{\場合の数と確率{順列の証明}[i]}}\par
-\場合の数と確率{順列の証明}[i]\par
-\auto{77}{\detokenize{\場合の数と確率{円順列}[i]}}\par
-\場合の数と確率{円順列}[i]\par
+
+\auto{75}{\detokenize{\場合の数と確率{順列の証明}}}
+
+\場合の数と確率{順列の証明}
+
+\auto{77}{\detokenize{\場合の数と確率{円順列}[i]}}
+
+\場合の数と確率{円順列}[i]
+
\auto{78}{\detokenize{\場合の数と確率{円順列}[b]}}
+
\場合の数と確率{円順列}[b]
-\auto{77}{\detokenize{\場合の数と確率{円順列の証明}[i]}}\par
-\場合の数と確率{円順列の証明}[i]\par
-\auto{79}{\detokenize{\場合の数と確率{重複順列}[i]}}\par
-\場合の数と確率{重複順列}[i]\par
+
+\auto{77}{\detokenize{\場合の数と確率{円順列の証明}}}
+
+\場合の数と確率{円順列の証明}
+
+\auto{79}{\detokenize{\場合の数と確率{重複順列}[i]}}
+
+\場合の数と確率{重複順列}[i]
+
\auto{80}{\detokenize{\場合の数と確率{重複順列}[b]}}
+
\場合の数と確率{重複順列}[b]
-\auto{81}{\detokenize{\場合の数と確率{組み合わせ}[i]}}\par
-\場合の数と確率{組み合わせ}[i]\par
+
+\auto{81}{\detokenize{\場合の数と確率{組み合わせ}[i]}}
+
+\場合の数と確率{組み合わせ}[i]
+
\auto{82}{\detokenize{\場合の数と確率{組み合わせ}[b]}}
+
\場合の数と確率{組み合わせ}[b]
-\auto{81}{\detokenize{\場合の数と確率{組み合わせの証明}[i]}}\par
-\場合の数と確率{組み合わせの証明}[i]\par
-\auto{83}{\detokenize{\場合の数と確率{同じものを含む順列}[i]}}\par
-\場合の数と確率{同じものを含む順列}[i]\par
+
+\auto{81}{\detokenize{\場合の数と確率{組み合わせの証明}}}
+
+\場合の数と確率{組み合わせの証明}
+
+\auto{83}{\detokenize{\場合の数と確率{同じものを含む順列}[i]}}
+
+\場合の数と確率{同じものを含む順列}[i]
+
\auto{84}{\detokenize{\場合の数と確率{同じものを含む順列}[b]}}
+
\場合の数と確率{同じものを含む順列}[b]
-\auto{83}{\detokenize{\場合の数と確率{同じものを含む順列の証明}[i]}}\par
-\場合の数と確率{同じものを含む順列の証明}[i]\par
-\auto{85}{\detokenize{\場合の数と確率{確率の定義}[i]}}\par
-\場合の数と確率{確率の定義}[i]\par
+
+\auto{83}{\detokenize{\場合の数と確率{同じものを含む順列の証明}}}
+
+\場合の数と確率{同じものを含む順列の証明}
+
+\auto{85}{\detokenize{\場合の数と確率{確率の定義}[i]}}
+
+\場合の数と確率{確率の定義}[i]
+
\auto{86}{\detokenize{\場合の数と確率{確率の定義}[b]}}
+
\場合の数と確率{確率の定義}[b]
-\auto{87}{\detokenize{\場合の数と確率{排反の定義}[i]}}\par
-\場合の数と確率{排反の定義}[i]\par
+
+\auto{87}{\detokenize{\場合の数と確率{排反の定義}[i]}}
+
+\場合の数と確率{排反の定義}[i]
+
\auto{88}{\detokenize{\場合の数と確率{排反の定義}[b]}}
-\場合の数と確率{排反の定義}[b]\par
-\auto{89}{\detokenize{\場合の数と確率{確率の性質A}[i]}}\par
-\場合の数と確率{確率の性質A}[i]\par
+
+\場合の数と確率{排反の定義}[b]
+
+
+\auto{89}{\detokenize{\場合の数と確率{確率の性質A}[i]}}
+
+\場合の数と確率{確率の性質A}[i]
+
\auto{90}{\detokenize{\場合の数と確率{確率の性質A}[b]}}
+
\場合の数と確率{確率の性質A}[b]
-\auto{91}{\detokenize{\場合の数と確率{確率の性質B}[i]}}\par
-\場合の数と確率{確率の性質B}[i]\par
+
+\auto{91}{\detokenize{\場合の数と確率{確率の性質B}[i]}}
+
+\場合の数と確率{確率の性質B}[i]
+
\auto{92}{\detokenize{\場合の数と確率{確率の性質B}[b]}}
+
\場合の数と確率{確率の性質B}[b]
-\auto{93}{\detokenize{\場合の数と確率{和事象の確率}[i]}}\par
-\場合の数と確率{和事象の確率}[i]\par
+
+\auto{93}{\detokenize{\場合の数と確率{和事象の確率}[i]}}
+
+\場合の数と確率{和事象の確率}[i]
+
\auto{94}{\detokenize{\場合の数と確率{和事象の確率}[b]}}
+
\場合の数と確率{和事象の確率}[b]
-\auto{95}{\detokenize{\場合の数と確率{積事象の確率}[i]}}\par
-%\場合の数と確率{積事象の確率}[i]\par
+
+\auto{95}{\detokenize{\場合の数と確率{積事象の確率}[i]}}
+
+%\場合の数と確率{積事象の確率}[i]
+
%\auto{96}{\detokenize{\場合の数と確率{積事象の確率}[b]}}
+
%\場合の数と確率{積事象の確率}[b]
-%\auto{97}{\detokenize{\場合の数と確率{余事象の確率}[i]}}\par
-\場合の数と確率{余事象の確率}[i]\par
+
+%\auto{97}{\detokenize{\場合の数と確率{余事象の確率}[i]}}
+
+\場合の数と確率{余事象の確率}[i]
+
\auto{98}{\detokenize{\場合の数と確率{余事象の確率}[b]}}
+
\場合の数と確率{余事象の確率}[b]
-\auto{99}{\detokenize{\場合の数と確率{独立な事象の確率}[i]}}\par
-\場合の数と確率{独立な事象の確率}[i]\par
+
+\auto{99}{\detokenize{\場合の数と確率{独立な事象の確率}[i]}}
+
+\場合の数と確率{独立な事象の確率}[i]
+
\auto{100}{\detokenize{\場合の数と確率{独立な事象の確率}[b]}}
+
\場合の数と確率{独立な事象の確率}[b]
-\auto{101}{\detokenize{\場合の数と確率{反復試行の確率}[i]}}\par
-\場合の数と確率{反復試行の確率}[i]\par
+
+\auto{101}{\detokenize{\場合の数と確率{反復試行の確率}[i]}}
+
+\場合の数と確率{反復試行の確率}[i]
+
\auto{102}{\detokenize{\場合の数と確率{反復試行の確率}[b]}}
+
\場合の数と確率{反復試行の確率}[b]
-\auto{101}{\detokenize{\場合の数と確率{反復試行の確率の証明}[i]}}\par
-\場合の数と確率{反復試行の確率の証明}[i]\par
-\auto{103}{\detokenize{\場合の数と確率{条件付き確率}[i]}}\par
-\場合の数と確率{条件付き確率}[i]\par
+
+\auto{101}{\detokenize{\場合の数と確率{反復試行の確率の証明}}}
+
+\場合の数と確率{反復試行の確率の証明}
+
+\auto{103}{\detokenize{\場合の数と確率{条件付き確率}[i]}}
+
+\場合の数と確率{条件付き確率}[i]
+
\auto{104}{\detokenize{\場合の数と確率{条件付き確率}[b]}}
+
\場合の数と確率{条件付き確率}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{図形の性質}
%\begin{description}
-\auto{105}{\detokenize{\図形の性質{内心}}}\par
-\図形の性質{内心}\par
-\auto{106}{\detokenize{\図形の性質{外心}}}\par
-\図形の性質{外心}\par
-\auto{107}{\detokenize{\図形の性質{垂心}}}\par
-\図形の性質{垂心}\par
-\auto{108}{\detokenize{\図形の性質{重心}}}\par
-\図形の性質{重心}\par
-\auto{109}{\detokenize{\図形の性質{傍心}}}\par
-\図形の性質{傍心}\par
-\auto{110}{\detokenize{\図形の性質{チェバの定理}}}\par
-\図形の性質{チェバの定理}\par
-\auto{110}{\detokenize{\図形の性質{チェバの定理の証明}}}\par
-\図形の性質{チェバの定理の証明}\par
-\auto{111}{\detokenize{\図形の性質{メネラウスの定理}}}\par
-\図形の性質{メネラウスの定理}\par
-\auto{111}{\detokenize{\図形の性質{メネラウスの定理の証明}}}\par
+\auto{105}{\detokenize{\図形の性質{内心}}}
+
+\図形の性質{内心}
+
+\auto{106}{\detokenize{\図形の性質{外心}}}
+
+\図形の性質{外心}
+
+\auto{107}{\detokenize{\図形の性質{垂心}}}
+
+\図形の性質{垂心}
+
+\auto{108}{\detokenize{\図形の性質{重心}}}
+
+\図形の性質{重心}
+
+\auto{109}{\detokenize{\図形の性質{傍心}}}
+
+\図形の性質{傍心}
+
+\auto{110}{\detokenize{\図形の性質{チェバの定理}}}
+
+\図形の性質{チェバの定理}
+
+\auto{110}{\detokenize{\図形の性質{チェバの定理の証明}}}
+
+\図形の性質{チェバの定理の証明}
+
+\auto{111}{\detokenize{\図形の性質{メネラウスの定理}}}
+
+\図形の性質{メネラウスの定理}
+
+\auto{111}{\detokenize{\図形の性質{メネラウスの定理の証明}}}
+
\図形の性質{メネラウスの定理の証明}
-\auto{112}{\detokenize{\図形の性質{円周角の定理}}}\par
-\図形の性質{円周角の定理}\par
-\auto{112}{\detokenize{\図形の性質{円周角の定理の証明}}}\par
-\図形の性質{円周角の定理の証明}\par
-\auto{113}{\detokenize{\図形の性質{内接四角形の定理}}}\par
-\図形の性質{内接四角形の定理}\par
-\auto{113}{\detokenize{\図形の性質{内接四角形の定理の証明}}}\par
-\図形の性質{内接四角形の定理の証明}\par
-\auto{114}{\detokenize{\図形の性質{接弦定理}}}\par
-\図形の性質{接弦定理}\par
-\auto{114}{\detokenize{\図形の性質{接弦定理の証明}}}\par
-\図形の性質{接弦定理の証明}\par
-\auto{115}{\detokenize{\図形の性質{内角と外角の二等分線}}}\par
-\図形の性質{内角と外角の二等分線}\par
-\auto{116}{\detokenize{\図形の性質{方べきの定理A}}}\par
-\図形の性質{方べきの定理A}\par
-\auto{116}{\detokenize{\図形の性質{方べきの定理Aの証明}}}\par
+\auto{112}{\detokenize{\図形の性質{円周角の定理}}}
+
+\図形の性質{円周角の定理}
+
+\auto{112}{\detokenize{\図形の性質{円周角の定理の証明}}}
+
+\図形の性質{円周角の定理の証明}
+
+\auto{113}{\detokenize{\図形の性質{内接四角形の定理}}}
+
+\図形の性質{内接四角形の定理}
+
+\auto{113}{\detokenize{\図形の性質{内接四角形の定理の証明}}}
+
+\図形の性質{内接四角形の定理の証明}
+
+\auto{114}{\detokenize{\図形の性質{接弦定理}}}
+
+\図形の性質{接弦定理}
+
+\auto{114}{\detokenize{\図形の性質{接弦定理の証明}}}
+
+\図形の性質{接弦定理の証明}
+
+\auto{115}{\detokenize{\図形の性質{内角と外角の二等分線}}}
+
+\図形の性質{内角と外角の二等分線}
+
+\auto{116}{\detokenize{\図形の性質{方べきの定理A}}}
+
+\図形の性質{方べきの定理A}
+
+\auto{116}{\detokenize{\図形の性質{方べきの定理Aの証明}}}
+
\図形の性質{方べきの定理Aの証明}
-\auto{117}{\detokenize{\図形の性質{方べきの定理B}}}\par
-\図形の性質{方べきの定理B}\par
-\auto{117}{\detokenize{\図形の性質{方べきの定理Bの証明}}}\par
+\auto{117}{\detokenize{\図形の性質{方べきの定理B}}}
+
+\図形の性質{方べきの定理B}
+
+\auto{117}{\detokenize{\図形の性質{方べきの定理Bの証明}}}
+
\図形の性質{方べきの定理Bの証明}
-\auto{118}{\detokenize{\図形の性質{方べきの定理C}}}\par
-\図形の性質{方べきの定理C}\par
-\auto{118}{\detokenize{\図形の性質{方べきの定理Cの証明}}}\par
+\auto{118}{\detokenize{\図形の性質{方べきの定理C}}}
+
+\図形の性質{方べきの定理C}
+
+\auto{118}{\detokenize{\図形の性質{方べきの定理Cの証明}}}
+
\図形の性質{方べきの定理Cの証明}
%\end{description}
%\end{simplesquarebox}
@@ -508,119 +808,193 @@ Now, here are the actual examples!
%n-118=個数
%\begin{simplesquarebox}{展開}
%\begin{description}
-\auto{119}{\detokenize{\三次式展開{公式A}[i]}}\par
-\三次式展開{公式A}[i]\par
+\auto{119}{\detokenize{\三次式展開{公式A}[i]}}
+
+\三次式展開{公式A}[i]
+
\auto{120}{\detokenize{\三次式展開{公式A}[b]}}
+
\三次式展開{公式A}[b]
-\auto{121}{\detokenize{\三次式展開{公式B}[i]}}\par
-\三次式展開{公式B}[i]\par
+
+\auto{121}{\detokenize{\三次式展開{公式B}[i]}}
+
+\三次式展開{公式B}[i]
+
\auto{122}{\detokenize{\三次式展開{公式B}[b]}}
+
\三次式展開{公式B}[b]
-\auto{123}{\detokenize{\三次式展開{公式C}[i]}}\par
-\三次式展開{公式C}[i]\par
+
+\auto{123}{\detokenize{\三次式展開{公式C}[i]}}
+
+\三次式展開{公式C}[i]
+
\auto{124}{\detokenize{\三次式展開{公式C}[b]}}
+
\三次式展開{公式C}[b]
-\auto{125}{\detokenize{\三次式展開{公式D}[i]}}\par
-\三次式展開{公式D}[i]\par
+
+\auto{125}{\detokenize{\三次式展開{公式D}[i]}}
+
+\三次式展開{公式D}[i]
+
\auto{126}{\detokenize{\三次式展開{公式D}[b]}}
+
\三次式展開{公式D}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{因数分解}
%\begin{description}
-\auto{127}{\detokenize{\三次式因数分解{公式A}[i]}}\par
-\三次式因数分解{公式A}[i]\par
+\auto{127}{\detokenize{\三次式因数分解{公式A}[i]}}
+
+\三次式因数分解{公式A}[i]
+
\auto{128}{\detokenize{\三次式因数分解{公式A}[b]}}
+
\三次式因数分解{公式A}[b]
-\auto{129}{\detokenize{\三次式因数分解{公式B}[i]}}\par
-\三次式因数分解{公式B}[i]\par
+
+\auto{129}{\detokenize{\三次式因数分解{公式B}[i]}}
+
+\三次式因数分解{公式B}[i]
+
\auto{130}{\detokenize{\三次式因数分解{公式B}[b]}}
+
\三次式因数分解{公式B}[b]
-\auto{131}{\detokenize{\三次式因数分解{公式C}[i]}}\par
-\三次式因数分解{公式C}[i]\par
+
+\auto{131}{\detokenize{\三次式因数分解{公式C}[i]}}
+
+\三次式因数分解{公式C}[i]
+
\auto{132}{\detokenize{\三次式因数分解{公式C}[b]}}
+
\三次式因数分解{公式C}[b]
-\auto{133}{\detokenize{\三次式因数分解{公式D}[i]}}\par
-\三次式因数分解{公式D}[i]\par
+
+\auto{133}{\detokenize{\三次式因数分解{公式D}[i]}}
+
+\三次式因数分解{公式D}[i]
+
\auto{134}{\detokenize{\三次式因数分解{公式D}[b]}}
+
\三次式因数分解{公式D}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{二項定理}
%\begin{description}
-\auto{135}{\detokenize{\二項定理{公式}[i]}}\par
-\二項定理{公式}[i]\par
+\auto{135}{\detokenize{\二項定理{公式}[i]}}
+
+\二項定理{公式}[i]
+
\auto{136}{\detokenize{\二項定理{公式}[b]}}
+
\二項定理{公式}[b]
-\auto{137}{\detokenize{\二項定理{一般項}[i]}}\par
-\二項定理{一般項}[i]\par
+
+\auto{137}{\detokenize{\二項定理{一般項}[i]}}
+
+\二項定理{一般項}[i]
+
\auto{138}{\detokenize{\二項定理{一般項}[b]}}
+
\二項定理{一般項}[b]
-\auto{135}{\detokenize{\二項定理{証明}}}\par
-\二項定理{証明}\par
+
+\auto{135}{\detokenize{\二項定理{証明}}}
+
+\二項定理{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{分数式}
%\begin{description}
-\auto{139}{\detokenize{\分数式{公式A}[i]}}\par
-\分数式{公式A}[i]\par
+\auto{139}{\detokenize{\分数式{公式A}[i]}}
+
+\分数式{公式A}[i]
+
\auto{140}{\detokenize{\分数式{公式A}[b]}}
+
\分数式{公式A}[b]
-\auto{141}{\detokenize{\分数式{公式B}[i]}}\par
-\分数式{公式B}[i]\par
+
+\auto{141}{\detokenize{\分数式{公式B}[i]}}
+
+\分数式{公式B}[i]
+
\auto{142}{\detokenize{\分数式{公式B}[b]}}
+
\分数式{公式B}[b]
-\auto{143}{\detokenize{\分数式{公式C}[i]}}\par
-\分数式{公式C}[i]\par
+
+\auto{143}{\detokenize{\分数式{公式C}[i]}}
+
+\分数式{公式C}[i]
+
\auto{144}{\detokenize{\分数式{公式C}[b]}}
+
\分数式{公式C}[b]
-\auto{145}{\detokenize{\分数式{公式D}[i]}}\par
-\分数式{公式D}[i]\par
+
+\auto{145}{\detokenize{\分数式{公式D}[i]}}
+
+\分数式{公式D}[i]
+
\auto{146}{\detokenize{\分数式{公式D}[b]}}
+
\分数式{公式D}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{相加相乗平均}
%\begin{description}
-\auto{147}{\detokenize{\相加相乗平均{公式}[i]}}\par
-\相加相乗平均{公式}[i]\par
+\auto{147}{\detokenize{\相加相乗平均{公式}[i]}}
+
+\相加相乗平均{公式}[i]
+
\auto{148}{\detokenize{\相加相乗平均{公式}[b]}}
+
\相加相乗平均{公式}[b]
-\auto{147}{\detokenize{\相加相乗平均{証明}}}\par
-\相加相乗平均{証明}\par
+
+\auto{147}{\detokenize{\相加相乗平均{証明}}}
+
+\相加相乗平均{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{虚数の定義}
%\begin{description}
-\auto{149}{\detokenize{\虚数の定義{定義}[i]}}\par
-\虚数の定義{定義}[i]\par
+\auto{149}{\detokenize{\虚数の定義{定義}[i]}}
+
+\虚数の定義{定義}[i]
+
\auto{150}{\detokenize{\虚数の定義{定義}[b]}}
+
\虚数の定義{定義}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{複素数の定義}
%\begin{description}
-\auto{151}{\detokenize{\複素数の定義{定義}[i]}}\par
-\複素数の定義{定義}[i]\par
-\auto{152}{\detokenize{\複素数の定義{定義}[b]}}\par
+\auto{151}{\detokenize{\複素数の定義{定義}[i]}}
+
+\複素数の定義{定義}[i]
+
+\auto{152}{\detokenize{\複素数の定義{定義}[b]}}
+
+
\複素数の定義{定義}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{二次方程式の解の判別}
%\begin{description}
-\auto{153}{\detokenize{\二次方程式の解の判別}}\par
+\auto{153}{\detokenize{\二次方程式の解の判別}}
+
\二次方程式の解の判別
%\end{description}
@@ -628,888 +1002,1611 @@ Now, here are the actual examples!
%\begin{simplesquarebox}{解と係数の関係}
%\begin{description}
-\auto{154}{\detokenize{\解と係数の関係{二次方程式の解と係数の関係A}[i]}}\par
-\解と係数の関係{二次方程式の解と係数の関係A}[i]\par
+\auto{154}{\detokenize{\解と係数の関係{二次方程式の解と係数の関係A}[i]}}
+
+\解と係数の関係{二次方程式の解と係数の関係A}[i]
+
\auto{155}{\detokenize{\解と係数の関係{二次方程式の解と係数の関係A}[b]}}
+
\解と係数の関係{二次方程式の解と係数の関係A}[b]
-\auto{156}{\detokenize{\解と係数の関係{二次方程式の解と係数の関係B}[i]}}\par
-\解と係数の関係{二次方程式の解と係数の関係B}[i]\par
+
+\auto{156}{\detokenize{\解と係数の関係{二次方程式の解と係数の関係B}[i]}}
+
+\解と係数の関係{二次方程式の解と係数の関係B}[i]
+
\auto{157}{\detokenize{\解と係数の関係{二次方程式の解と係数の関係B}[b]}}
+
\解と係数の関係{二次方程式の解と係数の関係B}[b]
-\auto{154}{\detokenize{\解と係数の関係{二次方程式の解と係数の関係の証明}[i]}}\par
-\解と係数の関係{二次方程式の解と係数の関係の証明}[i]\par
-\auto{158}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係A}[i]}}\par
-\解と係数の関係{三次方程式の解と係数の関係A}[i]\par
+
+\auto{154}{\detokenize{\解と係数の関係{二次方程式の解と係数の関係の証明}}}
+
+\解と係数の関係{二次方程式の解と係数の関係の証明}
+
+\auto{158}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係A}[i]}}
+
+\解と係数の関係{三次方程式の解と係数の関係A}[i]
+
\auto{159}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係A}[b]}}
+
\解と係数の関係{三次方程式の解と係数の関係A}[b]
-\auto{160}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係B}[i]}}\par
-\解と係数の関係{三次方程式の解と係数の関係B}[i]\par
+
+\auto{160}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係B}[i]}}
+
+\解と係数の関係{三次方程式の解と係数の関係B}[i]
+
\auto{161}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係B}[b]}}
+
\解と係数の関係{三次方程式の解と係数の関係B}[b]
-\auto{162}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係C}[i]}}\par
-\解と係数の関係{三次方程式の解と係数の関係C}[i]\par
+
+\auto{162}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係C}[i]}}
+
+\解と係数の関係{三次方程式の解と係数の関係C}[i]
+
\auto{163}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係C}[b]}}
+
\解と係数の関係{三次方程式の解と係数の関係C}[b]
-\auto{158}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係の証明}[i]}}\par
-\解と係数の関係{三次方程式の解と係数の関係の証明}[i]\par
+
+\auto{158}{\detokenize{\解と係数の関係{三次方程式の解と係数の関係の証明}}}
+
+\解と係数の関係{三次方程式の解と係数の関係の証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{剰余定理}
%\begin{description}
-\auto{164}{\detokenize{\剰余定理{定理A}[i]}}\par
-\剰余定理{定理A}[i]\par
+\auto{164}{\detokenize{\剰余定理{定理A}[i]}}
+
+\剰余定理{定理A}[i]
+
\auto{165}{\detokenize{\剰余定理{定理A}[b]}}
+
\剰余定理{定理A}[b]
-\auto{166}{\detokenize{\剰余定理{定理B}[i]}}\par
-\剰余定理{定理B}[i]\par
+
+\auto{166}{\detokenize{\剰余定理{定理B}[i]}}
+
+\剰余定理{定理B}[i]
+
\auto{167}{\detokenize{\剰余定理{定理B}[b]}}
+
\剰余定理{定理B}[b]
-\auto{164}{\detokenize{\剰余定理{証明}}}\par
-\剰余定理{証明}\par
+
+\auto{164}{\detokenize{\剰余定理{証明}}}
+
+\剰余定理{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{因数定理}
%\begin{description}
-\auto{168}{\detokenize{\因数定理{定理}[i]}}\par
-\因数定理{定理}[i]\par
+\auto{168}{\detokenize{\因数定理{定理}[i]}}
+
+\因数定理{定理}[i]
+
\auto{168}{\detokenize{\因数定理{定理}[b]}}
+
\因数定理{定理}[b]
-\auto{168}{\detokenize{\因数定理{証明}}}\par
-\因数定理{証明}\par
+\auto{168}{\detokenize{\因数定理{証明}}}
+
+\因数定理{証明}
+
+\auto{168}{\detokenize{\ユークリッド幾何の公理{公理A}}}
+
+\ユークリッド幾何の公理{公理A}
+
+\auto{168}{\detokenize{\ユークリッド幾何の公理{公理B}}}
+
+\ユークリッド幾何の公理{公理B}
+
+\auto{168}{\detokenize{\直線}}
+
+\直線
+
+\auto{168}{\detokenize{\線分}}
+
+\線分
+
+\auto{168}{\detokenize{\半直線}}
+
+\半直線
+
+\auto{168}{\detokenize{\距離}}
+
+\距離
+
+\auto{168}{\detokenize{\円}}
+
+\円
+
+\auto{168}{\detokenize{\弧}}
+
+\弧
+
+\auto{168}{\detokenize{\弦}}
+
+\弦
+
+\auto{168}{\detokenize{\中心角}}
+
+\中心角
+
+\auto{168}{\detokenize{\対頂角{定義}}}
+
+\対頂角{定義}
+
+\auto{168}{\detokenize{\対頂角{性質}}}
+
+\対頂角{性質}
+
+\auto{168}{\detokenize{\対頂角{証明}}}
+
+\対頂角{証明}
+
+\auto{168}{\detokenize{\錯角{定義}}}
+
+\錯角{定義}
+
+\auto{168}{\detokenize{\錯角{性質}}}
+
+\錯角{性質}
+
+\auto{168}{\detokenize{\錯角{証明}}}
+
+\錯角{証明}
+
+\auto{168}{\detokenize{\同位角{定義}}}
+
+\同位角{定義}
+
+\auto{168}{\detokenize{\同位角{公理}}}
+
+\同位角{公理}
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{点の座標}
%\begin{description}
-\auto{169}{\detokenize{\点の座標{二点間の距離}[i]}}\par
-\点の座標{二点間の距離}[i]\par
+\auto{169}{\detokenize{\点の座標{二点間の距離}[i]}}
+
+\点の座標{二点間の距離}[i]
+
\auto{170}{\detokenize{\点の座標{二点間の距離}[b]}}
+
\点の座標{二点間の距離}[b]
-\auto{171}{\detokenize{\点の座標{内分点の座標}[i]}}\par
-\点の座標{内分点の座標}[i]\par
+
+\auto{171}{\detokenize{\点の座標{内分点の座標}[i]}}
+
+\点の座標{内分点の座標}[i]
+
\auto{172}{\detokenize{\点の座標{内分点の座標}[b]}}
+
\点の座標{内分点の座標}[b]
-\auto{171}{\detokenize{\点の座標{内分点の座標の証明}[i]}}\par
-\点の座標{内分点の座標の証明}[i]\par
-\auto{173}{\detokenize{\点の座標{外分点の座標}[i]}}\par
-\点の座標{外分点の座標}[i]\par
+
+\auto{171}{\detokenize{\点の座標{内分点の座標の証明}}}
+
+\点の座標{内分点の座標の証明}
+
+\auto{173}{\detokenize{\点の座標{外分点の座標}[i]}}
+
+\点の座標{外分点の座標}[i]
+
\auto{174}{\detokenize{\点の座標{外分点の座標}[b]}}
+
\点の座標{外分点の座標}[b]
-\auto{173}{\detokenize{\点の座標{外分点の座標の証明}[i]}}\par
-\点の座標{外分点の座標の証明}[i]\par
-\auto{175}{\detokenize{\点の座標{中点の座標}[i]}}\par
-\点の座標{中点の座標}[i]\par
+
+\auto{173}{\detokenize{\点の座標{外分点の座標の証明}}}
+
+\点の座標{外分点の座標の証明}
+
+\auto{175}{\detokenize{\点の座標{中点の座標}[i]}}
+
+\点の座標{中点の座標}[i]
+
\auto{176}{\detokenize{\点の座標{中点の座標}[b]}}
+
\点の座標{中点の座標}[b]
-\auto{175}{\detokenize{\点の座標{中点の座標の証明}[i]}}\par
-\点の座標{中点の座標の証明}[i]\par
-\auto{177}{\detokenize{\点の座標{重心の座標}[i]}}\par
-\点の座標{重心の座標}[i]\par
+
+\auto{175}{\detokenize{\点の座標{中点の座標の証明}}}
+
+\点の座標{中点の座標の証明}
+
+\auto{177}{\detokenize{\点の座標{重心の座標}[i]}}
+
+\点の座標{重心の座標}[i]
+
\auto{178}{\detokenize{\点の座標{重心の座標}[b]}}
+
\点の座標{重心の座標}[b]
-\auto{177}{\detokenize{\点の座標{重心の座標の証明}[i]}}\par
-\点の座標{重心の座標の証明}[i]\par
+
+\auto{177}{\detokenize{\点の座標{重心の座標の証明}}}
+
+\点の座標{重心の座標の証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{直線の方程式}
%\begin{description}
-\auto{179}{\detokenize{\直線の方程式{公式A}[i]}}\par
-\直線の方程式{公式A}[i]\par
+\auto{179}{\detokenize{\直線の方程式{公式A}[i]}}
+
+\直線の方程式{公式A}[i]
+
\auto{180}{\detokenize{\直線の方程式{公式A}[b]}}
+
\直線の方程式{公式A}[b]
-\auto{181}{\detokenize{\直線の方程式{公式B}[i]}}\par
-\直線の方程式{公式B}[i]\par
+
+\auto{181}{\detokenize{\直線の方程式{公式B}[i]}}
+
+\直線の方程式{公式B}[i]
+
\auto{182}{\detokenize{\直線の方程式{公式B}[b]}}
+
\直線の方程式{公式B}[b]
-\auto{183}{\detokenize{\直線の方程式{公式C}[i]}}\par
-\直線の方程式{公式C}[i]\par
+
+\auto{183}{\detokenize{\直線の方程式{公式C}[i]}}
+
+\直線の方程式{公式C}[i]
+
\auto{184}{\detokenize{\直線の方程式{公式C}[b]}}
+
\直線の方程式{公式C}[b]
-\auto{183}{\detokenize{\直線の方程式{公式Bの証明}}}\par
-\直線の方程式{公式Bの証明}\par
+
+\auto{183}{\detokenize{\直線の方程式{公式Bの証明}}}
+
+\直線の方程式{公式Bの証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{二直線の関係}
%\begin{description}
-\auto{185}{\detokenize{\二直線の関係{公式A}[i]}}\par
-\二直線の関係{公式A}[i]\par
+\auto{185}{\detokenize{\二直線の関係{公式A}[i]}}
+
+\二直線の関係{公式A}[i]
+
\auto{186}{\detokenize{\二直線の関係{公式A}[b]}}
+
\二直線の関係{公式A}[b]
-\auto{187}{\detokenize{\二直線の関係{公式B}[i]}}\par
-\二直線の関係{公式B}[i]\par
+
+\auto{187}{\detokenize{\二直線の関係{公式B}[i]}}
+
+\二直線の関係{公式B}[i]
+
\auto{188}{\detokenize{\二直線の関係{公式B}[b]}}
+
\二直線の関係{公式B}[b]
-\auto{185}{\detokenize{\二直線の関係{公式Bの証明}[i]}}\par
-\二直線の関係{公式Bの証明}[i]\par
+
+\auto{185}{\detokenize{\二直線の関係{公式Bの証明}}}
+
+\二直線の関係{公式Bの証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{点と直線の距離}
%\begin{description}
-\auto{189}{\detokenize{\点と直線の距離{公式}[i]}}\par
-\点と直線の距離{公式}[i]\par
+\auto{189}{\detokenize{\点と直線の距離{公式}[i]}}
+
+\点と直線の距離{公式}[i]
+
\auto{190}{\detokenize{\点と直線の距離{公式}[b]}}
+
\点と直線の距離{公式}[b]
-\auto{189}{\detokenize{\点と直線の距離{証明}}}\par
-\点と直線の距離{証明}\par
+
+\auto{189}{\detokenize{\点と直線の距離{証明}}}
+
+\点と直線の距離{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{円の方程式}
%\begin{description}
-\auto{191}{\detokenize{\円の方程式{公式}[i]}}\par
-\円の方程式{公式}[i]\par
+\auto{191}{\detokenize{\円の方程式{公式}[i]}}
+
+\円の方程式{公式}[i]
+
\auto{192}{\detokenize{\円の方程式{公式}[b]}}
+
\円の方程式{公式}[b]
-\auto{191}{\detokenize{\円の方程式{証明}}}\par
-\円の方程式{証明}\par
+
+\auto{191}{\detokenize{\円の方程式{証明}}}
+
+\円の方程式{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{円と直線}
%\begin{description}
-\auto{193}{\detokenize{\円と直線{公式}[i]}}\par
-\円と直線{公式}[i]\par
+\auto{193}{\detokenize{\円と直線{公式}[i]}}
+
+\円と直線{公式}[i]
+
\auto{194}{\detokenize{\円と直線{公式}[b]}}
+
\円と直線{公式}[b]
-\auto{193}{\detokenize{\円と直線{証明}}}\par
-\円と直線{証明}\par
+
+\auto{193}{\detokenize{\円と直線{証明}}}
+
+\円と直線{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{三角関数の相互関係}
%\begin{description}
-\auto{195}{\detokenize{\三角関数の相互関係{公式A}[i]}}\par
-\三角関数の相互関係{公式A}[i]\par
+\auto{195}{\detokenize{\三角関数の相互関係{公式A}[i]}}
+
+\三角関数の相互関係{公式A}[i]
+
\auto{196}{\detokenize{\三角関数の相互関係{公式A}[b]}}
+
\三角関数の相互関係{公式A}[b]
-\auto{197}{\detokenize{\三角関数の相互関係{公式B}[i]}}\par
-\三角関数の相互関係{公式B}[i]\par
+
+\auto{197}{\detokenize{\三角関数の相互関係{公式B}[i]}}
+
+\三角関数の相互関係{公式B}[i]
+
\auto{198}{\detokenize{\三角関数の相互関係{公式B}[b]}}
+
\三角関数の相互関係{公式B}[b]
-\auto{199}{\detokenize{\三角関数の相互関係{公式C}[i]}}\par
-\三角関数の相互関係{公式C}[i]\par
+
+\auto{199}{\detokenize{\三角関数の相互関係{公式C}[i]}}
+
+\三角関数の相互関係{公式C}[i]
+
\auto{200}{\detokenize{\三角関数の相互関係{公式C}[b]}}
+
\三角関数の相互関係{公式C}[b]
-\auto{195}{\detokenize{\三角関数の相互関係{証明}}}\par
-\三角関数の相互関係{証明}\par
+
+\auto{195}{\detokenize{\三角関数の相互関係{証明}}}
+
+\三角関数の相互関係{証明}
+
%\end{description}
%\end{simplesquarebox}
-\auto{201}{\detokenize{\三角関数の性質{性質A}[i]}}\par
-\三角関数の性質{性質A}[i]\par
+\auto{201}{\detokenize{\三角関数の性質{性質A}[i]}}
+
+\三角関数の性質{性質A}[i]
+
\auto{202}{\detokenize{\三角関数の性質{性質A}[b]}}
+
\三角関数の性質{性質A}[b]
-\auto{203}{\detokenize{\三角関数の性質{性質B}[i]}}\par
-\三角関数の性質{性質B}[i]\par
+
+\auto{203}{\detokenize{\三角関数の性質{性質B}[i]}}
+
+\三角関数の性質{性質B}[i]
+
\auto{204}{\detokenize{\三角関数の性質{性質B}[b]}}
+
\三角関数の性質{性質B}[b]
-\auto{205}{\detokenize{\三角関数の性質{性質C}[i]}}\par
-\三角関数の性質{性質C}[i]\par
+
+\auto{205}{\detokenize{\三角関数の性質{性質C}[i]}}
+
+\三角関数の性質{性質C}[i]
+
\auto{206}{\detokenize{\三角関数の性質{性質C}[b]}}
+
\三角関数の性質{性質C}[b]
-\auto{207}{\detokenize{\三角関数の性質{性質D}[i]}}\par
-\三角関数の性質{性質D}[i]\par
+
+\auto{207}{\detokenize{\三角関数の性質{性質D}[i]}}
+
+\三角関数の性質{性質D}[i]
+
\auto{208}{\detokenize{\三角関数の性質{性質D}[b]}}
+
\三角関数の性質{性質D}[b]
-\auto{209}{\detokenize{\三角関数の性質{性質E}[i]}}\par
-\三角関数の性質{性質E}[i]\par
+
+\auto{209}{\detokenize{\三角関数の性質{性質E}[i]}}
+
+\三角関数の性質{性質E}[i]
+
\auto{210}{\detokenize{\三角関数の性質{性質E}[b]}}
+
\三角関数の性質{性質E}[b]
-\auto{211}{\detokenize{\三角関数の性質{性質F}[i]}}\par
-\三角関数の性質{性質F}[i]\par
+
+\auto{211}{\detokenize{\三角関数の性質{性質F}[i]}}
+
+\三角関数の性質{性質F}[i]
+
\auto{212}{\detokenize{\三角関数の性質{性質F}[b]}}
+
\三角関数の性質{性質F}[b]
-\auto{213}{\detokenize{\三角関数の性質{性質G}[i]}}\par
-\三角関数の性質{性質G}[i]\par
+
+\auto{213}{\detokenize{\三角関数の性質{性質G}[i]}}
+
+\三角関数の性質{性質G}[i]
+
\auto{214}{\detokenize{\三角関数の性質{性質G}[b]}}
+
\三角関数の性質{性質G}[b]
-\auto{215}{\detokenize{\三角関数の性質{性質H}[i]}}\par
-\三角関数の性質{性質H}[i]\par
+
+\auto{215}{\detokenize{\三角関数の性質{性質H}[i]}}
+
+\三角関数の性質{性質H}[i]
+
\auto{216}{\detokenize{\三角関数の性質{性質H}[b]}}
+
\三角関数の性質{性質H}[b]
-\auto{217}{\detokenize{\三角関数の性質{性質I}[i]}}\par
-\三角関数の性質{性質I}[i]\par
+
+\auto{217}{\detokenize{\三角関数の性質{性質I}[i]}}
+
+\三角関数の性質{性質I}[i]
+
\auto{218}{\detokenize{\三角関数の性質{性質I}[b]}}
+
\三角関数の性質{性質I}[b]
-\auto{219}{\detokenize{\三角関数の性質{性質J}[i]}}\par
-\三角関数の性質{性質J}[i]\par
+
+\auto{219}{\detokenize{\三角関数の性質{性質J}[i]}}
+
+\三角関数の性質{性質J}[i]
+
\auto{220}{\detokenize{\三角関数の性質{性質J}[b]}}
+
\三角関数の性質{性質J}[b]
-\auto{221}{\detokenize{\三角関数の性質{性質K}[i]}}\par
-\三角関数の性質{性質K}[i]\par
+
+\auto{221}{\detokenize{\三角関数の性質{性質K}[i]}}
+
+\三角関数の性質{性質K}[i]
+
\auto{222}{\detokenize{\三角関数の性質{性質K}[b]}}
+
\三角関数の性質{性質K}[b]
-\auto{223}{\detokenize{\三角関数の性質{性質L}[i]}}\par
-\三角関数の性質{性質L}[i]\par
+
+\auto{223}{\detokenize{\三角関数の性質{性質L}[i]}}
+
+\三角関数の性質{性質L}[i]
+
\auto{224}{\detokenize{\三角関数の性質{性質L}[b]}}
+
\三角関数の性質{性質L}[b]
-\auto{225}{\detokenize{\三角関数の性質{性質M}[i]}}\par
-\三角関数の性質{性質M}[i]\par
+
+\auto{225}{\detokenize{\三角関数の性質{性質M}[i]}}
+
+\三角関数の性質{性質M}[i]
+
\auto{226}{\detokenize{\三角関数の性質{性質M}[b]}}
+
\三角関数の性質{性質M}[b]
-\auto{227}{\detokenize{\三角関数の性質{性質N}[i]}}\par
-\三角関数の性質{性質N}[i]\par
+
+\auto{227}{\detokenize{\三角関数の性質{性質N}[i]}}
+
+\三角関数の性質{性質N}[i]
+
\auto{228}{\detokenize{\三角関数の性質{性質N}[b]}}
+
\三角関数の性質{性質N}[b]
-\auto{229}{\detokenize{\三角関数の性質{性質O}[i]}}\par
-\三角関数の性質{性質O}[i]\par
+
+\auto{229}{\detokenize{\三角関数の性質{性質O}[i]}}
+
+\三角関数の性質{性質O}[i]
+
\auto{230}{\detokenize{\三角関数の性質{性質O}[b]}}
+
\三角関数の性質{性質O}[b]
+
%\begin{simplesquarebox}{三角関数の加法定理}
%\begin{description}
-\auto{231}{\detokenize{\三角関数の加法定理{公式A}[i]}}\par
-\三角関数の加法定理{公式A}[i]\par
+\auto{231}{\detokenize{\三角関数の加法定理{公式A}[i]}}
+
+\三角関数の加法定理{公式A}[i]
+
\auto{232}{\detokenize{\三角関数の加法定理{公式A}[b]}}
+
\三角関数の加法定理{公式A}[b]
-\auto{233}{\detokenize{\三角関数の加法定理{公式B}[i]}}\par
-\三角関数の加法定理{公式B}[i]\par
+
+\auto{233}{\detokenize{\三角関数の加法定理{公式B}[i]}}
+
+\三角関数の加法定理{公式B}[i]
+
\auto{234}{\detokenize{\三角関数の加法定理{公式B}[b]}}
+
\三角関数の加法定理{公式B}[b]
-\auto{235}{\detokenize{\三角関数の加法定理{公式C}[i]}}\par
-\三角関数の加法定理{公式C}[i]\par
+
+\auto{235}{\detokenize{\三角関数の加法定理{公式C}[i]}}
+
+\三角関数の加法定理{公式C}[i]
+
\auto{236}{\detokenize{\三角関数の加法定理{公式C}[b]}}
+
\三角関数の加法定理{公式C}[b]
-\auto{231}{\detokenize{\三角関数の加法定理{証明}}}\par
-\三角関数の加法定理{証明}\par
+
+\auto{231}{\detokenize{\三角関数の加法定理{証明}}}
+
+\三角関数の加法定理{証明}
+
%\end{description}
%\end{simplesquarebox}
-\auto{237}{\detokenize{\三角関数の二倍角の公式{公式A}[i]}}\par
-\三角関数の二倍角の公式{公式A}[i]\par
+\auto{237}{\detokenize{\三角関数の二倍角の公式{公式A}[i]}}
+
+\三角関数の二倍角の公式{公式A}[i]
+
\auto{238}{\detokenize{\三角関数の二倍角の公式{公式A}[b]}}
+
\三角関数の二倍角の公式{公式A}[b]
-\auto{239}{\detokenize{\三角関数の二倍角の公式{公式B}[i]}}\par
-\三角関数の二倍角の公式{公式B}[i]\par
+
+\auto{239}{\detokenize{\三角関数の二倍角の公式{公式B}[i]}}
+
+\三角関数の二倍角の公式{公式B}[i]
+
\auto{240}{\detokenize{\三角関数の二倍角の公式{公式B}[b]}}
+
\三角関数の二倍角の公式{公式B}[b]
-\auto{241}{\detokenize{\三角関数の二倍角の公式{公式C}[i]}}\par
-\三角関数の二倍角の公式{公式C}[i]\par
+
+\auto{241}{\detokenize{\三角関数の二倍角の公式{公式C}[i]}}
+
+\三角関数の二倍角の公式{公式C}[i]
+
\auto{242}{\detokenize{\三角関数の二倍角の公式{公式C}[b]}}
+
\三角関数の二倍角の公式{公式C}[b]
-\auto{243}{\detokenize{\三角関数の二倍角の公式{公式D}[i]}}\par
-\三角関数の二倍角の公式{公式D}[i]\par
+
+\auto{243}{\detokenize{\三角関数の二倍角の公式{公式D}[i]}}
+
+\三角関数の二倍角の公式{公式D}[i]
+
\auto{244}{\detokenize{\三角関数の二倍角の公式{公式D}[b]}}
+
\三角関数の二倍角の公式{公式D}[b]
-\auto{245}{\detokenize{\三角関数の二倍角の公式{公式E}[i]}}\par
-\三角関数の二倍角の公式{公式E}[i]\par
+
+\auto{245}{\detokenize{\三角関数の二倍角の公式{公式E}[i]}}
+
+\三角関数の二倍角の公式{公式E}[i]
+
\auto{246}{\detokenize{\三角関数の二倍角の公式{公式E}[b]}}
+
\三角関数の二倍角の公式{公式E}[b]
-\auto{237}{\detokenize{\三角関数の二倍角の公式{証明}}}\par
-\三角関数の二倍角の公式{証明}\par
-\auto{247}{\detokenize{\三角関数の三倍角の公式{公式A}[i]}}\par
-\三角関数の三倍角の公式{公式A}[i]\par
+
+\auto{237}{\detokenize{\三角関数の二倍角の公式{証明}}}
+
+\三角関数の二倍角の公式{証明}
+
+\auto{247}{\detokenize{\三角関数の三倍角の公式{公式A}[i]}}
+
+\三角関数の三倍角の公式{公式A}[i]
+
\auto{248}{\detokenize{\三角関数の三倍角の公式{公式A}[b]}}
+
\三角関数の三倍角の公式{公式A}[b]
-\auto{249}{\detokenize{\三角関数の三倍角の公式{公式B}[i]}}\par
-\三角関数の三倍角の公式{公式B}[i]\par
+
+\auto{249}{\detokenize{\三角関数の三倍角の公式{公式B}[i]}}
+
+\三角関数の三倍角の公式{公式B}[i]
+
\auto{250}{\detokenize{\三角関数の三倍角の公式{公式B}[b]}}
+
\三角関数の三倍角の公式{公式B}[b]
-%\auto{251}{\detokenize{\三角関数の三倍角の公式{公式C}[i]}}\par
-%\三角関数の三倍角の公式{公式C}[i]\par
+
+%\auto{251}{\detokenize{\三角関数の三倍角の公式{公式C}[i]}}
+
+%\三角関数の三倍角の公式{公式C}[i]
+
%\auto{251}{\detokenize{\三角関数の三倍角の公式{公式C}[b]}}
+
%\三角関数の三倍角の公式{公式C}[b]
-\auto{247}{\detokenize{\三角関数の三倍角の公式{証明}}}\par
-\三角関数の三倍角の公式{証明}\par
-\auto{252}{\detokenize{\三角関数の積和公式{公式A}[i]}}\par
-\三角関数の積和公式{公式A}[i]\par
+\auto{247}{\detokenize{\三角関数の三倍角の公式{証明}}}
+
+\三角関数の三倍角の公式{証明}
+
+
+\auto{252}{\detokenize{\三角関数の積和公式{公式A}[i]}}
+
+\三角関数の積和公式{公式A}[i]
+
\auto{253}{\detokenize{\三角関数の積和公式{公式A}[b]}}
+
\三角関数の積和公式{公式A}[b]
-\auto{254}{\detokenize{\三角関数の積和公式{公式B}[i]}}\par
-\三角関数の積和公式{公式B}[i]\par
+
+\auto{254}{\detokenize{\三角関数の積和公式{公式B}[i]}}
+
+\三角関数の積和公式{公式B}[i]
+
\auto{255}{\detokenize{\三角関数の積和公式{公式B}[b]}}
+
\三角関数の積和公式{公式B}[b]
-\auto{256}{\detokenize{\三角関数の積和公式{公式C}[i]}}\par
-\三角関数の積和公式{公式C}[i]\par
+
+\auto{256}{\detokenize{\三角関数の積和公式{公式C}[i]}}
+
+\三角関数の積和公式{公式C}[i]
+
\auto{257}{\detokenize{\三角関数の積和公式{公式C}[b]}}
+
\三角関数の積和公式{公式C}[b]
-\auto{252}{\detokenize{\三角関数の積和公式{証明}}}\par
-\三角関数の積和公式{証明}\par
-\auto{258}{\detokenize{\三角関数の和積公式{公式A}[i]}}\par
-\三角関数の和積公式{公式A}[i]\par
+\auto{252}{\detokenize{\三角関数の積和公式{証明}}}
+
+\三角関数の積和公式{証明}
+
+
+\auto{258}{\detokenize{\三角関数の和積公式{公式A}[i]}}
+
+\三角関数の和積公式{公式A}[i]
+
\auto{259}{\detokenize{\三角関数の和積公式{公式A}[b]}}
+
\三角関数の和積公式{公式A}[b]
-\auto{260}{\detokenize{\三角関数の和積公式{公式B}[i]}}\par
-\三角関数の和積公式{公式B}[i]\par
+
+\auto{260}{\detokenize{\三角関数の和積公式{公式B}[i]}}
+
+\三角関数の和積公式{公式B}[i]
+
\auto{261}{\detokenize{\三角関数の和積公式{公式B}[b]}}
+
\三角関数の和積公式{公式B}[b]
-\auto{262}{\detokenize{\三角関数の和積公式{公式C}[i]}}\par
-\三角関数の和積公式{公式C}[i]\par
+
+\auto{262}{\detokenize{\三角関数の和積公式{公式C}[i]}}
+
+\三角関数の和積公式{公式C}[i]
+
\auto{263}{\detokenize{\三角関数の和積公式{公式C}[b]}}
+
\三角関数の和積公式{公式C}[b]
-\auto{264}{\detokenize{\三角関数の和積公式{公式D}[i]}}\par
-\三角関数の和積公式{公式D}[i]\par
+
+\auto{264}{\detokenize{\三角関数の和積公式{公式D}[i]}}
+
+\三角関数の和積公式{公式D}[i]
+
\auto{265}{\detokenize{\三角関数の和積公式{公式D}[b]}}
+
\三角関数の和積公式{公式D}[b]
-\auto{258}{\detokenize{\三角関数の和積公式{証明}}}\par
-\三角関数の和積公式{証明}\par
+
+\auto{258}{\detokenize{\三角関数の和積公式{証明}}}
+
+\三角関数の和積公式{証明}
+
%\begin{simplesquarebox}{三角関数の合成}
%\begin{description}
-\auto{267}{\detokenize{\三角関数の合成{公式}[i]}}\par
-\三角関数の合成{公式}[i]\par
+\auto{267}{\detokenize{\三角関数の合成{公式}[i]}}
+
+\三角関数の合成{公式}[i]
+
\auto{268}{\detokenize{\三角関数の合成{公式}[b]}}
-\三角関数の合成{公式}[b]\par
-\auto{267}{\detokenize{\三角関数の合成{証明}}}\par
-\三角関数の合成{証明}\par
+
+\三角関数の合成{公式}[b]
+
+
+\auto{267}{\detokenize{\三角関数の合成{証明}}}
+
+\三角関数の合成{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{有理数の指数}
%\begin{description}
-\auto{269}{\detokenize{\有理数の指数{公式A}[i]}}\par
-\有理数の指数{公式A}[i]\par
+\auto{269}{\detokenize{\有理数の指数{公式A}[i]}}
+
+\有理数の指数{公式A}[i]
+
\auto{270}{\detokenize{\有理数の指数{公式A}[b]}}
+
\有理数の指数{公式A}[b]
-\auto{271}{\detokenize{\有理数の指数{公式B}[i]}}\par
-\有理数の指数{公式B}[i]\par
+
+\auto{271}{\detokenize{\有理数の指数{公式B}[i]}}
+
+\有理数の指数{公式B}[i]
+
\auto{272}{\detokenize{\有理数の指数{公式B}[b]}}
+
\有理数の指数{公式B}[b]
-\auto{273}{\detokenize{\有理数の指数{公式C}[i]}}\par
-\有理数の指数{公式C}[i]\par
+
+\auto{273}{\detokenize{\有理数の指数{公式C}[i]}}
+
+\有理数の指数{公式C}[i]
+
\auto{274}{\detokenize{\有理数の指数{公式C}[b]}}
+
\有理数の指数{公式C}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{指数法則}
%\begin{description}
-\auto{275}{\detokenize{\指数法則{公式A}[i]}}\par
-\指数法則{公式A}[i]\par
+\auto{275}{\detokenize{\指数法則{公式A}[i]}}
+
+\指数法則{公式A}[i]
+
\auto{276}{\detokenize{\指数法則{公式A}[b]}}
+
\指数法則{公式A}[b]
-\auto{277}{\detokenize{\指数法則{公式B}[i]}}\par
-\指数法則{公式B}[i]\par
+
+\auto{277}{\detokenize{\指数法則{公式B}[i]}}
+
+\指数法則{公式B}[i]
+
\auto{278}{\detokenize{\指数法則{公式B}[b]}}
+
\指数法則{公式B}[b]
-\auto{279}{\detokenize{\指数法則{公式C}[i]}}\par
-\指数法則{公式C}[i]\par
+
+\auto{279}{\detokenize{\指数法則{公式C}[i]}}
+
+\指数法則{公式C}[i]
+
\auto{280}{\detokenize{\指数法則{公式C}[b]}}
+
\指数法則{公式C}[b]
-\auto{281}{\detokenize{\指数法則{公式D}[i]}}\par
-\指数法則{公式D}[i]\par
+
+\auto{281}{\detokenize{\指数法則{公式D}[i]}}
+
+\指数法則{公式D}[i]
+
\auto{282}{\detokenize{\指数法則{公式D}[b]}}
+
\指数法則{公式D}[b]
-\auto{283}{\detokenize{\指数法則{公式E}[i]}}\par
-\指数法則{公式E}[i]\par
+
+\auto{283}{\detokenize{\指数法則{公式E}[i]}}
+
+\指数法則{公式E}[i]
+
\auto{284}{\detokenize{\指数法則{公式E}[b]}}
+
\指数法則{公式E}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{対数の定義}
%\begin{description}
-\auto{285}{\detokenize{\対数の定義{定義}[i]}}\par
-\対数の定義{定義}[i]\par
+\auto{285}{\detokenize{\対数の定義{定義}[i]}}
+
+\対数の定義{定義}[i]
+
\auto{286}{\detokenize{\対数の定義{定義}[b]}}
+
\対数の定義{定義}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{対数の性質}
%\begin{description}
-\auto{287}{\detokenize{\対数の性質{公式A}[i]}}\par
-\対数の性質{公式A}[i]\par
+\auto{287}{\detokenize{\対数の性質{公式A}[i]}}
+
+\対数の性質{公式A}[i]
+
\auto{288}{\detokenize{\対数の性質{公式A}[b]}}
+
\対数の性質{公式A}[b]
-\auto{289}{\detokenize{\対数の性質{公式B}[i]}}\par
-\対数の性質{公式B}[i]\par
+
+\auto{289}{\detokenize{\対数の性質{公式B}[i]}}
+
+\対数の性質{公式B}[i]
+
\auto{290}{\detokenize{\対数の性質{公式B}[b]}}
+
\対数の性質{公式B}[b]
-\auto{291}{\detokenize{\対数の性質{公式C}[i]}}\par
-\対数の性質{公式C}[i]\par
+
+\auto{291}{\detokenize{\対数の性質{公式C}[i]}}
+
+\対数の性質{公式C}[i]
+
\auto{292}{\detokenize{\対数の性質{公式C}[b]}}
+
\対数の性質{公式C}[b]
-\auto{293}{\detokenize{\対数の性質{公式D}[i]}}\par
-\対数の性質{公式D}[i]\par
+
+\auto{293}{\detokenize{\対数の性質{公式D}[i]}}
+
+\対数の性質{公式D}[i]
+
\auto{294}{\detokenize{\対数の性質{公式D}[b]}}
+
\対数の性質{公式D}[b]
-\auto{295}{\detokenize{\対数の性質{公式E}[i]}}\par
-\対数の性質{公式E}[i]\par
+
+\auto{295}{\detokenize{\対数の性質{公式E}[i]}}
+
+\対数の性質{公式E}[i]
+
\auto{296}{\detokenize{\対数の性質{公式E}[b]}}
+
\対数の性質{公式E}[b]
-\auto{297}{\detokenize{\対数の性質{公式F}[i]}}\par
-\対数の性質{公式F}[i]\par
+
+\auto{297}{\detokenize{\対数の性質{公式F}[i]}}
+
+\対数の性質{公式F}[i]
+
\auto{298}{\detokenize{\対数の性質{公式F}[b]}}
+
\対数の性質{公式F}[b]
-\auto{287}{\detokenize{\対数の性質{証明}}}\par
-\対数の性質{証明}\par
+
+\auto{287}{\detokenize{\対数の性質{証明}}}
+
+\対数の性質{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{底の変換公式}
%\begin{description}
-\auto{299}{\detokenize{\底の変換公式{公式}[i]}}\par
-\底の変換公式{公式}[i]\par
+\auto{299}{\detokenize{\底の変換公式{公式}[i]}}
+
+\底の変換公式{公式}[i]
+
\auto{300}{\detokenize{\底の変換公式{公式}[b]}}
+
\底の変換公式{公式}[b]
-\auto{299}{\detokenize{\底の変換公式{証明}}}\par
-\底の変換公式{証明}\par
+
+\auto{299}{\detokenize{\底の変換公式{証明}}}
+
+\底の変換公式{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{導関数の微分}
%\begin{description}
-\auto{301}{\detokenize{\導関数の定義{定義}[i]}}\par
-\導関数の定義{定義}[i]\par
+\auto{301}{\detokenize{\導関数の定義{定義}[i]}}
+
+\導関数の定義{定義}[i]
+
\auto{302}{\detokenize{\導関数の定義{定義}[b]}}
+
\導関数の定義{定義}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{べき乗関数と定数関数の導関数}
%\begin{description}
-\auto{303}{\detokenize{\べき乗関数と定数関数の導関数{公式A}[i]}}\par
-\べき乗関数と定数関数の導関数{公式A}[i]\par
+\auto{303}{\detokenize{\べき乗関数と定数関数の導関数{公式A}[i]}}
+
+\べき乗関数と定数関数の導関数{公式A}[i]
+
\auto{304}{\detokenize{\べき乗関数と定数関数の導関数{公式A}[b]}}
+
\べき乗関数と定数関数の導関数{公式A}[b]
-\auto{305}{\detokenize{\べき乗関数と定数関数の導関数{公式B}[i]}}\par
-\べき乗関数と定数関数の導関数{公式B}[i]\par
+
+\auto{305}{\detokenize{\べき乗関数と定数関数の導関数{公式B}[i]}}
+
+\べき乗関数と定数関数の導関数{公式B}[i]
+
\auto{306}{\detokenize{\べき乗関数と定数関数の導関数{公式B}[b]}}
+
\べき乗関数と定数関数の導関数{公式B}[b]
-\auto{303}{\detokenize{\べき乗関数と定数関数の導関数{証明}}}\par
-\べき乗関数と定数関数の導関数{証明}\par
+
+\auto{303}{\detokenize{\べき乗関数と定数関数の導関数{証明}}}
+
+\べき乗関数と定数関数の導関数{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{導関数の性質}
%\begin{description}
-\auto{307}{\detokenize{\導関数の性質{公式A}[i]}}\par
-\導関数の性質{公式A}[i]\par
+\auto{307}{\detokenize{\導関数の性質{公式A}[i]}}
+
+\導関数の性質{公式A}[i]
+
\auto{308}{\detokenize{\導関数の性質{公式A}[b]}}
+
\導関数の性質{公式A}[b]
-\auto{309}{\detokenize{\導関数の性質{公式B}[i]}}\par
-\導関数の性質{公式B}[i]\par
+
+\auto{309}{\detokenize{\導関数の性質{公式B}[i]}}
+
+\導関数の性質{公式B}[i]
+
\auto{310}{\detokenize{\導関数の性質{公式B}[b]}}
+
\導関数の性質{公式B}[b]
-\auto{311}{\detokenize{\導関数の性質{公式C}[i]}}\par
-\導関数の性質{公式C}[i]\par
+
+\auto{311}{\detokenize{\導関数の性質{公式C}[i]}}
+
+\導関数の性質{公式C}[i]
+
\auto{312}{\detokenize{\導関数の性質{公式C}[b]}}
+
\導関数の性質{公式C}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{接線の方程式}
%\begin{description}
-\auto{313}{\detokenize{\接線の方程式{公式}[i]}}\par
-\接線の方程式{公式}[i]\par
+\auto{313}{\detokenize{\接線の方程式{公式}[i]}}
+
+\接線の方程式{公式}[i]
+
\auto{314}{\detokenize{\接線の方程式{公式}[b]}}
+
\接線の方程式{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{不定積分の定義}
%\begin{description}
-\auto{315}{\detokenize{\不定積分の定義{定義}[i]}}\par
-\不定積分の定義{定義}[i]\par
+\auto{315}{\detokenize{\不定積分の定義{定義}[i]}}
+
+\不定積分の定義{定義}[i]
+
\auto{316}{\detokenize{\不定積分の定義{定義}[b]}}
+
\不定積分の定義{定義}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{べき乗関数の不定積分}
%\begin{description}
-\auto{317}{\detokenize{\べき乗関数の不定積分{公式}[i]}}\par
-\べき乗関数の不定積分{公式}[i]\par
+\auto{317}{\detokenize{\べき乗関数の不定積分{公式}[i]}}
+
+\べき乗関数の不定積分{公式}[i]
+
\auto{318}{\detokenize{\べき乗関数の不定積分{公式}[b]}}
+
\べき乗関数の不定積分{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{不定積分の性質}
%\begin{description}
-%\auto{319}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式A}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}\par
-\auto[1]{\不定積分の性質{公式A}[i]\par}\par
-\不定積分の性質{公式A}[i]\par\par
-%\auto{320}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式A}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}\par
-\auto[1]{\不定積分の性質{公式A}[b]}\par
+%\auto{319}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式A}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}
+
+\auto[1]{\不定積分の性質{公式A}[i]
+}
+
+\不定積分の性質{公式A}[i]
+
+
+%\auto{320}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式A}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}
+
+\auto[1]{\不定積分の性質{公式A}[b]
+}
+
\不定積分の性質{公式A}[b]
-%\auto{321}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式B}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}\par
-\auto[1]{\不定積分の性質{公式B}[i]\par}\par
-\不定積分の性質{公式B}[i]\par\par
-%\auto{322}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式B}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}\par
-\auto[1]{\不定積分の性質{公式B}[b]}\par
+
+%\auto{321}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式B}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}
+
+\auto[1]{\不定積分の性質{公式B}[i]
+}
+
+\不定積分の性質{公式B}[i]
+
+
+%\auto{322}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式B}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}
+
+\auto[1]{\不定積分の性質{公式B}[b]
+}
+
\不定積分の性質{公式B}[b]
-%\auto{323}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式C}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}\par
-\auto[1]{\不定積分の性質{公式C}[i]\par}\par
-\不定積分の性質{公式C}[i]\par\par
+
+%\auto{323}{\texttt{\textbackslash 不定積分の性質\h{-0.1mm}$\lbrace$\h{公式C}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}
+
+\auto[1]{\不定積分の性質{公式C}[i]
+}
+
+\不定積分の性質{公式C}[i]
+
+
%\auto{324}{\texttt{\textbackslash
-%\不定積分の性質{公式C}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}\par
-\auto[1]{\不定積分の性質{公式C}[b]}\par
+%\不定積分の性質{公式C}\h{-0.1mm}$\rbrace$\kakkokukuri[[]{i}}}
+
+\auto[1]{\不定積分の性質{公式C}[b]
+}
+
\不定積分の性質{公式C}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{定積分の定義}
%\begin{description}
-\auto{325}{\detokenize{\定積分の定義{定義}[i]}}\par
-\定積分の定義{定義}[i]\par
+\auto{325}{\detokenize{\定積分の定義{定義}[i]}}
+
+\定積分の定義{定義}[i]
+
\auto{326}{\detokenize{\定積分の定義{定義}[b]}}
+
\定積分の定義{定義}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{定積分の性質}
%\begin{description}
-\auto{327}{\detokenize{\定積分の性質{公式A}[i]}}\par
-\定積分の性質{公式A}[i]\par
+\auto{327}{\detokenize{\定積分の性質{公式A}[i]}}
+
+\定積分の性質{公式A}[i]
+
\auto{328}{\detokenize{\定積分の性質{公式A}[b]}}
+
\定積分の性質{公式A}[b]
-\auto{329}{\detokenize{\定積分の性質{公式B}[i]}}\par
-\定積分の性質{公式B}[i]\par
+
+\auto{329}{\detokenize{\定積分の性質{公式B}[i]}}
+
+\定積分の性質{公式B}[i]
+
\auto{330}{\detokenize{\定積分の性質{公式B}[b]}}
+
\定積分の性質{公式B}[b]
-\auto{331}{\detokenize{\定積分の性質{公式C}[i]}}\par
-\定積分の性質{公式C}[i]\par
+
+\auto{331}{\detokenize{\定積分の性質{公式C}[i]}}
+
+\定積分の性質{公式C}[i]
+
\auto{332}{\detokenize{\定積分の性質{公式C}[b]}}
+
\定積分の性質{公式C}[b]
-\auto{333}{\detokenize{\定積分の性質{公式D}[i]}}\par
-\定積分の性質{公式D}[i]\par
+
+\auto{333}{\detokenize{\定積分の性質{公式D}[i]}}
+
+\定積分の性質{公式D}[i]
+
\auto{334}{\detokenize{\定積分の性質{公式D}[b]}}
+
\定積分の性質{公式D}[b]
-\auto{335}{\detokenize{\定積分の性質{公式E}[i]}}\par
-\定積分の性質{公式E}[i]\par
+
+\auto{335}{\detokenize{\定積分の性質{公式E}[i]}}
+
+\定積分の性質{公式E}[i]
+
\auto{336}{\detokenize{\定積分の性質{公式E}[b]}}
+
\定積分の性質{公式E}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{ベクトルの演算}
%\begin{description}
%n-336=個数
-\auto{337}{\detokenize{\ベクトルの演算{公式A}[i]}}\par
-\ベクトルの演算{公式A}[i]\par
+\auto{337}{\detokenize{\ベクトルの演算{公式A}[i]}}
+
+\ベクトルの演算{公式A}[i]
+
\auto{338}{\detokenize{\ベクトルの演算{公式A}[b]}}
+
\ベクトルの演算{公式A}[b]
-\auto{339}{\detokenize{\ベクトルの演算{公式B}[i]}}\par
-\ベクトルの演算{公式B}[i]\par
+
+\auto{339}{\detokenize{\ベクトルの演算{公式B}[i]}}
+
+\ベクトルの演算{公式B}[i]
+
\auto{340}{\detokenize{\ベクトルの演算{公式B}[b]}}
+
\ベクトルの演算{公式B}[b]
-\auto{341}{\detokenize{\ベクトルの演算{公式C}[i]}}\par
-\ベクトルの演算{公式C}[i]\par
+
+\auto{341}{\detokenize{\ベクトルの演算{公式C}[i]}}
+
+\ベクトルの演算{公式C}[i]
+
\auto{342}{\detokenize{\ベクトルの演算{公式C}[b]}}
+
\ベクトルの演算{公式C}[b]
-\auto{343}{\detokenize{\ベクトルの演算{公式D}[i]}}\par
-\ベクトルの演算{公式D}[i]\par
+
+\auto{343}{\detokenize{\ベクトルの演算{公式D}[i]}}
+
+\ベクトルの演算{公式D}[i]
+
\auto{344}{\detokenize{\ベクトルの演算{公式D}[b]}}
+
\ベクトルの演算{公式D}[b]
-\auto{345}{\detokenize{\ベクトルの演算{公式E}[i]}}\par
-\ベクトルの演算{公式E}[i]\par
+
+\auto{345}{\detokenize{\ベクトルの演算{公式E}[i]}}
+
+\ベクトルの演算{公式E}[i]
+
\auto{346}{\detokenize{\ベクトルの演算{公式E}[b]}}
+
\ベクトルの演算{公式E}[b]
-\auto{347}{\detokenize{\ベクトルの演算{公式F}[i]}}\par
-\ベクトルの演算{公式F}[i]\par
+
+\auto{347}{\detokenize{\ベクトルの演算{公式F}[i]}}
+
+\ベクトルの演算{公式F}[i]
+
\auto{348}{\detokenize{\ベクトルの演算{公式F}[b]}}
+
\ベクトルの演算{公式F}[b]
-\auto{349}{\detokenize{\ベクトルの演算{公式G}[i]}}\par
-\ベクトルの演算{公式G}[i]\par
+
+\auto{349}{\detokenize{\ベクトルの演算{公式G}[i]}}
+
+\ベクトルの演算{公式G}[i]
+
\auto{350}{\detokenize{\ベクトルの演算{公式G}[b]}}
+
\ベクトルの演算{公式G}[b]
-\auto{351}{\detokenize{\ベクトルの演算{公式H}[i]}}\par
-\ベクトルの演算{公式H}[i]\par
+
+\auto{351}{\detokenize{\ベクトルの演算{公式H}[i]}}
+
+\ベクトルの演算{公式H}[i]
+
\auto{352}{\detokenize{\ベクトルの演算{公式H}[b]}}
+
\ベクトルの演算{公式H}[b]
-\auto{353}{\detokenize{\ベクトルの演算{公式I}[i]}}\par
-\ベクトルの演算{公式I}[i]\par
+
+\auto{353}{\detokenize{\ベクトルの演算{公式I}[i]}}
+
+\ベクトルの演算{公式I}[i]
+
\auto{354}{\detokenize{\ベクトルの演算{公式I}[b]}}
+
\ベクトルの演算{公式I}[b]
-\auto{355}{\detokenize{\ベクトルの演算{公式J}[i]}}\par
-\ベクトルの演算{公式J}[i]\par
+
+\auto{355}{\detokenize{\ベクトルの演算{公式J}[i]}}
+
+\ベクトルの演算{公式J}[i]
+
\auto{356}{\detokenize{\ベクトルの演算{公式J}[b]}}
+
\ベクトルの演算{公式J}[b]
-\auto{357}{\detokenize{\ベクトルの演算{公式K}[i]}}\par
-\ベクトルの演算{公式K}[i]\par
+
+\auto{357}{\detokenize{\ベクトルの演算{公式K}[i]}}
+
+\ベクトルの演算{公式K}[i]
+
\auto{358}{\detokenize{\ベクトルの演算{公式K}[b]}}
+
\ベクトルの演算{公式K}[b]
-\auto{359}{\detokenize{\ベクトルの演算{公式L}[i]}}\par
-\ベクトルの演算{公式L}[i]\par
+
+\auto{359}{\detokenize{\ベクトルの演算{公式L}[i]}}
+
+\ベクトルの演算{公式L}[i]
+
\auto{360}{\detokenize{\ベクトルの演算{公式L}[b]}}
+
\ベクトルの演算{公式L}[b]
-%\auto{361}{\detokenize{\ベクトルの演算{公式M}[i]}}\par
-%\ベクトルの演算{公式M}[i]\par
+
+%\auto{361}{\detokenize{\ベクトルの演算{公式M}[i]}}
+
+%\ベクトルの演算{公式M}[i]
+
%\auto{362}{\detokenize{\ベクトルの演算{公式M}[b]}}
+
%\ベクトルの演算{公式M}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{平面ベクトルの分解}
%\begin{description}
-\auto{363}{\detokenize{\平面ベクトルの分解{公式}[i]}}\par
-\平面ベクトルの分解{公式}[i]\par
+\auto{363}{\detokenize{\平面ベクトルの分解{公式}[i]}}
+
+\平面ベクトルの分解{公式}[i]
+
\auto{364}{\detokenize{\平面ベクトルの分解{公式}[b]}}
+
\平面ベクトルの分解{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{平面ベクトルの成分}
%\begin{description}
-\auto{365}{\detokenize{\平面ベクトルの成分{公式A}[i]}}\par
-\平面ベクトルの成分{公式A}[i]\par
+\auto{365}{\detokenize{\平面ベクトルの成分{公式A}[i]}}
+
+\平面ベクトルの成分{公式A}[i]
+
\auto{366}{\detokenize{\平面ベクトルの成分{公式A}[b]}}
+
\平面ベクトルの成分{公式A}[b]
-\auto{367}{\detokenize{\平面ベクトルの成分{公式B}[i]}}\par
-\平面ベクトルの成分{公式B}[i]\par
+
+\auto{367}{\detokenize{\平面ベクトルの成分{公式B}[i]}}
+
+\平面ベクトルの成分{公式B}[i]
+
\auto{368}{\detokenize{\平面ベクトルの成分{公式B}[b]}}
+
\平面ベクトルの成分{公式B}[b]
-\auto{369}{\detokenize{\平面ベクトルの成分{公式C}[i]}}\par
-\平面ベクトルの成分{公式C}[i]\par
+
+\auto{369}{\detokenize{\平面ベクトルの成分{公式C}[i]}}
+
+\平面ベクトルの成分{公式C}[i]
+
\auto{370}{\detokenize{\平面ベクトルの成分{公式C}[b]}}
+
\平面ベクトルの成分{公式C}[b]
-\auto{371}{\detokenize{\平面ベクトルの成分{公式D}[i]}}\par
-\平面ベクトルの成分{公式D}[i]\par
+
+\auto{371}{\detokenize{\平面ベクトルの成分{公式D}[i]}}
+
+\平面ベクトルの成分{公式D}[i]
+
\auto{372}{\detokenize{\平面ベクトルの成分{公式D}[b]}}
+
\平面ベクトルの成分{公式D}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{ベクトルの成分と大きさ}
%\begin{description}
-\auto{373}{\detokenize{\ベクトルの成分と大きさ{公式A}[i]}}\par
-\ベクトルの成分と大きさ{公式A}[i]\par
+\auto{373}{\detokenize{\ベクトルの成分と大きさ{公式A}[i]}}
+
+\ベクトルの成分と大きさ{公式A}[i]
+
\auto{374}{\detokenize{\ベクトルの成分と大きさ{公式A}[b]}}
+
\ベクトルの成分と大きさ{公式A}[b]
-\auto{375}{\detokenize{\ベクトルの成分と大きさ{公式B}[i]}}\par
-\ベクトルの成分と大きさ{公式B}[i]\par
+
+\auto{375}{\detokenize{\ベクトルの成分と大きさ{公式B}[i]}}
+
+\ベクトルの成分と大きさ{公式B}[i]
+
\auto{376}{\detokenize{\ベクトルの成分と大きさ{公式B}[b]}}
+
\ベクトルの成分と大きさ{公式B}[b]
-\auto{373}{\detokenize{\ベクトルの成分と大きさ{証明}}}\par
-\ベクトルの成分と大きさ{証明}\par
+
+\auto{373}{\detokenize{\ベクトルの成分と大きさ{証明}}}
+
+\ベクトルの成分と大きさ{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{平面ベクトルの内積}
%\begin{description}
-\auto{377}{\detokenize{\平面ベクトルの内積{公式}[i]}}\par
-\平面ベクトルの内積{公式}[i]\par
+\auto{377}{\detokenize{\平面ベクトルの内積{公式}[i]}}
+
+\平面ベクトルの内積{公式}[i]
+
\auto{378}{\detokenize{\平面ベクトルの内積{公式}[b]}}
+
\平面ベクトルの内積{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{内積の性質}
%\begin{description}
-\auto{379}{\detokenize{\内積の性質{公式A}[i]}}\par
-\内積の性質{公式A}[i]\par
+\auto{379}{\detokenize{\内積の性質{公式A}[i]}}
+
+\内積の性質{公式A}[i]
+
\auto{380}{\detokenize{\内積の性質{公式A}[b]}}
+
\内積の性質{公式A}[b]
-\auto{381}{\detokenize{\内積の性質{公式B}[i]}}\par
-\内積の性質{公式B}[i]\par
+
+\auto{381}{\detokenize{\内積の性質{公式B}[i]}}
+
+\内積の性質{公式B}[i]
+
\auto{382}{\detokenize{\内積の性質{公式B}[b]}}
+
\内積の性質{公式B}[b]
-\auto{383}{\detokenize{\内積の性質{公式C}[i]}}\par
-\内積の性質{公式C}[i]\par
+
+\auto{383}{\detokenize{\内積の性質{公式C}[i]}}
+
+\内積の性質{公式C}[i]
+
\auto{384}{\detokenize{\内積の性質{公式C}[b]}}
+
\内積の性質{公式C}[b]
-\auto{385}{\detokenize{\内積の性質{公式D}[i]}}\par
-\内積の性質{公式D}[i]\par
+
+\auto{385}{\detokenize{\内積の性質{公式D}[i]}}
+
+\内積の性質{公式D}[i]
+
\auto{386}{\detokenize{\内積の性質{公式D}[b]}}
+
\内積の性質{公式D}[b]
-\auto{387}{\detokenize{\内積の性質{公式E}[i]}}\par
-\内積の性質{公式E}[i]\par
+
+\auto{387}{\detokenize{\内積の性質{公式E}[i]}}
+
+\内積の性質{公式E}[i]
+
\auto{388}{\detokenize{\内積の性質{公式E}[b]}}
+
\内積の性質{公式E}[b]
-\auto{389}{\detokenize{\内積の性質{公式F}[i]}}\par
-\内積の性質{公式F}[i]\par
+
+\auto{389}{\detokenize{\内積の性質{公式F}[i]}}
+
+\内積の性質{公式F}[i]
+
\auto{390}{\detokenize{\内積の性質{公式F}[b]}}
+
\内積の性質{公式F}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{平面ベクトルの平行条件}
%\begin{description}
-\auto{391}{\detokenize{\平面ベクトルの平行条件{条件}[i]}}\par
-\平面ベクトルの平行条件{条件}[i]\par
+\auto{391}{\detokenize{\平面ベクトルの平行条件{条件}[i]}}
+
+\平面ベクトルの平行条件{条件}[i]
+
\auto{392}{\detokenize{\平面ベクトルの平行条件{条件}[b]}}
+
\平面ベクトルの平行条件{条件}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{平面ベクトルの垂直条件}
%\begin{description}
-\auto{393}{\detokenize{\平面ベクトルの垂直条件{条件}[i]}}\par
-\平面ベクトルの垂直条件{条件}[i]\par
+\auto{393}{\detokenize{\平面ベクトルの垂直条件{条件}[i]}}
+
+\平面ベクトルの垂直条件{条件}[i]
+
\auto{394}{\detokenize{\平面ベクトルの垂直条件{条件}[b]}}
+
\平面ベクトルの垂直条件{条件}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{位置ベクトル}
%\begin{description}
-\auto{395}{\detokenize{\位置ベクトル{公式A}[i]}}\par
-\位置ベクトル{公式A}[i]\par
+\auto{395}{\detokenize{\位置ベクトル{公式A}[i]}}
+
+\位置ベクトル{公式A}[i]
+
\auto{396}{\detokenize{\位置ベクトル{公式A}[b]}}
+
\位置ベクトル{公式A}[b]
-\auto{395}{\detokenize{\位置ベクトル{公式A}[i]}}\par
-\位置ベクトル{内分点の位置ベクトルの証明}[i]\par
-\auto{397}{\detokenize{\位置ベクトル{公式B}[i]}}\par
-\位置ベクトル{公式B}[i]\par
+
+\auto{395}{\detokenize{\位置ベクトル{公式A}[i]}}
+
+\位置ベクトル{内分点の位置ベクトルの証明}
+
+\auto{397}{\detokenize{\位置ベクトル{公式B}[i]}}
+
+\位置ベクトル{公式B}[i]
+
\auto{398}{\detokenize{\位置ベクトル{公式B}[b]}}
+
\位置ベクトル{公式B}[b]
-\auto{397}{\detokenize{\位置ベクトル{外分点の位置ベクトルの証明}[i]}}\par
-\位置ベクトル{外分点の位置ベクトルの証明}[i]\par
-\auto{399}{\detokenize{\位置ベクトル{公式C}[i]}}\par
-\位置ベクトル{公式C}[i]\par
+
+\auto{397}{\detokenize{\位置ベクトル{外分点の位置ベクトルの証明}}}
+
+\位置ベクトル{外分点の位置ベクトルの証明}
+
+\auto{399}{\detokenize{\位置ベクトル{公式C}[i]}}
+
+\位置ベクトル{公式C}[i]
+
\auto{400}{\detokenize{\位置ベクトル{公式C}[b]}}
+
\位置ベクトル{公式C}[b]
-\auto{401}{\detokenize{\位置ベクトル{公式D}[i]}}\par
-\位置ベクトル{公式D}[i]\par
+
+\auto{401}{\detokenize{\位置ベクトル{公式D}[i]}}
+
+\位置ベクトル{公式D}[i]
+
\auto{402}{\detokenize{\位置ベクトル{公式D}[b]}}
+
\位置ベクトル{公式D}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{ベクトル方程式}
%\begin{description}
-\auto{403}{\detokenize{\ベクトル方程式{公式A}[i]}}\par
-\ベクトル方程式{公式A}[i]\par
+\auto{403}{\detokenize{\ベクトル方程式{公式A}[i]}}
+
+\ベクトル方程式{公式A}[i]
+
\auto{404}{\detokenize{\ベクトル方程式{公式A}[b]}}
+
\ベクトル方程式{公式A}[b]
-\auto{405}{\detokenize{\ベクトル方程式{公式B}[i]}}\par
-\ベクトル方程式{公式B}[i]\par
+
+\auto{405}{\detokenize{\ベクトル方程式{公式B}[i]}}
+
+\ベクトル方程式{公式B}[i]
+
\auto{406}{\detokenize{\ベクトル方程式{公式B}[b]}}
+
\ベクトル方程式{公式B}[b]
-\auto{407}{\detokenize{\ベクトル方程式{公式C}[i]}}\par
-\ベクトル方程式{公式C}[i]\par
+
+\auto{407}{\detokenize{\ベクトル方程式{公式C}[i]}}
+
+\ベクトル方程式{公式C}[i]
+
\auto{408}{\detokenize{\ベクトル方程式{公式C}[b]}}
+
\ベクトル方程式{公式C}[b]
-\auto{409}{\detokenize{\ベクトル方程式{公式D}[i]}}\par
-\ベクトル方程式{公式D}[i]\par
+
+\auto{409}{\detokenize{\ベクトル方程式{公式D}[i]}}
+
+\ベクトル方程式{公式D}[i]
+
\auto{410}{\detokenize{\ベクトル方程式{公式D}[b]}}
+
\ベクトル方程式{公式D}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{等差数列}
%\begin{description}
-\auto{411}{\detokenize{\等差数列{一般項}[i]}}\par
-\等差数列{一般項}[i]\par
+\auto{411}{\detokenize{\等差数列{一般項}[i]}}
+
+\等差数列{一般項}[i]
+
\auto{412}{\detokenize{\等差数列{一般項}[b]}}
+
\等差数列{一般項}[b]
-\auto{413}{\detokenize{\等差数列{総和}[i]}}\par
-\等差数列{総和}[i]\par
+
+\auto{413}{\detokenize{\等差数列{総和}[i]}}
+
+\等差数列{総和}[i]
+
\auto{414}{\detokenize{\等差数列{総和}[b]}}
+
\等差数列{総和}[b]
-\auto{411}{\detokenize{\等差数列{証明}}}\par
-\等差数列{証明}\par
+
+\auto{411}{\detokenize{\等差数列{証明}}}
+
+\等差数列{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{等比数列}
%\begin{description}
-\auto{415}{\detokenize{\等比数列{一般項}[i]}}\par
-\等比数列{一般項}[i]\par
+\auto{415}{\detokenize{\等比数列{一般項}[i]}}
+
+\等比数列{一般項}[i]
+
\auto{416}{\detokenize{\等比数列{一般項}[b]}}
+
\等比数列{一般項}[b]
-\auto{417}{\detokenize{\等比数列{総和}[i]}}\par
-\等比数列{総和}[i]\par
+
+\auto{417}{\detokenize{\等比数列{総和}[i]}}
+
+\等比数列{総和}[i]
+
\auto{418}{\detokenize{\等比数列{総和}[b]}}
+
\等比数列{総和}[b]
-\auto{415}{\detokenize{\等比数列{証明}}}\par
-\等比数列{証明}\par
+
+\auto{415}{\detokenize{\等比数列{証明}}}
+
+\等比数列{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{シグマの公式}
%\begin{description}
-\auto{419}{\detokenize{\シグマの公式{公式A}[i]}}\par
-\シグマの公式{公式A}[i]\par
+\auto{419}{\detokenize{\シグマの公式{公式A}[i]}}
+
+\シグマの公式{公式A}[i]
+
\auto{420}{\detokenize{\シグマの公式{公式A}[b]}}
+
\シグマの公式{公式A}[b]
-\auto{421}{\detokenize{\シグマの公式{公式B}[i]}}\par
-\シグマの公式{公式B}[i]\par
+
+\auto{421}{\detokenize{\シグマの公式{公式B}[i]}}
+
+\シグマの公式{公式B}[i]
+
\auto{422}{\detokenize{\シグマの公式{公式B}[b]}}
+
\シグマの公式{公式B}[b]
-\auto{423}{\detokenize{\シグマの公式{公式C}[i]}}\par
-\シグマの公式{公式C}[i]\par
+
+\auto{423}{\detokenize{\シグマの公式{公式C}[i]}}
+
+\シグマの公式{公式C}[i]
+
\auto{424}{\detokenize{\シグマの公式{公式C}[b]}}
+
\シグマの公式{公式C}[b]
-\auto{425}{\detokenize{\シグマの公式{公式D}[i]}}\par
-\シグマの公式{公式D}[i]\par
+
+\auto{425}{\detokenize{\シグマの公式{公式D}[i]}}
+
+\シグマの公式{公式D}[i]
+
\auto{426}{\detokenize{\シグマの公式{公式D}[b]}}
+
\シグマの公式{公式D}[b]
-\auto{427}{\detokenize{\シグマの公式{公式E}[i]}}\par
-\シグマの公式{公式E}[i]\par
+
+\auto{427}{\detokenize{\シグマの公式{公式E}[i]}}
+
+\シグマの公式{公式E}[i]
+
\auto{428}{\detokenize{\シグマの公式{公式E}[b]}}
+
\シグマの公式{公式E}[b]
-\auto{419}{\detokenize{\シグマの公式{証明}}}\par
-\シグマの公式{証明}\par
+
+\auto{419}{\detokenize{\シグマの公式{証明}}}
+
+\シグマの公式{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{シグマの性質}
%\begin{description}
-\auto{429}{\detokenize{\シグマの性質{性質}[i]}}\par
-\シグマの性質{性質}[i]\par
+\auto{429}{\detokenize{\シグマの性質{性質}[i]}}
+
+\シグマの性質{性質}[i]
+
\auto{430}{\detokenize{\シグマの性質{性質}[b]}}
+
\シグマの性質{性質}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{階差数列}
%\begin{description}
-\auto{431}{\detokenize{\階差数列{一般項}[i]}}\par
-\階差数列{一般項}[i]\par
+\auto{431}{\detokenize{\階差数列{一般項}[i]}}
+
+\階差数列{一般項}[i]
+
\auto{432}{\detokenize{\階差数列{一般項}[b]}}
+
\階差数列{一般項}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{漸化式}
%\begin{description}
-\auto{433}{\detokenize{\漸化式{等差型}[i]}}\par
-\漸化式{等差型}[i]\par
+\auto{433}{\detokenize{\漸化式{等差型}[i]}}
+
+\漸化式{等差型}[i]
+
\auto{434}{\detokenize{\漸化式{等差型}[b]}}
+
\漸化式{等差型}[b]
-\auto{435}{\detokenize{\漸化式{等比型}[i]}}\par
-\漸化式{等比型}[i]\par
+
+\auto{435}{\detokenize{\漸化式{等比型}[i]}}
+
+\漸化式{等比型}[i]
+
\auto{436}{\detokenize{\漸化式{等比型}[b]}}
-\漸化式{等比型}[b]\par
-\auto{437}{\detokenize{\漸化式{階差型}[i]}}\par
-\漸化式{階差型}[i]\par
+
+\漸化式{等比型}[b]
+
+
+\auto{437}{\detokenize{\漸化式{階差型}[i]}}
+
+\漸化式{階差型}[i]
+
\auto{438}{\detokenize{\漸化式{階差型}[b]}}
-\漸化式{階差型}[b]\par
-\auto{439}{\detokenize{\漸化式{特性方程式}[i]}}\par
-\漸化式{特性方程式}[i]\par
+
+\漸化式{階差型}[b]
+
+
+\auto{439}{\detokenize{\漸化式{特性方程式}[i]}}
+
+\漸化式{特性方程式}[i]
+
\auto{440}{\detokenize{\漸化式{特性方程式}[b]}}
+
\漸化式{特性方程式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{数学的帰納法}
%\begin{description}
-\auto{441}{\detokenize{\数学的帰納法}}\par
+\auto{441}{\detokenize{\数学的帰納法}}
+
\数学的帰納法
%\end{description}
@@ -1520,347 +2617,615 @@ Now, here are the actual examples!
%\begin{simplesquarebox}{共役複素数}
%\begin{description}
%n-441=個数
-\auto{442}{\detokenize{\共役複素数{定義}[i]}}\par
-\共役複素数{定義}[i]\par
+\auto{442}{\detokenize{\共役複素数{定義}[i]}}
+
+\共役複素数{定義}[i]
+
\auto{443}{\detokenize{\共役複素数{定義}[b]}}
+
\共役複素数{定義}[b]
-\auto{444}{\detokenize{\共役複素数{性質A}[i]}}\par
-\共役複素数{性質A}[i]\par
+
+\auto{444}{\detokenize{\共役複素数{性質A}[i]}}
+
+\共役複素数{性質A}[i]
+
\auto{445}{\detokenize{\共役複素数{性質A}[b]}}
-\共役複素数{性質A}[b]\par
-\auto{446}{\detokenize{\共役複素数{性質B}[i]}}\par
-\共役複素数{性質B}[i]\par
+
+\共役複素数{性質A}[b]
+
+
+\auto{446}{\detokenize{\共役複素数{性質B}[i]}}
+
+\共役複素数{性質B}[i]
+
\auto{447}{\detokenize{\共役複素数{性質B}[b]}}
+
\共役複素数{性質B}[b]
-\auto{448}{\detokenize{\共役複素数{性質C}[i]}}\par
-\共役複素数{性質C}[i]\par
+
+\auto{448}{\detokenize{\共役複素数{性質C}[i]}}
+
+\共役複素数{性質C}[i]
+
\auto{449}{\detokenize{\共役複素数{性質C}[b]}}
-\共役複素数{性質C}[b]\par
-\auto{450}{\detokenize{\共役複素数{性質D}[i]}}\par
-\共役複素数{性質D}[i]\par
+
+\共役複素数{性質C}[b]
+
+
+\auto{450}{\detokenize{\共役複素数{性質D}[i]}}
+
+\共役複素数{性質D}[i]
+
\auto{451}{\detokenize{\共役複素数{性質D}[b]}}
+
\共役複素数{性質D}[b]
-\auto{452}{\detokenize{\共役複素数{性質E}[i]}}\par
-\共役複素数{性質E}[i]\par
+
+\auto{452}{\detokenize{\共役複素数{性質E}[i]}}
+
+\共役複素数{性質E}[i]
+
\auto{453}{\detokenize{\共役複素数{性質E}[b]}}
+
\共役複素数{性質E}[b]
-\auto{454}{\detokenize{\共役複素数{性質F}[i]}}\par
-\共役複素数{性質F}[i]\par
+
+\auto{454}{\detokenize{\共役複素数{性質F}[i]}}
+
+\共役複素数{性質F}[i]
+
\auto{455}{\detokenize{\共役複素数{性質F}[b]}}
+
\共役複素数{性質F}[b]
-\auto{456}{\detokenize{\共役複素数{性質G}[i]}}\par
-\共役複素数{性質G}[i]\par
+
+\auto{456}{\detokenize{\共役複素数{性質G}[i]}}
+
+\共役複素数{性質G}[i]
+
\auto{457}{\detokenize{\共役複素数{性質G}[b]}}
+
\共役複素数{性質G}[b]
-\auto{442}{\detokenize{\共役複素数{証明}}}\par
-\共役複素数{証明}\par
+
+\auto{442}{\detokenize{\共役複素数{証明}}}
+
+\共役複素数{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{複素数の絶対値}
%\begin{description}
-\auto{458}{\detokenize{\複素数の絶対値{定義}[i]}}\par
-\複素数の絶対値{定義}[i]\par
+\auto{458}{\detokenize{\複素数の絶対値{定義}[i]}}
+
+\複素数の絶対値{定義}[i]
+
\auto{459}{\detokenize{\複素数の絶対値{定義}[b]}}
+
\複素数の絶対値{定義}[b]
-\auto{460}{\detokenize{\複素数の絶対値{性質A}[i]}}\par
-\複素数の絶対値{性質A}[i]\par
+
+\auto{460}{\detokenize{\複素数の絶対値{性質A}[i]}}
+
+\複素数の絶対値{性質A}[i]
+
\auto{461}{\detokenize{\複素数の絶対値{性質A}[b]}}
+
\複素数の絶対値{性質A}[b]
-\auto{462}{\detokenize{\複素数の絶対値{性質B}[i]}}\par
-\複素数の絶対値{性質B}[i]\par
+
+\auto{462}{\detokenize{\複素数の絶対値{性質B}[i]}}
+
+\複素数の絶対値{性質B}[i]
+
\auto{463}{\detokenize{\複素数の絶対値{性質B}[b]}}
+
\複素数の絶対値{性質B}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{極形式}
%\begin{description}
-\auto{464}{\detokenize{\極形式{定義}[i]}}\par
-\極形式{定義}[i]\par
+\auto{464}{\detokenize{\極形式{定義}[i]}}
+
+\極形式{定義}[i]
+
\auto{465}{\detokenize{\極形式{定義}[b]}}
-\極形式{定義}[b]\par
-\auto{466}{\detokenize{\極形式{性質A}[i]}}\par
-\極形式{性質A}[i]\par
+
+\極形式{定義}[b]
+
+
+\auto{466}{\detokenize{\極形式{性質A}[i]}}
+
+\極形式{性質A}[i]
+
\auto{467}{\detokenize{\極形式{性質A}[b]}}
+
\極形式{性質A}[b]
-\auto{468}{\detokenize{\極形式{性質B}[i]}}\par
-\極形式{性質B}[i]\par
+
+\auto{468}{\detokenize{\極形式{性質B}[i]}}
+
+\極形式{性質B}[i]
+
\auto{469}{\detokenize{\極形式{性質B}[b]}}
+
\極形式{性質B}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{偏角}
%\begin{description}
-\auto{470}{\detokenize{\偏角{定義}[i]}}\par
-\偏角{定義}[i]\par
+\auto{470}{\detokenize{\偏角{定義}[i]}}
+
+\偏角{定義}[i]
+
\auto{471}{\detokenize{\偏角{定義}[b]}}
-\偏角{定義}[b]\par
-\auto{472}{\detokenize{\偏角{性質A}[i]}}\par
-\偏角{性質A}[i]\par
+
+\偏角{定義}[b]
+
+
+\auto{472}{\detokenize{\偏角{性質A}[i]}}
+
+\偏角{性質A}[i]
+
\auto{473}{\detokenize{\偏角{性質A}[b]}}
-\偏角{性質A}[b]\par
-\auto{474}{\detokenize{\偏角{性質B}[i]}}\par
-\偏角{性質B}[i]\par
+
+\偏角{性質A}[b]
+
+
+\auto{474}{\detokenize{\偏角{性質B}[i]}}
+
+\偏角{性質B}[i]
+
\auto{475}{\detokenize{\偏角{性質B}[b]}}
+
\偏角{性質B}[b]
-\auto{476}{\detokenize{\偏角{性質C}[i]}}\par
-\偏角{性質C}[i]\par
+
+\auto{476}{\detokenize{\偏角{性質C}[i]}}
+
+\偏角{性質C}[i]
+
\auto{477}{\detokenize{\偏角{性質C}[b]}}
+
\偏角{性質C}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{ドモアブルの定理}
%\begin{description}
-\auto{478}{\detokenize{\ドモアブルの定理{公式}[i]}}\par
-\ドモアブルの定理{公式}[i]\par
+\auto{478}{\detokenize{\ドモアブルの定理{公式}[i]}}
+
+\ドモアブルの定理{公式}[i]
+
\auto{479}{\detokenize{\ドモアブルの定理{公式}[b]}}
+
\ドモアブルの定理{公式}[b]
-\auto{478}{\detokenize{\ドモアブルの定理{証明}}}\par
-\ドモアブルの定理{証明}\par
+
+\auto{478}{\detokenize{\ドモアブルの定理{証明}}}
+
+\ドモアブルの定理{証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{放物線}
%\begin{description}
-\auto{480}{\detokenize{\放物線{定義}[i]}}\par
-\放物線{定義}[i]\par
+\auto{480}{\detokenize{\放物線{定義}[i]}}
+
+\放物線{定義}[i]
+
\auto{481}{\detokenize{\放物線{定義}[b]}}
+
\放物線{定義}[b]
-\auto{482}{\detokenize{\放物線{性質A}[i]}}\par
-\放物線{性質A}[i]\par
+
+\auto{482}{\detokenize{\放物線{性質A}[i]}}
+
+\放物線{性質A}[i]
+
\auto{483}{\detokenize{\放物線{性質A}[b]}}
-\放物線{性質A}[b]\par
-\auto{484}{\detokenize{\放物線{性質B}[i]}}\par
-\放物線{性質B}[i]\par
+
+\放物線{性質A}[b]
+
+
+\auto{484}{\detokenize{\放物線{性質B}[i]}}
+
+\放物線{性質B}[i]
+
\auto{485}{\detokenize{\放物線{性質B}[b]}}
+
\放物線{性質B}[b]
-\auto{486}{\detokenize{\放物線{性質C}[i]}}\par
-\放物線{性質C}[i]\par
+
+\auto{486}{\detokenize{\放物線{性質C}[i]}}
+
+\放物線{性質C}[i]
+
\auto{487}{\detokenize{\放物線{性質C}[b]}}
+
\放物線{性質C}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{楕円}
%\begin{description}
-\auto{488}{\detokenize{\楕円{定義}[i]}}\par
-\楕円{定義}[i]\par
+\auto{488}{\detokenize{\楕円{定義}[i]}}
+
+\楕円{定義}[i]
+
\auto{489}{\detokenize{\楕円{定義}[b]}}
-\楕円{定義}[b]\par
-\auto{490}{\detokenize{\楕円{性質A}[i]}}\par
-\楕円{性質A}[i]\par
+
+\楕円{定義}[b]
+
+
+\auto{490}{\detokenize{\楕円{性質A}[i]}}
+
+\楕円{性質A}[i]
+
\auto{491}{\detokenize{\楕円{性質A}[b]}}
-\楕円{性質A}[b]\par
-\auto{492}{\detokenize{\楕円{性質B}[i]}}\par
-\楕円{性質B}[i]\par
+
+\楕円{性質A}[b]
+
+
+\auto{492}{\detokenize{\楕円{性質B}[i]}}
+
+\楕円{性質B}[i]
+
\auto{493}{\detokenize{\楕円{性質B}[b]}}
+
\楕円{性質B}[b]
-\auto{494}{\detokenize{\楕円{性質C}[i]}}\par
-\楕円{性質C}[i]\par
+
+\auto{494}{\detokenize{\楕円{性質C}[i]}}
+
+\楕円{性質C}[i]
+
\auto{495}{\detokenize{\楕円{性質C}[b]}}
+
\楕円{性質C}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{双曲線}
%\begin{description}
-\auto{496}{\detokenize{\双曲線{定義}[i]}}\par
-\双曲線{定義}[i]\par
+\auto{496}{\detokenize{\双曲線{定義}[i]}}
+
+\双曲線{定義}[i]
+
\auto{497}{\detokenize{\双曲線{定義}[b]}}
-\双曲線{定義}[b]\par
-\auto{498}{\detokenize{\双曲線{性質A}[i]}}\par
-\双曲線{性質A}[i]\par
+
+\双曲線{定義}[b]
+
+
+\auto{498}{\detokenize{\双曲線{性質A}[i]}}
+
+\双曲線{性質A}[i]
+
\auto{499}{\detokenize{\双曲線{性質A}[b]}}
-\双曲線{性質A}[b]\par
-\auto{500}{\detokenize{\双曲線{性質B}[i]}}\par
-\双曲線{性質B}[i]\par
+
+\双曲線{性質A}[b]
+
+
+\auto{500}{\detokenize{\双曲線{性質B}[i]}}
+
+\双曲線{性質B}[i]
+
\auto{501}{\detokenize{\双曲線{性質B}[b]}}
+
\双曲線{性質B}[b]
-\auto{502}{\detokenize{\双曲線{性質C}[i]}}\par
-\双曲線{性質C}[i]\par
+
+\auto{502}{\detokenize{\双曲線{性質C}[i]}}
+
+\双曲線{性質C}[i]
+
\auto{503}{\detokenize{\双曲線{性質C}[b]}}
+
\双曲線{性質C}[b]
-\auto{504}{\detokenize{\双曲線{性質D}[i]}}\par
-\双曲線{性質D}[i]\par
+
+\auto{504}{\detokenize{\双曲線{性質D}[i]}}
+
+\双曲線{性質D}[i]
+
\auto{505}{\detokenize{\双曲線{性質D}[b]}}
+
\双曲線{性質D}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{連続な関数}
%\begin{description}
-\auto{506}{\detokenize{\連続な関数{公式}[i]}}\par
-\連続な関数{公式}[i]\par
+\auto{506}{\detokenize{\連続な関数{公式}[i]}}
+
+\連続な関数{公式}[i]
+
\auto{507}{\detokenize{\連続な関数{公式}[b]}}
+
\連続な関数{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{中間値の定理}
%\begin{description}
-\auto{508}{\detokenize{\中間値の定理{公式}[i]}}\par
-\中間値の定理{公式}[i]\par
+\auto{508}{\detokenize{\中間値の定理{公式}[i]}}
+
+\中間値の定理{公式}[i]
+
\auto{509}{\detokenize{\中間値の定理{公式}[b]}}
+
\中間値の定理{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{平均値の定理}
%\begin{description}
-\auto{510}{\detokenize{\平均値の定理{公式}[i]}}\par
-\平均値の定理{公式}[i]\par
+\auto{510}{\detokenize{\平均値の定理{公式}[i]}}
+
+\平均値の定理{公式}[i]
+
\auto{511}{\detokenize{\平均値の定理{公式}[b]}}
+
\平均値の定理{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{微分}
%\begin{description}
-\auto{512}{\detokenize{\微分{定義}[i]}}\par
-\微分{定義}[i]\par
+\auto{512}{\detokenize{\微分{定義}[i]}}
+
+\微分{定義}[i]
+
\auto{513}{\detokenize{\微分{定義}[b]}}
+
\微分{定義}[b]
-\auto{514}{\detokenize{\微分{積の微分公式}[i]}}\par
-\微分{積の微分公式}[i]\par
+
+\auto{514}{\detokenize{\微分{積の微分公式}[i]}}
+
+\微分{積の微分公式}[i]
+
\auto{515}{\detokenize{\微分{積の微分公式}[b]}}
+
\微分{積の微分公式}[b]
-\auto{516}{\detokenize{\微分{商の微分公式}[i]}}\par
-\微分{商の微分公式}[i]\par
+
+\auto{516}{\detokenize{\微分{商の微分公式}[i]}}
+
+\微分{商の微分公式}[i]
+
\auto{517}{\detokenize{\微分{商の微分公式}[b]}}
+
\微分{商の微分公式}[b]
-\auto{518}{\detokenize{\微分{合成関数の微分}[i]}}\par
-\微分{合成関数の微分}[i]\par
+
+\auto{518}{\detokenize{\微分{合成関数の微分}[i]}}
+
+\微分{合成関数の微分}[i]
+
\auto{519}{\detokenize{\微分{合成関数の微分}[b]}}
+
\微分{合成関数の微分}[b]
-\auto{520}{\detokenize{\微分{初等関数の微分公式A}[i]}}\par
-\微分{初等関数の微分公式A}[i]\par
+
+\auto{520}{\detokenize{\微分{初等関数の微分公式A}[i]}}
+
+\微分{初等関数の微分公式A}[i]
+
\auto{521}{\detokenize{\微分{初等関数の微分公式A}[b]}}
+
\微分{初等関数の微分公式A}[b]
-\auto{522}{\detokenize{\微分{初等関数の微分公式B}[i]}}\par
-\微分{初等関数の微分公式B}[i]\par
+
+\auto{522}{\detokenize{\微分{初等関数の微分公式B}[i]}}
+
+\微分{初等関数の微分公式B}[i]
+
\auto{523}{\detokenize{\微分{初等関数の微分公式B}[b]}}
+
\微分{初等関数の微分公式B}[b]
-\auto{524}{\detokenize{\微分{初等関数の微分公式C}[i]}}\par
-\微分{初等関数の微分公式C}[i]\par
+
+\auto{524}{\detokenize{\微分{初等関数の微分公式C}[i]}}
+
+\微分{初等関数の微分公式C}[i]
+
\auto{525}{\detokenize{\微分{初等関数の微分公式C}[b]}}
+
\微分{初等関数の微分公式C}[b]
-\auto{526}{\detokenize{\微分{初等関数の微分公式D}[i]}}\par
-\微分{初等関数の微分公式D}[i]\par
+
+\auto{526}{\detokenize{\微分{初等関数の微分公式D}[i]}}
+
+\微分{初等関数の微分公式D}[i]
+
\auto{527}{\detokenize{\微分{初等関数の微分公式D}[b]}}
+
\微分{初等関数の微分公式D}[b]
-\auto{528}{\detokenize{\微分{初等関数の微分公式E}[i]}}\par
-\微分{初等関数の微分公式E}[i]\par
+
+\auto{528}{\detokenize{\微分{初等関数の微分公式E}[i]}}
+
+\微分{初等関数の微分公式E}[i]
+
\auto{529}{\detokenize{\微分{初等関数の微分公式E}[b]}}
+
\微分{初等関数の微分公式E}[b]
-\auto{530}{\detokenize{\微分{初等関数の微分公式F}[i]}}\par
-\微分{初等関数の微分公式F}[i]\par
+
+\auto{530}{\detokenize{\微分{初等関数の微分公式F}[i]}}
+
+\微分{初等関数の微分公式F}[i]
+
\auto{531}{\detokenize{\微分{初等関数の微分公式F}[b]}}
+
\微分{初等関数の微分公式F}[b]
-\auto{532}{\detokenize{\微分{初等関数の微分公式G}[i]}}\par
-\微分{初等関数の微分公式G}[i]\par
+
+\auto{532}{\detokenize{\微分{初等関数の微分公式G}[i]}}
+
+\微分{初等関数の微分公式G}[i]
+
\auto{533}{\detokenize{\微分{初等関数の微分公式G}[b]}}
+
\微分{初等関数の微分公式G}[b]
-\auto{534}{\detokenize{\微分{初等関数の微分公式H}[i]}}\par
-\微分{初等関数の微分公式H}[i]\par
+
+\auto{534}{\detokenize{\微分{初等関数の微分公式H}[i]}}
+
+\微分{初等関数の微分公式H}[i]
+
\auto{535}{\detokenize{\微分{初等関数の微分公式H}[b]}}
+
\微分{初等関数の微分公式H}[b]
-\auto{536}{\detokenize{\微分{初等関数の微分公式I}[i]}}\par
-\微分{初等関数の微分公式I}[i]\par
+
+\auto{536}{\detokenize{\微分{初等関数の微分公式I}[i]}}
+
+\微分{初等関数の微分公式I}[i]
+
\auto{537}{\detokenize{\微分{初等関数の微分公式I}[b]}}
+
\微分{初等関数の微分公式I}[b]
-\auto{512}{\detokenize{\微分{三角関数の微分公式の証明}[i]}}\par
-\微分{三角関数の微分公式の証明}[i]\par
-\auto{512}{\detokenize{\微分{対数関数の微分公式の証明}[i]}}\par
-\微分{対数関数の微分公式の証明}[i]\par
+
+\auto{512}{\detokenize{\微分{三角関数の微分公式の証明}}}
+
+\微分{三角関数の微分公式の証明}
+
+\auto{512}{\detokenize{\微分{対数関数の微分公式の証明}}}
+
+\微分{対数関数の微分公式の証明}
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{接線の方程式}
%\begin{description}
-\auto{538}{\detokenize{\接線の方程式{公式}[i]}}\par
-\接線の方程式{公式}[i]\par
+\auto{538}{\detokenize{\接線の方程式{公式}[i]}}
+
+\接線の方程式{公式}[i]
+
\auto{539}{\detokenize{\接線の方程式{公式}[b]}}
+
\接線の方程式{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{法線の方程式}
%\begin{description}
-\auto{540}{\detokenize{\法線の方程式{公式}[i]}}\par
-\法線の方程式{公式}[i]\par
+\auto{540}{\detokenize{\法線の方程式{公式}[i]}}
+
+\法線の方程式{公式}[i]
+
\auto{541}{\detokenize{\法線の方程式{公式}[b]}}
+
\法線の方程式{公式}[b]
+
%\end{description
%\end{simplesquarebox}
%\begin{simplesquarebox}{不定積分}
%\begin{description}
-\auto{542}{\detokenize{\不定積分{定義}[i]}}\par
-\不定積分{定義}[i]\par
+\auto{542}{\detokenize{\不定積分{定義}[i]}}
+
+\不定積分{定義}[i]
+
\auto{543}{\detokenize{\不定積分{定義}[b]}}
-\不定積分{定義}[b]\par
-\auto{544}{\detokenize{\不定積分{置換積分}[i]}}\par
-\不定積分{置換積分}[i]\par
+
+\不定積分{定義}[b]
+
+
+\auto{544}{\detokenize{\不定積分{置換積分}[i]}}
+
+\不定積分{置換積分}[i]
+
\auto{545}{\detokenize{\不定積分{置換積分}[b]}}
-\不定積分{置換積分}[b]\par
-\auto{546}{\detokenize{\不定積分{部分積分}[i]}}\par
-\不定積分{部分積分}[i]\par
+
+\不定積分{置換積分}[b]
+
+
+\auto{546}{\detokenize{\不定積分{部分積分}[i]}}
+
+\不定積分{部分積分}[i]
+
\auto{547}{\detokenize{\不定積分{部分積分}[b]}}
+
\不定積分{部分積分}[b]
-\auto{548}{\detokenize{\不定積分{初等関数の積分公式A}[i]}}\par
-\不定積分{初等関数の積分公式A}[i]\par
+
+\auto{548}{\detokenize{\不定積分{初等関数の積分公式A}[i]}}
+
+\不定積分{初等関数の積分公式A}[i]
+
\auto{549}{\detokenize{\不定積分{初等関数の積分公式A}[b]}}
+
\不定積分{初等関数の積分公式A}[b]
-\auto{550}{\detokenize{\不定積分{初等関数の積分公式B}[i]}}\par
-\不定積分{初等関数の積分公式B}[i]\par
+
+\auto{550}{\detokenize{\不定積分{初等関数の積分公式B}[i]}}
+
+\不定積分{初等関数の積分公式B}[i]
+
\auto{551}{\detokenize{\不定積分{初等関数の積分公式B}[b]}}
+
\不定積分{初等関数の積分公式B}[b]
-\auto{552}{\detokenize{\不定積分{初等関数の積分公式C}[i]}}\par
-\不定積分{初等関数の積分公式C}[i]\par
+
+\auto{552}{\detokenize{\不定積分{初等関数の積分公式C}[i]}}
+
+\不定積分{初等関数の積分公式C}[i]
+
\auto{553}{\detokenize{\不定積分{初等関数の積分公式C}[b]}}
+
\不定積分{初等関数の積分公式C}[b]
-\auto{554}{\detokenize{\不定積分{初等関数の積分公式D}[i]}}\par
-\不定積分{初等関数の積分公式D}[i]\par
+
+\auto{554}{\detokenize{\不定積分{初等関数の積分公式D}[i]}}
+
+\不定積分{初等関数の積分公式D}[i]
+
\auto{555}{\detokenize{\不定積分{初等関数の積分公式D}[b]}}
+
\不定積分{初等関数の積分公式D}[b]
-\auto{556}{\detokenize{\不定積分{初等関数の積分公式E}[i]}}\par
-\不定積分{初等関数の積分公式E}[i]\par
+
+\auto{556}{\detokenize{\不定積分{初等関数の積分公式E}[i]}}
+
+\不定積分{初等関数の積分公式E}[i]
+
\auto{557}{\detokenize{\不定積分{初等関数の積分公式E}[b]}}
+
\不定積分{初等関数の積分公式E}[b]
-\auto{558}{\detokenize{\不定積分{初等関数の積分公式F}[i]}}\par
-\不定積分{初等関数の積分公式F}[i]\par
+
+\auto{558}{\detokenize{\不定積分{初等関数の積分公式F}[i]}}
+
+\不定積分{初等関数の積分公式F}[i]
+
\auto{559}{\detokenize{\不定積分{初等関数の積分公式F}[b]}}
+
\不定積分{初等関数の積分公式F}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{定積分}
%\begin{description}
-\auto{560}{\detokenize{\定積分{定義}[i]}}\par
-\定積分{定義}[i]\par
+\auto{560}{\detokenize{\定積分{定義}[i]}}
+
+\定積分{定義}[i]
+
\auto{561}{\detokenize{\定積分{定義}[b]}}
+
\定積分{定義}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{区分求積法}
%\begin{description}
-\auto{562}{\detokenize{\区分求積法{公式}[i]}}\par
-\区分求積法{公式}[i]\par
+\auto{562}{\detokenize{\区分求積法{公式}[i]}}
+
+\区分求積法{公式}[i]
+
\auto{563}{\detokenize{\区分求積法{公式}[b]}}
+
\区分求積法{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
%\begin{simplesquarebox}{体積の積分}
%\begin{description}
-\auto{564}{\detokenize{\体積の積分{公式}[i]}}\par
-\体積の積分{公式}[i]\par
+\auto{564}{\detokenize{\体積の積分{公式}[i]}}
+
+\体積の積分{公式}[i]
+
\auto{565}{\detokenize{\体積の積分{公式}[b]}}
+
\体積の積分{公式}[b]
+
%\end{description}
%\end{simplesquarebox}
diff --git a/macros/unicodetex/latex/bithesis/bithesis.dtx b/macros/unicodetex/latex/bithesis/bithesis.dtx
index 009e537a41..215deabaf6 100644
--- a/macros/unicodetex/latex/bithesis/bithesis.dtx
+++ b/macros/unicodetex/latex/bithesis/bithesis.dtx
@@ -21,7 +21,7 @@
%<thesis>\ProvidesExplClass{bithesis}
%<report>\ProvidesExplClass{bitreport}
%<beamer>\ProvidesExplClass{bitbeamer}
-%<cls>{2022-09-29}{3.0.3}{BIT Thesis Templates}
+%<cls>{2022-09-30}{3.0.4}{BIT Thesis Templates}
%
%<oldcls>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
%<book>\ProvidesClass{bitbook}
@@ -30,7 +30,7 @@
%<oldcls> [2022/05/09 v2.1.1 BIT Thesis Templates]
%
%<*driver>
-\ProvidesFile{bithesis.dtx}[2022/09/29 3.0.3 BIT Thesis Templates]
+\ProvidesFile{bithesis.dtx}[2022/09/30 3.0.4 BIT Thesis Templates]
\documentclass[letterpaper]{l3doc}
\usepackage{dtx-style}
@@ -82,7 +82,8 @@
%
% \def\abstractname{}
% \begin{abstract}\noindent
-% 此宏包旨在建立一个简单易用的北京理工大学学位论文模板(以及其他模板),包括本科毕业设计与研究生论文。
+% 此宏包旨在建立一个简单易用的北京理工大学学位论文 $\LaTeX$ 模板
+% (以及其他模板),包括本科毕业设计与研究生学位论文。
% \end{abstract}
%
% \vspace{5mm}
@@ -96,10 +97,11 @@
% \noindent
% \begin{enumerate}
% \item 本模板的发布遵守 \LPPL ,使用前请认真阅读协议内容。
-% \item 与\BIThesis 相关的文档内容采用 \href{https://github.com/BITNP/BIThesis-wiki/blob/main/LICENSE}{CC0-1.0 协议} 发布。
-% \item 任何个人或组织以本模板为基础进行修改、扩展而生成的新的专用模板,请严格遵
-% 守 \LaTeX{} Project Public License 协议。由于违犯协议而引起的任何纠纷争端均与
-% 本模板作者无关。
+% \item 与\BIThesis 相关的文档内容采用
+% \href{https://github.com/BITNP/BIThesis-wiki/blob/main/LICENSE}{CC0-1.0 协议} 发布。
+% \item 任何个人或组织以本模板为基础进行修改、扩展而生成的新的专用模板,
+% 请严格遵守 \LaTeX{} Project Public License 协议。
+% 由于违犯协议而引起的任何纠纷争端均与本模板作者无关。
% \end{enumerate}
% \end{abstract}
%
@@ -107,14 +109,22 @@
%
% \def\abstractname{简介}
% \begin{abstract}
-% \BIThesisLaTeX 是北京理工大学本科生毕业设计与研究生学位论文,以及其他课程报告、实验报告的 {\LaTeX} 模板集合。
-% 如果你厌烦了 Word 格式的不人性化、参考文献的难以管理、公式输入的差劲体验……那么欢迎来尝试用专业的学术稿件排版利器 —— {\LaTeX},来排版你的论文。
-% 专业高端、学界认可、开源免费,{\LaTeX} 是你论文排版的最佳搭档。
-%
-% \BIThesisLaTeX 目前支持使用 {\hologo{XeLaTeX}} 进行编译,使用以 biber 为后端的 BibLaTeX 进行参考文献的生成,
+% \BIThesisLaTeX 是北京理工大学本科生毕业设计与研究生学位论文,
+% 以及其他课程报告、实验报告的 {\LaTeX} 模板集合。
+% 如果你厌烦了 Word 格式的不人性化、参考文献的难以管理、
+% 公式输入的差劲体验……那么欢迎来尝试用专业的学术稿件排版利器 —— {\LaTeX},
+% 来排版你的论文。
+% 专业高端、学界认可、开源免费,{\LaTeX} 是你论文排版的最佳搭档。
+%
+% \BIThesisLaTeX 目前支持使用 {\hologo{XeLaTeX}} 进行编译,
+% 使用以 biber 为后端的 BibLaTeX 进行参考文献的生成,
% 符合《信息与文献参考文献著录规则》
-% (\href{http://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=7FA63E9BBA56E60471AEDAEBDE44B14C}{GB/T 7714—2015})的标准。
-% 目前主要设计完成了计算机学院本科生毕业论文开题报告、毕业设计毕业论文与通用实验报告的 {\LaTeX} 模板。
+% (\href{http://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=7FA63E9BBA56E60471AEDAEBDE44B14C}{GB/T 7714—2015})
+% 的标准。
+%
+% 目前,\BIThesisLaTeX 主要设计完成了计算机学院本科生毕业论文开题报告、
+% 本科生毕业(设计)论文、研究生学位论文、本科生毕业(设计)论文外文翻译、
+% 全英文专业本科生毕业(设计)论文与通用实验报告的 {\LaTeX} 模板。
%
% \end{abstract}
% \newpage
@@ -123,32 +133,101 @@
% \clearpage
% \setlength{\parskip}{0.8ex}
%
+% \section{常用术语表}
+% \label{sec:terms}
+% \begin{description}
+% \item[\LaTeX] \LaTeX{} 是一个高质量的文档排版系统
+% ,他是基于 \TeX{} 进一步封装实现的。
+% \item[\LaTeX2e] \LaTeX2e 是 \LaTeX{} 的最新稳定版本,
+% 目前大家使用的都是这个版本。
+% \item[\LaTeX3] \LaTeX3 是 \LaTeX{} 的下一代版本,
+% 目前还在开发中(近十年了)。
+% \LaTeX3 旨在为宏基编写人员提供一套通用的编程层。
+% 目前,\LaTeX3 的功能已经
+% 通过 \pkg{expl3} 等宏包在 \LaTeX2e 中提供。
+% 目前,|bithesis| 就是通过 \pkg{expl3} 实现的。
+% \item[\LaTeX 引擎] 引擎就是将TeX代码转化为页面描述语言(PDL)的核心部分,
+% 就像C语言的编译器一样。比如 \hologo{XeLaTeX}、\hologo{LuaLaTeX} 等。
+% \item[编辑器] TeX的编辑器给用户提供了较为方便的交互工具,
+% 将一些编译的过程都做成了按钮,
+% 省去了我们需要去命令行一步步编译,且提供了较为方便的编辑环境,
+% 如快捷键注释、语法高亮等等功能。常见的编辑器有 TeXstudio 等。
+% 另一些编辑器则是通过插件的方式来实现 TeX 的编辑,如 VSCode、Neovim、Vim 等。
+% \item[宏包 (package)] \LaTeX{} 语言本质上是一个宏语言(通过文本替换而层层展开),
+% 而宏包就是一些宏的集合。CTAN 中的 bithesis 就是一个宏包。
+% \item[宏集] 宏集是一些宏包的集合,比如 ctex 宏集。
+% \item[CTAN] Comprehensive TeX Archive Network,CTAN 是 TeX 项目的官方网站,
+% 也是 TeX 项目的主要资源库。
+% 你使用的 \LaTeX{} 发行版中的宏包都是通过 CTAN 来发布的。
+% \item[发行版] 发行版是将引擎,格式,宏包等等打包成一套安装文件的软件,
+% TeX Live、MiKTeX 等。
+% \item[文档类] 文档类指代一类以 |.cls| 结尾的文件,它们定义了文档的基本结构,
+% 通常包括文档的标题、作者、日期、页眉、页脚、正文样式等等。
+% 你可以通过 \cs{documentclass} 命令来指定文档类。
+% 没错,|bithesis| 为你提供的模板功能就是通过数个文档类实现的。
+% \end{description}
+%
% \section{项目简介}
% \subsection{历史与贡献者们}
% \begin{itemize}
-% \item 2017 - 2018 年,杨雅婷等人受研究生院委托,制作了\href{https://github.com/BIT-thesis/LaTeX-template}{BIT-Thesis} 研究生学位论文模板。
-% \item 2019 - 2020 年,\BIThesis 最早由 2016 级的武上博、王赞、唐誉铭、牟思睿和詹熠莎等人维护。
+% \item 在 2017 年之前,网络上已经出现一些北京理工大学学位论文 \LaTeX 模板。
+% 它们是“2012大眼小蚂蚁版”和“2016汪卫版”,均以上海交通大学的模板为基础。
+% \item 2017 - 2018 年,计算机学院 2016 级研究生杨雅婷等人受研究生院委托,
+% 制作了\href{https://github.com/BIT-thesis/LaTeX-template}{BIT-Thesis}
+% 研究生学位论文模板。
+% \item 2019 - 2020 年,\BIThesis 最早由 2016 级的
+% 武上博、王赞、唐誉铭、牟思睿和詹熠莎等人维护。
% \begin{itemize}
-% \item 在此期间,\BIThesis 从无到有诞生了,包括使用手册、在线文档和开箱即用的模板。
-% \item 同时,2017 级的赵池等同学完成了一系列 \BIThesisLaTeX 的视频教程。
+% \item 此时,\BIThesis 仅支持本科生毕业论文的排版。
+% \item 在此期间,\BIThesis 从无到有诞生了,包括使用手册、
+% 在线文档和开箱即用的模板。
+% \item 同时,2017 级的赵池等同学完成了一系列 \BIThesisLaTeX
+% 的视频教程。
% \end{itemize}
-% \item 2020 - 2021 年,2017 级的冯开宇、杨思云、郝正亮和顾骁等人接管了维护开发工作。
+% \item 2020 - 2021 年,2017 级的冯开宇、杨思云、郝正亮和顾骁等人
+% 接管了维护开发工作。
% \begin{itemize}
% \item 在此期间,冯开宇将原来的 .tex 文件制作成了宏包,并发布到 CTAN 上。
-% \item 项目代码也随之被拆分成了 \BIThesisMacroPackage,\BIThesisWiki 和 \BIThesisScaffold。
+% \item 项目代码也随之被拆分成了 \BIThesisMacroPackage,
+% \BIThesisWiki 和 \BIThesisScaffold。
+% \item 此版本是 V2 版本,代号为 Birthday Cake.
% \end{itemize}
-% \item 2021 - 2022 年,2021 级(硕士研究生)的冯开宇针对 2021、2022 毕业季收到的反馈对该项目进行维护升级。
+% \item 2021 - 2022 年,2021 级(硕士研究生)的冯开宇针对 2021、
+% 2022 毕业季收到的反馈对该项目进行维护升级。
% \begin{itemize}
-% \item 在此期间,冯开宇合入了杨雅婷等人在 2017 年开发的研究生学位论文模板。
-% \item 在项目架构上,BIThesis-scaffold 合入 BIThesis 以便于进一步维护。
-% \item 次年暑假期间,冯开宇用 \pkg{expl3} 重构了\LaTeX 样式代码,向用户提供了简易易用的接口。
-% \item 同时,也增加了本科全英文专业的毕设论文模板样式。
+% \item 在此期间,冯开宇合入了杨雅婷等人在 2017 年开发的研究生学位论文模板。
+% \item 在项目架构上,BIThesis-scaffold 合入 BIThesis 以便于进一步维护。
+% \item 次年暑假期间,冯开宇用 \pkg{expl3} 重构了\LaTeX 样式代码,
+% 向用户提供了简易易用的接口。
+% \item 同时,也增加了本科全英文专业的毕设论文模板样式。
+% \item 此版本是 V3 版本,代号为 Summer Time.
% \end{itemize}
% \end{itemize}
+%
% \subsection{\BIThesis 是什么?}
-% \BIThesis 之名是英文单词 Beijing Institution of Technology(北京理工大学)的首字母缩写“BIT” 与“Thesis”结合而成。在纯文本环境下,该名字应写作“BIThesis”。
+% \BIThesis 之名是英文单词 Beijing Institution of Technology(北京理工大学)
+% 的首字母缩写“BIT” 与“Thesis”结合而成。在纯文本环境下,该名字应写作“BIThesis”。
+% 同理,其 IPA 发音为 |/ˈbiːˈaiˈtiːˈθiː.sis/|。
+%
+% \BIThesisLaTeX 是由北京理工大学众多学子发起并维护的开源项目。
+% 该项目旨在建立一套简单易用的北京理工大学 \LaTeX 学位论文模板。
+%
+% \subsection{为什么要使用 \BIThesis?}
+% 学位论文通常具有比较严格的格式要求,这是为了方便同行学术交流的起码要求,
+% 同时也是科学研究严谨性的体现。
+% 然而,由于市场各种排版软件混杂,使用者水平不一,学生对格式的重视程度不够,
+% 学生编写标准格式的学位论存在很多问题。
+% \BIThesisLaTeX 为符合北京理工大学硕士(博士)学位论文的LaTeX模板。
+% 通过使用\BIThesisLaTeX 模板,学生可以轻松撰写符合学校格式要求的学位论文,
+% 避免繁琐的论文格式调整;从而将关注点更多地放在高质量的内容本身。
+%
+% 要使用这个模板协助你完成学位论文的创作,下面的条件必须满足:
+% \begin{itemize}
+% \item 操作系统字体目录中有中文字体;
+% \item \TeX~系统有~\XeTeX~引擎(一般发行版均已经具备);
+% \item 你有使用~\LaTeX~ 的经验,或者愿意为此学习;
+% \end{itemize}
%
-% \BIThesisLaTeX 是由北京理工大学众多学子发起并维护的开源项目。该项目旨在建立一套简单易用的北京理工大学 \LaTeX 学位论文模板,包括本科综合论文训练。
% \subsubsection{\BIThesisLaTeX 的组成}
% 我们将 \BIThesisLaTeX 划分为了两个主要仓库:
% \begin{table}[H]
@@ -156,45 +235,141 @@
% \begin{tabular}{@{}l l p{6cm} @{}}
% \toprule
% 项目 & 项目地址 & 主要目的 \\ \midrule
-% BIThesis & \href{https://github.com/BITNP/BIThesis}{BITNP/BIThesis} & 主要存储 \BIThesis 宏包以及开箱即用的模板样式 \\
-% BIThesis-wiki & \href{https://github.com/BITNP/BIThesis-wiki}{BITNP/BIThesis-wiki} & 存储 \BIThesisLaTeX 项目在线文档 \\ \bottomrule
+% BIThesis & \href{https://github.com/BITNP/BIThesis}{BITNP/BIThesis}
+% & 主要存储 \BIThesis 宏包以及开箱即用的模板样式 \\
+% BIThesis-wiki
+% & \href{https://github.com/BITNP/BIThesis-wiki}{BITNP/BIThesis-wiki}
+% & 存储 \BIThesisLaTeX 项目在线文档 \\ \bottomrule
% \end{tabular}
% \end{table}
%
-% 如果你仅想解决「我如何使用 \BIThesisLaTeX 来帮助我完成实验论文?」这个问题,那么欢迎你访问我们的\href{https://bithesis.bitnp.net}{在线文档}以获得更多信息。
+% 如果你仅想解决「我如何使用 \BIThesisLaTeX 来帮助我完成实验论文?」这个问题,
+% 那么欢迎你访问我们的\href{https://bithesis.bitnp.net}{在线文档}以获得更多信息。
%
% 如果你想深入了解 \BIThesisLaTeX 提供的接口的各种选项,那么请继续阅读。
%
% \subsection{\BIThesis 宏包的组成}
-% 为了适应用户的不同需求,并符合 CTeX 宏集的设计习惯,我们将 \BIThesisMacroPackage 的主要功能设计安排在两个中文文档类当中,具体的组成见 \ref{tab:classes}。
+% 为了适应用户的不同需求,我们将 \BIThesisMacroPackage
+% 的主要功能设计安排在两个中文文档类当中,具体的组成见 \ref{tab:classes}。
% \begin{table}[H]
% \centering
% \caption{测试}
% \label{tab:classes}
% \begin{tabular}{@{}lll@{}}
% \toprule
-% 类别 & 文件 & 说明 \\ \midrule
-% \multirow{2}{*}{文档类} & \cls{bithesis.cls} & 封装本科生与研究生的毕业论文样式。 \\
-% & \cls{bitreport.cls} & 封装了本科生开题报告与实验报告样式。 \\ \cmidrule(l){2-3}
-% & \cls{bitbeamer.cls} & 对应 ctexbeamer.cls ,提供了北理工的 Beamer 模板样式。 \\ \cmidrule(l){2-3}
+% 类别 & 文件
+% & 说明 \\ \midrule
+% \multirow{2}{*}{文档类} & \cls{bithesis.cls}\ref{sec:bithesis}
+% & 封装本科生与研究生的毕业论文样式。 \\
+% & \cls{bitreport.cls}\ref{sec:bitreport}
+% & 封装了本科生开题报告与实验报告样式。 \\ \cmidrule(l){2-3}
+% & \cls{bitbeamer.cls}
+% & 对应 ctexbeamer.cls ,提供了北理工的 Beamer 模板样式。
+% \\ \cmidrule(l){2-3}
% \end{tabular}
% \end{table}
%
+% \subsection{\BIThesisLaTeX 是如何发布的?}
+% \label{sec:release}
+%
+% \BIThesisLaTeX 每一个版本会有三种发布方式:
+%
+% \begin{itemize}
+% \item CTAN 发布:
+% \href{https://ctan.org/pkg/bithesis}{CTAN bithesis package}
+% \item GitHub 发布:
+% \href{https://github.com/BITNP/BIThesis/releases}{Github Releases}
+% \footnote{最推荐使用此种方式}
+% \item Overleaf 发布:
+% \href{https://bithesis.bitnp.net}{Overleaf Templates}
+% \end{itemize}
+% 其中,CTAN 上发布的是 bithesis 宏包,也就是 |*.cls| 组成的文件,
+% 它们可以通过 \TeX 发行版自带的包管理器 tlmgr 来更新。
+%
+% GitHub 和 Overleaf 上发布的是 \BIThesisLaTeX 的完整模板,因此想要升级
+% 到最新版本,你需要重新下载最新模板。然后,选择下列方法的一种来更新:
+%
+% \begin{itemize}
+% \item 将新模板中的 |*.cls| 文件替换到你原有模板的工作目录中。
+% \item 将旧模板中的写作内容复制到新模板中。
+% \end{itemize}
+%
+% 需要注意的是,Github 和 Overleaf 的模板中包含了当前版本的 |*.cls| 文件,
+% 因此不会因为 CTAN 上的更新而导致模板无法编译。(但代价当然是需要手动升级)
+%
% \section{安装}
+%
% \subsection{\BIThesis 宏包的安装和更新}
-% 最常见的 \TeX 发行版(\hologo{TeX} Live 和 \hologo{MiKTeX})已收录\BIThesisMacroPackage 及其依赖的宏包和宏集。
%
-% 如果安装以上发行版的时间较早,可能你本地的环境中不存在 \BIThesisMacroPackage 或者不是最新版本的。那么你需要通过包管理器来安装/更新 \BIThesisMacroPackage:
+% 最常见的 \TeX 发行版(\hologo{TeX} Live 和 \hologo{MiKTeX})已收录
+% \BIThesisMacroPackage 及其依赖的宏包和宏集。
+%
+% \begin{itemize}
+% \item Windows、Linux用户推荐安装 TeX Live 套装,
+% 并更新宏包(Linux系统由于版权问题,未能预装宋体等 Windows 下的字体,需要手动安装)
+% \item OSX用户推荐安装 Mac TeX。
+% \item 由于CTeX套装所含宏包比较陈旧,可能会导致编译无法通过,故不推荐安装。
+% 如果已安装 CTeX,\textbf{建议将其卸载}。
+% \end{itemize}
+%
+% 如果安装以上发行版的时间较早,可能你本地的环境中不存在
+% \BIThesisMacroPackage 或者不是最新版本的。
+% 那么你需要通过包管理器来安装/更新 \BIThesisMacroPackage:
+%
% \begin{shell}[morekeywords={tlmgr,install}]
-% tlmgr install fduthesis
+% tlmgr install bithesis
% \end{shell}
%
% 更新可以通过图形界面进行,或者通过命令行:
+%
% \begin{shell}[morekeywords={tlmgr,install}]
-% tlmgr update fduthesis
+% tlmgr update bithesis
+% \end{shell}
+%
+% \textbf{
+% 在安装完发行版之后,还需要安装编辑 \LaTeX 所需的编辑器,在这里推荐 TexStudio。
+% }
+%
+% \textit{更多安装教程请访问我们的
+% \href{https://bithesis.bitnp.net}{wiki 网站},那里收录了使用模板以外的信息。}
+%
+% \subsubsection{升级模板版本}
+%
+% 由于软件维护是一个持续的过程,我们会不定期地更新 \BIThesisMacroPackage 的版本。
+% 更新的版本可能会修复一些 bug,也可能会增加新的功能。
+%
+% 因此,首先建议你首先查看最新版本与你当前版本的差异,以便决定是否升级。
+% 你可以通过 Github Releases 或者 ChangeLog 来查看更新内容。
+%
+% 当你决定升级时,请首先备份你的工作目录,然后按照\ref{sec:release}节的描述进行升级。
+%
+% \section{编译方式}
+%
+% \subsection{使用 Latexmk(推荐)}
+%
+% 在项目模板中,已经预制好了 latexmk 的配置文件 |.latexmkrc|。
+%
+% 因此只需要在命令行里执行,或者在代码编辑器里配置并运行以下命令即可:
+%
+% \begin{shell}
+% latexmk
% \end{shell}
%
-% \section{\cls{bithesis} 使用与配置}
+% \subsubsection{手动四次编译}
+%
+% \begin{shell}
+% xelatex -no-pdf --interaction=nonstopmode main
+% biber main
+% xelatex -no-pdf --interaction=nonstopmode main
+% xelatex --interaction=nonstopmode main
+% \end{shell}
+%
+% 运行bibtex的时候会提示一些错误,可能是~{{\sc Bib}\TeX}~对UTF-8支持不充
+% 分,一般不影响最终结果。加入~\verb|--interaction=nonstopmode|~参数是不让错误打断编译过程。
+% \XeTeX~ 仍存在一些宏包兼容性问题,而这些错误通常不会影响最终的编译结果。
+%
+% \section{\cls{bithesis.cls} 使用与配置}
+% \label{sec:bithesis}
%
% 推荐使用\BIThesisRelease (开箱即用)。
%
@@ -223,7 +398,7 @@
% \end{document}
% \end{latex}
%
-% 如您所见,在 \LaTeX 中,用户使用的命令通常以「\\」作为开头,后面依次跟随
+% 如您所见,在 \LaTeX 中,用户使用的命令通常以「|\|」作为开头,后面依次跟随
% 命令名称、若干可选参数和若干必需参数。如:
%
% \begin{latex}
@@ -232,7 +407,8 @@
% \FooBar[]{}
% \end{latex}
%
-% 同理,用户使用的环境通常以 begin 和 end 进行包裹,同样可以传入可选参数和必需参数:
+% 同理,用户使用的环境通常以 begin 和 end 进行包裹,
+% 同样可以传入可选参数和必需参数:
%
% \begin{latex}
% \begin{abstract}
@@ -298,7 +474,8 @@
%
% 该选项用于传入模板选项至 ctexbook。
%
-% 例如:想要同时修改 ctex 的字体参数和标点符号处理格式(更多选项请参考 ctex 手册)。
+% 例如:想要同时修改 ctex 的字体参数和标点符号处理格式
+% (更多选项请参考 ctex 手册)。
%
% \begin{latex}[emph={[1]type,master,ctex,fontset,fandol,punct,banjiao,bithesis}]
% \documentclass[type=master,ctex={fontset=fandol,punct=banjiao}]{bithesis}
@@ -494,14 +671,16 @@
%
% 书籍页竖排标题。此选项默认为空。为空时,会被 \kvopt{info/title}{字符串} 替代。
%
-% 如想要使用竖排英文,可以使用 \lstinline|{X }|。其中 X 为英文字符,每个竖排英文间需要空一格。
+% 如想要使用竖排英文,可以使用 \lstinline|{X }|。
+% 其中 X 为英文字符,每个竖排英文间需要空一格。
% 比如,想要竖排「LaTeX」,可以使用:
%
% \begin{latex}[emph={[1]}]
% verticalTitle = {其他文字{L } {a } {T } {e } {X }其他文字}
% \end{latex}
%
-% 如果想要使用旋转竖排英文,可以使用 \lstinline|\rotatebox[origin=c]{-90}{English text}|。
+% 如果想要使用旋转竖排英文,可以使用
+% \lstinline|\rotatebox[origin=c]{-90}{English text}|。
%
% \begin{latex}[emph={[1]}]
% verticalTitle = {其他文字 \lstinline{\rotatebox[origin=c]{-90}{English text}} 其他文字}
@@ -689,7 +868,7 @@
% TOC/(*\meta{key}*) = (*\meta{value}*)
% \end{bitsyntax}
%
-% 该选项包含许多子项目,用于调整其他选项。具体内容见下。
+% 该选项包含许多子项目,用于调整其他选项。具体内容见下:
% \end{function}
%
% \begin{function}{TOC/abstract,TOC/abstractEn}
@@ -720,7 +899,7 @@
% appendices/(*\meta{key}*) = (*\meta{value}*)
% \end{bitsyntax}
%
-% 该选项包含许多子项目,用于调整其他选项。具体内容见下。
+% 该选项包含许多子项目,用于调整其他选项。具体内容见下:
% \end{function}
%
% \begin{function}{appendices/chapterLevel}
@@ -730,7 +909,7 @@
%
% \textit{此选项一般不需要用户自行修改。}
%
-% 开启后,可以使用以「chapter」为顶层的附录格式。
+% 开启后,可以使用以「chapter」为顶层的附录格式:
%
% \begin{latex}[emph={[1]appendices,chapter}]
% \begin{appendices}
@@ -740,11 +919,14 @@
% (*\meta{附录B 内容}*)
% \end{appendices}
% \end{latex}
+%
+% 默认不开启,使用以「section」为顶层的附录格式。
+%
% \end{function}
%
% \begin{function}{appendices/title}
% \begin{bitsyntax}[emph={[1]title}]
-% title = (*\meta{字符串}*)
+% title = (*(附录)|\meta{字符串}*)
% \end{bitsyntax}
%
% 可以覆盖附录的标题名称,默认为「附录」。
@@ -752,7 +934,7 @@
%
% \begin{function}{appendices/TOCTitle}
% \begin{bitsyntax}[emph={[1]TOCTitle}]
-% TOCTitle = (*\meta{字符串}*)
+% TOCTitle = (*(附录)|\meta{字符串}*)
% \end{bitsyntax}
%
% 可以覆盖附录在目录中的名称,默认为「附录」。
@@ -766,7 +948,7 @@
% misc/(*\meta{key}*) = (*\meta{value}*)
% \end{bitsyntax}
%
-% 该选项包含许多子项目,用于调整其他选项。具体内容见下。
+% 该选项包含许多子项目,用于调整其他选项。具体内容见下:
% \end{function}
%
% \begin{function}{misc/arialFont}
@@ -788,14 +970,26 @@
%
% \begin{function}{\MakeCover}
%
-% \textit{封面内容会根据模板选项(具体参见节\ref{sec:template-options})中\meta{type=xxx}的值而变化。}
-% \textit{封面的下划线效果会受到参数设置中封面选项(具体见节\ref{sec:cover})的影响。}
+% \textit{封面内容会根据模板选项(具体参见节
+% \ref{sec:template-options})中\meta{type=xxx}的值而变化。}
+% \textit{封面的下划线效果会受到参数设置中封面选项
+% (具体见节\ref{sec:cover})的影响。}
%
% 绘制封面。
%
-% 在默认配置下,封面中的下划线会自动计算最大宽度。此时,如果用户需要换行,可以通过「//」控制换行。
+% 在默认配置下,封面中的下划线会自动计算最大宽度。
+% 此时,如果用户需要换行,可以通过「//」控制换行。
+%
+% 当关闭自动计算下划线宽度后,
+% 可以通过
+%
+% \meta{labelMaxWidth=xxx}
%
-% 当关闭自动计算下划线宽度后,可以通过\meta{labelMaxWidth=xxx} 与 \meta{valueMaxWidth=xxx}来指定下划线的宽度。一般情况下,我们不建议您这样做。
+% 与
+%
+% \meta{valueMaxWidth=xxx}
+%
+% 来指定下划线的宽度。一般情况下,我们不建议您这样做。
% \end{function}
%
% \begin{function}{\MakePaperBack}
@@ -965,9 +1159,14 @@
%
% 打印参考文献。
%
-% 在使用\BIThesisTemplates{GT}时需要注意,由于研究生学位论文也要求使用国标形式输出「攻读学位期间发表论文与研究成果清单」,因此 bithesis 同样使用 bibtex 管理其文献。而由于 biblatex 的排序是全局的,因此需要使用 \meta{category} 功能来分割出两个不同的类别。
+% 在使用\BIThesisTemplates{GT}时需要注意,
+% 由于研究生学位论文也要求使用国标形式输出「攻读学位期间发表论文与研究成果清单」,
+% 因此 bithesis 同样使用 bibtex 管理其文献。
+% 而由于 biblatex 的排序是全局的,
+% 因此需要使用 \meta{category} 功能来分割出两个不同的类别。
+%
+% 因此,请使用下列语句输出参考文献:
%
-% 因此,请使用下列语句输出参考文献:
% \begin{latex}[emph={[1]bibprint}]
% \begin{bibprint}
% \printbibliography[heading=none,notcategory=mypub,resetnumbers=true]
@@ -1020,7 +1219,8 @@
% 个人简介。
% \end{function}
%
-% \section{\cls{bitreport} 使用与配置}
+% \section{\cls{bitreport.cls} 使用与配置}
+% \label{sec:bitreport}
%
% 推荐使用\BIThesisRelease (开箱即用)。
%
@@ -1237,11 +1437,28 @@
%
% \section{致谢}
% \begin{itemize}
-% \item 感谢贡献者对 BIThesis 的无私奉献。
-% \item 感谢学校及相关老师对 BIThesis 的支持。
-% \item 感谢清华大学和复旦大学的学位论文模板项目,他们为后来者提供了前进的方向。
+% \item 感谢历届贡献者对 BIThesis 的悉心维护。
+% \item 感谢学校及老师们对 BIThesis 的支持。
+% \begin{itemize}
+% \item 感谢北京理工大学教务部、计算机学院对本科模板的支持。
+% \item 感谢北京理工大学研究生院对研究生模板的支持。
+% \end{itemize}
+% \item 感谢众多优秀的开源 $\LaTeX$ 项目,他们为后来者提供了前进的方向。
+% \begin{itemize}
+% \item \href{https://github.com/hushidong/biblatex-gb7714-2015}{biblatex-gb7714-2015}
+% 提供了易用的国标引用格式以及细心指导。
+% \item \href{https://github.com/BIT-thesis/LaTeX-template}
+% {北京理工大学硕士(博士)学位论文 $\LaTeX$ 模板} 提供了
+% 研究生模板样式的代码参考。
+% \item \href{https://github.com/stone-zeng/fduthesis}
+% {fduthesis(复旦大学学位论文 $\LaTeX$ 模板)} 提供了包编写的最佳实践。
+% \item \href{https://github.com/tuna/thuthesis}
+% {ThuThesis(清华大学学位论文 $\LaTeX$ 模板)} 提供了 dtx 文件的编写参考。
+% \end{itemize}
% \end{itemize}
%
+% 最后,感谢你的使用。
+%
% \section{软件许可证}
%
% \begin{itemize}
@@ -1263,12 +1480,15 @@
% \begin{macrocode}
%</package>
% \end{macrocode}
-
+%
+% \subsection{bithesis.cls 文档类}
+%
% \begin{macrocode}
%<*thesis>
% \end{macrocode}
-
-% \subsection{全局变量与临时变量}
+%
+% \subsubsection{全局变量与临时变量}
+%
% 定义全局变量。
% \begin{variable}{\g_@@_thesis_type_int}
% 论文类型,取值从 1 开始,分别对应:
@@ -1283,36 +1503,42 @@
\int_new:N \g_@@_thesis_type_int
% \end{macrocode}
% \end{variable}
+%
% \begin{variable}{\g_@@_head_zihao_int}
% 页眉字号。研究生论文使用 5 号字,本科生论文使用 4 号字。
% \begin{macrocode}
\int_new:N \g_@@_head_zihao_int
% \end{macrocode}
% \end{variable}
+%
% \begin{variable}{\g_@@_twoside_bool}
% 是否双面打印。默认单面打印。
% \begin{macrocode}
\bool_new:N \g_@@_twoside_bool
% \end{macrocode}
% \end{variable}
+%
% \begin{variable}{\g_@@_thesis_type_english_bool}
% 是否为英文模板。目前只有本科生全英文专业的模板会将此变量设置为 true。
% \begin{macrocode}
\bool_new:N \g_@@_thesis_type_english_bool
% \end{macrocode}
% \end{variable}
+%
% \begin{variable}{\g_@@_blind_mode_bool}
% 是否为盲审模式。默认为 false。
% \begin{macrocode}
\bool_new:N \g_@@_blind_mode_bool
% \end{macrocode}
% \end{variable}
+%
% \begin{variable}{\g_@@_label_divide_char_tl}
% 用于分隔标签的字符。默认为「-」或者「.」。
% \begin{macrocode}
\tl_new:N \g_@@_label_divide_char_tl
% \end{macrocode}
% \end{variable}
+%
% \begin{variable}{\l_@@_right_seq, \l_@@_left_seq}
% 定义临时变量。
% \begin{macrocode}
@@ -1320,8 +1546,9 @@
\seq_new:N \l_@@_left_seq
% \end{macrocode}
% \end{variable}
-
-% \subsection{辅助函数与常量}
+%
+% \subsubsection{辅助函数与常量}
+%
% \begin{macro}{\tl_if_empty:xTF,\seq_set_split:Nnx}
% 生成变体。
% \begin{macrocode}
@@ -1329,6 +1556,7 @@
\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx}
% \end{macrocode}
% \end{macro}
+%
% \begin{macro}{\@@_same_page:}
% 取消换页。
% \begin{macrocode}
@@ -1364,7 +1592,7 @@
\cs_new:Npn \@@_if_thesis_english:T #1 {\@@_if_thesis_english:TF {#1}{}}
% \end{macrocode}
% \end{macro}
-
+%
% \begin{macro}{\@@_if_bachelor_thesis:TF,\@@_if_bachelor_thesis:T,\@@_if_master_thesis:TF,\@@_if_doctor_thesis:TF}
% 是否为本科、硕士、博士学位论文。
% \begin{macrocode}
@@ -1374,8 +1602,7 @@
\cs_new:Npn \@@_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g_@@_thesis_type_int} = {5} {#1} {#2}}
% \end{macrocode}
% \end{macro}
-
-
+%
% \begin{variable}{\c_@@_thesis_type_clist}
% 定义论文类型的列表。
% \begin{macrocode}
@@ -1383,7 +1610,7 @@
{ bachelor, bachelor_translation, bachelor_english, master, doctor}
% \end{macrocode}
% \end{variable}
-
+%
% \begin{macro}{\@@_define_label:nn,\@@_define_label_by_thesis_type:nnn,\@@_define_label:nnn,\@@_define_label_by_thesis_type:nnnn}
% 定义常量(标签)的辅助函数。
% \begin{macrocode}
@@ -1408,7 +1635,7 @@
}
% \end{macrocode}
% \end{macro}
-
+%
% \begin{macro}{\smallgap:}
% 标签文字之间的间距。
% \begin{macrocode}
@@ -1417,7 +1644,7 @@
}
% \end{macrocode}
% \end{macro}
-
+%
% \begin{macro}{\label_space:}
% 标签与内容之间的空白间距。
% \begin{macrocode}
@@ -1428,7 +1655,7 @@
}
% \end{macrocode}
% \end{macro}
-
+%
% \begin{variable}{\c_@@_label_code_tl,\c_@@_label_udc_tl,
% \c_@@_label_classification_tl,\c_@@_label_classified_level_tl,\c_@@_label_type_tl}
% 没有对应英文的常量。
@@ -1444,24 +1671,32 @@
{\@@_define_label:nn #1}
% \end{macrocode}
% \end{variable}
-
+%
% \begin{variable}{\c_@@_bachelor_label_xxx_tl}
% 本科毕设的常量。
% \begin{macrocode}
-% bachelor
\clist_map_inline:nn
{
{title} {本科生毕业设计(论文)},
{originality} {原创性声明},
- {originality_clause} {本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。},
+ {originality_clause} {本人郑重声明:所呈交的毕业设计(论文),
+ 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,
+ 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。
+ 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par~特此申明。},
{authorization} {关于使用授权的声明},
- {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。},
- {originality_author_signature} {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日},
- {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日},
+ {authorization_clause} {本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,
+ 其中包括:\circled{1}~学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;
+ \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);
+ \circled{3}~学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}~学校可以学术交流为目的,
+ 复制赠送和交换本毕业设计(论文);\circled{5}~学校可以公布本毕业设计(论文)的全部或部分内容。},
+ {originality_author_signature}
+ {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日},
+ {originality_supervisor_signature}
+ {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日},
} {\@@_define_label_by_thesis_type:nnn {bachelor} #1}
% \end{macrocode}
% \end{variable}
-
+%
% \begin{variable}{\c_@@_bachelor_english_label_xxx_tl}
% 全英文专业的常量。
% \begin{macrocode}
@@ -1470,9 +1705,13 @@
{title} {},
{originality} {原创性声明~Statement~of~Originality},
{originality_clause} {
- 本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par
+ 本人郑重声明:所呈交的毕业设计(论文),
+ 是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,
+ 本文不包含任何其他个人或集体已经发表或撰写过的研究成果。
+ 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。特此申明。\par
\arialfamily I,\dunderline[-1pt]{1pt}{\makebox[18mm]{}},~solemnly~
- declare:~the~submitted~graduation~design~(thesis),~is~the~research~achievement~completed~independently~by~myself~
+ declare:~the~submitted~graduation~design~(thesis),~
+ is~the~research~achievement~completed~independently~by~myself~
under~the~guidance~of~the~supervisor.~This~article~does~not~contain~
any~research~published~or~written~by~any~other~individual~or~group,~
except~as~already~referenced~in~this~paper.~Individuals~and~groups~
@@ -1481,29 +1720,55 @@
},
{authorization} {关于使用授权的声明~State~of~Use~Authorization},
{authorization_clause} {
- 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;\circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);\circled{3}学校可允许本毕业设计(论文)被查阅或借阅;\circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);\circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par
- I~fully~understand~the~regulations~on~the~storage,~use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~and~to~the~relevant~departments~to~send~the~original~or~copy~of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~graduation~design~(thesis)~by~photocopying,~miniature~or~other~means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~
+ 本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,
+ 其中包括:\circled{1}学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;
+ \circled{2}学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);
+ \circled{3}学校可允许本毕业设计(论文)被查阅或借阅;
+ \circled{4}学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);
+ \circled{5}学校可以公布本毕业设计(论文)的全部或部分内容。\par
+ I~fully~understand~the~regulations~on~the~storage,~
+ use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~
+ Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~
+ and~to~the~relevant~departments~to~send~the~original~or~copy~
+ of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~
+ graduation~design~(thesis)~by~photocopying,~miniature~or~other~
+ means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~
+ to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~
+ copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~
+ publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~
},
} {\@@_define_label_by_thesis_type:nnn {bachelor_english} #1}
% \end{macrocode}
% \end{variable}
-
+%
% \begin{variable}{\c_@@_graduate_label_xxx_tl}
% 研究生模板的常量。
% \begin{macrocode}
-% graduate
\clist_map_inline:nn
{
{originality} {研究成果声明},
- {originality_clause} {本人郑重声明:所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。尽我所知,文中除特别标注和致谢的地方外,学位论文中不包含其他人已经发表或撰写过的研究成果,也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。与我一同工作的合作者对此研究工作所做的任何贡献均已在学位论文中作了明确的说明并表示了谢意。\par~特此申明。},
+ {originality_clause} {本人郑重声明:
+ 所提交的学位论文是我本人在指导教师的指导下进行的研究工作获得的研究成果。
+ 尽我所知,文中除特别标注和致谢的地方外,
+ 学位论文中不包含其他人已经发表或撰写过的研究成果,
+ 也不包含为获得北京理工大学或其它教育机构的学位或证书所使用过的材料。
+ 与我一同工作的合作者对此研究工作所做的任何贡献均已在
+ 学位论文中作了明确的说明并表示了谢意。\par~特此申明。},
{authorization} {关于学位论文使用权的说明},
- {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定,其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件;\circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文;\circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。},
- {originality_author_signature} {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad},
- {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad},
+ {authorization_clause} {本人完全了解北京理工大学有关保管、使用学位论文的规定,
+ 其中包括:\circled{1}~学校有权保管、并向有关部门送交学位论文的原件与复印件;
+ \circled{2}~学校可以采用影印、缩印或其它复制手段复制并保存学位论文;
+ \circled{3}~学校可允许学位论文被查阅或借阅;\circled{4}~
+ 学校可以学术交流为目的,复制赠送和交换学位论文;\circled{5}~
+ 学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。},
+ {originality_author_signature}
+ {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad},
+ {originality_supervisor_signature}
+ {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad},
} {\@@_define_label_by_thesis_type:nnn {graduate} #1}
% \end{macrocode}
% \end{variable}
-
+%
% \begin{variable}{\c_@@_graduate_label_xxx_tl,\c_@@_graduate_label_xxx_en_tl}
% 研究生模板的中英常量。
% \begin{macrocode}
@@ -1513,14 +1778,20 @@
{school} {学\quad 院\quad 名\quad 称} {School~or~Department},
{supervisor} {指\quad 导\quad 教\quad 师} {Faculty~Mentor},
{chairman} {答辩委员会主席} {Chair,~Thesis~Committee},
- {degree} {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别} {Degree~Applied},
+ {degree}
+ {申\smallgap: 请\smallgap: 学\smallgap: 位\smallgap: 级\smallgap: 别}
+ {Degree~Applied},
{major} {学\quad 科\quad 专\quad 业} {Major},
- {institute} {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} {Degree~by},
- {defense_date} {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} {The~Date~of~Defence},
+ {institute}
+ {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位}
+ {Degree~by},
+ {defense_date}
+ {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期}
+ {The~Date~of~Defence},
} {\@@_define_label_by_thesis_type:nnnn {graduate} #1}
% \end{macrocode}
% \end{variable}
-
+%
% \begin{variable}{\c_@@_label_xxx_tl,\c_@@_label_xxx_en_tl}
% 常用的中英常量。
% \begin{macrocode}
@@ -1543,7 +1814,8 @@
{appendix_prefix} {附录} {Appendix},
{reference} {参考文献} {References},
{university} {北京理工大学} {Beijing~Institute~of~Technology},
- {publications} {攻读学位期间发表论文与研究成果清单} {Publications~During~Studies},
+ {publications} {攻读学位期间发表论文与研究成果清单}
+ {Publications~During~Studies},
% TODO: Not so sure about the translation.
{resume} {作者简介} {},
{symbols} {主要符号对照表} {},
@@ -1551,12 +1823,16 @@
{\@@_define_label:nnn #1}
% \end{macrocode}
% \end{variable}
-
+%
% \begin{variable}{\c_@@_bachelor_thesis_header_clist,\c_@@_bachelor_thesis_cover_title_clist}
% 本科生模板的封面标题与页眉标题常量列表。
% \begin{macrocode}
\clist_const:Nn \c_@@_bachelor_thesis_header_clist
- {北京理工大学本科生毕业设计(论文), 北京理工大学本科生毕业设计(论文)外文翻译, Beijing~Institute~of~Technology~Bachelor's~Thesis }
+ {
+ 北京理工大学本科生毕业设计(论文),
+ 北京理工大学本科生毕业设计(论文)外文翻译,
+ Beijing~Institute~of~Technology~Bachelor's~Thesis
+ }
\clist_const:Nn \c_@@_bachelor_thesis_cover_title_clist
{
本科生毕业设计(论文),
@@ -1565,11 +1841,11 @@
}
% \end{macrocode}
% \end{variable}
-
-
-% \subsection{l3keys 接口键值对定义}
+%
+% \subsubsection{l3keys 接口键值对定义}
+%
+% 定义 |bithesis| 键值对类。
% \begin{macrocode}
-% key-value interface definition.
\keys_define:nn { bithesis }
{
info .meta:nn = { bithesis / info } {#1},
@@ -1580,7 +1856,10 @@
TOC .meta:nn = { bithesis / TOC } {#1},
appendices .meta:nn = { bithesis / appendices } {#1},
}
-
+% \end{macrocode}
+%
+% 定义 |bithesis/option| 键值对类。
+% \begin{macrocode}
\keys_define:nn { bithesis / option }
{
type .choice:,
@@ -1599,7 +1878,10 @@
blindPeerReview .bool_gset:N = \g_@@_blind_mode_bool,
ctex .tl_set:N = \l_@@_options_to_ctex_tl,
}
-
+% \end{macrocode}
+%
+% 定义 |bithesis/cover| 键值对类。
+% \begin{macrocode}
\keys_define:nn { bithesis / cover }
{
date .tl_set:N = \l_@@_cover_date_tl,
@@ -1621,7 +1903,10 @@
underlineOffset .dim_set:N = \l_@@_cover_underline_offset_dim,
underlineOffset .initial:n = { -10pt },
}
-
+% \end{macrocode}
+%
+% 定义 |bithesis/info| 键值对类。
+% \begin{macrocode}
\keys_define:nn { bithesis / info }
{
title .tl_set:N = \l_@@_value_title_tl,
@@ -1657,12 +1942,19 @@
defenseDateEn .tl_set:N = \l_@@_value_defense_date_en_tl,
classifiedLevel .tl_set:N = \l_@@_value_classified_level_tl,
}
-
+% \end{macrocode}
+%
+% 定义 |bithesis/misc| 键值对类。
+% \begin{macrocode}
\keys_define:nn { bithesis / misc }
{
arialFont .tl_set:N = \l_@@_misc_arial_font_path_tl,
}
+% \end{macrocode}
+%
+% 定义 |bithesis/style| 键值对类。
+% \begin{macrocode}
\keys_define:nn { bithesis / style }
{
head .tl_set:N = \l_@@_style_head_tl,
@@ -1679,7 +1971,10 @@
bibliographyIndent .bool_set:N = \l_@@_style_bibliography_indent_bool,
bibliographyIndent .initial:n = {true},
}
-
+% \end{macrocode}
+%
+% 定义 |bithesis/TOC| 键值对类。
+% \begin{macrocode}
\keys_define:nn { bithesis / TOC }
{
abstract .bool_set:N = \l_@@_add_abstract_to_toc_bool,
@@ -1689,34 +1984,58 @@
symbols .bool_set:N = \l_@@_add_symbols_to_toc_bool,
symbols .initial:n = {true},
}
-
+% \end{macrocode}
+%
+% 定义 |bithesis/appendices| 键值对类。
+% \begin{macrocode}
\keys_define:nn { bithesis / appendices }
{
chapterLevel .bool_set:N = \l_@@_appendices_chapter_level_bool,
title .tl_set:N = \l_@@_appendices_title_tl,
TOCTitle .tl_set:N = \l_@@_appendix_toc_title_tl,
}
-
+% \end{macrocode}
+%
+% 在宏加载时,处理 |bithesis/option| 中的值。使得 |bithesis|
+% 宏包的模板选项可以在宏加载时生效。
+% \begin{macrocode}
\ProcessKeysOptions { bithesis / option }
-
+% \end{macrocode}
+%
+% \subsubsection{处理模板选项}
+%
+% 英文模板需要开启 ctexbook 宏包的英文选项。
+% \begin{macrocode}
\@@_if_thesis_english:T {
\PassOptionsToClass{scheme=plain}{ctexbook}
}
-
+% \end{macrocode}
+%
+% 如果没有开启双面打印选项,则在 ctexbook 中开启单面打印选项。
+% \begin{macrocode}
\bool_if:NTF \g_@@_twoside_bool {} {
\PassOptionsToClass{oneside,openany}{ctexbook}
}
-
-
+% \end{macrocode}
+%
+% 将 |bithesis/option/ctex| 中的值传递给 ctexbook 模板类。
+% \begin{macrocode}
% Any extra option passed by user will be passed to ctexbook.
\DeclareOption*{
\PassOptionsToClass{\l_@@_options_to_ctex_tl}{ctexbook}
}
-% Executes the code for each option.
+% \end{macrocode}
+%
+% 加载 ctexbook 模板类。
+% \begin{macrocode}
\ProcessOptions\relax
-% Load
\LoadClass[zihao=-4,]{ctexbook}
-
+% \end{macrocode}
+%
+% \subsubsection{定义模板类样式}
+%
+% 加载所需的宏包。
+% \begin{macrocode}
\RequirePackage{geometry}
\RequirePackage{xeCJK}
\RequirePackage{titletoc}
@@ -1740,13 +2059,22 @@
\RequirePackage{pdfpages}
\RequirePackage{listings}
\RequirePackage{enumitem}
-\RequirePackage{environ}
-
-% Suppress warning for \hskip by hyperref.
+% \end{macrocode}
+%
+% 抑制 \pkg{hyperref} 中对 |\hskip| 的 warning 信息。
+% \begin{macrocode}
\pdfstringdefDisableCommands{%
\let\quad\empty
}
-
+% \end{macrocode}
+%
+% 设置页眉字号,页边距。
+%
+% 需要注意的是,根据 \pkg{geometry} 的规则,
+% |headsep| 和 |footskip| 分别受到 |top| 与 |bottom| 的影响。
+% 所以你能看到在计算 |headsep| 与 |footskip| 时,我们
+% 首先计算了相应的偏移量。
+% \begin{macrocode}
\@@_if_graduate:TF {
\int_set:Nn \g_@@_head_zihao_int {5}
\geometry{
@@ -1755,8 +2083,10 @@
bottom=2.5cm + 7bp,
top=3.5cm + 7bp,
right=2.7cm,
+ % `headsep' is affected by `top' option.
headsep = 3.5cm + 7bp - 2.5cm - 15bp,
headheight = 15 bp,
+ % `footskip' is affected by `bottom' option.
footskip = 2.5cm + 7bp - 1.8cm,
}
} {
@@ -1767,31 +2097,46 @@
bottom=2.6cm + 7bp,
top=3.5cm + 7bp,
right=2.6cm,
+ % `headsep' is affected by `top' option.
headsep = 3.5cm + 7bp - 2.4cm - 20bp,
headheight = 20 bp,
+ % `footskip' is affected by `bottom' option.
footskip = 2.6cm + 7bp - 2cm,
}
}
-
-% One blank line before the figure and after the caption.
+% \end{macrocode}
+%
+% 根据学校的要求,在图片前后加上一行空白。
+% \begin{macrocode}
\setlength{\intextsep}{2\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
-
+% \end{macrocode}
+%
+% 设置 Times New Roman 字体。
+% \begin{macrocode}
\setromanfont{Times~New~Roman}
-
+% \end{macrocode}
+%
+% 在 |preamble| 中,加载各个模板需要的字体。
+% \begin{macrocode}
\ctex_at_end_preamble:n {
\@@_if_thesis_english:TF {
\@@_if_thesis_int_type:nT {3} {
- % font Arial needed
+ % 对于本科全英文专业模板
+ % Font Arial is needed.
\newfontfamily\arialfamily{Arial}
}
} {
+ % 对于其他的中文模板,
+ % 需要加载细黑体。
\tl_if_blank:VTF \l_@@_cover_xihei_font_path_tl {}
{
- \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]{\l_@@_cover_xihei_font_path_tl}
+ \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]
+ {\l_@@_cover_xihei_font_path_tl}
}
}
+ % 对于本科全英文专业模板,需要自定义日期格式。
\@@_if_thesis_int_type:nT {3} {
\RequirePackage[en-US]{datetime2}
\RequirePackage{indentfirst}
@@ -1799,11 +2144,17 @@
}
% Define biblatex category if it was imported.
+ % 这部分是给研究生模板中的
+ % 「攻读学位期间发表论文与研究成果清单」使用的。
\cs_if_exist:NT \DeclareBibliographyCategory {
\DeclareBibliographyCategory{mypub}
}
}
-
+% \end{macrocode}
+%
+% \begin{macro}{\xihei:n}
+% 定义细黑字体。
+% \begin{macrocode}
\cs_new:Npn \xihei:n #1 {
\xeCJK_family_if_exist:nTF {xihei} {
\CJKfamily{xihei} #1
@@ -1811,7 +2162,12 @@
\heiti #1
}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_title_font_cs:n}
+% 定义标题字体。
+% \begin{macrocode}
\cs_new:Npn \l_@@_title_font_cs:n #1 {
\int_compare:nNnTF {\g_@@_thesis_type_int} = {3}
{
@@ -1820,7 +2176,12 @@
\heiti #1
}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_unnumchapter_style_cs:n}
+% 定义无序章节的样式。
+% \begin{macrocode}
\cs_new:Npn \l_@@_unnumchapter_style_cs:n #1 {
% 本科全英文、研究生学位论文需要加粗
\int_compare:nNnTF {\g_@@_thesis_type_int} > {2}
@@ -1830,19 +2191,34 @@
\mdseries #1
}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\arabicHeiti}
+% 遗留下来的黑体字体定义。
+% \begin{macrocode}
\cs_set:Npn \arabicHeiti #1 {#1}
-
-% TODO: custom title
+% \end{macrocode}
+% \end{macro}
+%
+% 定义 \pkg{fancyhdr} 的页眉页脚。
+% \begin{macrocode}
\fancypagestyle{BIThesis}{
\fancyhf{}
% 定义页眉、页码
- \fancyhead[C]{\zihao{\int_use:N \g_@@_head_zihao_int}\ziju{0.08}\songti{\tl_use:N \l_@@_style_head_tl}}
+ \fancyhead[C]{
+ \zihao{\int_use:N \g_@@_head_zihao_int}
+ \ziju{0.08}
+ \songti{\tl_use:N \l_@@_style_head_tl}
+ }
\fancyfoot[C]{\songti\zihao{5} \thepage}
% 页眉分割线稍微粗一些
\RenewDocumentCommand \headrulewidth {} {0.6pt}
}
-
+% \end{macrocode}
+%
+% 定义 \pkg{ctex} 的章节标题形式。
+% \begin{macrocode}
\ctexset{chapter={
number = {\arabicHeiti{ \arabic{chapter} }},
format = { \l_@@_title_font_cs:n \bfseries \centering \zihao{3}},
@@ -1869,7 +2245,13 @@
}
\ctexset{subsection={
- number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}}},
+ number = {
+ \arabicHeiti{
+ \thechapter.\hspace{1bp}
+ \arabic{section}.\hspace{1bp}
+ \arabic{subsection}
+ }
+ },
format = {\l_@@_title_font_cs:n \bfseries \raggedright \zihao{-4}},
nameformat = {},
titleformat = {},
@@ -1884,7 +2266,14 @@
secnumdepth = 3,
subsubsection={
numbering = true,
- number = {\arabicHeiti{\arabic{chapter}.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}.\hspace{1bp}\arabic{subsubsection}}},
+ number = {
+ \arabicHeiti{
+ \arabic{chapter}.\hspace{1bp}
+ \arabic{section}.\hspace{1bp}
+ \arabic{subsection}.\hspace{1bp}
+ \arabic{subsubsection}
+ }
+ },
format={\l_@@_title_font_cs:n \bfseries \raggedright \zihao{-4}},
nameformat = {},
titleformat = {},
@@ -1893,68 +2282,45 @@
fixskip=true,
}
}
-
-% TOC
+% \end{macrocode}
+%
+% 定义 TOC 样式。
+% \begin{macrocode}
\addtocontents{toc}{\protect\hypersetup{hidelinks}}
\@@_if_graduate:TF {
- % 各章标题,宋体四号
+ % 对于研究生模板,定义各章标题为宋体四号。
\titlecontents{chapter}[0pt]{\songti \zihao{4}}
{\thecontentslabel\hspace{\ccwd}}{}
{\hspace{.5em}\titlerule*{.}\contentspage}
} {
+ % 对于其他,定义各章标题为宋体小四号。
\titlecontents{chapter}[0pt]{\songti \zihao{-4}}
{\thecontentslabel\hspace{\ccwd}}{}
{\hspace{.5em}\titlerule*{.}\contentspage}
}
+% section 标题为宋体小四号。
\titlecontents{section}[1\ccwd]{\songti \zihao{-4}}
{\thecontentslabel\hspace{\ccwd}}{}
{\hspace{.5em}\titlerule*{.}\contentspage}
+% subsection 标题为宋体小四号。
\titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}}
{\thecontentslabel\hspace{\ccwd}}{}
{\hspace{.5em}\titlerule*{.}\contentspage}
-
-% \bool_new:N \l_@@_add_to_toc_bool
-% \bool_set_true:N \l_@@_add_to_toc_bool
-%
-% \keys_define:nn { bit }
-% {
-% abstract .meta:nn = { bit / abstract } {#1},
-% abstract_en .meta:nn = { bit / abstract_en } {#1},
-% symbols .meta:nn = { bit / symbols } {#1},
-% appendices .meta:nn = { bit / appendices } {#1},
-% }
-%
-% \keys_define:nn { bit / abstract }
-% {
-% addTOC .bool_set:N = \l_@@_add_to_toc_bool,
-% }
-%
-% \keys_define:nn { bit / abstract_en }
-% {
-% addTOC .bool_set:N = \l_@@_add_to_toc_bool,
-% }
-%
-% \keys_define:nn { bit / symbols }
-% {
-% addTOC .bool_set:N = \l_@@_add_to_toc_bool,
-% }
-%
-% \keys_define:nn { bit / appendices }
-% {
-% chapterLevel .bool_set:N = \l_@@_appendices_chapter_level_bool,
-% title .tl_set:N = \l_@@_appendices_title_tl,
-% TOCTitle .tl_set:N = \l_@@_appendix_toc_title_tl,
-% }
-
+% \end{macrocode}
+%
+% \begin{macro}{\frontmatter}
+% 定义前置内容的页面样式。
+% \begin{macrocode}
\RenewDocumentCommand \frontmatter {} {
-
\int_compare:nNnTF {\g_@@_thesis_type_int} = {3}
{
+ % 本科全英文专业论文,页码使用小罗马数字。
\pagenumbering{roman}
} {
\pagenumbering{Roman}
}
+ % 这部分的章节标题不进行编号。
\ctexset{
chapter = {
numbering = false,
@@ -1962,15 +2328,22 @@
}
\pagestyle{BIThesis}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mainmatter}
+% 主体内容的页面样式。
+% \begin{macrocode}
\RenewDocumentCommand \mainmatter {} {
\cleardoublepage
+ % 这部分的章节标题进行编号。
\ctexset{
chapter = {
numbering = true,
}
}
+ % 页码使用阿拉伯数字。
\pagenumbering{arabic}
\pagestyle{BIThesis}
% 正文 22 磅的行距
@@ -1979,8 +2352,14 @@
% 修复脚注出现跨页的问题
\interfootnotelinepenalty=10000
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\backmatter}
+% 后置内容的页面样式。
+% \begin{macrocode}
\RenewDocumentCommand \backmatter {} {
+ % 同样,所有的章节标题不进行编号。
\setcounter{section}{0}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
@@ -1988,21 +2367,34 @@
chapter = {
numbering = false,
beforeskip = 18bp,
- format = {\l_@@_title_font_cs:n \l_@@_unnumchapter_style_cs:n \centering \zihao{3}},
+ format = {
+ \l_@@_title_font_cs:n \l_@@_unnumchapter_style_cs:n \centering \zihao{3}
+ },
afterskip = 26bp,
}
}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% 定义标题的前后间距。
+% \begin{macrocode}
\setlength{\abovecaptionskip}{11pt}
\setlength{\belowcaptionskip}{9pt}
-
+% \end{macrocode}
+%
+% 定义分隔字符。
+% \begin{macrocode}
\@@_if_graduate:TF {
\tl_set:Nn \g_@@_label_divide_char_tl {.}
} {
\tl_set:Nn \g_@@_label_divide_char_tl {-}
}
-
+% \end{macrocode}
+%
+% \begin{macro}{\thefigure,\thetable,\theequation,\thelstlisting,\lstlistingname}
+% 定义各种计数器的格式。
+% \begin{macrocode}
% figure
\cs_set:Npn \thefigure {\thechapter\g_@@_label_divide_char_tl\arabic{figure}}
\captionsetup[figure]{font=small,labelsep=space}
@@ -2017,14 +2409,20 @@
% code snippet
\cs_set:Npn \thelstlisting {\thechapter\g_@@_label_divide_char_tl\arabic{lstlisting}}
\cs_set:Npn \lstlistingname {\c_@@_label_code_tl}
-
-
-% 调整底层 TeX 排版引擎参数以保证所有段落能够很好地以两端对齐的方式呈现
+% \end{macrocode}
+% \end{macro}
+%
+% 调整底层 TeX 排版引擎参数以保证所有段落能够很好地以两端对齐的方式呈现。
+% 是的,这是祖传代码。
+% \begin{macrocode}
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
-
+% \end{macrocode}
+%
+% 自定义一个默认的 lstlisting 样式。
+% \begin{macrocode}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
@@ -2047,23 +2445,26 @@
showtabs=false,
tabsize=2
}
-% TODO: optional
\lstset{style=examplestyle}
-
-% 调整插图目录与表格目录的标题
+% \end{macrocode}
+%
+% 调整插图目录与表格目录的标题。
+% \begin{macrocode}
\cs_set:Npn \listfigurename {\c_@@_label_figure_tl}
\cs_set:Npn \listtablename {\c_@@_label_table_tl}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
+% \end{macrocode}
+%
% 根据 GB 3102.11--93 以及 ISO 80000-2:2009 的规定,数学表达式中
% 表示变量的拉丁字母和希腊字母均应当使用斜体。
+% \begin{macrocode}
\unimathsetup{
math-style = ISO,
bold-style = ISO,
}
-
-% 预定义用户常用的证明环境
+% \end{macrocode}
+%
+% 预定义用户常用的证明环境。
+% \begin{macrocode}
\theoremstyle{plain}
\newtheorem{algorithm}{算法}[chapter]
\newtheorem{theorem}{定理}[chapter]
@@ -2079,31 +2480,86 @@
\theoremstyle{remark}
\newtheorem{remark}{注}
\renewcommand{\qedsymbol}{\ensuremath{\QED}}
-
-
-% user interface.
-\DeclareDocumentCommand \BITSetup { m }
- { \keys_set:nn { bithesis } { #1 }}
-
+% \end{macrocode}
+%
+% \begin{macro}{\@@_dunderline:nnn,\@@_dunderline:nn,\@@_dunderline:n}
+% 用于渲染下划线。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1 位置,可选值为 \texttt{c}enter、\texttt{l}eft、\texttt{r}ight。
+% \item \#2 |dim| 长度。
+% \item \#3 |tl| 文字内容。
+% \end{itemize}
+% \begin{macrocode}
+\cs_new:Npn \@@_dunderline:nnn #1#2#3 {
+ {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}
+}
+\cs_new:Npn \@@_dunderline:nn #1#2 {
+ \@@_dunderline:nnn {#1} {1pt} {#2}
+}
+\cs_new:Npn \@@_dunderline:n #1 {
+ \@@_dunderline:nnn {-10pt} {1pt} {#1}
+}
+% 遗留代码,等待重构。
+\newcommand\dunderline[3][-1pt]{{%
+ \setbox0=\hbox{#3}
+ \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{|@@_render_cover_entry:nn}
+% 用于渲染封面的辅助函数。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1 |{token_list}| 为封面信息条目的名称。
+% \item \#2 |{token_list}| 为封面信息条目的内容。
+% \end{itemize}
+%
+% 需要在 |\l_@@_cover_label_max_width_dim| 和 |\l_@@_cover_value_max_width_dim|
+% 存储已经计算出来的最大宽度。
+% \begin{macrocode}
\cs_new:Npn \@@_render_cover_entry:nn #1#2 {
\makebox[\l_@@_cover_label_max_width_dim][\l_@@_cover_label_align_tl]{
\tl_if_blank:VTF #1 {} {#1\l_@@_cover_dilimiter_tl}
}
\hspace{1ex}
- \@@_dunderline:nnn{\l_@@_cover_underline_offset_dim}{\l_@@_cover_underline_thickness_dim}{
+ \@@_dunderline:nnn{\l_@@_cover_underline_offset_dim}
+ {\l_@@_cover_underline_thickness_dim}{
\makebox[\l_@@_cover_value_max_width_dim][\l_@@_cover_value_align_tl]{#2}
}\par
}
-
-% Get text with from #2, then set to #1.
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{|@@_get_text_width:Nn,\@@_get_text_width:NV}
+% 计算 \#2 所占用的宽度,将结果存储在 \#1 中。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1 |dim| 存储宽度的变量。
+% \item \#2 |tl| 要计算宽度的文本。
+% \end{itemize}
+% \begin{macrocode}
\cs_new:Npn \@@_get_text_width:Nn #1#2
{
\hbox_set:Nn \l_tmpa_box {#2}
\dim_set:Nn #1 { \box_wd:N \l_tmpa_box }
}
\cs_generate_variant:Nn \@@_get_text_width:Nn { NV }
-
-% Get max text width from seq #2, then set to #1.
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_get_max_text_width:NN}
+% 从 \#2 中获取最大的文本宽度,然后设置到 \#1 中。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1: |dim| 用于存储最大宽度。
+% \item \#2: |seq| 用于存储文本。
+% \end{itemize}
+% \begin{macrocode}
\cs_new:Npn \@@_get_max_text_width:NN #1#2
{
% 这里用 |group| 确保局部变量不会被污染。
@@ -2118,8 +2574,20 @@
}
\group_end:
}
-
-% process label (#1) and value #2 separately
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_parse_entry}
+% 解析封面信息条目。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1: |tl| 为封面信息条目的名称。
+% \item \#2: |tl| 为封面信息条目的内容。
+% \end{itemize}
+% |//| 会被视为换行符,从而实现信息条目换行的效果。
+%
+% \begin{macrocode}
\cs_new:Npn \@@_parse_entry #1 #2 {
\seq_set_split:Nnx \l_@@_tmp_right_seq {//} {#2}
\seq_clear:N \l_@@_tmp_left_seq
@@ -2129,22 +2597,40 @@
\seq_put_left:Nn \l_@@_tmp_left_seq {#1}
\seq_pop_right:NN \l_@@_tmp_left_seq \g_@@_trashcan_tl
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_render_cover_entry}
+% 渲染封面信息项。此函数为主函数。
+% \begin{macrocode}
\cs_new:Npn \@@_render_cover_entry:n #1 {
+ % 左边是标签,右边是值。
+ % 形如:
+ % { {label_1} {value_1}, {label_2} {value 2} }
+ % 首先转换成 seq 类型。
\seq_set_from_clist:NN \l_@@_input_seq #1
- % parse newline //
\seq_map_inline:Nn \l_@@_input_seq {
+ % 然后对于每一对 label 和 value,首先查找
+ % value 中是否含有 // 字符,如果有,则将其分割成多个
+ % label - value 对。
+ % 比如 {label_1} {value // 1} 会被转换成
+ % { {label_1} {value}, {} {1} }
\@@_parse_entry ##1
+ % 然后将这些 label - value 对添加到 \l_@@_right_seq
+ % 或者 \l_@@_left_sql 中。
+ % left 就是 label,right 就是 value。
\seq_concat:NNN \l_@@_right_seq \l_@@_right_seq \l_@@_tmp_right_seq
\seq_concat:NNN \l_@@_left_seq \l_@@_left_seq \l_@@_tmp_left_seq
}
+ % 如果用户选择自动计算最大宽度,则计算最大宽度。
\bool_if:NT \l_@@_cover_auto_width_bool {
\@@_get_max_text_width:NN \l_@@_cover_label_max_width_dim \l_@@_left_seq
\@@_get_max_text_width:NN \l_@@_cover_value_max_width_dim \l_@@_right_seq
}
+ % 最后,根据宽度渲染 label 和 value 对。
\group_begin:
\bool_until_do:nn { \seq_if_empty_p:N \l_@@_left_seq }
{
@@ -2156,44 +2642,12 @@
}
\group_end:
}
-
-% #1: position
-% #2: line_thickness
-% #3: token list
-\cs_new:Npn \@@_dunderline:nnn #1#2#3 {
- {\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}
-}
-
-\cs_new:Npn \@@_dunderline:nn #1#2 {
- \@@_dunderline:nnn {#1} {1pt} {#2}
-}
-
-\cs_new:Npn \@@_dunderline:n #1 {
- \@@_dunderline:nnn {-10pt} {1pt} {#1}
-}
-
-\newcommand\dunderline[3][-1pt]{{%
- \setbox0=\hbox{#3}
- \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}}
-
-\NewEnviron{blindPeerReview}{
- \bool_if:NTF \g_@@_blind_mode_bool {} {
- \BODY
- }
-}
-
-% 重定义 \tn{cleardoublepage},使得偶数页面在没有内容时也不显示页眉页脚,见
-% \url{https://tex.stackexchange.com/a/1683}。
-\RenewDocumentCommand \cleardoublepage { }
- {
- \clearpage
- \bool_if:NT \g_@@_twoside_bool
- {
- \int_if_odd:nF \c@page
- { \hbox:n { } \thispagestyle { empty } \newpage }
- }
- }
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make_graduate_cover:}
+% 制作研究生论文模板封面。
+% \begin{macrocode}
\cs_new:Npn \make_graduate_cover: {
\cleardoublepage
\begin{titlepage}
@@ -2209,12 +2663,19 @@
\vspace*{65mm}
{\heiti\zihao{-2} \l_@@_value_title_tl}
\vskip 60mm
- {\heiti \zihao{-3} \l_@@_value_author_tl} % 黑体 小三
+ % 黑体 小三
+ {\heiti \zihao{-3} \l_@@_value_author_tl}
\vskip 10mm
- {\heiti \zihao{-3} \l_@@_cover_date_tl} % 黑体 小三
+ % 黑体 小三
+ {\heiti \zihao{-3} \l_@@_cover_date_tl}
\end{titlepage}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make_paper_back:}
+% 制作书脊。
+% \begin{macrocode}
\cs_new:Npn \make_paper_back: {
\cleardoublepage
\begin{titlepage}
@@ -2223,7 +2684,11 @@
\setstretch{1.1}
\begin{minipage}[t][19.7cm]{2em}
\begin{center}
- {\heiti\zihao{3} \tl_if_blank:VTF \l_@@_value_vertical_title_tl {\l_@@_value_title_tl}{\l_@@_value_vertical_title_tl}}
+ {
+ \heiti\zihao{3}
+ \tl_if_blank:VTF \l_@@_value_vertical_title_tl
+ {\l_@@_value_title_tl}{\l_@@_value_vertical_title_tl}
+ }
\vfill
{\heiti\zihao{3}\l_@@_value_author_tl}
\vfill
@@ -2234,31 +2699,43 @@
% \vskip 5cm
\end{titlepage}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_make_chinese_title_page:}
+% 制作中文封面页。
+% \begin{macrocode}
\cs_new:Npn \@@_make_chinese_title_page: {
\cleardoublepage
\begin{titlepage}
- { %
- {\heiti \zihao{5} \noindent \c_@@_label_classification_tl} \l_@@_value_classification_tl\\
+ {
+ % 密级、分类号
+ {\heiti \zihao{5} \noindent \c_@@_label_classification_tl}
+ \l_@@_value_classification_tl\\
{\heiti \zihao{5} \c_@@_label_udc_tl} \l_@@_value_udc_tl
}
+
\begin{center}
\vskip \stretch{1}
+
{\heiti\zihao{-2} \l_@@_value_title_tl}
+
\vskip \stretch{1}
\def\tabcolsep{1pt}
\def\arraystretch{1.5}
{
- \renewcommand{\baselinestretch}{2}
+ \renewcommand{\baselinestretch}{2}
\tl_if_empty:NT \l_@@_cover_dilimiter_tl {
\tl_set:Nn \l_@@_cover_dilimiter_tl {\qquad}
}
\tl_set:Nn \l_@@_cover_underline_offset_dim {-5pt}
- % if not auto width, try override width
+
+ % 如果不是自动计算宽度,且用户没有自定义宽度,
+ % 则尝试提供一个默认宽度。
\bool_if:NF \l_@@_cover_auto_width_bool {
\dim_compare:nNnT {\l_@@_cover_label_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_label_max_width_dim {45mm}
@@ -2268,32 +2745,42 @@
}
}
- \clist_set:Nn \l_@@_input_clist {
- {\c_@@_graduate_label_author_tl} {\l_@@_value_author_tl},
- {\c_@@_graduate_label_school_tl} {\l_@@_value_school_tl},
- {\c_@@_graduate_label_supervisor_tl} {\l_@@_value_supervisor_tl},
- {\c_@@_graduate_label_chairman_tl} {\l_@@_value_chairman_tl},
- {\c_@@_graduate_label_degree_tl} {\l_@@_value_degree_tl},
- {\c_@@_graduate_label_major_tl} {\l_@@_value_major_tl},
- {\c_@@_graduate_label_institute_tl} {\l_@@_value_institute_tl},
- {\c_@@_graduate_label_defense_date_tl} {\l_@@_value_defense_date_tl},
- }
-
- \heiti\zihao{-3}
- \@@_render_cover_entry:n \l_@@_input_clist
+ % 渲染信息。
+ \clist_set:Nn \l_@@_input_clist {
+ {\c_@@_graduate_label_author_tl} {\l_@@_value_author_tl},
+ {\c_@@_graduate_label_school_tl} {\l_@@_value_school_tl},
+ {\c_@@_graduate_label_supervisor_tl} {\l_@@_value_supervisor_tl},
+ {\c_@@_graduate_label_chairman_tl} {\l_@@_value_chairman_tl},
+ {\c_@@_graduate_label_degree_tl} {\l_@@_value_degree_tl},
+ {\c_@@_graduate_label_major_tl} {\l_@@_value_major_tl},
+ {\c_@@_graduate_label_institute_tl} {\l_@@_value_institute_tl},
+ {\c_@@_graduate_label_defense_date_tl} {\l_@@_value_defense_date_tl},
+ }
+
+ \heiti\zihao{-3}
+ \@@_render_cover_entry:n \l_@@_input_clist
}
\end{center}
\vskip \stretch{0.5}
\end{titlepage}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_make_english_title_page:}
+% 制作英文封面页。
+% \begin{macrocode}
\cs_new:Npn \@@_make_english_title_page: {
\begin{titlepage}
\begin{center}
\vspace*{10em}
- {\zihao{-2}\textbf{\l_@@_value_title_en_tl}}
- % \bfseries
+
+ {
+ \zihao{-2}
+ \textbf{\l_@@_value_title_en_tl}
+ }
+
\vskip \stretch{1}
{
@@ -2304,7 +2791,8 @@
\tl_set:Nn \l_@@_cover_label_align_tl {l}
\tl_set:Nn \l_@@_cover_underline_offset_dim {-5pt}
- % if not auto width, try override width
+ % 如果不是自动计算宽度,且用户没有自定义宽度,
+ % 则尝试提供一个默认宽度。
\bool_if:NF \l_@@_cover_auto_width_bool {
\dim_compare:nNnT {\l_@@_cover_label_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_label_max_width_dim {55mm}
@@ -2314,6 +2802,7 @@
}
}
+ % 渲染信息。
\clist_set:Nn \l_@@_input_clist {
{\c_@@_graduate_label_author_en_tl} {\l_@@_value_author_en_tl},
{\c_@@_graduate_label_school_en_tl} {\l_@@_value_school_en_tl},
@@ -2334,7 +2823,126 @@
\vskip \stretch{0.5}
\end{titlepage}
}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\circled}
+% 圆形数字编号定义。
+% \begin{macrocode}
+\newcommand{\circled}[2][]{\tikz[baseline=(char.base)]
+ {\node[shape = circle, draw, inner~sep = 1pt]
+ (char) {\phantom{\ifblank{#1}{#2}{#1}}};
+ \node at (char.center) {\makebox[0pt][c]{#2}};}}
+\robustify{\circled}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_graduate_originality:}
+% 研究生原创性声明。
+% \begin{macrocode}
+\cs_new:Npn \@@_graduate_originality:
+ {
+ % 取消页眉页脚。
+ \ctexset {
+ chapter / pagestyle = plain,
+ }
+
+ \begin{titlepage}
+ % 不计算页码。
+ \pagenumbering{gobble}
+
+ % 原创性声明部分
+ \begin{center}
+ \@@_same_page:
+ \chapter*{
+ \heiti\zihao{3}
+ \c_@@_graduate_label_originality_tl
+ }
+ \end{center}~\par
+ % 本部分字号为四号。
+ \zihao{4}
+ \c_@@_graduate_label_originality_clause_tl
+
+ \vspace{17mm}
+
+ \begin{flushright}
+ \c_@@_graduate_label_originality_author_signature_tl\par
+ \end{flushright}
+
+ \vspace{16mm}
+
+ % 使用授权声明部分。
+ \begin{center}
+ \@@_same_page:
+ \chapter*{
+ \heiti\zihao{3}
+ \c_@@_graduate_label_authorization_tl
+ }
+ \end{center}~\par
+
+ \c_@@_graduate_label_authorization_clause_tl
+
+ \vspace*{15mm}
+
+ \begin{flushright}
+ \begin{spacing}{1.65}
+ \zihao{4}
+ % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm}
+ \c_@@_graduate_label_originality_author_signature_tl\par
+ \c_@@_graduate_label_originality_supervisor_signature_tl\par
+ \end{spacing}
+ \end{flushright}
+ \end{titlepage}
+ \cleardoublepage
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{定义用户接口}
+%
+% \begin{macro}{\BITSetup}
+% 提供用户配置的接口。
+% \begin{macrocode}
+\DeclareDocumentCommand \BITSetup { m }
+ { \keys_set:nn { bithesis } { #1 }}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{blindPeerReview}
+% 用于包裹涉及个人信息的内容。
+%
+% 在启用盲审模式时,其中的内容会被隐藏。
+% \begin{macrocode}
+\NewDocumentEnvironment {blindPeerReview} {+b}
+ {
+ \bool_if:NTF \g_@@_blind_mode_bool {} {
+ #1
+ }
+ } {}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\cleardoublepage}
+% 重定义 \tn{cleardoublepage},
+% 使得偶数页面在没有内容时也不显示页眉页脚。见:
+% \url{https://tex.stackexchange.com/a/1683}。
+% \begin{macrocode}
+\RenewDocumentCommand \cleardoublepage { }
+ {
+ \clearpage
+ \bool_if:NT \g_@@_twoside_bool
+ {
+ \int_if_odd:nF \c@page
+ { \hbox:n { } \thispagestyle { empty } \newpage }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeCover}
+% 制作封面。
+% \begin{macrocode}
\DeclareDocumentCommand \MakeCover {}
{
\begin{blindPeerReview}
@@ -2467,7 +3075,8 @@
\tl_set:Nn \l_@@_cover_dilimiter_tl {:}
}
- % if not auto width, try override width
+ % 如果不是自动计算宽度,且用户没有自定义宽度,
+ % 则尝试提供一个默认宽度。
\bool_if:NF \l_@@_cover_auto_width_bool {
\dim_compare:nNnT {\l_@@_cover_label_max_width_dim} = {0pt} {
\dim_set:Nn \l_@@_cover_label_max_width_dim {35mm}
@@ -2479,6 +3088,7 @@
\zihao{3}
+ % 渲染信息。
\clist_set:Nn \l_@@_input_clist {
{\c_@@_label_school_tl} {\l_@@_value_school_tl},
{\c_@@_label_major_tl} {\l_@@_value_major_tl},
@@ -2507,7 +3117,8 @@
\vspace*{-3mm}
- \zihao{1}\textbf{\ziju{0.12}Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis}\par
+ \zihao{1}\textbf{\ziju{0.12}Beijing\nobreak{~}Institute
+ \nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis}\par
\vspace{18mm}
@@ -2569,158 +3180,131 @@
\group_end:
\end{blindPeerReview}
}
-
-% 圆形数字编号定义
-\newcommand{\circled}[2][]{\tikz[baseline=(char.base)]
- {\node[shape = circle, draw, inner~sep = 1pt]
- (char) {\phantom{\ifblank{#1}{#2}{#1}}};
- \node at (char.center) {\makebox[0pt][c]{#2}};}}
-\robustify{\circled}
-
-\cs_new:Npn \@@_graduate_originality: {
- \ctexset {
- chapter / pagestyle = plain,
- }
-
- \begin{titlepage}
- \pagenumbering{gobble}
-
- % 原创性声明部分
- \begin{center}
- \@@_same_page:
- \chapter*{\heiti\zihao{3}\c_@@_graduate_label_originality_tl}
- \end{center}~\par
-
- % 本部分字号为小三
- \zihao{4}
- \c_@@_graduate_label_originality_clause_tl
-
- \vspace{17mm}
-
- \begin{flushright}
- \c_@@_graduate_label_originality_author_signature_tl\par
- \end{flushright}
-
- \vspace{16mm}
-
- % 使用授权声明部分
- \begin{center}
- \@@_same_page:
- \chapter*{\heiti\zihao{3}\c_@@_graduate_label_authorization_tl}
- \end{center}~\par
-
- \c_@@_graduate_label_authorization_clause_tl
-
- \vspace*{15mm}
-
- \begin{flushright}
- \begin{spacing}{1.65}
- \zihao{4}
- % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm}
- \c_@@_graduate_label_originality_author_signature_tl\par
- \c_@@_graduate_label_originality_supervisor_signature_tl\par
- \end{spacing}
- \end{flushright}
- \end{titlepage}
- \cleardoublepage
-}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeOriginality}
+% 原创性声明。
+% \begin{macrocode}
\NewDocumentCommand \MakeOriginality {}
-{
- \group_begin:
- \begin{blindPeerReview}
- \int_case:nn {\g_@@_thesis_type_int}
- {
- {1}
+ {
+ \group_begin:
+ \begin{blindPeerReview}
+ \int_case:nn {\g_@@_thesis_type_int}
{
- \pagestyle{BIThesis}
- \pagenumbering{gobble}
+ {1}
+ {
+ \pagestyle{BIThesis}
+ \pagenumbering{gobble}
- % 原创性声明部分
- \begin{center}
- \vspace*{-2bp}
- \@@_same_page:
- \chapter*{\heiti\zihao{2}\c_@@_bachelor_label_originality_tl}
- \end{center}~\par
+ % 原创性声明部分
+ \begin{center}
+ \vspace*{-2bp}
+ \@@_same_page:
+ \chapter*{\heiti\zihao{2}\c_@@_bachelor_label_originality_tl}
+ \end{center}~\par
- % 本部分字号为小三
- \zihao{-3}
- \c_@@_bachelor_label_originality_clause_tl
+ % 本部分字号为小三。
+ \zihao{-3}
+ \c_@@_bachelor_label_originality_clause_tl
- \vspace{17mm}
+ \vspace{17mm}
- \begin{flushright}
- \c_@@_bachelor_label_originality_author_signature_tl\par
- \end{flushright}
+ \begin{flushright}
+ \c_@@_bachelor_label_originality_author_signature_tl\par
+ \end{flushright}
- \vspace{16mm}
+ \vspace{16mm}
- % 使用授权声明部分
- \begin{center}
- \@@_same_page:
- \chapter*{\heiti\zihao{2}\c_@@_bachelor_label_authorization_tl}
- \end{center}~\par
+ % 使用授权声明部分
+ \begin{center}
+ \@@_same_page:
+ \chapter*{
+ \heiti\zihao{2}
+ \c_@@_bachelor_label_authorization_tl
+ }
+ \end{center}~\par
- \c_@@_bachelor_label_authorization_clause_tl
+ \c_@@_bachelor_label_authorization_clause_tl
- \vspace*{3mm}
+ \vspace*{3mm}
- \begin{flushright}
- \begin{spacing}{1.65}
- \zihao{-3}
- % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm}
- \c_@@_bachelor_label_originality_author_signature_tl\par
- \c_@@_bachelor_label_originality_supervisor_signature_tl\par
- \end{spacing}
- \end{flushright}
+ \begin{flushright}
+ \begin{spacing}{1.65}
+ \zihao{-3}
+ % \hspace{5mm}\raisebox{-2ex}{\includegraphics[width=30mm]{example-image}}\hspace{5mm}
+ \c_@@_bachelor_label_originality_author_signature_tl\par
+ \c_@@_bachelor_label_originality_supervisor_signature_tl\par
+ \end{spacing}
+ \end{flushright}
- \newpage
- }
- {3} {
- \setstretch{1.26}
- % 原创性声明部分
- \begin{center}
- \vspace*{-2bp}
- \@@_same_page:
- \chapter*{\heiti\zihao{-2}\c_@@_bachelor_english_label_originality_tl}
- \end{center}~\par
+ \newpage
+ }
+ {3} {
+ \setstretch{1.26}
+ % 原创性声明部分
+ \begin{center}
+ \vspace*{-2bp}
+ \@@_same_page:
+ \chapter*{
+ \heiti\zihao{-2}
+ \c_@@_bachelor_english_label_originality_tl
+ }
+ \end{center}~\par
- % 本部分字号为小三
- \zihao{-4}
- \c_@@_bachelor_english_label_originality_clause_tl
+ % 本部分字号为小三
+ \zihao{-4}
+ \c_@@_bachelor_english_label_originality_clause_tl
- \bigbreak
+ \bigbreak
- Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par
+ Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~Date:\par
- \vspace{6mm}
+ \vspace{6mm}
- % 使用授权声明部分
- \begin{center}
- \@@_same_page:
- \chapter*{\heiti\zihao{-2}\c_@@_bachelor_english_label_authorization_tl}
- \end{center}~\par
+ % 使用授权声明部分
+ \begin{center}
+ \@@_same_page:
+ \chapter*{
+ \heiti\zihao{-2}
+ \c_@@_bachelor_english_label_authorization_tl
+ }
+ \end{center}~\par
- \c_@@_bachelor_english_label_authorization_clause_tl
+ \c_@@_bachelor_english_label_authorization_clause_tl
- \bigbreak
- Student~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~\hspace{2mm}Date:\par
- Supervisor~(Signature):~\dunderline[-1pt]{1pt}{\makebox[18mm]{}}~\hspace{2mm}Date:\par
+ \bigbreak
+ Student~(Signature):~
+ \dunderline[-1pt]{1pt}{\makebox[18mm + 16bp]{}}~
+ \hspace{2mm}Date:\par
+ Supervisor~(Signature):~
+ \dunderline[-1pt]{1pt}{\makebox[18mm]{}}~
+ \hspace{2mm}Date:\par
+ }
+ {4} {\@@_graduate_originality:}
+ {5} {\@@_graduate_originality:}
}
- {4} {\@@_graduate_originality:}
- {5} {\@@_graduate_originality:}
- }
- \end{blindPeerReview}
- \group_end:
-}
-
+ \end{blindPeerReview}
+ \group_end:
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakePaperBack}
+% 生成书脊。
+% \begin{macrocode}
\NewDocumentCommand \MakePaperBack {}
{
\begin{blindPeerReview}
\make_paper_back:
\end{blindPeerReview}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeTitle}
+% 生成标题页。(研究生)
+% \begin{macrocode}
\NewDocumentCommand \MakeTitle {}
{
\begin{blindPeerReview}
@@ -2728,7 +3312,12 @@
\@@_make_english_title_page:
\end{blindPeerReview}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeTOC}
+% 生成目录。
+% \begin{macrocode}
\DeclareDocumentCommand \MakeTOC {}
{
{
@@ -2747,7 +3336,9 @@
% 自定义目录样式
\cs_set:Npn \contentsname {
\fontsize{16pt}{\baselineskip}
- \l_@@_unnumchapter_style_cs:n\l_@@_title_font_cs:n{\l_@@_toc_title_tl}
+ \l_@@_unnumchapter_style_cs:n
+ \l_@@_title_font_cs:n
+ {\l_@@_toc_title_tl}
\vspace{-8pt}
}
@@ -2760,9 +3351,13 @@
}
}
}
-
- % TODO:
- \NewDocumentEnvironment {abstract} {}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{abstract}
+% 生成摘要。
+% \begin{macrocode}
+\NewDocumentEnvironment {abstract} {}
{
\cleardoublepage
@@ -2807,11 +3402,18 @@
}
{
\par
- \vspace{4ex}\noindent\textbf{\heiti \c_@@_label_keywords_tl \l_@@_value_keywords_tl}\par
+ \vspace{4ex}
+ \noindent
+ \textbf{\heiti \c_@@_label_keywords_tl \l_@@_value_keywords_tl}\par
\newpage
}
-
- \NewDocumentEnvironment {abstractEn} {}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{abstractEn}
+% 生成英文摘要。
+% \begin{macrocode}
+\NewDocumentEnvironment {abstractEn} {}
{
\cleardoublepage
\setstretch{1.53}
@@ -2822,9 +3424,11 @@
\vspace*{-2bp}
\@@_if_thesis_int_type:nTF {3} {
- \arialfamily\zihao{-2}\textbf\l_@@_value_title_en_tl\\
+ \arialfamily\zihao{-2}\textbf
+ \l_@@_value_title_en_tl\\
} {
- \heiti\zihao{3}\textbf\l_@@_value_title_en_tl\\
+ \heiti\zihao{3}\textbf
+ \l_@@_value_title_en_tl\\
}
\end{spacing}
\vspace*{10mm}
@@ -2865,12 +3469,18 @@
}
}
{
- \par\vspace{3ex}\noindent\textbf{\c_@@_label_keywords_en_tl \l_@@_value_keywords_en_tl}
+ \par\vspace{3ex}\noindent
+ \textbf{\c_@@_label_keywords_en_tl \l_@@_value_keywords_en_tl}
\newpage
}
-% after \backmatter
- \NewDocumentEnvironment {conclusion} {}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{conclusion}
+% 生成结论。需要放在 \cs{macrocode} 之后。
+% \begin{macrocode}
+\NewDocumentEnvironment {conclusion} {}
{
\ctexset{
section/number = \arabic{section}
@@ -2883,9 +3493,13 @@
}
}
{}
-
-% after backmatter
- \NewDocumentEnvironment {bibprint} {}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{bibprint}
+% 生成参考文献。需要放在 \cs{backmatter} 之后。
+% \begin{macrocode}
+\NewDocumentEnvironment {bibprint} {}
{
% 设置参考文献字号为 5 号
\renewcommand*{\bibfont}{\zihao{5}}
@@ -2926,10 +3540,13 @@
}
}
{}
-
- % #1: The name that used as chapter title
- % #2: The name that used in ToC.
- \NewDocumentEnvironment {appendices} {}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{appendices}
+% 生成附录。
+% \begin{macrocode}
+\NewDocumentEnvironment {appendices} {}
{
% Used in chapter, ToC.
\tl_new:N \l_@@_appendix_plain_label_tl
@@ -2945,6 +3562,7 @@
}
\bool_if:NTF \l_@@_appendices_chapter_level_bool {
+ % 附录章节级别
\setcounter{chapter}{0}
\ctexset{
chapter/numbering = true,
@@ -2958,6 +3576,7 @@
\Alph{chapter}
}
} {
+ % 附录节(section)级别
\ctexset{
section/number = \l_@@_appendix_plain_label_tl\hspace{1ex}\Alph{section},
subsection/number = \Alph{section}. \arabic{subsection},
@@ -2982,8 +3601,13 @@
}
{
}
-
- \NewDocumentEnvironment {acknowledgements} {+b}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{acknowledgements}
+% 生成致谢。
+% \begin{macrocode}
+\NewDocumentEnvironment {acknowledgements} {+b}
{
\begin{blindPeerReview}
\ctexset{
@@ -3000,8 +3624,13 @@
#1
\end{blindPeerReview}
} {}
-
- \NewDocumentEnvironment {publications} {+b}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{publications}
+% 生成攻读学位期间发表论文与研究成果清单。
+% \begin{macrocode}
+\NewDocumentEnvironment {publications} {+b}
{
\begin{blindPeerReview}
% 设置参考文献字号为 5 号
@@ -3049,8 +3678,13 @@
\end{blindPeerReview}
}
{}
-
- \NewDocumentEnvironment {resume} {+b}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{resume}
+% 生成个人简历。
+% \begin{macrocode}
+\NewDocumentEnvironment {resume} {+b}
{
\begin{blindPeerReview}
\chapter{\c_@@_label_resume_tl}
@@ -3059,8 +3693,13 @@
}
{
}
+% \end{macrocode}
+% \end{environment}
- \NewDocumentEnvironment {symbols} {}
+% \begin{environment}{symbols}
+% 生成主要术语对照包。
+% \begin{macrocode}
+\NewDocumentEnvironment {symbols} {}
{
\bool_if:NTF \l_@@_add_symbols_to_toc_bool {
\chapter{\c_@@_label_symbols_tl}
@@ -3068,35 +3707,69 @@
\chapter*{\c_@@_label_symbols_tl}
}
\zihao{-4}
- \begin{itemize}[labelwidth=2.5cm,labelsep=0.5cm,leftmargin=3cm,itemindent=0cm,itemsep=0cm]
+ \begin{itemize}[
+ labelwidth=2.5cm,
+ labelsep=0.5cm,
+ leftmargin=3cm,
+ itemindent=0cm,
+ itemsep=0cm
+ ]
\cs_set:Npn \makelabel ##1 {##1\hfil}
}
{
\end{itemize}
}
% \end{macrocode}
+% \end{environment}
+%
% \begin{macrocode}
%</thesis>
% \end{macrocode}
-
+%
+% \subsection{bitreport.cls 模板类}
+%
% \begin{macrocode}
%<*report>
% \end{macrocode}
%
+% \subsubsection{全局变量与临时变量}
+%
+% \begin{variable}{\g_@@_thesis_type_int}
+% 论文类型,取值从 1 开始,分别对应:
+% \begin{enumerate}
+% \item 课程实验报告
+% \item (计算机学院)本科生毕业(设计)开题报告
+% \end{enumerate}
% \begin{macrocode}
-% Define global
\int_new:N \g_@@_report_type_int
-
-% Define Consts.
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\c_@@_report_type_clist}
+% 定义报告类型的列表。
+% \begin{macrocode}
\clist_const:Nn \c_@@_report_type_clist
{ common, undergraduate_proposal}
-
-% Define tmp Variables
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_right_seq,\l_@@_left_seq}
+% 临时变量。
+% \begin{macrocode}
\seq_new:N \l_@@_right_seq
\seq_new:N \l_@@_left_seq
-
+% \end{macrocode}
+% \end{variable}
+%
+% 手动开启伪粗体、伪斜体。
+% \begin{macrocode}
\PassOptionsToPackage{AutoFakeBold,AutoFakeSlant}{xeCJK}
-
+% \end{macrocode}
+%
+% \subsubsection{l3keys 接口键值对定义}
+%
+% 定义 |bitreport| 模板类的键值对。
+% \begin{macrocode}
\keys_define:nn { bitreport }
{
option .meta:nn = {bitreport / option } {#1},
@@ -3104,7 +3777,10 @@
info .meta:nn = { bitreport / info } {#1},
misc .meta:nn = { bitreport / misc } {#1}
}
-
+% \end{macrocode}
+%
+% 定义 |bitreport/option| 模板类的键值对。
+% \begin{macrocode}
\keys_define:nn { bitreport / option }
{
type .choice:,
@@ -3117,25 +3793,10 @@
type .initial:n = common,
ctex .tl_set:N = \l_@@_options_to_ctex_tl,
}
-
-
-% Pass every option not explicitly defined to `ctexbeamer`.
-\DeclareOption*{
- \PassOptionsToClass{\l_@@_options_to_ctex_tl}{ctexart}
-}
-% Executes the code for each option.
-\ProcessOptions\relax
-% Load
-\LoadClass[zihao=-4]{ctexart}
-
-\RequirePackage[a4paper,left=3cm,right=2.4cm,top=2.6cm,bottom=2.38cm,includeheadfoot]{geometry}
-\RequirePackage{fancyhdr}
-\RequirePackage{setspace}
-\RequirePackage{caption}
-\RequirePackage{booktabs}
-\RequirePackage{pdfpages}
-
-
+% \end{macrocode}
+%
+% 定义 |bitreport/cover| 模板类的键值对。
+% \begin{macrocode}
\keys_define:nn { bitreport / cover }
{
imagePath .tl_set:N = \l_bit_coverimagepath_tl,
@@ -3155,7 +3816,10 @@
underlineOffset .dim_set:N = \l_@@_cover_underline_offset_dim,
underlineOffset .initial:n = { -10pt },
}
-
+% \end{macrocode}
+%
+% 定义 |bitreport/info| 模板类的键值对。
+% \begin{macrocode}
\keys_define:nn { bitreport / info }
{
title .tl_set:N = \l_@@_value_title_tl,
@@ -3167,24 +3831,84 @@
externalSupervisor .tl_set:N = \l_@@_value_external_supervisor_tl,
studentId .tl_set:N = \l_@@_value_student_id_tl,
}
-
+% \end{macrocode}
+%
+% 定义 |bitreport/misc| 模板类的键值对。
+% \begin{macrocode}
\keys_define:nn { bitreport / misc }
{
reviewTable .tl_set:N = \l_bit_reviewtable_tl,
}
-
+% \end{macrocode}
+%
+% 将 |bithesis/option/ctex| 中的值传递给 ctexbook 模板类。
+% \begin{macrocode}
+\DeclareOption*{
+ \PassOptionsToClass{\l_@@_options_to_ctex_tl}{ctexart}
+}
+% \end{macrocode}
+%
+% 加载 ctexbook 模板类。
+% \begin{macrocode}
+\ProcessOptions\relax
+\LoadClass[zihao=-4]{ctexart}
+% \end{macrocode}
+%
+% \subsubsection{定义模板类样式}
+% 加载所需的宏包。
+% \begin{macrocode}
+\RequirePackage[a4paper,left=3cm,right=2.4cm,top=2.6cm,bottom=2.38cm,includeheadfoot]{geometry}
+\RequirePackage{fancyhdr}
+\RequirePackage{setspace}
+\RequirePackage{caption}
+\RequirePackage{booktabs}
+\RequirePackage{pdfpages}
+% \end{macrocode}
+%
+% 在宏加载时,处理 |bitreport/option| 中的值。使得 |bitreport|
+% 宏包的模板选项可以在宏加载时生效。
+% \begin{macrocode}
\ProcessKeysOptions { bitreport / option }
-
+% \end{macrocode}
+%
+% \subsubsection{辅助函数与常量}
+%
+% \begin{macro}{\tl_if_empty:xTF,\seq_set_split:Nnx}
+% 生成变体。
+% \begin{macrocode}
\cs_generate_variant:Nn \tl_if_empty:nTF {x}
\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx}
-
-% #1: position
-% #2: line_thickness
-% #3: token list
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_dunderline:nnn}
+% 用于渲染下划线。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1 位置,可选值为 \texttt{c}enter、\texttt{l}eft、\texttt{r}ight。
+% \item \#2 |dim| 长度。
+% \item \#3 |tl| 文字内容。
+% \end{itemize}
+% \begin{macrocode}
\cs_new:Npn \@@_dunderline:nnn #1#2#3 {
{\setbox0=\hbox{#3}\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{|@@_render_cover_entry:nn}
+% 用于渲染封面的辅助函数。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1 |{token_list}| 为封面信息条目的名称。
+% \item \#2 |{token_list}| 为封面信息条目的内容。
+% \end{itemize}
+%
+% 需要在 |\l_@@_cover_label_max_width_dim| 和 |\l_@@_cover_value_max_width_dim|
+% 存储已经计算出来的最大宽度。
+% \begin{macrocode}
\cs_new:Npn \@@_render_cover_entry:nn #1#2 {
\makebox[\l_@@_cover_label_max_width_dim][\l_@@_cover_label_align_tl]{
\tl_if_blank:VTF #1 {} {#1\l_@@_cover_dilimiter_tl}
@@ -3194,7 +3918,18 @@
\makebox[\l_@@_cover_value_max_width_dim][\l_@@_cover_value_align_tl]{#2}
}\par
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{|@@_get_text_width:Nn,\@@_get_text_width:NV}
+% 计算 \#2 所占用的宽度,将结果存储在 \#1 中。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1 |dim| 存储宽度的变量。
+% \item \#2 |tl| 要计算宽度的文本。
+% \end{itemize}
+% \begin{macrocode}
% Get text with from #2, then set to #1.
\cs_new:Npn \@@_get_text_width:Nn #1#2
{
@@ -3202,8 +3937,18 @@
\dim_set:Nn #1 { \box_wd:N \l_tmpa_box }
}
\cs_generate_variant:Nn \@@_get_text_width:Nn { NV }
-
-% Get max text width from seq #2, then set to #1.
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_get_max_text_width:NN}
+% 从 \#2 中获取最大的文本宽度,然后设置到 \#1 中。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1: |dim| 用于存储最大宽度。
+% \item \#2: |seq| 用于存储文本。
+% \end{itemize}
+% \begin{macrocode}
\cs_new:Npn \@@_get_max_text_width:NN #1#2
{
% 这里用 |group| 确保局部变量不会被污染。
@@ -3218,8 +3963,20 @@
}
\group_end:
}
-
-% process label (#1) and value #2 separately
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_parse_entry}
+% 解析封面信息条目。
+%
+% 参数如下:
+% \begin{itemize}
+% \item \#1: |tl| 为封面信息条目的名称。
+% \item \#2: |tl| 为封面信息条目的内容。
+% \end{itemize}
+% |//| 会被视为换行符,从而实现信息条目换行的效果。
+%
+% \begin{macrocode}
\cs_new:Npn \@@_parse_entry #1 #2 {
\seq_set_split:Nnx \l_@@_tmp_right_seq {//} {#2}
\seq_clear:N \l_@@_tmp_left_seq
@@ -3229,22 +3986,40 @@
\seq_put_left:Nn \l_@@_tmp_left_seq {#1}
\seq_pop_right:NN \l_@@_tmp_left_seq \g_@@_trashcan_tl
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_render_cover_entry}
+% 渲染封面信息项。此函数为主函数。
+% \begin{macrocode}
\cs_new:Npn \@@_render_cover_entry:n #1 {
+ % 左边是标签,右边是值。
+ % 形如:
+ % { {label_1} {value_1}, {label_2} {value 2} }
+ % 首先转换成 seq 类型。
\seq_set_from_clist:NN \l_@@_input_seq #1
- % parse newline //
\seq_map_inline:Nn \l_@@_input_seq {
+ % 然后对于每一对 label 和 value,首先查找
+ % value 中是否含有 // 字符,如果有,则将其分割成多个
+ % label - value 对。
+ % 比如 {label_1} {value // 1} 会被转换成
+ % { {label_1} {value}, {} {1} }
\@@_parse_entry ##1
+ % 然后将这些 label - value 对添加到 \l_@@_right_seq
+ % 或者 \l_@@_left_sql 中。
+ % left 就是 label,right 就是 value。
\seq_concat:NNN \l_@@_right_seq \l_@@_right_seq \l_@@_tmp_right_seq
\seq_concat:NNN \l_@@_left_seq \l_@@_left_seq \l_@@_tmp_left_seq
}
+ % 如果用户选择自动计算最大宽度,则计算最大宽度。
\bool_if:NT \l_@@_cover_auto_width_bool {
\@@_get_max_text_width:NN \l_@@_cover_label_max_width_dim \l_@@_left_seq
\@@_get_max_text_width:NN \l_@@_cover_value_max_width_dim \l_@@_right_seq
}
+ % 最后,根据宽度渲染 label 和 value 对。
\group_begin:
\bool_until_do:nn { \seq_if_empty_p:N \l_@@_left_seq }
{
@@ -3256,9 +4031,22 @@
}
\group_end:
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{定义用户接口}
+%
+% \begin{macro}{\BITSetup}
+% 提供用户配置的接口。
+% \begin{macrocode}
\DeclareDocumentCommand \BITSetup { m }
{ \keys_set:nn { bitreport } { #1 }}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeCover}
+% 渲染封面。
+% \begin{macrocode}
\DeclareDocumentCommand \MakeCover {}
{
\group_begin:
@@ -3266,29 +4054,39 @@
{1} {
\begin{titlepage}
\centering
+
\vspace{23mm}
+
\tl_if_empty:NF \l_bit_coverimagepath_tl {
\includegraphics[width=.5\textwidth]{\l_bit_coverimagepath_tl}\\
}
+
\vspace{10mm}
+
\heiti\fontsize{24pt}{24pt}\selectfont{\l_@@_value_title_tl}\\
+
\vspace{67mm}
- \begin{spacing}{2.2}
- \songti\zihao{3}
- \clist_set:Nn \l_@@_input_clist {
- {\textbf{学\qquad 院:}} {\l_@@_value_school_tl},
- {\textbf{专\qquad 业:}} {\l_@@_value_major_tl},
- {\textbf{班\qquad 级:}} {\l_@@_value_class_tl},
- {\textbf{学\qquad 号:}} {\l_@@_value_student_id_tl},
- {\textbf{姓\qquad 名:}} {\l_@@_value_author_tl},
- {\textbf{任课教师:}} {\l_@@_value_supervisor_tl},
- }
-
- \@@_render_cover_entry:n \l_@@_input_clist
- \end{spacing}
+ \begin{spacing}{2.2}
+ \songti\zihao{3}
+
+ \clist_set:Nn \l_@@_input_clist {
+ {\textbf{学\qquad 院:}} {\l_@@_value_school_tl},
+ {\textbf{专\qquad 业:}} {\l_@@_value_major_tl},
+ {\textbf{班\qquad 级:}} {\l_@@_value_class_tl},
+ {\textbf{学\qquad 号:}} {\l_@@_value_student_id_tl},
+ {\textbf{姓\qquad 名:}} {\l_@@_value_author_tl},
+ {\textbf{任课教师:}} {\l_@@_value_supervisor_tl},
+ }
+
+ \@@_render_cover_entry:n \l_@@_input_clist
+
+ \end{spacing}
+
\vspace*{\fill}
+
\centering
+
\songti\fontsize{12pt}{12pt}\selectfont{
\tl_if_empty:NTF \l_@@_cover_date_tl {
\today
@@ -3304,11 +4102,15 @@
\topskip=0pt
\vspace*{-16mm}
\centering
- \hspace{-6mm}\songti\fontsize{22pt}{22pt}\selectfont{北京理工大学}\par
+ \hspace{-6mm}
+ \songti\fontsize{22pt}{22pt}
+ \selectfont{北京理工大学}\par
\vspace{13mm}
- \hspace{-6mm}\heiti\fontsize{24pt}{24pt}\selectfont{本科生毕业设计(论文)开题报告}\par
+ \hspace{-6mm}
+ \heiti\fontsize{24pt}{24pt}
+ \selectfont{本科生毕业设计(论文)开题报告}\par
\vspace{53mm}
@@ -3321,7 +4123,7 @@
{\textbf{姓\qquad 名:}} {\l_@@_value_author_tl},
{\textbf{指导教师:}} {\l_@@_value_supervisor_tl},
{\textbf{校外指导教师:}} {\l_@@_value_external_supervisor_tl},
- }
+ }
\@@_render_cover_entry:n \l_@@_input_clist
@@ -3331,12 +4133,18 @@
\centering
\hspace{-6mm}\songti\fontsize{12pt}{12pt}\selectfont{\today}
+
\end{titlepage}
}
}
\group_end:
}
-
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeReviewTable}
+% 渲染评阅表。
+% \begin{macrocode}
\DeclareDocumentCommand \MakeReviewTable {}
{
\group_begin:
@@ -3345,65 +4153,96 @@
\end{titlepage}
\group_end:
}
-
+% \end{macrocode}
+% \end{macro}
+%
% 定义 caption 字体为楷体
+% \begin{macrocode}
\DeclareCaptionFont{kaiticaption}{\kaishu \normalsize}
-
+% \end{macrocode}
+%
% 设置图片的 caption 格式
+% \begin{macrocode}
\renewcommand{\thefigure}{\thesection-\arabic{figure}}
\captionsetup[figure]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption}
-
+% \end{macrocode}
+%
% 设置表格的 caption 格式
+% \begin{macrocode}
\renewcommand{\thetable}{\thesection-\arabic{table}}
\captionsetup[table]{font=small,labelsep=space,skip=10bp,labelfont=bf,font=kaiticaption}
-
+% \end{macrocode}
+%
% 输出大写数字日期
+% \begin{macrocode}
\ctexset{today=big}
-
+% \end{macrocode}
+%
% 将西文字体设置为 Times New Roman
+% \begin{macrocode}
\setromanfont{Times~New~Roman}
-
-%% 将中文楷体设置为 SIMKAI.TTF(如果需要)
-% \setCJKfamilyfont{zhkai}{[SIMKAI.TTF]}
-% \newcommand*{\kaiti}{\CJKfamily{zhkai}}
-
+% \end{macrocode}
+%
% 设置文档标题深度
+% \begin{macrocode}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
-
-%%
-% 设置一级标题、二级标题格式
-% 一级标题:小三,宋体,加粗,段前段后各半行
+% \end{macrocode}
+%
+% 设置一级标题、二级标题格式。
+% \begin{macrocode}
+% 一级标题:小三,宋体,加粗,段前段后各半行。
\ctexset{section={
- format={\raggedright \bfseries \songti \zihao{-3}},
+ format={
+ \raggedright \bfseries \songti \zihao{-3}
+ },
beforeskip = 24bp plus 1ex minus .2ex,
afterskip = 24bp plus .2ex,
fixskip = true,
name = {,.\quad}
}
}
-% 二级标题:小四,宋体,加粗,段前段后各半行
+% 二级标题:小四,宋体,加粗,段前段后各半行。
\ctexset{subsection={
- format = {\bfseries \songti \raggedright \zihao{4}},
+ format = {
+ \bfseries \songti \raggedright \zihao{4}
+ },
beforeskip = 24bp plus 1ex minus .2ex,
afterskip = 24bp plus .2ex,
fixskip = true,
}
}
-% 页眉和页脚(页码)的格式设定
+% \end{macrocode}
+%
+% 页眉和页脚(页码)的格式设定。
+% \begin{macrocode}
\fancyhf{}
\int_case:nn {\g_@@_report_type_int} {
- {1} {\fancyhead[R]{\fontsize{10.5pt}{10.5pt}\selectfont{\l_@@_value_title_tl}}}
- {2} {\fancyhead[R]{\fontsize{10.5pt}{10.5pt}\selectfont{北京理工大学本科生毕业设计(论文)开题报告}}}
+ {1} {
+ \fancyhead[R]{
+ \fontsize{10.5pt}{10.5pt}
+ \selectfont{\l_@@_value_title_tl}
+ }
+ }
+ {2} {
+ \fancyhead[R]{
+ \fontsize{10.5pt}{10.5pt}
+ \selectfont{北京理工大学本科生毕业设计(论文)开题报告}
+ }
+ }
}
\fancyfoot[R]{\fontsize{9pt}{9pt}\selectfont{\thepage}}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{0pt}
-
+% \end{macrocode}
+%
% 正文开始
+% \begin{macrocode}
\pagestyle{fancy}
\setcounter{page}{1}
-
+% \end{macrocode}
+%
+% \begin{macrocode}
% 正文 22 磅的行距,段前段后间距为 0
% \setlength{\parskip}{0em}
\cs_set:Npn \baselinestretch {1.53}
@@ -3414,63 +4253,106 @@
% \begin{macrocode}
%</report>
% \end{macrocode}
+%
+% \subsection{bitbeamer.cls 文档类}
+%
% \begin{macrocode}
%<*beamer>
% \end{macrocode}
%
+% \subsubsection{l3keys 接口键值对定义}
+%
+% 定义 |bitbeamer| 文档类的接口键值对。
% \begin{macrocode}
-% Define our keyvalues
\keys_define:nn { bitbeamer }
{
titlegraphic .tl_set:N = \l_bit_titlegraphic_tl,
framelogo .tl_set:N = \l_bit_framelogo_tl,
}
+% \end{macrocode}
+%
+% 在宏加载时,处理 |bitbeamer| 中的值。使得 |bitbeamer|
+% 宏包的模板选项可以在宏加载时生效。
+% \begin{macrocode}
\ProcessKeysOptions { bitbeamer }
-
+% \end{macrocode}
+%
% Pass every option not explicitly defined to `ctexbeamer`.
+% \begin{macrocode}
\DeclareOption*{
\PassOptionsToClass{\CurrentOption}{ctexbeamer}
}
+% \end{macrocode}
+%
% Executes the code for each option.
+% Load.
+% \begin{macrocode}
\ProcessOptions\relax
-
-% Load
\LoadClass{ctexbeamer}
-
+% \end{macrocode}
+%
+% \subsubsection{定义模板类样式}
+%
+% 加载所需的宏包。
+% \begin{macrocode}
\RequirePackage{xeCJKfntef}
\RequirePackage{tikz}
-
+% \end{macrocode}
+%
+% 设置主题与主题色。
+% \begin{macrocode}
\usetheme{Madrid}
-% 设置主题色
\colorlet{beamer@blendedblue}{green!40!black}
-
+% \end{macrocode}
+%
+%
+% \begin{macro}{\CJKhl:nn}
+% 高亮中文字符。
+% \begin{macrocode}
\cs_new:Npn \CJKhl:nn #1 #2
{ \CJKsout*[thickness=2.5ex, format=\color{#1}]{#2} }
-
+% \end{macrocode}
+% \end{macro}
+%
% Set header if logo path is provided.
+% \begin{macrocode}
\tl_if_empty:NF \l_bit_titlegraphic_tl {
% BIT Logo
\titlegraphic{
\includegraphics[width=2cm]{\l_bit_titlegraphic_tl}
}
}
-
+% \end{macrocode}
+%
% Set title logo if logo path is provided.
+% \begin{macrocode}
\tl_if_empty:NF \l_bit_framelogo_tl {
\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember~picture,overlay]
- \node[anchor=north~east,yshift=2pt] at (current~page.north~east) {\includegraphics[height=0.8cm]{\tl_use:N \l_bit_framelogo_tl}};
+ \node[anchor=north~east,yshift=2pt] at (current~page.north~east)
+ {\includegraphics[height=0.8cm]{\tl_use:N \l_bit_framelogo_tl}};
\end{tikzpicture}
}
}
-
-% Expose command to user.
+% \end{macrocode}
+%
+% \subsubsection{定义用户接口}
+%
+% \begin{macrocode}
\cs_new_eq:NN \CJKhl \CJKhl:nn
% \end{macrocode}
+%
% \begin{macrocode}
%</beamer>
% \end{macrocode}
-
+%
+% \subsection{已弃用的代码}
+%
+% 来自老版本的代码,但是在新版本中已经不再使用。
+% ,为了保证老版本论文能够正常编译,特此保留。
+%
+% \subsubsection{bitbook.cls 文档类(已弃用)}
+%
% \begin{macrocode}
%<*book>
% \end{macrocode}
@@ -3727,6 +4609,7 @@
% \begin{macrocode}
%</book>
% \end{macrocode}
+% \subsubsection{bitart.cls 文档类(已弃用)}
% \begin{macrocode}
%<*article>
% \end{macrocode}
@@ -3878,6 +4761,7 @@
% \begin{macrocode}
%</article>
% \end{macrocode}
+% \subsubsection{bitgraduate.cls 文档类(已弃用)}
% \begin{macrocode}
%<*graduate>
% \end{macrocode}
@@ -4741,11 +5625,7 @@ footskip=0.7cm% 页脚 1.8cm %
\RequirePackage{siunitx}
\setcounter{secnumdepth}{4} % 章节编号深度 (part 对应 -1)
\setcounter{tocdepth}{2} % 目录深度 (part 对应 -1)
-
-%% End of file `bitmaster-xetex.cls'.
-
%% =========================================================
-
% \end{macrocode}
% \begin{macrocode}
%</graduate>
@@ -4805,7 +5685,7 @@ footskip=0.7cm% 页脚 1.8cm %
}%
\newcommand{\BIThesisLaTeX}{{\BIThesis}北京理工大学学位论文及报告{\LaTeX}模板}
-\newcommand{\BIThesisMacroPackage}{{\BIThesis}宏集}
+\newcommand{\BIThesisMacroPackage}{{\BIThesis}宏包}
\newcommand{\BIThesisWiki}{{\BIThesis}在线文档}
\newcommand{\BIThesisScaffold}{{\BIThesis}模板}
\newcommand{\BIThesisRelease}{{\BIThesis}模板}
@@ -4852,6 +5732,8 @@ footskip=0.7cm% 页脚 1.8cm %
abstractname=简介,
}
+\pagestyle{fancy}
+
\ctexset{section={
format={\raggedright \bfseries \zihao{-3}},
name = {第,章}
diff --git a/macros/unicodetex/latex/bithesis/bithesis.pdf b/macros/unicodetex/latex/bithesis/bithesis.pdf
index c58e628028..9833758cbe 100644
--- a/macros/unicodetex/latex/bithesis/bithesis.pdf
+++ b/macros/unicodetex/latex/bithesis/bithesis.pdf
Binary files differ