Skip to content

Instantly share code, notes, and snippets.

@k16shikano
Last active December 31, 2015 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save k16shikano/7924591 to your computer and use it in GitHub Desktop.
Save k16shikano/7924591 to your computer and use it in GitHub Desktop.
listinline で前後に xkanjiskip があくようになるかもしれない内部マクロの再定義
\def\lst@Init#1{%
\begingroup
\ifx\lst@float\relax\else
\edef\@tempa{\noexpand\lst@beginfloat{lstlisting}[\lst@float]}%
\expandafter\@tempa
\fi
\ifx\lst@multicols\@empty\else
\edef\lst@next{\noexpand\multicols{\lst@multicols}}
\expandafter\lst@next
\fi
\ifhmode\ifinner \lst@boxtrue \fi\fi
\lst@ifbox
\lsthk@BoxUnsafe
\hbox to\z@\bgroup
$\if t\lst@boxpos \vtop
\else \if b\lst@boxpos \vbox
\else \vcenter \fi\fi
\bgroup \par\noindent
\else
\lst@ifdisplaystyle
\lst@EveryDisplay
\par\penalty-200\relax
\vspace\lst@aboveskip
\else
\hskip\xkanjiskip
\fi
\fi
\normalbaselines
\abovecaptionskip\lst@abovecaption\relax
\belowcaptionskip\lst@belowcaption\relax
\lst@MakeCaption t%
\lsthk@PreInit \lsthk@Init
\lst@ifdisplaystyle
\global\let\lst@ltxlabel\@empty
\if@inlabel
\lst@ifresetmargins
\leavevmode
\else
\xdef\lst@ltxlabel{\the\everypar}%
\lst@AddTo\lst@ltxlabel{%
\global\let\lst@ltxlabel\@empty
\everypar{\lsthk@EveryLine\lsthk@EveryPar}}%
\fi
\fi
\everypar\expandafter{\lst@ltxlabel
\lsthk@EveryLine\lsthk@EveryPar}%
\else
\everypar{}\let\lst@NewLine\@empty
\fi
\lsthk@InitVars \lsthk@InitVarsBOL
\lst@Let{13}\lst@MProcessListing
\let\lst@Backslash#1%
\lst@EnterMode{\lst@Pmode}{\lst@SelectCharTable}%
\lst@InitFinalize}
\def\lst@DeInit{%
\lst@XPrintToken \lst@EOLUpdate
\global\advance\lst@newlines\m@ne
\lst@ifshowlines
\lst@DoNewLines
\else
\setbox\@tempboxa\vbox{\lst@DoNewLines}%
\fi
\lst@ifdisplaystyle \par\removelastskip \fi
\lsthk@ExitVars\everypar{}\lsthk@DeInit\normalbaselines\normalcolor
\lst@MakeCaption b%
\lst@ifbox
\egroup $\hss \egroup
\vrule\@width\lst@maxwidth\@height\z@\@depth\z@
\else
\lst@ifdisplaystyle
\par\penalty-200\addvspace\lst@belowskip
\else
\hskip\xkanjiskip
\fi
\fi
\ifx\lst@multicols\@empty\else
\def\lst@next{\global\let\@checkend\@gobble
\endmulticols
\global\let\@checkend\lst@@checkend}
\expandafter\lst@next
\fi
\ifx\lst@float\relax\else
\expandafter\lst@endfloat
\fi
\endgroup}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment