Sagittarius Rover
Sagittarius Rover
这家伙很懒,什么也没写!

注册于 3年前

回答
486
文章
0
关注者
17

改的不是很好。

注意到amsart.sty中的:

% line 524~549
\def\@setaddresses{\par
  \nobreak \begingroup
\footnotesize
  \def\author##1{\nobreak\addvspace\bigskipamount}%
  \def\\{\unskip, \ignorespaces}%
  \interlinepenalty\@M
  \def\address##1##2{\begingroup
    \par\addvspace\bigskipamount\indent
    \@ifnotempty{##1}{(\ignorespaces##1\unskip) }%
    {\scshape\ignorespaces##2}\par\endgroup}%
  \def\curraddr##1##2{\begingroup
    \@ifnotempty{##2}{\nobreak\indent\curraddrname
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      ##2\par}\endgroup}%
  \def\email##1##2{\begingroup
    \@ifnotempty{##2}{\nobreak\indent\emailaddrname
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      \ttfamily##2\par}\endgroup}%
  \def\urladdr##1##2{\begingroup
    \def~{\char`\~}%
    \@ifnotempty{##2}{\nobreak\indent\urladdrname
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      \ttfamily##2\par}\endgroup}%
  \addresses
  \endgroup
}

其中关键的部分为

    \par\addvspace\bigskipamount\indent
    \@ifnotempty{##1}{(\ignorespaces##1\unskip) }%
    {\scshape\ignorespaces##2}\par\endgroup}%

可以修改为「去掉小括号」+「去掉地址的小型大写字体」+「修改缩进」 +「编组内给姓名设置小体大写」...

    \par\addvspace\bigskipamount
    %\indent
    % \@ifnotempty{##1}{(\ignorespaces##1\unskip) }%
    \@ifnotempty{##1}{{\scshape\ignorespaces\noindent##1\unskip\par}}%
    % {\scshape\ignorespaces##2}\par\endgroup}%
    {\ignorespaces\noindent##2}\par\endgroup}%

完整代码:

\documentclass[11pt]{amsart}

\makeatletter
\def\@setaddresses{\par
  \nobreak \begingroup
\footnotesize
  \def\author##1{\nobreak\addvspace\bigskipamount}%
  \def\\{\unskip, \ignorespaces}%
  \interlinepenalty\@M
  \def\address##1##2{\begingroup
    \par\addvspace\bigskipamount
    %\indent
    % \@ifnotempty{##1}{(\ignorespaces##1\unskip) }%
    \@ifnotempty{##1}{{\scshape\ignorespaces\noindent##1\unskip\par}}%
    % {\scshape\ignorespaces##2}\par\endgroup}%
    {\ignorespaces\noindent##2}\par\endgroup}%
  \def\curraddr##1##2{\begingroup
    \@ifnotempty{##2}{\nobreak\indent\curraddrname
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      ##2\par}\endgroup}%
  \def\email##1##2{\begingroup
    \@ifnotempty{##2}{\nobreak\indent\emailaddrname
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      \ttfamily##2\par}\endgroup}%
  \def\urladdr##1##2{\begingroup
    \def~{\char`\~}%
    \@ifnotempty{##2}{\nobreak\indent\urladdrname
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      \ttfamily##2\par}\endgroup}%
  \addresses
  \endgroup
}
\makeatother


\address[H. Zhu]{School of Physics and Information Engineering, Jiangsu Second Normal University, 6 Xinhe West Road, Shiqiu street, Nanjing 211200, P. R. China}
\email{\tt zhs@fudan.edu.cn}

\address[H. Song]{Department of Basic Courses, P. R. China}
\email{\tt s3@13.com}


\begin{document}

hello!

Here below is the permission:

\end{document}

这将得到:

image.png

BTW, 这无疑是编辑的无理需求...

灰原老师到此一游...
(其实是不慎把回复点成了答案)

第(2)问里面我找了过(1,0)和(1,2)的线段与AB相交得到C点,然后旋转,算是取巧,但总算是顺利画出来了

另外第(2)问是否还有别的合适的画法

其实注意到A(4,0)B(0,4),那么直线AB的方程显然是x+y=4,又因为x_C=1,瞪眼立得C(1,3),又因为旋转的是90°,再瞪眼又显然有D(3,-1)...

直接定下所有点的坐标,然后连线画图就行了😀...

并不需要照着题目的意思慢慢旋转,画图就要找最容易确定图形的思路(?)


第(3)问里面的等腰直角三角形有几个限制条件,我画不出来了

我觉得可以用要证的结论「BD+OB=AB」来取巧

因为要证的结论就一定是对的,这就免去了搜题这一步了😀.

注意到∠OBD=45°,而△OAB又是等腰直角,所以AB⊥CD. 又因为「BD=AB-OB=4√2-4」,所以其实只要确定了「D」点,它是AB过B的垂线,向左下延长「4(√2-1)」的长度得到的,即可唯一确定这个图形.

这样做顶多有一丢丢浮点误差,但是肉眼很难分辨的...

\documentclass[border=5pt]{standalone}
\usepackage{tkz-base}
\usepackage{tkz-euclide}
\begin{document}
\tkzSetUpLine[line width=.8pt]
\begin{tikzpicture}
\tkzInit[xmin=-1,xmax=5,ymin=-2,ymax=5]
\tkzDrawX[noticks,thick]
\tkzDrawY[noticks,right=2pt,thick]
\tkzDefPoints{0/0/O,0/4/A,4/0/B}
\def\lenBD{\fpeval{4*(\tkzSqrTwo-1)}}% 4(√2-1)

% 计算|BD|长度并定点
% \node {\lenBD};
\tkzDefPointWith[orthogonal normed,K=\lenBD](B,A) 
\tkzGetPoint{D}

% 利用角平分线确定M点
\tkzDefLine[bisector,normed](O,B,A) 
\tkzGetPoint{m}
\tkzInterLL(O,A)(B,m)
\tkzGetPoint{M}

% tkz-euclide可以很轻松地通过等腰直角三角形地斜边确定直角顶点
% 实际上手动求垂直平分线 + 确定交点也不难...
\tkzDefTriangle[isosceles right](O,D) 
\tkzGetPoint{C}

%
\tkzLabelPoints[below left](O)
\tkzLabelPoints[left](A,M)
\tkzLabelPoints[below](D,B)
\tkzLabelPoints[left](A,M)
\tkzLabelPoints[above](C)
\tkzDrawPolygons(O,A,B O,B,D O,B,M O,C,D)
\end{tikzpicture}
\end{document}

image.png

方案三:基于ctexheading提供的功能👇

image.png

但要尤其注意的是,在elegantbook.cls中使用的是:

% Line 194-221
\ifdefstring{\ELEGANT@lang}{cn}{
  \ifdefstring{\ELEGANT@chinesefont}{founder}{
    \RequirePackage[UTF8, scheme=plain, fontset=none]{ctex}
    \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
    \setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03}
    \setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02}
    \setCJKfamilyfont{zhsong}{FZShuSong-Z01}
    \setCJKfamilyfont{zhhei}{FZHei-B01}
    \setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03}
    \setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02}
    \newcommand*{\songti}{\CJKfamily{zhsong}}
    \newcommand*{\heiti}{\CJKfamily{zhhei}}
    \newcommand*{\kaishu}{\CJKfamily{zhkai}}
    \newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax}
  
  \ifdefstring{\ELEGANT@chinesefont}{nofont}{
    \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}
    \xeCJKsetup{AutoFakeBold=true}
    }{\relax}

  \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
    \RequirePackage[UTF8,scheme=plain]{ctex}
    \xeCJKsetup{AutoFakeBold=true}
    }{\relax}
  
  \AfterEndPreamble{
    \setlength\parindent{2\ccwd}}
}{\relax}
\RequirePackage[UTF8,scheme=plain]{ctex}

这并不会启用heading=true:

image.png

下面的workaround使用了\PassOptionsToPackage{heading=true}{ctex}:

\PassOptionsToPackage{heading=true}{ctex}
\documentclass[lang=cn,scheme=chinese]{elegantbook}
\usepackage{zhlipsum}
\usepackage{geometry}
\geometry{paperheight=10cm}
\begin{document}
\ctexset{chapter/pagestyle = fancy}

\chapter{标题标题}
\zhlipsum[2]

\chapter{标题标题}
\zhlipsum[2]
\end{document}

image.png

期待更多可能的回答~

方案二:使用etoolbox提供的\patchcmd命令:

\documentclass[lang=cn,scheme=chinese]{elegantbook}
\usepackage{zhlipsum}
\geometry{paperheight=10cm}
\patchcmd{\chapter}{\thispagestyle{plain}}{}{}{}
\begin{document}
\chapter{标题标题}
\zhlipsum[2]

\chapter{标题标题}
\zhlipsum[2]
\end{document}

image.png

方案一:使用fancyhdr提供的方案,将plain设置为fancy样式:

\documentclass[lang=cn,scheme=chinese]{elegantbook}
\usepackage{zhlipsum}
\geometry{paperheight=10cm}
\fancypagestyle{plain}[fancy]{}
\begin{document}
\chapter{标题标题}
\zhlipsum[2]

\chapter{标题标题}
\zhlipsum[2]
\end{document}

image.png

这看上去非常AI,直接拿着AI生成的代码提问可不是非常鼓励的...

  1. 请把你的代码补充完整(编辑问题),从\documentclss开始到\end{document}结束
  2. 请把你代码的编译截图也上传,具体指明是哪段代码在实现「标题与正文之间的距离调节」,但实际上没有改变

@u26254 有一个2023年才出现的子库tikz-nfold: https://ctan.org/ctan-ann/pkg/tikz-nfold

\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{nfold}
\begin{document}

\tikz\draw[double,teal] (0,0) rectangle (1,1);

\tikz\draw[double distance=1pt,nfold=3,violet] (0,0) rectangle (1,1);

\tikz\draw[line join=round, double distance=4pt, nfold=4, magenta] (0,0) rectangle (1,1);

\end{document}

image.png

Refs: https://tex.stackexchange.com/a/692283/322482

描述不完整

请尽可能补充更多的信息,一步步告诉别人你做了什么,以便别人复现你的问题...

例如:

由于siunitxphysics宏包冲突报错,故删去相关部分并停止使用physics宏包

具体删除了哪个文件的哪个部分,原先所谓「siunitxphysics宏包冲突报错」的报错信息是什么?

使用模板【非官方】天津大学的 LaTeX 试卷模板编写试卷

你贴的链接需要20积分下载,这意味着每个想回答问题的人都得花20积分,这对潜在的回答者不友好...

报错信息如下图,具体表现为无法编译文件,无法生成*.log*.toc*.aux等文件。

你图示的报错信息是从清除辅助文件开始的,并不完整,如有可能,应该补充完整。

但修改后仍无法编译文件,且重新下载原模板并打开也无法编译。

在重新编译的时候你是否删除了全部中间辅助文件再开始(?)


另外,不知为什么,我从链接处下载的文件中的设置文件名为:TJ-exam-8kai-settings.tex

而在TJ-exam-8kai.tex中的第二行却只有\input{settings}

\documentclass[AutoFakeBold,twocolumn,zihao=-4,UTF8,answers]{ctexart} % 
% \input{settings} 
\input{TJ-exam-8kai-settings}% 我做的替换

这点你完全没提到,情况是相同的吗?


由于latexmk会自动执行多个编译命令,只是方便了运行,但是不方便debug. 所以最好依次执行xelatex等一系列命令查看报错信息.

在windows11+TL2025上使用xelatex TJ-exam-8kai.tex编译上面的代码是可以得到.log的(不知道为什么.log上传不了...):

注意其中最后几行:

% Line 1497  TJ-exam-8kai.log
[2]
! Emergency stop.
<inserted text> }\endwrite 
                           
l.109 \end{document}
                    
Unbalanced write command

且此时是可以顺利得到PDF文件的:

image.png

至此,问题的关键是找到为何会出现Unbalanced write command...


进一步简化问题:

\documentclass[AutoFakeBold,twocolumn,zihao=-4,UTF8]{ctexart}% 
% \input{settings} 
% \input{TJ-exam-8kai-settings}
\begin{document} 
  
\section{\textbf{填空题}(aaa)}

\end{document}

! Emergency stop.<inserted text> }\endwrite报错

但是

\documentclass[AutoFakeBold,twocolumn,zihao=-4,UTF8]{ctexart}% 
% \input{settings} 
\input{TJ-exam-8kai-settings}
\begin{document} 
  
