\documentclass[a4paper, twoside, 12pt]{book}
\usepackage{ctex}
\renewcommand
\baselinestretch{1.41}
\usepackage{amsmath, amsthm, amssymb, amscd}
\usepackage{makecell,booktabs}
\usepackage{float}
\usepackage{mathrsfs}
\usepackage{latexsym}
\usepackage{setspace}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{tocbibind}
\usepackage{fancyhdr}
\allowdisplaybreaks
\newtheorem{theorem}{\indent 定理}[section]
\newtheorem{corollary}[theorem]{\indent 推论}
\newtheorem{lemma}[theorem]{\indent 引理}
\newtheorem{proposition}[theorem]{\indent 命题}
\newtheorem{nature}[theorem]{\indent 性质}
\newtheorem{definition}[theorem]{\indent 定义}
\newtheorem{remark}[theorem]{\indent 注记}
\newtheorem{example}[theorem]{\indent 例}
\newcommand{\headingstobeshown}{}
\newcommand{\cndash}{\rule{0.2em}{0pt}\rule[0.35em]{1.6em}{0.05em}\rule{0.2em}{0pt}}
\renewcommand{\proofname}{\bf{\indent 证明}}
\numberwithin{equation}{section} %公式编号与章节关联
\topmargin=0.5cm
\oddsidemargin=20pt
\evensidemargin=0pt
\textwidth=15.1cm
\textheight=22.5cm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%加入如下命令后报错
\makeatletter
\def\ps@headings{%
\def\@oddfoot{\hfill\thepage\hfill}
\def\@evenfoot{\hfill\thepage\hfill}
\def\@evenhead{\pushziti\thepage\hfil\slshape\leftmark\popziti}% !!!
\def\@oddhead{\pushziti{\slshape\rightmark}\hfil\thepage\popziti}% !!!
\let\@mkboth\markboth
\def\chaptermark##1{%
\markboth {% !!!
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\chaptername \ \ % !!!
\fi
\fi
##1}{}}% !!!
\def\sectionmark##1{%
\markright {% !!!
\ifnum \c@secnumdepth >\z@
\sectionname \ \ % !!!
\fi
##1}}}% !!!
\ps@headings
\renewcommand{\@oddhead}{\pushziti{\protect\footnotesize{%
\begin{minipage}{\textwidth}
{\heiti \hfill \ziju{0.5} 家里蹲大学学位论文
\hfill} \\
\begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}r@{}}%
{\kaishu \leftmark} & { \kaishu \rightmark}
\\ \hline \hline\vspace{2pt}
\end{tabular*}
\end{minipage}
}}\popziti}
\renewcommand{\@evenhead}{\@oddhead}
\makeatletter
\@addtoreset{equation}{section}
\makeatother
%%%%%%%%%%%%%%%%加入上述命令后报错
\begin{document}
你好!家里蹲大学 aaaabbbbb
\end{document}
把 \pushziti
和 \popziti
替换为空吧.
\documentclass[a4paper, twoside, 12pt]{book}
\usepackage{ctex}
\renewcommand
\baselinestretch{1.41}
\usepackage{amsmath, amsthm, amssymb, amscd}
\usepackage{makecell,booktabs}
\usepackage{float}
\usepackage{mathrsfs}
\usepackage{latexsym}
\usepackage{setspace}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{tocbibind}
\usepackage{fancyhdr}
\allowdisplaybreaks
\newtheorem{theorem}{\indent 定理}[section]
\newtheorem{corollary}[theorem]{\indent 推论}
\newtheorem{lemma}[theorem]{\indent 引理}
\newtheorem{proposition}[theorem]{\indent 命题}
\newtheorem{nature}[theorem]{\indent 性质}
\newtheorem{definition}[theorem]{\indent 定义}
\newtheorem{remark}[theorem]{\indent 注记}
\newtheorem{example}[theorem]{\indent 例}
\newcommand{\headingstobeshown}{}
\newcommand{\cndash}{\rule{0.2em}{0pt}\rule[0.35em]{1.6em}{0.05em}\rule{0.2em}{0pt}}
\renewcommand{\proofname}{\bf{\indent 证明}}
\numberwithin{equation}{section} %公式编号与章节关联
\topmargin=0.5cm
\oddsidemargin=20pt
\evensidemargin=0pt
\textwidth=15.1cm
\textheight=22.5cm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%加入如下命令后报错
\makeatletter
\def\ps@headings{%
\def\@oddfoot{\hfill\thepage\hfill}
\def\@evenfoot{\hfill\thepage\hfill}
\def\@evenhead{\thepage\hfil\slshape\leftmark}% !!!
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}% !!!
\let\@mkboth\markboth
\def\chaptermark##1{%
\markboth {% !!!
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\chaptername \ \ % !!!
\fi
\fi
##1}{}}% !!!
\def\sectionmark##1{%
\markright {% !!!
\ifnum \c@secnumdepth >\z@
\sectionname \ \ % !!!
\fi
##1}}}% !!!
\ps@headings
\renewcommand{\@oddhead}{{\protect\footnotesize{%
\begin{minipage}{\textwidth}
{\heiti \hfill \ziju{0.5} 家里蹲大学学位论文
\hfill} \\
\begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}r@{}}%
{\kaishu \leftmark} & { \kaishu \rightmark}
\\ \hline \hline\vspace{2pt}
\end{tabular*}
\end{minipage}
}}}
\renewcommand{\@evenhead}{\@oddhead}
\makeatletter
\@addtoreset{equation}{section}
\makeatother
%%%%%%%%%%%%%%%%加入上述命令后报错
\begin{document}
你好!家里蹲大学 aaaabbbbb
\end{document}
感谢感谢!你们真的太好了!!!!