20 ctex下cctbook 转texlive 的问题

发布于 2024-08-19 19:44:26
\documentclass[a4paper, twoside, 12pt]{book} 
\usepackage{ctex}
\renewcommand
\baselinestretch{1.41} 
\usepackage{ccmap}%这个包在texlive中会报错
\usepackage{amsmath, amsthm, amssymb, amscd}
\usepackage{makecell,booktabs} 
\usepackage{float} 
\usepackage{mathrsfs}
\usepackage{latexsym}
\usepackage{setspace}
\usepackage{headrule}%这个包在texlive中会报错
\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 证明}}
\renewcommand\subsectionformat{}%添加这个命令在texlive中会报错
\renewcommand\sectionformat{}%添加这个命令在texlive中会报错
\def\Box{\hfill\square}

%%%%%%%%%%%%%%%%%%%
\numberwithin{equation}{section} 
\topmargin=0.5cm
\oddsidemargin=20pt 
\evensidemargin=0pt 
\textwidth=15.1cm
\textheight=22.5cm
%%%%%%%%%%%%%%%%%
\makeatletter 
\numberwithin{equation}{section} 
\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  
\renewcommand\contentsname{目 \ 录}
\renewcommand\bibname{参考文献}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  摘要 %%%%%%%%%%%%%%%    
    \newpage\pagenumbering{Roman}\thispagestyle{plain}\chapter*{摘 \ 要}
    \addcontentsline{toc}{chapter}{摘 \ \ \ \ 要} 
    在第一章中, 我们主要阐述本文所讨论问题的背景及研究现状, 并简要介绍本文的主要工作以及相关的预备知识和一些记号.
    
    \bigskip
    
    \textbf{\zihao{4}\textbf{关键词}:}  临界指数;\ Lusternik-Schnirelman定理.
    
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End of 摘要 %%%%%%%%%%%%%%%
\thispagestyle{plain}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The Abstract of Thesis %%%
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{\large Abstract}
In this thesis, 

\bigskip

\textbf{\zihao{4}\textbf{Keywords}:}   Lusternik-Schnirelman theory.

\newpage
\thispagestyle{plain}

\tableofcontents

\newpage

\pagenumbering{arabic} \setcounter{page}{1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 引言 %%%%%%%%%%%%%
\chapter{引 言}\renewcommand\headingstobeshown{ 引 \ 言}

本章介绍了与本文所研究课题相关的背景知识, 发展概况以及我们所做的主要工作.
\section{问题的背景及研究现状} %%使用\section命令会报错

\chapter{第一章}

\section{问题的背景及研究现状} %%使用\section命令会报错

\begin{thebibliography}{199}
\bibitem{ass} AAAA

\end{thebibliography}
%%%%%%%%%%%致谢
\newpage\thispagestyle{empty}\chapter*{\zihao{2} 致 \ \ \ 谢}
\addcontentsline{toc}{chapter}{致\ \ \ \ \ 谢}\bigskip

aaa
\chapter*{攻读XX学位期间发表的学术论文}
\addcontentsline{toc}{chapter}{攻读XX学位期间发表的学术论文}
\begin{enumerate}

\vskip 20pt

{\zihao{4}}

\item 1

\vskip 15pt

\item 2

\vskip 15pt

\item 3

\end{enumerate}

\end{document}

将上述出问题的命令注释后texlive能运行,但是和ctex的不一样。比较如下
微信图片_20240819220138.png
微信图片_20240819220159.png
微信图片_20240819220233.png
微信图片_20240819220241.png
微信图片_20240819220247.png

查看更多

关注者
0
被浏览
736
2 个回答
LaTeXer
LaTeXer 2024-08-19
这家伙很懒,什么也没写!

实际最早的 ctexbook 继承了 cctbook 的特性,现在,ctexbook 已经大大优化了很多内容,完全和以前的对照比较困难,除非回退版本,不过,一点点对照,回退到 cctbook 的样式,需要点功夫。

Sagittarius Rover
Sagittarius Rover 2025-02-28
我要成为Typst糕手/(ㄒoㄒ)/~~

时隔半年,我尝试了一下...

其实对于大致了解texlive基本语法的用户,从上面的代码微调到texlive支持的样式并不难,但是对于初学者来说,很难分辨如何修改回退。此外你的截图中的需求有一些不合理之处,比如不应该用章节目录来和TOC的对齐情况相比较:

我修改了CCT一些奇怪的设置,在TEXLIVE下一个可行的例子是:

\documentclass[a4paper,twoside,12pt]{ctexbook} 
\renewcommand\baselinestretch{1.414} 
\usepackage{amsmath, amsthm, amssymb, amscd}
\usepackage{makecell,booktabs} 
% \usepackage{float}
\usepackage{mathrsfs}
% \usepackage{latexsym}
\usepackage{setspace}
% \usepackage{makeidx}
\usepackage{graphicx}
\usepackage{enumitem}
\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{\cndash}{\rule{0.2em}{0pt}\rule[0.35em]{1.6em}{0.05em}\rule{0.2em}{0pt}}
\renewcommand{\proofname}{\bf{\indent 证明}}
\def\Box{\hfill\square}

%%%%%%%%%%%%%%%%%%%
\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}}}%                             !!!
\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  
\renewcommand\contentsname{目 \ 录}
\renewcommand\bibname{参考文献}

\begin{document}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  摘要 %%%%%%%%%%%%%%%    
% \newpage
\pagenumbering{Roman}\thispagestyle{plain}
\chapter*{摘 \ 要}
\addcontentsline{toc}{chapter}{摘 \ \ \ \ 要} 
在第一章中, 我们主要阐述本文所讨论问题的背景及研究现状, 并简要介绍本文的主要工作以及相关的预备知识和一些记号.

\bigskip

\textbf{\zihao{4}\textbf{关键词}:}  临界指数;\ Lusternik-Schnirelman定理.
    
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End of 摘要 %%%%%%%%%%%%%%%
\thispagestyle{plain}%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The Abstract of Thesis %%%
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{\large Abstract}
In this thesis, we want to introduce that...

\bigskip

\textbf{\zihao{4}\textbf{Keywords}:}   Lusternik-Schnirelman theory.

\newpage
\thispagestyle{plain}

\tableofcontents

\newpage

\pagenumbering{arabic} 
\setcounter{page}{1}
\chapter{引 言}

本章介绍了与本文所研究课题相关的背景知识, 发展概况以及我们所做的主要工作. 本章介绍了与本文所研究课题相关的背景知识, 发展概况以及我们所做的主要工作.

\section{问题的背景及研究现状} 

\chapter{第一章}

\section{问题的背景及研究现状}

\begin{thebibliography}{99}
\bibitem{ass} AAAA
\bibitem{bss} BBBB
\end{thebibliography}
% %%%%%%%%%%%致谢
\newpage\thispagestyle{empty}\chapter*{\zihao{2} 致 \ \ \ 谢}
\addcontentsline{toc}{chapter}{致\ \ \ \ \ 谢}\bigskip

aaa这里是致谢...
\chapter*{攻读XX学位期间发表的学术论文}
\addcontentsline{toc}{chapter}{攻读XX学位期间发表的学术论文}\vskip 20pt
\begingroup\zihao{4}
\begin{enumerate}[itemsep=15pt]%
    \item 1
    \item 2
    \item 3
\end{enumerate}
\endgroup
\end{document}

image.png

image.png

image.png

image.png

务必要有熟练使用TeXLive语法的功能的能力,才能比较好的用好这种转换,不然很容易一步一卡,非常打击自信心。同时也建议,如非必要,不要使用基于CTeX套装的古早模板。

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览