\section{\textbf{填空题}(aaa)}

\end{document}

则会出现上述报错,至此TJ-exam-8kai-settings.tex中必定有问题.

稍微做一些简化,你可以把代码删减到:

\documentclass{ctexart}% 
\ctexset{section={number = \bfseries\chinese{section}}}
\usepackage{zref-lastpage}
\begin{document} 
  
\section{\textbf{填空题}hello}

你好!

\end{document}

同样会得到:

[1]
! Emergency stop.
<inserted text> }\endwrite

l.10 \end{document}

的问题...

image.png

事实上这里没必要用\bfseries,可以把TJ-exam-8kai-settings.tex中的

\ctexset{section={
        name = {,、\hspace*{-5mm}},
        number = \bfseries\chinese{section},
        format = {\zihao{-4}},
        beforeskip = 9pt,
        afterskip = 4pt
       }}

修改为

\ctexset{section={
        name = {,、\hspace*{-5mm}},
        number = \chinese{section},
        format = {\zihao{-4}},
        beforeskip = 9pt,
        afterskip = 4pt
       }}

既可以避免上述的问题。

另外,这个模板并不新,真的一定要用吗?!


BTW, 还要注意到这个模板似乎是13-14年写的,tasks包还报了如下的一个警告:

Package tasks Warning: You've tried setting command `\NewTasks ' on line 56.
(tasks)                However, command `\NewTasks ' is deprecated. Please use
(tasks)                command `\NewTasksEnvironment ' instead. Refer to the
(tasks)                manual for details.

自己做修改,留做习题....

具体是什么问题,两者有什么差异,请尽可能详细描述

不要只是提供几个代码片段让别人做猜测...


Edit

似乎 是因为.sty中 会默认启用expl3环境,因此_会被转义...

