LaTeXStudio.net 问答 RSS 最新问答 https://ask.latexstudio.net/addons/ask/rss/index Mon, 27 Oct 2025 21:46:58 +0800 有条件限制的等腰直角三角形绘制 近期在各位大佬的指点下,给小朋友绘制简单的平面几何图形,感觉已渐入佳境。然而,今天晚上遇到了一个题目,却又不晓得怎么精确录入。再次求助大家!题目和图形见下:

image.png

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

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

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

O(∩_∩)O谢谢先!

]]>
https://ask.latexstudio.net/ask/question/17945.html Sun, 26 Oct 2025 23:02:07 +0800
「elegantbook-latex日经问题」如何让「\chapter」页也正常显示页码? 如题,希望使用elegantbook模板实现让「\chapter」的首页也显示正常的页码?

虽然这是book.cls文档类的默认行为,也是大多数book排版的惯例:

% book.cls Line 350~354
\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{plain}%
                    \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}

下面是MWE:

\documentclass[lang=cn,scheme=chinese]{elegantbook}
\usepackage{zhlipsum}
\geometry{paperheight=10cm}

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

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

\end{document}

image.png

]]>
https://ask.latexstudio.net/ask/question/17944.html Sun, 26 Oct 2025 19:34:06 +0800
标题与正文之间的距离调节没有反应怎么办? % 一级标题:第一章 绪论(对应\section) \titleformat{\section}[block] {% 字体设置 \centering % 居中对齐 \bfseries % 加粗 \fontsize{16pt}{16pt}\selectfont % 三号字(16pt),单倍行距 \CJKfontspec{SimHei}% 中文黑体 \fontspec{Times New Roman}% 西文Times New Roman } {\thesection}% 题序(如"第一章") {1\ccwd}% 题序与标题间空1个汉字宽度(1个空格) {}% 标题内容前无额外内容 {} \titlespacing{\section} {0pt}% 左缩进 {15.6pt}% 段前距离 {15.6pt}% 段后距离 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 二级标题:1.1 研究背景(对应\subsection) \titleformat{\subsection}[block] {% 字体设置 \raggedright % 左对齐 \bfseries % 加粗 \fontsize{14pt}{14pt}\selectfont % 四号字(14pt),单倍行距 \CJKfontspec{SimHei}% 中文黑体 \fontspec{Times New Roman}% 西文Times New Roman } {\thesubsection}% 题序(如"1.1") {1\ccwd}% 题序与标题间空1个汉字宽度(1个空格) {}% 标题内容前无额外内容 {} \titlespacing{\subsection} {0pt}% 左缩进 {9.1pt}% 段前距离 {9.1pt}% 段后距离 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %三级标题 % 2. 字体与样式(严格匹配要求) \titleformat{\subsubsection}[block] {% \raggedright % 左对齐(无缩进) \bfseries % 加粗 \fontsize{12pt}{12pt} % 小四号(12pt),单倍行距(标题自身行距=字号) \CJKfontspec{SimHei}% 中文黑体 \fontspec{Times New Roman}% 西文Times New Roman } {\thesubsubsection}% 题序(如"1.4.1") {1\ccwd}% 题序与标题间空1个汉字宽度(1个空格) {}% 标题内容前无额外内容 {} \titlespacing{\subsubsection} {0pt}% 左缩进(无) {8pt}% 段前0.5行(基于当前字体的行高) {8pt}% 段后0.5行 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %四级标题 % 四级标题完整配置(确保显示) % 四级标题完整配置(与三级标题一致) \newcounter{subsubsubsection}[subsubsection] \renewcommand{\thesubsubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsubsection}.\arabic{subsubsubsection}} \titleformat{\subsubsubsection}[block] {% \raggedright \bfseries \fontsize{12pt}{15.6pt}\selectfont \CJKfontspec{SimHei} \fontspec{Times New Roman} } {\thesubsubsubsection} {1\ccwd} {} {} % 无额外命令 \titlespacing{\subsubsubsection} {0pt} {8pt}% 段前0.5行 {8pt}% 段后0.5行(固定值,与三级标题一致) % 简化自定义命令,移除强制行距 \newcommand{\subsubsubsection}[1]{% \par \refstepcounter{subsubsubsection}% {\raggedright\bfseries\fontsize{12pt}{15.6pt}\selectfont\CJKfontspec{SimHei}\fontspec{Times New Roman}% \thesubsubsubsection\hspace{1\ccwd}#1\par}% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 创建独立正文环境(强制固定行距20磅) \newenvironment{maintext}{% \begingroup% 局部作用域,隔离外部设置 \interlinepenalty=0% 允许段落分页 \brokenpenalty=0% 允许段落跨页 \raggedbottom % 1. 核心:强制行距为20pt,不缩放 \linespread{1}\selectfont% 禁用行距缩放(关键!避免setspace宏包干扰) \fontsize{12pt}{20pt}\selectfont% 字号12pt,行距绑定为20pt(第二个参数直接控制\baselineskip) % 2. 锁定行距参数,不允许小于20pt \setlength{\baselineskip}{20pt}% 显式设置基线距为20pt(双重保障) \setlength{\lineskiplimit}{19.9pt}% 允许行距最小为19.9pt(仅比20pt小0.1pt,确保正文内强制20pt) \setlength{\lineskip}{20pt}% 多行环境(如列表、表格)强制行距20pt % 3. 正文格式设置 \justifying% 两端对齐 \setlength{\parskip}{0pt}% 段落间距0(避免干扰) \setlength{\parindent}{2em}% 首行缩进2字符 \frenchspacing% 取消句末额外空格 % 4. 确保表格内行距同步为20pt \AtBeginEnvironment{tabular}{\fontsize{12pt}{20pt}\selectfont\setlength{\baselineskip}{20pt}} % 5. 移除\everypar强制命令(避免干扰标题后第一个段落) }{% \endgroup% 结束局部作用域 } ]]> https://ask.latexstudio.net/ask/question/17943.html Sat, 25 Oct 2025 15:24:50 +0800 编译报错Cleaning failed: Latexmk: Error on first line of 'TJ-exam-8kai.log'. 系统:Windows 11 专业版 24H2 发行版本:TeX Live 2024 编译环境:VS Code

问题:使用模板【非官方】天津大学的 LaTeX 试卷模板编写试卷时,由于siunitxphysics宏包冲突报错,故删去相关部分并停止使用physics宏包,但修改后仍无法编译文件,且重新下载原模板并打开也无法编译。报错信息如下图,具体表现为无法编译文件,无法生成*.log*.toc*.aux等文件。 补充:电脑上的其他*.tex文件均能正常编译

PixPin_2025-10-21_15-55-35.png

]]>
https://ask.latexstudio.net/ask/question/17942.html Tue, 21 Oct 2025 16:08:06 +0800
tcolorbox 使用 minted 库排版代码, 实现目录报错 \tcblistof
  • 操作系统 Windows11
  • 发行版 TeX Live 2025
  • 编辑器 TeXstudio
  • 编译命令 XeLaTeX
  • mwe? 如下
    
    \documentclass[UTF8]{ctexbook}
    %代码排版
    \usepackage{tcolorbox}
    \tcbuselibrary{minted,breakable}
    \newtcblisting[auto counter,list inside=abMATLABlist]{abMATLAB}[3][]{%
      coltitle=black,
      colbacktitle=white,
      colupper=black,
      colback=white,
      boxrule=0pt,
      toprule=0.08em,
      titlerule=0.05em,
      bottomrule=0.08em,
      fonttitle=\bfseries,
      title={\heiti 代码列表 \thetcbcounter: #2},
      listing only,
      sharp corners=all,
      minted language=matlab,
      before={\begin{listing}[htbp!]},
      after={\label{#3}\end{listing}},
      #1,
    }
    \begin{document}
    \tableofcontents
    \tcblistof[\chapter*]{abMATLABlist}{MATLAB 代码}
    %\tcblistof[\section*]{abMATLABlist}{MATLAB 代码}
    %\begin{abMATLAB}{拉普拉斯展开计算行列式}{abMATLABlist:DetLaplace}
  • %\end{abMATLAB} \chapter{AAA} \begin{abMATLAB}{拉普拉斯展开计算行列式}{abMATLABlist:DetLaplace}

    \end{abMATLAB} \end{document}

    可供测试的一段 `MATLAB` 代码
    ```matlab
    function d=DetLaplace(A)
    % DETLAPLACE 使用 Lapace 展开计算行列式
    % d = DetLaplace(A); 计算矩阵 A 的行列式 (determinant)
    % 对第一行 (row) 使用 Laplace 展开 (expansion)
    n = length(A);
    if n==1
        d=A(1,1);
    else
        d=0; v=1;
        for j=1:n
            M1j = [A(2:n,1:j-1) A(2:n,j+1:n)];
            d = d + v*A(1,j)*DetLaplace(M1j);
            v = -v;
        end
    end
    • 需求
      • 使用 tcolorbox 中的 minted 库以及 \tcblistof (这可能不是好的方案) 实现 minted 宏包类 \listoflistings 排版代码目录的效果 (或许有没有进一步修改目录样式的方法)
      • 盒子的样式已经在代码中实现 image.png

    image.png

    • 报错信息如下: (可能的错误before={\begin{listing}[htbp!]},after={\label{#3}\end{listing}} , 有意思的是在下面的代码中
      
      \tcblistof[\chapter*]{abMATLABlist}{MATLAB 代码}
      %\begin{abMATLAB}{拉普拉斯展开计算行列式}{abMATLABlist:DetLaplace}

    %\end{abMATLAB} \chapter{AAA} \begin{abMATLAB}{拉普拉斯展开计算行列式}{abMATLABlist:DetLaplace}

    \end{abMATLAB}

    注释掉下面一段代码 `abMATLAB` 环境, 然后取消上面的 `abMATLAB` 的注释却能正常编译)

    ! Extra }, or forgotten \endgroup. \@endfloatbox ...pagefalse \outer@nobreak \egroup \color@endbox l.37 \end{abMATLAB}

    I've deleted a group-closing symbol because it seems to be spurious, as in $x}$'. But perhaps the } is legitimate and you forgot something else, as in\hbox{$x}'. In such cases the way to recover is to insert both the forgotten and the deleted material, e.g., by typing `I$}'.

    ! Extra }, or forgotten \endgroup. \color@endbox ->\color@endgroup \egroup

    l.37 \end{abMATLAB}

    I've deleted a group-closing symbol because it seems to be spurious, as in $x}$'. But perhaps the } is legitimate and you forgot something else, as in\hbox{$x}'. In such cases the way to recover is to insert both the forgotten and the deleted material, e.g., by typing `I$}'.

    ! Undefined control sequence. \endlisting ...floatbox \global \setbox \@currbox \float@makebox \columnwidt... l.37 \end{abMATLAB}

    The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

    ! Missing number, treated as zero.

    \vbox l.37 \end{abMATLAB}

    A number should have been here; I inserted 0'. (If you can't figure out why I needed to see a number, look upweird error' in the index to The TeXbook.)

    ! Undefined control sequence. \float@makebox ...ze =#1 \@parboxrestore \@fs@pre \@fs@iftopcapt \ifvoid \@f... l.37 \end{abMATLAB}

    The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

    ! Undefined control sequence. \float@makebox ...restore \@fs@pre \@fs@iftopcapt \ifvoid \@floatcapt \else ... l.37 \end{abMATLAB}

    The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

    ! Undefined control sequence. \float@makebox ... \@fs@mid \fi \unvbox \@currbox \else \unvbox \@currbox \i... l.37 \end{abMATLAB}

    The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

    ! Extra \else. \float@makebox ...mid \fi \unvbox \@currbox \else \unvbox \@currbox \ifvoid ... l.37 \end{abMATLAB}

    I'm ignoring this; it doesn't match any \if.

    ! Missing number, treated as zero.

    \unvbox l.37 \end{abMATLAB}

    A number should have been here; I inserted 0'. (If you can't figure out why I needed to see a number, look upweird error' in the index to The TeXbook.)

    ! Undefined control sequence. \float@makebox ...currbox \else \unvbox \@currbox \ifvoid \@floatcapt \else ... l.37 \end{abMATLAB}

    The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

    ! Extra \fi. \float@makebox ...mid \unvbox \@floatcapt \fi \fi \par \@fs@post \vskip \z@ } l.37 \end{abMATLAB}

    I'm ignoring this; it doesn't match any \if.

    ! Missing number, treated as zero.

    \scan_stop: l.37 \end{abMATLAB}

    A number should have been here; I inserted 0'. (If you can't figure out why I needed to see a number, look upweird error' in the index to The TeXbook.)

    ! Undefined control sequence. \float@makebox ...loatcapt \fi \fi \par \@fs@post \vskip \z@ } l.37 \end{abMATLAB}

    The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

    ! LaTeX Error: \begin{tcolorbox} on input line 37 ended by \end{listing}.

    See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

    l.37 \end{abMATLAB}

    Your command was ignored. Type I to replace it with another command, or to continue without it.

    ! LaTeX Error: \begin{abMATLAB} on input line 35 ended by \end{tcb@drawing}.

    See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

    l.37 \end{abMATLAB}

    Your command was ignored. Type I to replace it with another command, or to continue without it.

    ! Missing number, treated as zero.

    \tcb@footnote@cnt@i l.37 \end{abMATLAB}

    A number should have been here; I inserted 0'. (If you can't figure out why I needed to see a number, look upweird error' in the index to The TeXbook.)

    ! LaTeX Error: \begin{document} ended by \end{tcolorbox}.

    See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

    l.37 \end{abMATLAB}

    Your command was ignored. Type I to replace it with another command, or to continue without it.

    ! Extra \endgroup. \end ...end#1\endcsname \@checkend {#1}\endgroup \UseHook {env/#1/after}\if... l.37 \end{abMATLAB}

    Things are pretty mixed up, but I think the worst is over.

    ! LaTeX Error: \begin{document} ended by \end{abMATLAB}.

    See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

    l.37 \end{abMATLAB}

    Your command was ignored. Type I to replace it with another command, or to continue without it.

    ! Extra \endgroup. \end ...end#1\endcsname \@checkend {#1}\endgroup \UseHook {env/#1/after}\if... l.37 \end{abMATLAB}

    Things are pretty mixed up, but I think the worst is over.

    [5] (./test.aux)


    LaTeX2e <2025-06-01> patch level 1 L3 programming layer <2022/07/14>


    LaTeX Font Warning: Some font shapes were not available, defaults substituted.

    ) Here is how much of TeX's memory you used: 25260 strings out of 468389 635955 string characters out of 5444297 1101832 words of memory out of 5000000 53359 multiletter control sequences out of 15000+600000 630527 words of font info for 76 fonts, out of 8000000 for 9000 1348 hyphenation exceptions out of 8191 116i,6n,121p,514b,1091s stack positions out of 10000i,1000n,20000p,200000b,200000s

    Output written on test.pdf (5 pages).

    ]]>
    https://ask.latexstudio.net/ask/question/17941.html Mon, 20 Oct 2025 22:06:22 +0800
    绘制如下形式的「抽象」矩阵的最佳实践? 如题,希望找到绘制如下两个矩阵公式的最佳实践.

    由于我会尝试自答,此处暂不给mwe.

    由于最佳实践总是讨论/比较出来的,所以什么形式的答案都欢迎,且只要绘制其一即可.

    image.png

    image.png

    ]]>
    https://ask.latexstudio.net/ask/question/17939.html Fri, 17 Oct 2025 21:51:27 +0800
    我需要设置随机数生成的种子以确保文档中生成的内容每次编译都相同,怎么做? 我需要设置随机数生成的种子以确保文档中生成的内容每次编译都相同,怎么做?

    目前所用的宏是randques.sty,如附件所示。编译时用的代码是:

    \RandSelQuestions[random=10]{Ach12-a}

    randques.rar

    ]]>
    https://ask.latexstudio.net/ask/question/17937.html Fri, 10 Oct 2025 10:29:32 +0800
    pdflatex下如何使 texhigh 不打印「显式空格」? 请问在使用 pdflatex 编译时, texhigh 怎样不打印「显式空格」?我希望 texhigh 能在 pdflatex 下使用「不可见空格」。 image.png

    \documentclass{article} 
    \usepackage{texhigh} 
    \begin{document}
    \begin{texhigh}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
    \end{texhigh}
    \end{document}
    ]]>
    https://ask.latexstudio.net/ask/question/17936.html Sat, 04 Oct 2025 00:51:31 +0800
    用TexLive2021版成功,新版本编译则目录中作者的格式会出错 https://www.latexstudio.net/index/details/index/mid/4546.html 网站上这个论文集模板编译失败!

    用TexLive2021版成功,新版本编译则目录中作者的格式出错

    Edited

    MWE的压缩包👉 20250605173859.zip

    ]]>
    https://ask.latexstudio.net/ask/question/17935.html Fri, 03 Oct 2025 11:26:44 +0800
    请简要介绍一下 texhigh 的宏包主要用途和主要使用方法 附件:texhigh-main.zip 操作系统:win 10 发行版:texlive 2025 编译命令:pdflatex 代码:

    \documentclass{article}
    \usepackage[centering,margin=.5cm,a6paper]{geometry}
    % \usepackage{texhigh} %% 
    \pagestyle{empty}
    \begin{document}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.
    
    Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
    
    Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at, tincidunt tristique, libero. Vivamus viverra fermentum felis. Donec nonummy pellentesque ante. Phasellus adipiscing semper elit. Proin fermentum massa ac quam. Sed diam turpis, molestie vitae, placerata, molestie nec, leo. Maecenas lacinia. Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi blandit ligula feugiat magna. Nunc eleifend consequat lorem. Sed lacinia nulla vitae enim. Pellentesque tincidunt purus vel magna. Integer non enim. Praesent euismod nunc eu purus. Donec bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec et mi. Nam vulputate metus eu enim. Vestibulum pellentesque felis eu massa.
    
    Quisque ullamcorper placerat ipsum. Cras nibh. Morbi vel justo vitae lacus tincidunt ultrices. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In hac habitasse platea dictumst. Integer tempus convallis augue. Etiam facilisis. Nunc elementum fermentum wisi. Aenean placerat. Ut imperdiet, enim sed gravida sollicitudin, felis odio placerat quam, ac pulvinar elit purus eget enim. Nunc vitae tortor. Proin tempus nibh sit amet nisl. Vivamus quis tortor vitae risus porta vehicula.
    
    Fusce mauris. Vestibulum luctus nibh at lectus. Sed bibendum, nulla a faucibus semper, leo velit ultricies tellus, ac venenatis arcu wisi vel nisl. Vestibulum diam. Aliquam pellentesque, augue quis sagittis posuere, turpis lacus congue quam, in hendrerit risus eros eget felis. Maecenas eget erat in sapien mattis porttitor. Vestibulum porttitor. Nulla facilisi. Sed a turpis eu lacus commodo facilisis. Morbi fringilla, wisi in dignissim interdum, justo lectus sagittis dui, et vehicula libero dui cursus dui. Mauris tempor ligula sed lacus. Duis cursus enim ut augue. Cras ac magna. Cras nulla. Nulla egestas. Curabitur a leo. Quisque egestas wisi eget nunc. Nam feugiat lacus vel est. Curabitur consectetuer.
    \end{document}
    ]]>
    https://ask.latexstudio.net/ask/question/17931.html Mon, 29 Sep 2025 21:25:49 +0800
    如何选择合适的 LaTeX 编辑器 请教大家LaTeX编辑器的问题:

    我最开始接触用的编辑器是texstudio,因为是软件装完后就带着的编辑器;样子不够美观,对我来说是在用,但估计很多的技巧我都不会;

    请问下大佬们有没有这方面使用的资料可以引导我一下。

    后来在知乎上面看到别人用 VS Code,也照猫画虎学了起来,这个编辑器倒是漂亮得紧。我一直也想像知乎上面那些大佬们设置片段,但不得其法。

    另外,在texstudio中,Ctrl+B,会把文字加上加粗的标记,在 VS Code 有这样的操作方法么?

    另外 VS Code 编辑 TeX,有没有学习的资料。

    ]]>
    https://ask.latexstudio.net/ask/question/17927.html Thu, 11 Sep 2025 21:47:29 +0800
    普通民办二本大二学生想做学校论文模板的问题. 我是一名大二学生,在今年2月份意外知道了你们网站,然后学着下载texlive阅读Ishort,然后进一步为备战全国大学生数学建模比赛练习小作文,然后尝试调用宏包,然后掌握了很多基本用法,到现在竞赛已经结束,比赛的时候直接按照群主老哥的.cls模板写的论文,然后现在想进一步学习LaTeX,也就是制作模板,恰巧我有写毕设的要求,而且学校没有模板,所以想尝试做做,然后各位群友已经给我了很多建议,然后我发上来自己再总结总结 我总结一下吧 各位佬们

    1.精通Ishort 2.了解article类 ,然后再谈修改 3.形成改article的能力

    然后 有偿发布 一经采纳 有悬赏

    注意要让我知道每一步是为了什么 以及做模板需要的能力是什么 这样我就不容易迷茫了

    ]]>
    https://ask.latexstudio.net/ask/question/17925.html Thu, 11 Sep 2025 12:24:13 +0800
    How to define a custom counter for Exercises? In LaTeX’s book class, how to define a custom counter for Exercises that is tied to the current chapter (e.g., Exercise 1.1, 1.2 in Chapter 1, Exercise 2.1 in Chapter 2, etc.), and also create a separate List of Exercises (similar to a Table of Contents)?

    ]]>
    https://ask.latexstudio.net/ask/question/17924.html Mon, 08 Sep 2025 21:32:41 +0800
    如何将自定义的myframe的参数传递给frame? 我希望创建一个frame级别的环境,也就是基于frame的自定义环境。它可以使用户比较方便地调节行距,而不是每次都调用\begin{spacing}{<arg>}...\end{spacing}之类的代码,同时它要接受一些参数,并将其传递给frame环境,考虑到frame环境是一个脆弱的环境,我的尝试总是失败。

    \documentclass{beamer}
    \usepackage{setspace}
    %\newenvironment{myframe}[2][1.5]
    %    {\begin{frame}[#2]\begin{spacing}{#1}}
    %    {\end{spacing}\end{frame}}
    \begin{document}
    %    \begin{myframe}
    %        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. 
    %    \end{myframe}
        \begin{frame}
        \begin{spacing}{1.5}
            Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
        \end{spacing}
        \end{frame}
    \end{document}
    ]]>
    https://ask.latexstudio.net/ask/question/17923.html Mon, 08 Sep 2025 14:23:06 +0800
    行间公式与上下文的垂直间距问题 image.png 如上图,对于 $Ff(x)$ 这种不太高的行间公式,其与上下文的垂直间距比下面的 $\frac{p}{q}$ 还大,这一点让我感到别扭。

    从我的测试来看,这个现象并不是 \abovedisplay(short)skip\belowdisplay(short)skip 造成的,而是因为行距。让我们看一下消除 \abovedisplay(short)skip\belowdisplay(short)skip 的效果:

    \documentclass{article}
    \makeatletter
    \renewcommand\normalsize{%
      \@setfontsize\normalsize{10pt}{10pt}%
      \abovedisplayskip 0pt
      \abovedisplayshortskip 0pt
      \belowdisplayshortskip 0pt
      \belowdisplayskip 0pt
    }
    \linespread{2}
    % \everydisplay{\linespread{1}\selectfont}
    \usepackage{amsmath}
    \begin{document}
    text text text text text text text text text text text text text text text text text text text text text text text text text text text
    \[
      Ff(x)
    \]
    text text text text text text text text text text text text text text text text text text text text text text text text text text text
    \[
      \frac{p}{q}
    \]
    text text text text text text text text text text text
    \begin{align*}
      b &= c \\
        &= d
    \end{align*}
    
    text text text text text text text text text text text text text text text text text text text text text text text text
    \end{document}

    image.png 为了让效果明显,我增加了行距。可以看到,高度较低的行间公式与上下文的间距看起来更大,就是行距带来的。

    为了让行间公式最高处与上文的垂直间距等于行间公式最低处与下文的垂直间距,需要做以下两步:

    • 将行间公式的行距设置为 1;
    • 消除行间公式与下一行文本的“interlineskip”。
      
      \documentclass{article}
      \makeatletter
      \renewcommand\normalsize{%
      \@setfontsize\normalsize{10pt}{10pt}%
      \abovedisplayskip 0pt
      \abovedisplayshortskip 0pt
      \belowdisplayshortskip 0pt
      \belowdisplayskip 0pt
      }
      \linespread{2}
      \everydisplay{\linespread{1}\selectfont}
      \usepackage{amsmath}
      \begin{document}
      text text text text text text text text text text text text text text text text text text text text text text text text text text text
      \[
      Ff(x)
      \]\par\nointerlineskip\@doendpe
      text text text text text text text text text text text text text text text text text text text text text text text text text text text
      \[
      \frac{p}{q}
      \]\par\nointerlineskip\@doendpe
      text text text text text text text text text text text
      \begin{align*}
      b &= c \\
        &= d
      \end{align*}\par\nointerlineskip\@doendpe

    text text text text text text text text text text text text text text text text text text text text text text text text \end{document}

    ![image.png](https://pics.latexstudio.net/uploads/20250907/3d8557b810ffc8f281e700b18ba760ad.png)
    此时再设置 `\abovedisplay(short)skip` 和 `\belowdisplay(short)skip`,效果就不别扭了:

    \documentclass{article} \makeatletter \renewcommand\normalsize{% \@setfontsize\normalsize{10pt}{10pt}% \abovedisplayskip 6pt \abovedisplayshortskip 0pt \belowdisplayshortskip 6pt \belowdisplayskip 6pt } \linespread{1.36} \everydisplay{\linespread{1}\selectfont} \usepackage{amsmath} \begin{document} text text text text text text text text text text text text text text text text text text text text text text text text text text text [ Ff(x) ]\par\nointerlineskip\@doendpe text text text text text text text text text text text text text text text text text text text text text text text text text text text [ \frac{p}{q} ]\par\nointerlineskip\@doendpe text text text text text text text text text text text \begin{align} b &= c \ &= d \end{align}\par\nointerlineskip\@doendpe

    text text text text text text text text text text text text text text text text text text text text text text text text \end{document}

    
    ![image.png](https://pics.latexstudio.net/uploads/20250907/b83a784dba854267b5a9fb8001791e89.png)
    
    现在我的问题总结如下:
    1. 虽然可以对行间公式环境进行封装,但一个个封装起来工作量太大了,有没有便捷方法?
    2. 有没有其他框架下更好的解决方案?
    ]]>
    https://ask.latexstudio.net/ask/question/17922.html Sun, 07 Sep 2025 15:08:25 +0800
    在tabular以及multirow宏包在涉及makecell共同作用时的纵向对齐问题? 该问题的tabularray方案可见这个链接

    本提问只希望局限在tabular的框架内,不希望用例如tabularray宏包的方案...

    希望实现合并单元格内的纵向对齐

    MWE如下:

    \documentclass[fontset=fandol]{ctexart}
    \usepackage{array}
    \usepackage{multirow}
    \usepackage{amsmath,amsfonts}
    \usepackage{makecell}
    \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
    \begin{document}
    
    \begin{tabular}{|M{5cm}|M{5cm}|M{5cm}|}
    \hline
    \textbf{条件} & \textbf{方程} & \textbf{说明} \\ \hline
    \multirow{2}{*}{圆心在原点} & $x^2+y^2=r^2$ & $a=b=0$ \\ \cline{2-3}
     & $x^2+y^2+F=0$ & $D=E=0$ \\ \hline
    \multirow{2}{*}{圆过原点} & $(x-a)^2+(y-b)^2=a^2+b^2$ & $a^2+b^2=r^2$ \\ \cline{2-3}
     & $x^2+y^2+Dx+Ey=0$ & $F=0$ \\ \hline
    \multirow{2}{*}{圆心在$x$轴上} & $(x-a)^2+y^2=r^2$ & $b=0$ \\ \cline{2-3}
     & $x^2+y^2+Dx+F=0$ & $E=0$ \\ \hline
    \multirow{2}{*}{圆心在$y$轴上} & $x^2+(y-b)^2=r^2$ & $a=0$ \\ \cline{2-3}
     & $x^2+y^2+Ey+F=0$ & $D=0$ \\ \hline
    \multirow{2}{*}{圆与$x$轴相切} & $(x-a)^2+(y-b)^2=b^2$ & $|b|=r$ \\ \cline{2-3}
     & \makecell{$x^2+y^2+Dx+Ey+F=0$\\$(E\neq 0,D^2-4F=0)$} & $E\neq 0,D^2-4F=0$ \\ \hline
    \multirow{2}{*}{圆与$y$轴相切} & $(x-a)^2+(y-b)^2=a^2$ & $|a|=r$ \\ \cline{2-3}
     & \makecell{$x^2+y^2+Dx+Ey+F=0$\\$(D\neq 0,E^2-4F=0)$} & $D\neq 0,E^2-4F=0$ \\ \hline
     \multirow{2}{*}{圆心在$x$轴上且圆过原点} & $(x-a)^2+y^2=a^2$ & $|a|=r,b=0$ \\ \cline{2-3}
     & $x^2+y^2+Dx=0$ & $E=F=0,D\neq 0$ \\ \hline
    \multirow{2}{*}{圆心在$y$轴上且圆过原点} & $x^2+(y-b)^2=b^2$ & $a=0,|b|=r$ \\ \cline{2-3}
     & $x^2+y^2+Ey=0$ & $D=F=0,E\neq 0$ \\ \hline
    \multirow{2}{*}{圆与$x,y$轴都相切} & \makecell{$(x-a)^2+(y-b)^2=a^2$\\$(|a|=|b|\neq 0)$} & $|a|=|b|=r$ \\ \cline{2-3}
     & \makecell{$x^2+y^2+Dx+Ey+F=0$\\$(|D|=|E|\neq 0)$} & $D^2=E^2=4F$ \\ \hline
    \end{tabular}
    
    \end{document}

    即使使用了array提供的m{<width>}格式这也并不令人满意....

    image.png

    本回答重点在于,希望在不改变目前代码的大框架下(i.e.必须使用原生的tabular环境)权衡好multirowmakecell的功能,试图找到tabular框架下纵向对齐的最佳实践。

    ]]>
    https://ask.latexstudio.net/ask/question/17921.html Sat, 06 Sep 2025 13:29:12 +0800
    如何调整itemize或enumerate里面项目内换行的行距? 项目内文字多时会自然换行,换行的距离怎么调整?enumerate的参数没找到哪个能控制。

    8b44df28-6c9f-4956-bb25-be07468136b7.png 如下图,item内的行距比item间还要大,不太协调。 fc65fcbf-e869-4737-9630-487cb8ec9d0e.png

    \documentclass[a4paper,11pt]{ctexart}
    \usepackage{enumitem}
    \begin{document}
    列表字数多了会分行
    \begin{enumerate}[label={\Alph*.},itemsep=-4mm]%
     \item 有非法关键字?
     \item 有非法关键字?
     \item 有非法关键字?
     \item 有非法关键字?
     \end{enumerate}
    \end{document}
    ]]>
    https://ask.latexstudio.net/ask/question/17917.html Wed, 03 Sep 2025 11:02:38 +0800
    超链接跳转错误 https://www.latexstudio.net/LearnLaTeX/basic/01.html#latex-%E7%9A%84%E5%B7%A5%E4%BD%9C%E6%B5%81%E7%A8%8B的“下一课”页面丢失

    ]]>
    https://ask.latexstudio.net/ask/question/17914.html Mon, 01 Sep 2025 21:15:36 +0800
    超链接跳转错误 https://www.latexstudio.net/LearnLaTeX/basic/01.html#latex-%E7%9A%84%E5%B7%A5%E4%BD%9C%E6%B5%81%E7%A8%8B的“下一课”页面丢失

    ]]>
    https://ask.latexstudio.net/ask/question/17913.html Mon, 01 Sep 2025 21:15:31 +0800
    如何设计命令\noteinpar,以使用户无感地自动创建叠层? LaTeX用户在beamer文档类中设计了一个\noteinpar命令来辅助他的教学活动。该命令可以为一个汉字的下方加上一个小圆点,并在右上方加上一个上标序号,还能在其后的圆括号中突出显示加点字的含义。

    \newcounter{noteinpar}
    \NewDocumentCommand{\noteinpar}{ mm }{%
        \stepcounter{noteinpar}%
        \CJKunderdot{#1}\ignorespaces%
        \textsuperscript{\circledtext[basechar=x,charf=\zihao{-4},boxlinewidth=.2pt]{\thenoteinpar}}%
        {\fangsong ({\textcolor{red}{#2}})}%
    }

    通常看来,这个\noteinpar命令的设计没有什么大问题。他只需要在正文中按下面的格式书写正文,即可创建一个符合他的教学需要的叠层:

    \noteinpar{#1}{\visible<num->{#2}}

    例如:

    劳仑衣\noteinpar{普}{\visible<2->{桑}},认至将指点效\noteinpar{则}{\visible<3->{机}},最你更枝。

    现在,他厌倦了在正文中书写\visible<num->,(因为这句代码需要他手动指定叠层的计数,并且在教学实际中他发现这一帧中的每个叠层都是独立且连续的,绝不会有至少两个加点字的含义需要被同时展示于同一个叠层之中,)并且他希望能够不用书写\visible<num->就能自动创建符合需要的叠层!

    因此,他做了如下尝试:

    1. 新建一个计数器natureframe,它将被紧跟在正文中的每一句\begin{frame}之后,也就是每一帧开始时,用来表示帧的自然序数(但是并不会打印其计数器值到正文中),虽然不知道叠层是否会对此产生影响,但他决定先试一试;
    2. 新建一个计数器naturevisible,它将在使用\visible<num->{#2}时,通过自增并打印计数器值,来代替num这个值;
    3. 每当计数器natureframe自增时,计数器naturevisible的值将被重置为1,这是因为,在教学实际中, 他需要一帧中出现的第一个\visible<num->中的num2开始,也就是说他希望:在一帧中,第1次输入\noteinpar{#1}{#2}时,自动实现\noteinpar{#1}{\visible<2->{#2}},第2次输入\noteinpar{#1}{#2}时,自动实现\noteinpar{#1}{\visible<3->{#2}},第3次输入\noteinpar{#1}{#2}时,自动实现\noteinpar{#1}{\visible<4->{#2}},……;
    4. 修改命令\noteinpar的定义。
      \newcounter{noteinpar}
      \NewDocumentCommand{\noteinpar}{ mm }{%
       \stepcounter{noteinpar}%
       \CJKunderdot{#1}\ignorespaces%
       \textsuperscript{\circledtext[basechar=x,charf=\zihao{-4},boxlinewidth=.2pt]{\thenoteinpar}}%
       {\fangsong ({\stepcounter{naturevisible}\textcolor{red}{\visible<thenaturevisible->{#2}}})}%
      }

      结果是,叠层失效,并且圆括号中突出显示加点字的含义也消失不见了。现在,他需要返回第4步,重新修改定义,或者,更换思路,另起炉灶。

    最小工作示例在此。

    ]]>
    https://ask.latexstudio.net/ask/question/17912.html Mon, 01 Sep 2025 00:35:27 +0800