![偶数页和奇数页的 Mathstyle 结构](https://linux22.com/image/384862/%E5%81%B6%E6%95%B0%E9%A1%B5%E5%92%8C%E5%A5%87%E6%95%B0%E9%A1%B5%E7%9A%84%20Mathstyle%20%E7%BB%93%E6%9E%84.png)
我想要以下结构:
ifoddpage\everydisplay{\color{blue}
ifevenpage\everydisplay{\color{red}}
我执行了以下命令:
\newcommand{\ctt}{\checkoddpage
\ifoddpage\everydisplay{\color{blue}}
\else\everydisplay{\color{red}}
\fi}
此结构无法正常工作。我使用xelatex
编译器。
我该怎么做?
这是我的代码:
\documentclass[twoside]{book}
\usepackage{xcolor}
\usepackage{everysel}
\usepackage{mathtools}
\usepackage{changepage}
\newcommand{\ctt}{\checkoddpage
\ifoddpage\everydisplay{\color{blue}}
\else\everydisplay{\color{red}}
\fi}\ctt
\begin{document}
\[a^2=b^2+c^2\]
text\newpage%\ctt
\[a^3=b^3+c^3\]
\end{document}
答案1
我会直接把支票转入\everydisplay
\documentclass[twoside]{book}
\usepackage{xcolor}
\usepackage{changepage}
\newcommand*{\ctt}{\checkoddpage\ifoddpage\color{blue}\else\color{red}\fi}
\everydisplay\expandafter{\the\everydisplay\ctt}
\begin{document}
Bla bla
\[a^2=b^2+c^2\] % will be blue
text
\newpage
Bla bla
\[a^2=b^2+c^2\] % will be red
text
\newpage
Bla bla
\[a^2=b^2+c^2\] % will be blue
text
\newpage
\renewcommand*{\ctt}{\relax}% revert to do nothing
Bla bla
\[a^2=b^2+c^2\] % will be black
text
\end{document}