鱼香肉丝没有鱼先生
鱼香肉丝没有鱼先生
鱼香肉丝没有鱼先生.

注册于 3年前

回答
102
文章
1
关注者
8

\item[二、多项选择题:] 本题共 3 小题,每小题 6 分,共 18 分. 在每小题给出的选项中,有多项符合题目要求. 全部选对的得 6 分,部分选对的得部分分,有选错的得 0 分.

改成

\item[] 二、多项选择题:本题共 3 小题,每小题 6 分,共 18 分. 在每小题给出的选项中,有多项符合题目要求. 全部选对的得 6 分,部分选对的得部分分,有选错的得 0 分.

代码有三处问题,

  • 缺字体 mathsymbol-zh-cn.otf, 可以下载该字体到文件夹内,也可以选择将 mathsymbolzhcn.sty 中第 8 行
\newfontfamily\unicodefont{mathsymbol-zh-cn.otf}

更改为

\let\unicodefont\relax

推荐前者.

  • ZKSJ.cls 中所有的 pre label=, 全部删掉或者更改为 pre label={}, 如下图

image.png

  • 2024_武珞路_有理数02.tex 中第 267 行多了个 & 符号,这是你自己的低级错误.

image.png

另外多一句嘴,为什么不用 exam-zh 呢?

去掉

texcl = true
\documentclass[a4paper]{article} %确定是A4纸格式
\usepackage{geometry}
\geometry{a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
%页边距左、右、上、下
\usepackage[UTF8,heading=true]{ctex}  %导入中文包

%%%%%%%%页眉页脚的处理%%%%%%%%%%%%
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt} % 移除页眉横线
\renewcommand{\footrulewidth}{0pt} % 移除页脚横线
\lfoot{}%这条语句可以让页码出现在下方
%%%%%%%%页眉页脚的处理%%%%%%%%%%%%

\usepackage{abstract} %导入摘要页
\renewcommand{\abstractname}{\bf\songti\zihao{4} 摘\hspace{1cm}要}%设置“摘要”两字的大小与间距
\setlength{\absleftindent} {1pt} %摘要的右缩进
\setlength{\absrightindent}{1pt} %摘要的左缩进

%调用数学公式包
\usepackage{amssymb}
\usepackage{amsmath}


\usepackage{listings}%用于设置插入附录的代码
\usepackage[dvipsnames]{xcolor} % 更全的色系
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% listings设置
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lstset{
    language = Matlab,
    backgroundcolor = \color{gray!10}, % 背景色:灰色
    basicstyle = \normalsize\ttfamily, % 基本样式 + 小号字体
    rulesepcolor= \color{blue!30}, % 代码块边框颜色
    breaklines = true, % 代码过长则换行
    flexiblecolumns,
    numbers = left, % 行号在左侧显示
    numberstyle = \small, % 行号字体
    keywordstyle = \color{blue}, % 关键字颜色
    commentstyle =\color{black!40!green}, % 注释颜色
    stringstyle = \color{red!100}, % 字符串颜色
    frame = shadowbox,  % 用(带影子效果)方框框住代码块
    showspaces = false, % 不显示空格
    columns = fixed, % 字间距固定
    % texcl=true,
    escapeinside=``,
}


