From 556520f4b73146ed100ea30b43d563ad1972d6b7 Mon Sep 17 00:00:00 2001 From: Hironobu Yamashita Date: Sun, 20 Aug 2017 00:47:56 +0900 Subject: [PATCH] exppl2e.sty: original \check@nocorr@ for italic correction (#48) --- exppl2e.sty | 82 ++++++++++++++++++++++++++++++++++++++ tests/icorr_xkanjiskip.tex | 45 +++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 tests/icorr_xkanjiskip.tex diff --git a/exppl2e.sty b/exppl2e.sty index b13f67e..9a2e212 100644 --- a/exppl2e.sty +++ b/exppl2e.sty @@ -525,4 +525,86 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % +% \section{$B%$%?%j%C%/Jd@5$H(B\cs{xkanjiskip}} +% +% \begin{macro}{\check@nocorr@} +% $B!V(B\verb|$B$"(B\texttt{abc}$B$$(B|$B!W$H$7$?$H$-!"=qBN$NJQ99$r;XDj$5$l$?2$J8$N:8B&$K(B +% $BOB2$J84V%9%Z!<%9$,F~$i$J$$$N$r=$@5$7$^$9!#(B +% \changes{v1.3i}{2000/07/13}{\cs{text..}$B%3%^%s%I$N:8B&$K(B\cs{xkanjiskip}$B$,(B +% $BF~$i$J$$$N$r=$@5!J$"$j$,$H$&!"25It!wElBg$5$s!K(B} +% +% $B%3%_%e%K%F%#HG$N=$@5!'(Bp\TeX{}$B$N%P!<%8%g%s(Bp3.1.11$B0JA0$O!"%$%?%j%C%/Jd@5(B +% $B!J0J2<(B|\/|$B$H5-$9!K$H(B|\xkanjiskip|$B$NA^F~$,>WFM(B\footnote{$BOBJ8$N%$%?%j%C%/(B +% $BJd@5MQ(Bkern$B$,!"DL>o$N(Bexplicit$B$J!J(B\cs{kern}$B$K$h$k!K(Bkern$B$HF1$807$$$rl9g$K$O(B|\/|$B$rL5;k$9$k(B +% $B!J$D$^$j8e$K(B|\xkanjiskip|$BA^F~2DG=!K(B +% \item $B!VOBJ8J8;z(B $B"*(B |\/|$B!W$N>l9g$K$O$3$N8e$K(B|\xkanjiskip|$B$OA^F~$G$-$J$$(B +% \end{enumerate} +% $B$H$$$&5sF0$K$J$C$F$$$^$7$?!#(Bp3.2$B!J(B2010$BG/!K$N=$@5$G(B +% \begin{itemize} +% \item |\xkanjiskip|$BA^F~;~$K$O$$$+$J$k>l9g$b(B|\/|$B$rL5;k$9$k(B +% \end{itemize} +% $B$H$$$&5sF0$KJQ99$5$l$^$7$?!#(Bp\LaTeX{}$B%+!<%M%k$N(B|\check@nocorr@|$B$N=$@5$O!"(B +% p3.1.11$B0JA0$N(B2.$B$X$NBP=h$G$7$?$,!"$3$l$O!V(B|\text...{}|$B$N:8$X$N(B|\/|$BA^F~!W$r(B +% $BL58z2=$7$F$$$k$N$G!"(B|\textit{f\textup{a}}|$B$GK\MhF~$k$Y$-%$%?%j%C%/Jd@5$,(B +% $BF~$j$^$;$s$G$7$?!#(Bp3.2$B0J9_$G$O(Bp\TeX{}$B$N(B|\xkanjiskip|$BBP:v$,ITMW$K$J$C$F(B +% $B$$$^$9$N$G!"%3%_%e%K%F%#HG$G$O:o=|$7$^$7$?!#(B +% \changes{v????}{????/??/??}{2010$BG/$N(Bp\TeX{}$BK\BN$N=$@5$K$h$j!"(Bv1.3i$B$GF~$l$?(B +% $BBP=h$,ITMW$K$J$C$F$$$?$N$G:o=|(B} +% \begin{macrocode} +%\plIncludeInRelease{????/??/??}{\check@nocorr@} +% {Italic correction before \textt...}% +%<*pldefs|platexrelease> +\def \check@nocorr@ #1#2\nocorr#3\@nil {% + \let \check@icl \maybe@ic + \def \check@icr {\ifvmode \else \aftergroup \maybe@ic \fi}% + \def \reserved@a {\nocorr}% + \def \reserved@b {#1}% + \def \reserved@c {#3}% + \ifx \reserved@a \reserved@b + \ifx \reserved@c \@empty + \let \check@icl \@empty + \else + \let \check@icl \@empty + \let \check@icr \@empty + \fi + \else + \ifx \reserved@c \@empty + \else + \let \check@icr \@empty + \fi + \fi +} +% +%\plEndIncludeInRelease +%\plIncludeInRelease{0000/00/00}{\check@nocorr@} +% {Italic correction before \textt...}% +%\def \check@nocorr@ #1#2\nocorr#3\@nil {% +% \let \check@icl \relax% \maybe@ic $B$+$iJQ99(B +% \def \check@icr {\ifvmode \else \aftergroup \maybe@ic \fi}% +% \def \reserved@a {\nocorr}% +% \def \reserved@b {#1}% +% \def \reserved@c {#3}% +% \ifx \reserved@a \reserved@b +% \ifx \reserved@c \@empty +% \let \check@icl \@empty +% \else +% \let \check@icl \@empty +% \let \check@icr \@empty +% \fi +% \else +% \ifx \reserved@c \@empty +% \else +% \let \check@icr \@empty +% \fi +% \fi +%} +%\plEndIncludeInRelease +% \end{macrocode} +% \end{macro} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \endinput diff --git a/tests/icorr_xkanjiskip.tex b/tests/icorr_xkanjiskip.tex new file mode 100644 index 0000000..8fe9b75 --- /dev/null +++ b/tests/icorr_xkanjiskip.tex @@ -0,0 +1,45 @@ +\documentclass{article} +\begin{document} + +% \xkanjiskip が両側に入ることを確認 +\xkanjiskip10pt +あ\texttt{abc}い\par +\textbf{いいい}$a$\par + +% イタリック補正が入ることを確認(1) +\setbox0=\hbox{\textit{f\textup{af}b}} +\showboxdepth10000 +\showboxbreadth10000 +\tracingonline1 +\showbox0 +\box0 +\hbox{\textit{f\/\textup{af}b}} % 比較用 + +% イタリック補正が入ることを確認(2) +\begin{quote}\itshape +You must think of \emph{what} to write +before thinking of \emph{how} to write. +\end{quote} +\begin{quote}\itshape % 比較用 +You must think of\/ \emph{what} to write +before thinking of\/ \emph{how} to write. +\end{quote} + +% fと漢の間にイタリック補正(kern)と和欧文間空白の両方が入る +string \textit{of}漢字\par +string {\itshape of\/}漢字\par +string {\itshape of}漢字\par % 比較用:これはイタリック補正なし + +% 必要なイタリック補正と和欧文間空白が入る +漢\textbf{f}漢f\textbf{漢}f\par +漢\textit{f}漢\par +\textit{f\/\textup{漢}f}\par + +\end{document} + +%% 以下、参考 %% +「\textbfと直後の欧文とのアキ」 +https://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa +55068-55069, 55073-55076, 55081, 55086 +「\text... の \xkanjiskip 対策は必要か?」 +https://github.com/texjporg/platex/issues/51