Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Last active December 29, 2015 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zr-tex8r/7718657 to your computer and use it in GitHub Desktop.
Save zr-tex8r/7718657 to your computer and use it in GitHub Desktop.
LaTeX: To fix a problem involving xeCJK and “manually-defined” environemnts
\documentclass{article}
\usepackage{zxjatype}
\usepackage{zxcjkfix1}%fix
\setjamainfont{IPAMincho}
\begin{document}
\begin{Huge}「」\end{Huge}
\end{document}
% zxcjkfix1.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zxcjkfix1}[2013/11/30 v0.2]
\def\zxqqf@pkgname{zxcjkfix1}
% environment check
\@ifpackageloaded{xeCJK}{}{%else
\PackageError\zxqqf@pkgname{xeCJK is not loaded}%
{Package loading is aborted.}%
\endinput}
% patch to \end
\begingroup
\toks0\expandafter{\end{#1}}
\toks2{\unless\ifcsname end#1\endcsname\relax\fi}
\edef\zxqqf@next{\gdef\noexpand\end##1{\the\toks2 \the\toks0 }}
\zxqqf@next
\endgroup
% done
\endinput
%% EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment