Skip to content

Commit

Permalink
exppl2e.sty: original \check@nocorr@ for italic correction (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
aminophen committed Aug 19, 2017
1 parent 9bd44d6 commit 556520f
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
82 changes: 82 additions & 0 deletions exppl2e.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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$$$r<u$1$F(B
% $B$$$?$?$a!#(B}$B$7(B
% \begin{enumerate}
% \item $B!V2$J8J8;z(B $B"*(B |\/|$B!W$N>l9g$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}
%<platexrelease>\plIncludeInRelease{????/??/??}{\check@nocorr@}
%<platexrelease> {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
}
%</pldefs|platexrelease>
%<platexrelease>\plEndIncludeInRelease
%<platexrelease>\plIncludeInRelease{0000/00/00}{\check@nocorr@}
%<platexrelease> {Italic correction before \textt...}%
%<platexrelease>\def \check@nocorr@ #1#2\nocorr#3\@nil {%
%<platexrelease> \let \check@icl \relax% \maybe@ic $B$+$iJQ99(B
%<platexrelease> \def \check@icr {\ifvmode \else \aftergroup \maybe@ic \fi}%
%<platexrelease> \def \reserved@a {\nocorr}%
%<platexrelease> \def \reserved@b {#1}%
%<platexrelease> \def \reserved@c {#3}%
%<platexrelease> \ifx \reserved@a \reserved@b
%<platexrelease> \ifx \reserved@c \@empty
%<platexrelease> \let \check@icl \@empty
%<platexrelease> \else
%<platexrelease> \let \check@icl \@empty
%<platexrelease> \let \check@icr \@empty
%<platexrelease> \fi
%<platexrelease> \else
%<platexrelease> \ifx \reserved@c \@empty
%<platexrelease> \else
%<platexrelease> \let \check@icr \@empty
%<platexrelease> \fi
%<platexrelease> \fi
%<platexrelease>}
%<platexrelease>\plEndIncludeInRelease
% \end{macrocode}
% \end{macro}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\endinput
45 changes: 45 additions & 0 deletions tests/icorr_xkanjiskip.tex
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 556520f

Please sign in to comment.