%改变公式大小但不改变公式标号大小的设置%
\makeatletter
\renewcommand{\maketag@@@}[1]{\hbox{\m@th\normalsize\normalfont#1}}%
\makeatother
%改变公式大小但不改变公式标号大小的设置%

%自定义标题设置
%正文部分是小四,一级标题是三号,二级标题是小三,三级标题是四号
\ctexset{
    section = {
        format = \centering\bf\songti\zihao{3}, % 设置一级标题的字体格式
        name = {}, % 通常章节标题前不需要标点
        number = \chinese{section}, % 中文编号
        aftername = 、, % 章节标题后通常使用点号
    },
    subsection = {
        format = \bf\songti\zihao{4}, % 设置二级标题的字体格式
        name = {}, 
        aftername = 、,
    },
    subsubsection = {
        format = \bf\songti\zihao{-4}, % 设置三级标题的字体格式
        aftername = 、, 
    }
}
\fancyhead{} % 清除所有页眉内容

\usepackage{enumitem} 

%.svg图片
\usepackage{svg}

%表格调整
\usepackage{tabularx}

%表格加粗
\usepackage{booktabs}

%设置表格间距
\usepackage{caption}

%允许表格长跨页
\usepackage{longtable}

%调用浮动包
\usepackage{float}
\usepackage{subfig}

%调用表格
\usepackage{multirow}

\captionsetup[table]{labelsep=space} %去除表格标题的冒号

\usepackage{times}

\usepackage{graphicx}
\graphicspath{{figures/}} %图片在当前目录下的figures目录

\linespread{1.25} %行间距
\usepackage{multirow} % 用于合并行
\begin{document}
\begin{lstlisting}[language = Matlab]
clc;
close all;
clear;

load('Position_Longshen.mat')
load('Position_Longtou.mat')
load('Position_Longtou_Hou.mat')
load('data.mat')
%Position = [Position_Longtou;Position_Longtou_Hou;Position_Longshen];
Position = data;
% plot(Position(1:2:end,end),Position(2:2:end,end),'g');
% axis equal;
% hold on;

%求矩形的左下点
syms x1 y1 x2 y2;
Qian_Point = zeros(420,2);

for i = 1:420
% 定义方程
eq1 = (Position(1,i)-x1)^2 + (Position(2,i)-y1)^2 == 0.275^2 + 0.15^2;
eq2 = (Position(3,i)-x1)^2 + (Position(4,i)-y1)^2 == (3.41-0.275)^2 + 0.15^2;
eq3 = (Position(1,i)-x2)^2 + (Position(2,i)-y2)^2 == (3.41-0.275)^2 + 0.15^2;
eq4 = (Position(3,i)-x2)^2 + (Position(4,i)-y2)^2 == 0.275^2 + 0.15^2;
% 求解方程
sol1 = solve([eq1, eq2], [x1,y1]);
sol2 = solve([eq3,eq4], [x2,y2]);

x_decimal1 = double(sol1.x1);
y_decimal1 = double(sol1.y1);
x_decimal2 = double(sol2.x2);
y_decimal2 = double(sol2.y2);

vertices = [x_decimal1(2), y_decimal1(2);
x_decimal1(1), y_decimal1(1);
x_decimal2(1), y_decimal2(1);
x_decimal2(2), y_decimal2(2)];
Qian_Point(i,1) = x_decimal1(2);
Qian_Point(i,2) = y_decimal1(2);
% fill(vertices(:,1), vertices(:,2), 'r');
end
plot(Qian_Point(1:420,1)',Qian_Point(1:420,2)','g')
axis equal;

\end{lstlisting}
\end{document}

经测试,为宏包 bug.
可以向作者提 issue.
以下是临时解决办法.
在导言区加入

\usepackage{xpatch}
\ExplSyntaxOn
  \patchcmd\__circledtext_calc_char_box_size:{\dim_gset_eq:NN \charboxwd}{\dim_set_eq:NN \charboxwd}{}{}
  \patchcmd\__circledtext_calc_char_box_size:{\dim_gset_eq:NN \charboxht}{\dim_set_eq:NN \charboxht}{}{}
\ExplSyntaxOff

image.png

你应该见过类似如下的写法吧.

\includegraphics[width = 0.5\textwidth]{example.png}

0.5\textwidth???, 你加个 * 意欲何为?, 不要有太多的自以为.

既然使用了 ctex,建议读一下 ctex 包手册,使用其接口

\ctexset{
  section = {
    name = {,},
    number = \chinese{section}
  }
}

MWE


\documentclass{article}
\usepackage[UTF8, heading=true]{ctex}
\usepackage{lipsum, zhlipsum}

% ---------- 示例区域(导言区) ---------- %
% \renewcommand{\thesection}{\chinese{section}}
\usepackage{amsmath} %\numberwithin
\usepackage{graphicx}
\usepackage{float} %option H
\numberwithin{figure}{section}
% ======================================== %


\ctexset{
  section = {
    name = {,},
    number = \chinese{section}
  }
}

\begin{document}

\tableofcontents
\listoffigures

\section{占位}

hallo LaTeX

% ---------- 示例区域(正文) ---------- %

\section{图片在这一章}

\begin{figure}[H]
  \caption{示例图片1}%\label{}
\end{figure}

% ======================================== %

\end{document} 

image.png

\begin{filecontents*}[overwrite]{myclass.cls}
\ProvidesClass{myclass}

\LoadClass{article}

\RequirePackage[margin = 2cm]{geometry}

\newif\if@classname@option@i 
\newif\if@classname@option@ii 

\DeclareOption{option-i}{
  \@classname@option@itrue
}

\DeclareOption{option-ii}{
  \@classname@option@iitrue
}

\ProcessOptions*\relax


\if@classname@option@i%
  \def\cmd{Y}%
\else%
  \if@classname@option@ii%
    \def\cmd{Y}%
  \else
    \def\cmd{N}%
  \fi
\fi


\end{filecontents*}

\documentclass{myclass}
% \documentclass[option-i]{myclass}
% \documentclass[option-ii]{myclass}

\begin{document}
\cmd
\end{document}

扩展问题,可以看看 expl3, 会方便很多.

可以在导言区加上

\usepackage[T1]{fontenc}

指定一下编码.

提问需要提供完整 MWE,

代码有两个问题.

  1. \cite 缺少必选参数?, 依稀记得应该用 \cite{} 而不是 \cite[] ?
  2. .bib 文件中有 LaTeX 命令 或者 数学公式 的话需要用 {} 包裹起来.

以下是修复后的 MWE

\documentclass{article}

\begin{filecontents*}[overwrite]{ref.bib}
@incollection{Branden_RZ,
  AUTHOR = {Br{\"a}nd{\'e}n, Petter},
  TITLE = {Unimodality, log-concavity, real-rootedness and beyond},
  BOOKTITLE = {Handbook of enumerative combinatorics},
  SERIES = {Discrete Math. Appl. (Boca Raton)},
  PAGES = {437--483},
  PUBLISHER = {CRC Press, Boca Raton, FL},
  YEAR = {2015},
  MRCLASS = {05Axx (05D40 05E10)},
  MRNUMBER = {3409348},
}
\end{filecontents*}

\begin{document}

\cite{Branden_RZ}
\bibliographystyle{alpha}
\bibliography{ref}

\end{document}

\bigintcalcMul 用于计算两个数的乘积, 既然使用了 LaTeX3 那么就可以直接使用 \int_eval:n { #1*##1} 替代, 如果你的 latex 发行版高于 2022, 你可以直接使用 \inteval{#1 * ##1}.

\documentclass{standalone}
\begin{document}
\ExplSyntaxOn
\begin{tabular}{*{9}{l}}
  \int_step_inline:nn {9}{
    \int_step_inline:nn {#1}{
    $ ##1 \times  #1 = \int_eval:n {#1 * ##1}$ 
    \int_compare:nNnF {##1} = {9}{ & }
    }\\
    }
\end{tabular}
\ExplSyntaxOff
\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}

暂时没有找到原因, 可能需要读源码, 一种解决方案是

% 没有可选参数的 ceshi 环境
\begin{ceshi}[series = AAA]
    \item 这是一
    \item 这是二
    \item 这是三
\end{ceshi}

% 使用可选参数 resume 的 ceshi 环境
\begin{ceshi}[resume = AAA]
    \item 这
\end{ceshi}

补充一下答案,resume 失效的原因是

\begin{ceshi}
...
\end{ceshi}

加了一层 group,导致 resume 无法更新.

解决方案是

\NewDocumentEnvironment{ceshi}{O{} +b}{
  \enumerate[#1]
        #2
  \endenumerate
}{}

还需弥补丢失的 hook

\NewDocumentEnvironment{ceshi}{O{} +b}{%
  \UseHook{env/enumerate/before}%
  \UseHook{env/enumerate/begin}%
  \enumerate[#1]%
        #2
  \endenumerate%
  \UseHook{env/enumerate/end}%
  \UseHook{env/enumerate/after}%
}{}

关于第二点我做一个补充, 可以定义一个命令 \viewcoordinate 用于 Debug:

\makeatletter
\def\viewcoordinate(#1);{%
  \message{=================== Coordinate Debug Start ==================== ^^J^^J}
  \foreach \coor@dinate in {#1} {
    \path (\coor@dinate);
    \message{The coordinate `\coor@dinate' at (\the\pgf@x, \the\pgf@y)^^J^^J}
  }
  \message{=================== Coordinate Debug End ======================= ^^J^^J}
}
\makeatother

使用方法如下 \viewcoordinate(<coordinate comma list>);

\viewcoordinate(a, c, b, d);

mwe 如下

\documentclass{article}
\usepackage{tikz}

\usetikzlibrary{intersections}


\makeatletter
\def\viewcoordinate(#1);{%
  \message{=================== Coordinate Debug Start ==================== ^^J^^J}
  \foreach \coor@dinate in {#1} {
    \path (\coor@dinate);
    \message{The coordinate `\coor@dinate' at (\the\pgf@x, \the\pgf@y)^^J^^J}
  }
  \message{=================== Coordinate Debug End ======================= ^^J^^J}
}
\makeatother

\begin{document}

\begin{tikzpicture}
  % coordinate and node
  \coordinate (a) at (4,0);
  \coordinate (b) at (3.2,0);
  \coordinate (c) at (20pt,0);
  \node (d) at (2pt, 1cm) {d};
  \viewcoordinate(a, c, b, d);

  % intersections
  \draw[red, name path = circle] (0,0) circle (1cm);
  \draw[blue, name path = line] (-1.5, -.3) -- (2.3, 1.5);
  \path[name intersections = {of = circle and line, name = intersections}];

  \viewcoordinate(intersections-1, intersections-2);
\end{tikzpicture}

\end{document}

这会在你的日志文件中输出

=================== Coordinate Debug Start ==================== 

The coordinate `a' at (113.81097pt, 0.0pt)

The coordinate `c' at (20.0pt, 0.0pt)

The coordinate `b' at (91.04869pt, 0.0pt)

The coordinate `d' at (2.0pt, 28.45274pt)

=================== Coordinate Debug End ====================== 

=================== Coordinate Debug Start ==================== 

The coordinate `intersections-1' at (19.34659pt, 20.83994pt)

The coordinate `intersections-2' at (-28.39893pt, -1.7654pt)

=================== Coordinate Debug End ====================== 

参考 Tabularray with footnotes

\documentclass{article}
\usepackage[a4paper]{geometry}

\usepackage{tabularray}
\UseTblrLibrary{counter}
\UseTblrLibrary{functional}

\makeatletter
\IgnoreSpacesOn
\tlNew \gFootNoteTl
\intNew \gFootNoteInt
\prgNewFunction \footNote {m}
  {
    \tlPutRight \gFootNoteTl
      {
        \stepcounter{footnote}
        \footnotetext{#1}
      }
    \prgReturn {\footnotemark{}}
  }
\AddToHook{env/tblr/before}{
  \intSetEq \gFootNoteInt \c@footnote
  \tlClear \gFootNoteTl
}
\AddToHook{env/tblr/after}{
  \intSetEq \c@footnote \gFootNoteInt
  \tlUse \gFootNoteTl
}
\IgnoreSpacesOff
\makeatother

\begin{document}

Some note\footnote{some note} before.

\bigskip

\begin{tblr}[evaluate=\footNote]{colspec={ll},hlines}
a line & a text\footNote{with a note} in the middle\\
another line & another text\footNote{with another note} in the middle
\end{tblr}

\bigskip

\begin{tblr}[evaluate=\footNote]{colspec={ll},hlines}
a line & a text\footNote{with a note} in the middle\\
another line & another text\footNote{with another note} in the middle
\end{tblr}

\bigskip

Another note\footnote{another note} after.

\end{document}

image.png

需要使用

\usepackage{footnote}
\BeforeBeginEnvironment{tcolorbox}{\savenotes}
\AfterEndEnvironment{tcolorbox}{\endsavenotes}
\documentclass{book}

\usepackage{ctex}
\usepackage{tcolorbox}
\usepackage{footnote}
\BeforeBeginEnvironment{tcolorbox}{\savenotes}
\AfterEndEnvironment{tcolorbox}{\endsavenotes}
\begin{document}

浔阳江头夜送客,枫叶荻花秋瑟瑟footnote{注一}。
主人下马客在船,举酒欲饮无管弦。
醉不成欢惨将别,别时茫茫江浸月。

\begin{tcolorbox}

忽闻水上琵琶声,主人忘归客不发\footnote{注二}。
\end{tcolorbox}

\end{document}

image.png

发布
问题