diff options
author | Karl Berry <karl@freefriends.org> | 2025-01-01 20:54:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2025-01-01 20:54:44 +0000 |
commit | 07aa058b14ebce75c62403ffaf453284d51fd1d3 (patch) | |
tree | e0ce00e824ce4f502530c09b29401a6bbca01e10 /Master/texmf-dist/tex/latex | |
parent | 4bc4c61003a57c57c73705696a6bad4151337c67 (diff) |
chuushaku (1jan25)
git-svn-id: svn://tug.org/texlive/trunk@73263 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/chuushaku/chuushaku.sty | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/chuushaku/chuushaku.sty b/Master/texmf-dist/tex/latex/chuushaku/chuushaku.sty new file mode 100644 index 00000000000..479ab063b1b --- /dev/null +++ b/Master/texmf-dist/tex/latex/chuushaku/chuushaku.sty @@ -0,0 +1,59 @@ +\NeedsTeXFormat{LaTeX2e}% +\ProvidesPackage{chuushaku}[2024/12/30,Ver1.0.1]% + +\RequirePackage{tikz,amsmath,framed,calc}% +\usetikzlibrary{positioning,quotes}% + +\newcommand{\段落下げ}{\parindent=1zw}% +\def\zw{\dimexpr1zw\relax}% + +\newcounter{chuubangou}% +\setcounter{chuubangou}{0}% +\newcommand{\chuukigouprintA}{$\dag$}% +\newcommand{\chuukigouprintB}{▶\ignorespaces}% +\newcommand{\chuuhabaprint}{.68}% +\newcommand{\chuuakiprint}{.7}% +\newcommand{\chuukigou}[2]{\renewcommand{\chuukigouprintA}{#1}\renewcommand{\chuukigouprintB}{#2}}% +\newcommand{\chuuhaba}[1]{\renewcommand{\chuuhabaprint}{#1}}% +\newcommand{\chuuaki}[1]{\renewcommand{\chuuakiprint}{#1}}% +\newcommand{\chuu}[1]% + {% + \stepcounter{chuubangou}% + \nolinebreak$\!^{\text{\chuukigouprintA}}$% + \tikz[remember picture]{\coordinate (A\thechuubangou);}% + \expandafter\gdef\csname chuunote\thechuubangou\endcsname{#1}% + }% +\newcommand{\chuuprint}% + {% + \begin{tikzpicture}[overlay, remember picture] + \foreach \n in {1,...,\thechuubangou}% + {% + \node[sidenote] at (A\n -| B) {\csname chuunote\n\endcsname};% + \node[pointer] at (A\n -| B) {\footnotesize\chuukigouprintB};% + }% + \end{tikzpicture}% + }% +\NewDocumentEnvironment{chuushaku}{ O{\chuuhabaprint} D<>{\chuuakiprint} }% + {% + %TikZのスタイル定義 + \tikzset{sidenote/.style={anchor=north west, inner sep=0pt, text width={\linewidth-#1\linewidth-#2\zw-1\zw}, font=\footnotesize, yshift=.8em}}% + \tikzset{pointer/.style={left, inner sep=3pt, yshift=.3em}} + \begin{minipage}[t]{#1\linewidth}\begin{右辺点線囲み}% + }% + {% + \end{右辺点線囲み}% + \end{minipage}\begin{minipage}[t]{#2zw+1zw}% + ~% + \end{minipage}\begin{minipage}[t]{\linewidth-#1\linewidth-#2\zw}% + \tikz[remember picture]{\coordinate (B);}% + \end{minipage}% + \chuuprint\setcounter{chuubangou}{0}% + }% + +\newenvironment{右辺点線囲み}% + {% + \def\FrameCommand##1{##1\hspace{10pt}\vrule width .3pt}% + \MakeFramed {\advance\hsize-\width \FrameRestore}% + \段落下げ% + }% + {\endMakeFramed}
\ No newline at end of file |