Skip to content

Instantly share code, notes, and snippets.

@yuw
Last active May 7, 2019 02:21
Show Gist options
  • Save yuw/a31936370647d0044eeb4e47f3ae913f to your computer and use it in GitHub Desktop.
Save yuw/a31936370647d0044eeb4e47f3ae913f to your computer and use it in GitHub Desktop.
amsmath.sty + pdfx.styで\hat{\hat{f}}等がエラーになる問題へのpatch(いきおい)
--- /usr/local/texlive/2019/texmf-dist/tex/latex/pdfx/pdfx.sty 2019-03-12 07:01:25.000000000 +0900
+++ ./pdfx.sty 2019-05-07 11:15:38.000000000 +0900
@@ -31,7 +31,7 @@
}{}%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pdfx}
- [2019/02/27 v1.6.3 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
+ [2019/05/07 v1.6.3.1-test PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
\newif\ifpdfx@noBOM \pdfx@noBOMfalse % use a BOM in the XMP packet
\newif\ifpdfx@x \pdfx@xfalse % PDF/X mode
@@ -2474,6 +2474,29 @@
\spacefactor\accent@spacefactor
}
%% same for named accents in math-mode
+\@ifpackageloaded{amsmath}{%
+ \def\pdfx@macc@a#1#2{%
+ \begingroup
+ \let\macc@style#1\relax
+ \def\macc@palette##1{##1\macc@style}%
+ \advance\macc@depth\m@ne
+ \ifnum\macc@depth=\z@
+ \gdef\macc@nucleus{\phantom{#2}}%
+ \setbox\z@\hbox{$#1#2\@empty{}\macc@skewchar$}%
+ \setbox\tw@\hbox{$#1#2\@empty\macc@skewchar$}%
+ \dimen@\tw@\wd\tw@ \advance\dimen@-\tw@\wd\z@
+ \xdef\macc@kerna{\the\dimen@\relax}%
+ \setbox4\hbox{$#1#2\acc@check\@empty$}%
+ \global\setbox\@ne\hbox to\wd4{}%
+ \ht\@ne\ht4 \dp\@ne\dp4
+ \xdef\macc@kernb{\the\wd4\relax}%
+ \mathaccent\macc@code{\box\@ne\kern\macc@kerna}%
+ \else
+ \mathaccent\macc@code{\let\macc@adjust\@empty #1#2\@empty}%
+ \macc@adjust
+ \fi
+ \endgroup
+ }}\relax
\def\pdfx@mathaccentV#1#2#3#4#5{%
#5{\mathsurround=\z@\relax
\everymath{}%
@@ -2483,12 +2506,13 @@
{\setbox\z@\hbox{$\scriptstyle #5$}\kern-\wd\z@}%
{\setbox\z@\hbox{$\scriptscriptstyle #5$}\kern-\wd\z@}%
}%
- \AMS@mathaccentV{#1}{#2}{#3}{#4}{\phantom{#5}}%
+ \AMS@mathaccentV{#1}{#2}{#3}{#4}{#5}%
}
\AtBeginDocument{%
\@ifpackageloaded{amsmath}{%
\let\AMS@mathaccentV\mathaccentV
- \let\mathaccentV\pdfx@mathaccentV}%
+ \let\mathaccentV\pdfx@mathaccentV
+ \let\macc@a\pdfx@macc@a}%
}%
%% How to support XeTeX here ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment