原始回复
你的MWE在我这里(TeXLive2025+windows11)没有任何警告出现。
猜测你的\documentclass
和\usepackage{tabularray}
之间有其他对\geometry
的设置(?)。
表格宽度太小,怎么加大表格宽度
你的代码里的Q[c,5cm]
正是使用Q
列格式控制宽度的方法
更新TL2024的情况
在TeXPage里使用TL2024
+xelatex
确实可以复现你的警告(我猜是TL2025 tblr更新了什么....):
你的MWE在我这里(TeXLive2025+windows11)没有任何警告出现。
猜测你的\documentclass
和\usepackage{tabularray}
之间有其他对\geometry
的设置(?)。
表格宽度太小,怎么加大表格宽度
你的代码里的Q[c,5cm]
正是使用Q
列格式控制宽度的方法
在TeXPage里使用TL2024
+xelatex
确实可以复现你的警告(我猜是TL2025 tblr更新了什么....):
S老师指出参考链接,你看了吗,付诸实践了吗?
用\setlength
改\abovedisplayskip
和\belowdisplayskip
如果你的实践有效,你应该自答。如果你的实践无效,那你应该补充上你的尝试。
使用
\texttt{\the\abovedisplayskip}
\texttt{\the\belowdisplayskip}
可以获知其默认值为:
\documentclass[12pt]{ctexart}
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage{enumitem}
\begin{document}
\setlength\abovedisplayskip{2pt plus 1pt minus 1pt}
\setlength\belowdisplayskip{2pt plus 1pt minus 1pt}
% \setlength{\abovedisplayshortskip}{0pt plus 1pt minus 1pt}
% \setlength{\belowdisplayshortskip}{0pt plus 1pt minus 1pt}
The skip \texttt{\char92 abovedisplayskip} is \texttt{\the\abovedisplayskip}
The skip \texttt{\char92 belowdisplayskip} is \texttt{\the\belowdisplayskip}
二阶常系数齐次线性方程的形式为:$y^{\prime \prime}+p y^{\prime}+q y=0$,其中$p, q$为常数,其特征方程为$\lambda^{2}+p \lambda+q=0$.
方程的通解为:
(1)特征方程有两个相异的实根$\lambda_{1}$,$\lambda_{2}$时,通解形式为
\[
y(x)=C_{1} \mathrm{e}^{\lambda_{1} x}+C_{2} \mathrm{e}^{\lambda_{2} x}.
\]
(2)特征方程有两个相同的实根$\lambda_{1}=\lambda_{2}$时,通解形式为
\[
y(x)=\left(C_{1}+C_{2} x\right) \mathrm{e}^{\lambda_{2} x}.
\]
(3)特征方程有一对共轭复根$\alpha \pm \beta \mathrm{i}$时,通解形式为
\[
y(x)=\mathrm{e}^{\alpha x}\left(C_{1} \cos \beta x+C_{2} \sin \beta x\right).
\]
我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体
\textbf{永远不要自己编号},请用\texttt{enumerate}环境
\begin{enumerate}[label=(\arabic*),itemsep=0pt,parsep=0pt]
\item 特征方程有两个相异的实根$\lambda_{1}$,$\lambda_{2}$时,通解形式为:
\[
y(x)=C_{1} \mathrm{e}^{\lambda_{1} x}+C_{2} \mathrm{e}^{\lambda_{2} x}.
\]
\item 特征方程有两个相同的实根$\lambda_{1}=\lambda_{2}$时,通解形式为
\[
y(x)=\left(C_{1}+C_{2} x\right) \mathrm{e}^{\lambda_{2} x}.
\]
\item 特征方程有一对共轭复根$\alpha \pm \beta \mathrm{i}$时,通解形式为
\[
y(x)=\mathrm{e}^{\alpha x}\left(C_{1} \cos \beta x+C_{2} \sin \beta x\right).
\]
\end{enumerate}
\end{document}
nxuthesis.cls
属于未知全貌的状态nxuthesis
原生为使用bibtex
基于nxuthesis-numeric
的方案可见nxusetup.tex
:
% Line 144~147
% 参考文献使用 BibTeX + natbib 宏包
% 顺序编码制
\usepackage[sort]{natbib}
\bibliographystyle{nxuthesis-numeric}
其中的nxuthesis-numeric.bst
按照其自述为:
%% The original source files were:
%%
%% gbt7714.dtx (with options: `2015,thu,numerical')
%% -------------------------------------------------------------------
%% GB/T 7714 BibTeX Style
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2024/03/08 v2.1.6
%%
我不知道有没有魔改自zepinglee的Version: 2024/03/08 v2.1.6
biblatex-gbt7714-2015
完全符合贵校的要求,请自行甄别请先texdoc biblatex-gbt7714-2015
查看文档信息
可以发现存在\setcounter{gbrefcompress}{3}
修改压缩计数器的方案,但我们需要switch from bibtex
to biblatex
(作者在nxusetup.tex
内选择保留bibtex
而注释biblatex
是有考量的,这样做只是workaround,而且不能保证稳定性):
将nxusetup.tex
的内容修改为:
% %%nxusetup.tex Line144~162 switch from `bibtex` to `biblatex`
% 参考文献使用 BibTeX + natbib 宏包
% 顺序编码制
% \usepackage[sort]{natbib}
% \bibliographystyle{nxuthesis-numeric}
% 著者-出版年制
% \usepackage{natbib}
% \bibliographystyle{nxuthesis-author-year}
% 参考文献使用 BibLaTeX 宏包
% \usepackage[style=nxuthesis-numeric]{biblatex}
% \usepackage[style=nxuthesis-author-year]{biblatex}
\usepackage[style=gb7714-2015]{biblatex}
% \usepackage[style=apa]{biblatex}
% \usepackage[style=mla-new]{biblatex}
% 声明 BibLaTeX 的数据库
\addbibresource{ref/refs.bib}%
% 修改顺序数字压缩的阈值
\setcounter{gbrefcompress}{3}%
请务必先读lshort-zh-cn
的6.1
节和biblatex-gbt7714-2015
的文档,必须搞清楚不同bib
方案的差异:
.cls
是很难收到回答的,毕竟作为一个如此小众的模板,是很少有人愿意看(除非你在nxu-LaTeX兴趣小组),更好的办法绝对是到这里提issues直接向作者反馈nxuthesis
早就在CTAN上upload了,你完全没必要上传这么大的压缩包,保证代码的简单易读是问题能够得到回答很重要的因素之一nxuthesis
并无太大关系,同时也不利于后来人通过关键词搜索到\parencite
的解决方案在修改了nxuthesis
对参考文献的引用方式后,如下这么写,应该可以实现你想要的效果:
我在使用宁夏大学毕业论文模板,我的目标是:
- 引用两篇连续的参考文献时,想显示[1,2]而不是[1-2],连续三篇以上再显示类似于[1-3]这样的形式
- 引用个别文献时,我不想放在上标(^[2-4]),想让其和正文字体一样,也就是正常的非上标的数字序号形式([2-4])
按我粗略的看如下的切片:
% \renewcommand\thefootnote{}
% \footnotetext{\textbf{Abbreviations:} ANA, anti-nuclear antibodies; APC, antigen-presenting cells; IRF, interferon regulatory factor.}
% \renewcommand\thefootnote{\fnsymbol{footnote}}
% \setcounter{footnote}{1}
你所指的横线应该是\footnoterule
导致的,使用下面的代码即可去掉:
\renewcommand{\footnoterule}{}
提问问题不够具体,而且代码也太长(包含了一些敏感内容导致的)。要体现你的问题完全不需要这么长的代码,不要让潜在的回答者看你300多行的源代码,这不礼貌。你应该只提取出和你问题核心相关的某几行。
\documentclass[12pt]{ctexart}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=2cm]{geometry}
\usepackage{tikz}
\usepackage{setspace}
\usepackage{zhlipsum}
\NewDocumentCommand{\mytextbox}{ o m }{%
\noindent%
\begin{center}\vspace*{2ex}%
\begin{tabular}{|c|}%
\IfNoValueF{#1}%
{\hline{\zihao{3}#1}\\}
\hline%
\parbox{.95\linewidth}{%
\vspace*{5ex}%
\foreach \i in {1,...,{#2}}{%
\vspace*{1ex}%
\hrulefill \par
\vspace*{1ex}%
}
}\\
\hline%
\end{tabular}\vspace*{2ex}%
\end{center}
}
\doublespace
\begin{document}
\begin{center}
{\zihao{2}\bfseries 我是一个标题哈哈哈哈}
\end{center}
\mytextbox[请以如何提问为题目写一篇文章。]{15}
\zhlipsum[2]
\mytextbox{10}
\zhlipsum[2]
\mytextbox[我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体]{17}
\end{document}
TeX
发展这么久了,类似作文纸的排版应该有相关的宏包...我自己造的轮子肯定相当粗糙...tikz
:\documentclass{ctexart}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=2cm]{geometry}
\usepackage{tikz}
\usepackage{zhlipsum}
\AddToHook{shipout/background}
{%
\begin{tikzpicture}[remember picture,overlay]
\useasboundingbox[draw=black,thick] ([xshift=1.45cm,yshift=1.95cm]current page.south west) rectangle ([xshift=-1.45cm,yshift=-1.45cm]current page.north east);
\end{tikzpicture}%%
}
\begin{document}
\zhlipsum[1-9]
\end{document}
"如何添加页面边框,实现如图效果"
maybe related: https://github.com/James-Yu/LaTeX-Workshop/issues/3988
我曾经自定义使用过musixflx
宏包需要的musixflx
命令,在LW
上是有效的,感觉就是James Yu没有在上游提供支持,上面的issues好像也没有下文了....
李清老师在2012年重排过一版《金瓶梅》,可见这个需要魔法的链接
为避免网络问题,这里上传相关的文件以供参考:
其中实现了类似的效果,可惜...我看不太懂李清在.sty
中的设置:
期待题主的排版大作早日问世~
请提供在别人的电脑上如何复现你的问题。无法复现的问题是玄学。不应该被提问。
建议你在vscode右下角的编码处尝试修改编码方式。
(感觉这份文件烂完了...)
使用tcolorbox
宏包的默认样式即可。
请在终端输入texdoc tcolorbox
,或者看这个链接。
请给一份完整的可直接编译的代码,并且分点详细说明哪些部分还不满意,以方便潜在的回答者逐一解决。
昨天修习了一下zref-lastpage
,如果不想用圈圈的话,可以试试下面的代码:
P.S.在calc
宏包中提供了名为\ratio
的用于计算两个<dim>
之比,最好是不要使用\ratio
作为宏的名称
\documentclass[tikz,border=5pt]{standalone}
\usepackage[totpages,lastpage]{zref}
\usetikzlibrary{calc}
\def\hlen{1.25cm}
\def\headradius{10pt}
\def\hwidth{2cm}
\def\hfillwidth{.567*\hwidth}
\newcommand*\pageProgressBar{%
\ifnum\ztotpages=0\relax
\def\myratio{1}
\else%
\pgfmathsetmacro{\myratio}{\value{page}/\ztotpages}
\fi
\def\hfillwidth{\myratio*\hwidth}
\begin{tikzpicture}[scale=3]
\draw[rounded corners = \headradius, fill = black!30] (0,0) rectangle ++ (\textwidth, .5cm);
\fill[rounded corners = \headradius, fill = violet!90] (0,0) rectangle ++ (\myratio*\textwidth, .5cm);
\end{tikzpicture}
}
\begin{document}
\foreach \p in {1, ..., 20}{%
\pageProgressBar
\newpage
}
\end{document}
(上述甚至抄了一些鱼老师的代码和思路)
LastPaage
索引的数值问题可以通过refcount
提供的\getrefbykeydefault
命令获取,或者直接通过zref-lastpage
获得;这里有一个较为详细的总结~LastPage
的值的取得需要等第一轮编译到shipout
阶段之后把页码信息(应该恰好是\@abspage@last
)写入.aux
内,而使用\ztotpages
等方法在第一轮的初始值是0(使用\@abspage@last
的初始值为\maxdimen
),因为这里需要在不能获取到LastPage
的时候先编译tikz
的计算,因此对第一轮需要进行特殊判断以避免除零错误。这一过程写入.aux
是由latex自动完成的,而如果需要写入其他信息,可以参考雾月老师的这个解答,或者使用zref
的机制写入新的property。maybe related in the hypererf
documentation:
我尝试对你的MWE缩了一下行...并试着结合啸行老师的做法给了一个尝试...
\documentclass[UTF8,a4paper,openany]{book} %% openany可以让你的页面少几面
\usepackage{ctex}
\ctexset{
contentsname={\textit{Contents}},
listfigurename={\zihao{3}\centering List of figures},
bibname={References},
}
\usepackage[colorlinks=true]{hyperref}
\usepackage{graphicx}
\begin{document}
WWW
QQQ
\newpage
\phantomsection
\addcontentsline{toc}{chapter}{ABSTRACT}
\centerline{\bfseries ABSTRACT}
AAA
\tableofcontents
\listoffigures
\addcontentsline{toc}{chapter}{LIST OF FIGURES}
\ExplSyntaxOn
\int_step_inline:nn {4}{%
\chapter{Chapter \int_to_Roman:n {#1}}
\section{111}
\section{222}
\section{333}
\int_step_inline:nn {4}{%
\begin{figure}
\centering
\includegraphics{example-image}
\caption{figure-{##1}}
\end{figure}
}
}
\ExplSyntaxOff
\begin{thebibliography}{9}
\bibitem{111} 1111
\bibitem{222} 222
\bibitem{333} 333
\bibitem{444} 444
\end{thebibliography}
\addcontentsline{toc}{chapter}{REFERENCES}
\end{document}
请看VCR:
我没看出来的你的图示是按什么对齐的,你的图示看上去很丑......
可能的正确示例如下:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
SSE &= \sum_{i=1}^n(y_i-\hat{y_i})\\
SST &= \sum_{i=1}^n(y_i-\bar{y})
\end{align*}
\end{document}
在公式环境不可以空行!!!你的MWE并不work...
\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}
\begin{align}
SSE = \sum_{i=1}^n(y_i-\hat{y_i})\notag\\
SST = \sum_{i=1}^n(y_i-\bar{y})\notag\\
\end{align}
\end{document}
倒数第三行!!!不允许空行!!!
这将会报错:
SSE = \sum _{i=1}^n(y_i-\hat {y_i})\notag \\ SST = \sum _{i=1}^n(y_i\ETC.
! Paragraph ended before \align was complete.
<to be read again>
\par
l.9
@u141196 如果我没有记错的话,你的上一个问题还没有做任何回复。提问请不要突然消失。
如果是“如何输入这些图标”,我们默认这是在标准文档类下进行的,下面是最简单的MWE:
% LuaLaTeX
\documentclass{article}
\usepackage{fontawesome5}
\usepackage{xcolor}
\colorlet{accent}{blue!70!black}
\begin{document}
\faIcon{qq}
\faIcon{github}
\textcolor{red}{\faIcon{qq}}
\textcolor{accent}{\faIcon{github}}
\end{document}
如若不然,请说明你的准确需求。同时,一个问题请只聚焦一个目标。
我也抽空试了下...核心基本都是用decorations.pathreplacing
提供的brace
:
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\draw (0,.15) -- (0,0) node[left,yshift=.12cm] {Hello} -- (5,0) -- (5,.15) decorate [decoration={brace,amplitude=5pt}] { (0,.15) -- (5,.15) node[midway,yshift=.35cm] {50 dollars}};
\draw (0,-1+.15) -- (0,-1) node[left,yshift=.12cm] {Hello} -- (7,-1) -- (7,-1+.15) (0,-1-.15) -- (0,-1) (7,-1-.15) -- (7,-1) decorate [decoration={brace,,amplitude=5pt,mirror}] { (0,-1-.15) -- (7,-1-.15) node[midway,yshift=-.53cm] {70 dollars}};
\draw (5,-1+.15) decorate [decoration={brace,amplitude=5pt}] { -- (7,-1+.15) node[midway,yshift=.35cm] {? dollars}};
\draw[dashed] (5,0) -- (5,-1);
\end{tikzpicture}
\end{document}
@u3945 但是同时有个小建议:
应该使用markdown的围栏代码块将你的代码包围,否则会出现丢失\
的现象,你可以使用“补充回答”功能,让这部分代码正确高亮。
PS.国外不知道有没有线段图这一称呼,不知道有没有造好的轮子。
问 tblr环境提示表格宽度太小.