% MyTemplate.sty
%==============  MyTemplate.sty  ==============%
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesExplPackage{MyTemplate}{2025-09-21}{1.1}{My personal utility macros}
% \NewDocumentCommand{\comb}{m m}{\mathrm{C}_{#1}^{#2}}% 这样写显示效果会有问题
\NewDocumentCommand{\comb}{m m}{\mathrm{C}\sp{#2}\sb{#1}} 

\endinput
% main.tex
\documentclass{article}
\usepackage{MyTemplate}
\begin{document}

before $\comb{n}{i}$ after

\end{document}

image.png

Ref: https://tex.stackexchange.com/a/698751/322482

虽然有一些神秘的baseline微调...

\documentclass{article}
\usepackage{fourier}
\usepackage{amsmath}
\usepackage{nicematrix}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}

\lipsum[2]

\[
R_o = 
\begin{bNiceArray}{ccc}[margin,last-row]
    \begin{tikzpicture}
    \clip (-.75,-.25) rectangle (1,3);
    \draw 
    (-.45,0) -- ++(0,2.25)
    (0.0,0) -- ++(0,2.25)
    node[above] {$K$}
    (+.45,0) -- ++(0,2.25);
    \end{tikzpicture}
    & 
    \begin{tikzpicture}[baseline=-1.25cm]
    \draw 
    (0,0) rectangle (1.5,1.5)
    (.75,1.5) node[above] {$K$}
    (1.5,.75) node[right] {$K$}
    ;
    \end{tikzpicture}
    & 
    \begin{tikzpicture}[baseline=-2cm]
    \draw 
    (0,-.5) --  ++(2,0)
    (0,0) -- ++(2,0) node[right] {$K$}
    (0,.5) -- node[midway,above] {$M$} ++(2,0);
    \end{tikzpicture} \\
    \mathbf{S} 
    & 
    % \mathbb{E}(\mathbf{a}\mathbf{a}^H) 
    \tikz[baseline=5.5ex]{
        \node (O) {non-singular};
        \node at (0,1) {$\mathbb{E}(\mathbf{a}\mathbf{a}^H) $}edge[latex-] (O.north);
    }
    &
    \mathbf{S}^H
\end{bNiceArray}
\]

\lipsum[2]

\end{document}

image.png

@u35231 提问要言之有物

能不能细致的讲一下randques.sty包的使用

这个包是什么,他不在CTAN上,你是从何获取?

论坛里提到过,他是运行频频出错

具体是论坛的哪里提到过?在哪里运行出错?报错信息是什么?

或者论坛里没人提到的probsoln.sty

这个包CTAN上有,你要如何细致呢,要实现什么目标?是否仔细阅读过宏包文档和他给的例子

https://ctan.org/topic/random

请补充给出你想用这个随机数如何生成内容的一个具体的完整例子。


翻阅远古提问,我猜测你是想要实现「随机抽题」

既然你已经提到

需要设置随机数生成的种子以确保文档中生成的内容每次编译都相同

言外之意是你已经有一个可以基于randques实现生成随机内容的文档,请提供这个文档的完整源代码,这样才能找到最合适的固定 random seed 的方法。


另外,关于randques宏包的官方下载来源,也建议你贴一个链接.是否是: https://www.latexstudio.net/archives/8366.html?

👉 randques.pdf
👉 test.tex
👉 test.pdf

image.png

也可以使用luadraw:

\documentclass[12pt]{standalone}
\usepackage[svgnames]{xcolor}
\usepackage[3d]{luadraw}
\usepackage{fouriernc}
\begin{document}
\begin{luadraw}{name=elippse-circle}
local g = graph3d:new{window={-5,5,-5,5}, viewdir={120,60}, size={12,12}}
g:Linejoin("round"); g:Linewidth(4)
Hiddenlinestyle = "dashed"
local k = 4
local R = 3
local Z0 = 3
local C1 = cone(Origin,k*vecK,R,100,true)
local C2 = cone(Origin, -k*vecK,R,100,true)
local P2 = {M(0,0,-Z0),vecK} -- plan de coupe
local P1 = {M(0,0,Z0-1),vecI + 2*vecK } -- plan de coupe
local I1 = g:Intersection3d(C1,P1)
local I2 = g:Intersection3d(C2,P2) 
g:Dcone(Origin,k*vecK,R,{color="orange"}) g:Dcone(Origin,-k*vecK,R,{color="orange"})
g:Lineoptions("solid","Navy",12)
g:Dedges(I1,{hidden=true})
g:Dedges(I2,{hidden=true}) 
g:Show()
\end{luadraw}
\end{document} 

image.png

\documentclass[12pt]{standalone}
\usepackage[svgnames]{xcolor}
\usepackage[3d]{luadraw}
\usepackage{fouriernc}
\begin{document}
\begin{luadraw}{name=elippse-cylinder}
local g = graph3d:new{window={-5,5,-5,5}, viewdir={120,60}, size={12,12}}
g:Linejoin("round"); g:Linewidth(6)
Hiddenlinestyle = "dashed"
local k = 6
local R = 3
local Z0 = 2
local C = cylinder(Origin,k*vecK,R,100,true)
local P = {M(0,0,Z0),vecI + 2*vecK} -- plan de coupe
local I1 = g:Intersection3d(C,P)
g:Dcylinder(Origin,k*vecK,R,{color="gray"}) 
g:Lineoptions("solid","Navy",12)
g:Dedges(I1,{hidden=true})
g:Show()
\end{luadraw}
\end{document} 

image.png

just curious: 这个链接究竟问了几个问题(?)


texhigh 环境中,怎样不打印「显式空格」?我希望能使用「不可见空格」
%\THSetCharReplacement{\ }{\ }%%\textvisiblespace 手册写道:texhigh已设置。这是什么意思?
texhigh使用打字机族时,是否支持两端对齐?

问题一:

对于你的mwe,直接使用latexmk -pdf --shell-escape编译即可得到不可见空格

\documentclass{article} 
\usepackage{texhigh} 
\begin{document}
\begin{texhigh}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
\end{texhigh}
\end{document}

image.png

而若根据文档3.3节中的内容加上char-replacements={\ =\textvisiblespace},可以局部设置texhigh环境显示visable space

\documentclass{article} 
\usepackage{texhigh} 
\begin{document}
\begin{texhigh}[char-replacements={\ =\textvisiblespace}]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
\end{texhigh}
\end{document}

清除所有辅助文件后编译可以得到:

image.png


问题二:

你似乎没有指出具体是在文档的哪个部分(?)例如(?):

image.png


问题三:

也许有关:https://ask.latexstudio.net/ask/question/17271.html

发布
问题