LaTeXStudio.net 问答 RSS 最新问答 https://ask.latexstudio.net/addons/ask/rss/index Mon, 09 Feb 2026 01:22:05 +0800 使用forest宏包排版树状结构图对于多行文本如何保持节点的对齐? 如题,对于如下的MWE:

\documentclass{standalone}
\usepackage{ctex}
\usepackage[edges]{forest}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}
\begin{forest}
    for tree={
        grow'=east,
        anchor=west,
        inner sep=0pt,
        outer sep=0pt,
        fit=band,
        align=left,
        if n=1{edge path'={(!ul.south west)-- (!u1.north west)}}{no edge},
        edge={decorate, decoration={brace,amplitude=1.5mm,raise=2mm}}
    }
    [1 一级标题
        [1.1 二级标题
            [1.1.1 三级标题
                [1.1.1.1 四级标题]
                [1.1.1.2 四级标题]
            ]
            [1.1.2 三级标题
                [1.1.2.1 四级标题]
                [1.1.2.2 四级标题]
            ]
        ]
        [1.2 二级标题
            [1.2.1 三级标题
                [1.2.1.1 四级标题]
                [1.2.1.2 四级标题]
            ]
            [1.2.2 三级标题
                [1.2.2.1 四级标题]
                [\parbox{8em}{文字文字文字文字文字文字文字文字文字文字文字文字}]
            ]
        ]
    ]
\end{forest}
\end{document}

image.png

希望「{」的父节点总是位于其所有子节点的几何中心。

]]>
https://ask.latexstudio.net/ask/question/18001.html Sun, 08 Feb 2026 11:15:21 +0800
一个趣味循环编程练习 如题,希望实现如下的表格的自动化排版。

代码越简洁、越高度自动化、越具有强拓展性越好。

对具体的实现方法不做任何限制~优雅即可

image.png

划去线的逻辑不必与此相同(我觉得涂色似乎更显眼,在tabularray框架里应该也更容易实现),能体现不同的条件判断即可。

image.png

由于我也会试试,这里暂不给出MWE.

]]>
https://ask.latexstudio.net/ask/question/18000.html Sat, 31 Jan 2026 21:51:59 +0800
l3build 如何打包宏包? 请问,下面的常规编译命令改用 l3build 的方式要怎么操作最方便啊?

我的目的是得到一本完整的 PDF 手册。

附上 hello.inshello.dtx 的源码。

下面的代码是使用传统的 DocStrip 的方式所用到的编译命令。

latex hello.ins

xelatex hello.dtx
makeindex -s gglo.ist -o hello.gls hello.glo
makeindex -s gind.ist -o hello.ind hello.idx
xelatex hello.dtx
xelatex hello.dtx

不知道为什么命令 l3build unpack 不能释放出 hello.sty 文件,会卡在 \usepackage{xeCJK} 这一行。然后我就问了 AI ,并用了下面的命令来编译:

latex hello.ins
l3build doc

然后因为我看不懂 l3build 文档,所以 build.lua 文件(上传失败)的代码也是 AI 生成的:

module = "hello"
-- 关键:禁止 l3build 尝试管理打包过程
packtds = 0
-- 关键:清空 unpackfiles,表示“不需要解包”
unpackfiles = {}
-- 明确源文件目录
sourcefiledir = "."
sourcefiles = {"hello.dtx", "hello.sty"} -- 将已存在的 .sty 也列为源文件

-- 文档编译设置
docfiledir = "."
docfiles = {module..".dtx"}
typesetfiles = docfiles
typesetexe = "xelatex"
typesetopts = "-interaction=nonstopmode"
typesetindexes = {
  ["hello.glo"] = {"hello.gls", "makeindex -s gglo.ist -o hello.gls hello.glo"},
  ["hello.idx"] = {"hello.ind", "makeindex -s gind.ist -o hello.ind hello.idx"}
}
typesetruns = 3

-- 可选:在清理时保留 .sty 文件
function clean_init()
  -- 不删除 hello.sty
  rm("hello.log", "hello.aux", "hello.glo", "hello.idx", "hello.gls", "hello.ind", "hello.ilg", "hello.out")
end
]]>
https://ask.latexstudio.net/ask/question/17998.html Wed, 28 Jan 2026 23:27:22 +0800
为什么目录超过一页就会产生空白页? 是一个美赛模板,不知道为什么目录一旦超过一页或者差不多满一页再接下来正文时就会有一个莫名其妙的空白页?

image.png

]]>
https://ask.latexstudio.net/ask/question/17996.html Sat, 17 Jan 2026 18:31:52 +0800
`elegantbook`宏包的使用`biblatex`选项backref=true时跳转位置不准确? Claim:这种跳转似乎只在pdflatex编译下可复现,在xelatex下跳转行为神秘...

如题,考虑如下的MWE:

elegantbook.cls可以在这里获取。

\begin{filecontents*}[overwrite]{refs.bib}
@book{anima,
  author       = {Aristotle},
  title        = {De Anima},
  date         = 1907,
  editor       = {Hicks, Robert Drew},
  publisher    = cup,
  location     = {Cambridge},
  keywords     = {primary},
  langid       = {english},
  langidopts   = {variant=british},
  annotation   = {A \texttt{book} entry with an \texttt{author} and an \texttt{editor}},
}
\end{filecontents*}
\documentclass[11pt]{elegantbook}
\title{An Elegant \LaTeX{} Template for Books}
\subtitle{Classic Elegant\LaTeX{} Template}
\author{Ethan Deng, Liam Huang, syvshc, sikouhjw \& Osbert Wang}
\institute{Elegant\LaTeX{} Program}
\date{Dec. 31, 2022}
\version{4.5}
\bioinfo{Bio}{Information}
\extrainfo{\textcolor{red}{\bfseries Caution: This template will no longer be maintained since January 1st, 2023.}}
\logo{example-image-duck.pdf}
\cover{example-image-duck.pdf}
\ExecuteBibliographyOptions{backref=true}% add backref support here
\addbibresource{refs.bib}% bib
\begin{document}

\frontmatter

\maketitle%<-

\mainmatter

\lipsum[1-10]

\section{Bibliography}

This template uses biblatex to generate the bibliography, the default citestyle and bibliography style are both \lstinline{numeric}. Let's take a glance at the citation effect. ~\cite{anima} use data from a major peer-to-peer lending

In order to get the editors' auto-completion working, you need to add following code in your preamble:

\lipsum

\printbibliography[heading=bibintoc, title=\ebibname]

\end{document}

情况一:

含有\maketitle,文末参考文献的索引将错误地跳转到「封面首页」

情况1.gif

情况二:

如果去掉\maketitle,则行为符合预期

情况2.gif


问题:

  • 这种现象出现的原因是什么?
  • 在不改动「elegantbook.cls」的绝对前提下,修复\ExecuteBibliographyOptions{backref=true}在添加了\maketitle时功能的最佳实践是?

Edited

一点探索,基本文档类book使用\maketitle不会有这个问题:

\begin{filecontents*}[overwrite]{refs.bib}
@book{anima,
  author       = {Aristotle},
  title        = {De Anima},
  date         = 1907,
  editor       = {Hicks, Robert Drew},
  publisher    = cup,
  location     = {Cambridge},
  keywords     = {primary},
  langid       = {english},
  langidopts   = {variant=british},
  annotation   = {A \texttt{book} entry with an \texttt{author} and an \texttt{editor}},
}
\end{filecontents*}
\documentclass[11pt]{book}
\usepackage{lipsum}
\title{test}
\usepackage[backref=true]{biblatex}
\addbibresource{refs.bib}% bib
\usepackage{hyperref}
\begin{document}

\frontmatter

\maketitle%<-

\mainmatter

\lipsum[1-10]

\section{Bibliography}

This template uses biblatex to generate the bibliography, the default citestyle and bibliography style are both Let's take a glance at the citation effect. ~\cite{anima} use data from a major peer-to-peer lending.

\lipsum

\printbibliography

\end{document}

因此问题应该出在elegantbook自定义的封面命令中....

]]>
https://ask.latexstudio.net/ask/question/17995.html Sat, 17 Jan 2026 15:57:15 +0800
l3keys多选的复杂使用 l3keys我想写个多选:

共有L,R两个选项,需求预期: 1.0. 输入{ mode={ L, R } },得到{ L=true, R=true }; 1.1. 输入{ mode=L },得到{ L=true } (R=false可有可无,下同); 1.2. 输入{ mode=R },得到{ R=true }; 希望选项输入时mode=可以省略,即: 2.0. 输入{ L, R },得到{ L=true, R=true }; 2.1. 输入{ L },得到{ L=true } (R=false可有可无,下同); 2.2. 输入{ R },得到{ R=true }


又增加需求预期: 0.0. 不输入,得到{ L=true, R=true }; 使用.initial:n = { L, R }会妨碍单独输入{ (mode=)L/R }的功能,应该如何解决?


再增加需求预期: 3.1. 输入{ L=false },得到{ L=false, R=true }; 3.2. 输入{ R=false },得到{ L=true , R=false }; 应该如何解决?


2026.01.18更新:

已解决

更新了思路:

\tl_new:N \l__l_tl
\tl_new:N \l__r_tl
\bool_new:N \l__l_bool
\bool_new:N \l__r_bool
\keys_define:nn { mymodule }
  {
    L .code:n     = { \tl_set:Ne \l__l_tl { \fp_compare_p:n {#1} } },
    L .default:n  = { true },
    R .code:n     = { \tl_set:Ne \l__r_tl { \tl_to_bool_p:n {#1} } },
    R .default:n  = { true },
  }
\keys_set:nn { mymodule } { }
\tl_if_empty:NTF \l__l_tl
  { \bool_set:Nn \l__l_bool { \bool_lazy_or_p:nn { \tl_if_empty_p:N \l__r_tl } { ! \l__r_tl } } }
  { \bool_set_eq:NN \l__l_bool \l__l_tl }
\tl_if_empty:NTF \l__r_tl
  { \bool_set:Nn \l__r_bool { \bool_lazy_or_p:nn { \tl_if_empty_p:N \l__l_tl } { ! \l__l_tl } } }
  { \bool_set_eq:NN \l__r_bool \l__r_tl }
\typeout {=====~L:~\bool_to_str:N \l__l_bool,~R:~\bool_to_str:N \l__r_bool~=====}

赋值后: 如果L为空,则取R的值: 若R也为空,即均为空,应均为true,L=true; 若R不为空,则取反,L=!R; 伪代码应为

L = \bool_lazy_or_p:nn
      { \tl_if_empty_p:N R } %若为空则L=true,且短路(不短路对empty取反会报错)
      { !R }                 %若不为空则取反

另外用了个语法糖:

\bool_set:Ne \l__L_bool { \fp_compare_p:n #1 }

interface330.13:(在fp表达式中) truefalse: Other names for 1 and +0.

]]>
https://ask.latexstudio.net/ask/question/17994.html Fri, 16 Jan 2026 18:05:23 +0800
「持续更新」是否有好用的数学公式OCR工具? 该问题将持续更新,将不断补充新发现的高效数学公式OCR工具:


推荐补充者使用:

  • 项目名称/仓库
  • 项目简单介绍
  • 自己的一些comment

的结构组织内容....


]]>
https://ask.latexstudio.net/ask/question/17992.html Mon, 12 Jan 2026 11:36:49 +0800
Article number (不是 pages) 在 BibTeX (bib) 参考文献应该如何表示? 现在有些文章的参考文献格式中不再出现页码了,而是使用 Article number。问题是在 BibTeX (bib) 参考文献应该如何表示它(它指的是 Article number)?

注意到在 RIS 文件中 Article number 被放到了 SP 字段(如下),这个字段的含义大概是 start page。这应该也是错误的。

TY  - JOUR
AU  - Han, Liuliu
AU  - Wang, Jin
AU  - Peter, Nicolas J.
AU  - Maccari, Fernando
AU  - Kovács, András
AU  - Schwaiger, Ruth
AU  - Gutfleisch, Oliver
AU  - Raabe, Dierk
PY  - 2025
DA  - 2025/03/11
TI  - Magnetic and mechanical hardening of nano-lamellar magnets using thermo-magnetic fields
JO  - Nature Communications
SP  - 2423
VL  - 16
IS  - 1
AB  - High-performance magnetic materials based on rare-earth intermetallic compounds are critical for energy conversion technologies. However, the high cost and supply risks of rare-earth elements necessitate the development of affordable alternatives. Another challenge lies in the inherent brittleness of current magnets, which limits their applications for high dynamic mechanical loading conditions during service and complex shape design during manufacturing towards high efficiency and sustainability. Here, we propose a strategy to simultaneously enhance the magnetic and mechanical performance of a rare-earth-free multicomponent magnet. We achieve this by introducing nano-lamellar structures with high shape anisotropy into a cobalt–iron–nickel–aluminum material system through eutectoid decomposition under externally applied thermo-magnetic fields. Compared to the conventional thermally activated processing, the thermo-magnetic field accelerates phase decomposition kinetics, producing finer lamellae spacings and smaller eutectoid colonies. The well-tailored size, density, interface, and chemistry of the nano-lamellae enhance their pinning effect against the motion of both magnetic domain walls and dislocations, resulting in concurrent gains in coercivity and mechanical strength. Our work demonstrates a rational pathway to designing multifunctional rare-earth-free magnets for energy conversion devices such as high-speed motors and generators operating under harsh service conditions.
SN  - 2041-1723
UR  - https://doi.org/10.1038/s41467-025-57571-6
DO  - 10.1038/s41467-025-57571-6
ID  - Han2025
ER  - 

如果利用 doi2bib 工具,则会发现参考文献中没有 Article number 2423,如下。

@article{Han2025,
  title = {Magnetic and mechanical hardening of nano-lamellar magnets using thermo-magnetic fields},
  volume = {16},
  ISSN = {2041-1723},
  url = {http://dx.doi.org/10.1038/s41467-025-57571-6},
  DOI = {10.1038/s41467-025-57571-6},
  number = {1},
  journal = {Nature Communications},
  publisher = {Springer Science and Business Media LLC},
  author = {Han,  Liuliu and Wang,  Jin and Peter,  Nicolas J. and Maccari,  Fernando and Kovács,  András and Schwaiger,  Ruth and Gutfleisch,  Oliver and Raabe,  Dierk},
  year = {2025},
  month = mar 
}
]]>
https://ask.latexstudio.net/ask/question/17990.html Thu, 08 Jan 2026 10:47:21 +0800
用`tikz`中的`polt`绘制`y=sqrt{16/(x+2)^2-(x-2)^2}`的图像时最右端部分无法闭合? tikz中的polt绘制24年新I卷数学第11题的飘带函数

y=sqrt{16/(x+2)^2-(x-2)^2}

的图像时最右端部分无法闭合,定义域已正确设置,请问有谁指定是什么地方有问题吗?

1.PNG

2.PNG

]]>
https://ask.latexstudio.net/ask/question/17988.html Sat, 03 Jan 2026 13:24:29 +0800
如何将部分公式实现缩进? 2.png 怎么将最后两行公式缩进,实现与倒数第三行的等号对齐 最终效果应该是最后三行在同一条垂直线上

\begin{equation}
    \begin{aligned}
        \min _{a_{i}^{*}, a_{i}} \frac{1}{2} \sum_{i=1}^{n} \sum_{j=1}^{n} & \left(a_{i}^{*}-a_{i}\right)\left(a_{j}^{*}-a_{j}\right) \phi_{Z}\left(X_{i}\right)^{T} \phi_{Z}\left(X_{j}\right)-\sum_{i=1}^{n}\left[y_{i}\left(a_{i}^{*}-a_{i}\right)-\varepsilon\left(a_{i}^{*}+a_{i}\right)\right], \\
        \text { s.t. } \quad & \sum_{i=1}^{n}\left(a_{i}^{*}-a_{i}\right)=0, \\
        & 0 \leq a_{i}^{*}, a_{i} \leq C, \\
        & \phi_{Z}\left(X_{i}\right)^{T} \phi_{Z}\left(X_{j}\right)=\varphi\left(K_{D E K F}\left(X_{i}, Z\right)\right)^{T} \varphi\left(K_{D E K F}\left(X_{j}, Z\right)\right), \\
        & =\left\langle\varphi\left(K_{D E K F}\left(X_{i}, Z\right)\right), \varphi\left(K_{DEKF}\left(X_{j}, Z\right)\right)\right\rangle, \\
        & =K\left(K_{D E K F}\left(X_{i}, Z\right), K_{D E K F}\left(X_{j}, Z\right)\right),
    \end{aligned}
    \label{eq:6}
\end{equation}
]]>
https://ask.latexstudio.net/ask/question/17985.html Fri, 26 Dec 2025 16:44:26 +0800
模板历史版本问题 如何删除已发布模板的所有历史版本,只保留最新版本,防止用户错误下载旧版本导致格式不对的问题,而且用户进入历史版本页面无法勾选最新版本,可能造成误解

]]>
https://ask.latexstudio.net/ask/question/17981.html Thu, 25 Dec 2025 16:29:36 +0800
在elegantbook.cls的现有框架中,添加「cleveref」功能的最佳实践? 众所周知,在默认的fancy模式下的「定理类」环境基于tcolorbox实现:

具体代码可见:https://github.com/ElegantLaTeX/ElegantBook/blob/master/elegantbook.cls#L911-L1037

本问题的需求是:在不改变现有的frozen版本elegantbook.cls的前提下,希望给其增加「cleveref」功能。


一点探索:

既然elegantbook.cls是基于tcolorbox的,因此首先一定要先在tcolorbox里实现cleveref的功能。查阅文档得知,大约有两套方案:

  • 基于cleveref(2018年以来不再更新,经常与hyperref的功能起冲突)
  • 基于zref-clever

对于方案一:

一个最小例子如下:

\documentclass[12pt]{article} 
\usepackage[
    noheadfoot,
    margin=8mm,
    papersize={10cm,10cm},
]{geometry} 
\usepackage{cleveref}
\usepackage{tcolorbox}
\newtcolorbox[
    auto counter,
    number within=section,
    crefname={bluebox}{blueboxes}
]{mybluebox}[2][]{
    % label is label,% default value
    colback=blue!5!white,
    colframe=blue!75!black,
    fonttitle=\bfseries,
    title=Bluebox \thetcbcounter: #2,#1
}
\begin{document} 
\section{Blue}

\begin{mybluebox}[label={myreference}]{My title} 
This is an example.
\end{mybluebox}

\begin{mybluebox}[label={myreference2}]{My titletitle} 
This is an example.
\end{mybluebox}

\noindent
\Cref{myreference}, \cref{myreference}.\\ 
\Cpageref{myreference}, \cpageref{myreference}.\\ 
\nameCref{myreference}, \namecref{myreference}.\\ 
\labelcref{myreference}, \labelcpageref{myreference}.\\ 
\Cref{myreference2}, \cref{myreference2}\\
\Cref{myreference,myreference2}, \cref{myreference,myreference2}\\

\end{document}

image.png

对于方案二:

\documentclass[12pt]{article} 
\usepackage[
    noheadfoot,
    margin=8mm,
    papersize={10cm,10cm},
]{geometry} 
\usepackage{zref-clever}
\zcRefTypeSetup{mybluebox}{
    Name-sg = Bluebox , 
    name-sg = bluebox , 
    Name-pl = Blueboxes ,
    name-pl = blueboxes ,
}
\usepackage{tcolorbox}
\newtcolorbox[
    auto counter,
    number within=section,
]{mybluebox}[2][]{
    label type=mybluebox,
    colback=blue!5!white,
    colframe=blue!75!black,
    fonttitle=\bfseries,
    title=Bluebox \thetcbcounter: #2,#1
}
\begin{document} 
\section{Blue}

\begin{mybluebox}[label={myreference}]{My title} 
This is an example.
\end{mybluebox}

\begin{mybluebox}[label={myreference2}]{My titletitle} 
This is an example.
\end{mybluebox}

\noindent
\zcref{myreference}.\\ 
\zcpageref{myreference}.\\ 
\zcref[S]{myreference}.\\
\zcref[S]{myreference,myreference2}.\\
\zcref{myreference,myreference2}.\\

\end{document}

image.png


现在的核心问题是,由于elegantbook已经停止维护了,最好是在不改变elegantbook.cls(v4.5)当前架构的大前提下,在main.tex下通过类似/.append style或者覆盖现有配置等方式实现对「定理类环境」的「cleveref」功能。

image.png

由于在这里使用了共同的接口\ELEGANT@newtheorem,我个人感觉无论是:

image.png

  • 想在init options里传入cleverefcrefname选项
  • 或者想在类似thmstyle样式里加入label typezref-clever方案

都不太轻松...


一个可供测试的MWE如下:

注意这里的\documentclass{elegantbook}用的就是这个官方唯一指定的v4.5文件,不允许对.cls文件做任何修改

\documentclass[lang=cn,fontset=fandol]{elegantbook}
\geometry{paperheight=12cm}
\usepackage{cleveref}
% \usepackage{zref-clever}
% \zcRefTypeSetup{mytheorem}{Name-sg={定理},Name-pl={定理}}
% \zcRefTypeSetup{mylemma}{Name-sg={引理},Name-pl={引理}}

\begin{document}
\chapter{111}

\begin{theorem}{欧拉定理}{Euler}
    这是一个定理。
\end{theorem}

\cref{lem:Osbert} 

\cref{lem:Wong}

\cref{lem:Osbert,lem:Wong}

% \zcref{lem:Osbert} 

% \zcref{lem:Wong}

% \zcref{lem:Osbert,lem:Wong}

\chapter{222}

\begin{lemma}{Osbert引理}{Osbert}
    这是一个引理。
\end{lemma}

\begin{theorem}{欧几里得公理}{Euclide}
    这是另一个定理。
\end{theorem}

\cref{thm:Euler}

\cref{thm:Euclide} 

\cref{thm:Euler,thm:Euclide}

% \zcref{thm:Euler}

% \zcref{thm:Euclide} 

% \zcref{thm:Euler,thm:Euclide}

\chapter{333}
\begin{lemma}{Wong引理}{Wong}
    这是一个引理。
\end{lemma}

\end{document}

当然,也希望该功能可以加入2026年可能有希望短暂(复活)的elegantbook更新中....

]]>
https://ask.latexstudio.net/ask/question/17980.html Sun, 14 Dec 2025 14:39:31 +0800
footline用tikz画直线为什么最左边有空隙 请问为什么footline中用tikz画直线,最左边有空隙。尝试了\hspace{-1pt},overlay,remember picture这些办法可以,是否可以不用这些,使得左边没有空隙。以下是代码

\documentclass{ctexbeamer}
\usepackage{tikz}
\usetikzlibrary{calc}
\setbeamertemplate{footline}{
   %\hspace*{-0.2pt}%
  \begin{tikzpicture}
    \def\r{1pt}
    \def\d{0.3pt}
    \coordinate (A) at (0,1.3em);
    \coordinate (B) at ($(A)+(0:{\paperwidth-(\r)-(\d)})$);
    \draw[red] (A)--(B);
    \fill[fill=white,line width=\d] (B) circle (\r);
    \node[anchor=south west,inner sep=0pt,outer sep=0pt,fill=red] at (0,0){\color{white}测试测试测试};
  \end{tikzpicture}
}
\begin{document}
\begin{frame}
  测试
\end{frame}
\end{document}

image.png

]]>
https://ask.latexstudio.net/ask/question/17977.html Thu, 11 Dec 2025 16:35:01 +0800
下载的国家标准模板编译出错 This compile didn’t produce a PDF. This can happen if: There is an unrecoverable LaTeX error. If there are LaTeX errors shown below or in the raw logs, please try to fix them and compile again. The document environment contains no content. If it’s empty, please add some content and compile again. This project contains a file called output.pdf. If that file exists, please rename it and compile again.

lightbulb Tip: Try to fix the first error and recompile. Often one error causes many later error messages. You can to focus on fixing errors. We recommend fixing errors as soon as possible; letting them accumulate may lead to hard-to-debug and fatal errors. Learn more

If you need to see the full logs, you can still download them or view the raw logs below.

]]>
https://ask.latexstudio.net/ask/question/17976.html Thu, 11 Dec 2025 14:40:52 +0800
如何实现这种带虚线的边框? cf64352b157d8e6b6f18c8356f12a4bd.png

想要复刻如图所示这种带虚线的边框和上下箭头,我的代码如下:

$\arraycolsep=1pt
\begin{array}{*1l@{\hskip\arraycolsep}c@{\hskip\arraycolsep}*{12}{>{\textstyle}l}}
x^3 & + & 2^3 & = (& x & + & 2) (& x^2 & - & x &\cdot& 2 & + & 2^2) \\
\bigg\updownarrow & & \bigg\updownarrow & & \bigg\updownarrow &  & \bigg\updownarrow & \bigg\updownarrow &  & \bigg\updownarrow & &\bigg\updownarrow & & \bigg\updownarrow \\
a^3 & + & b^3 & = (&a & + & b) (& a^2 & - & a&\cdot& b & + & b^2)
\end{array}$

实现效果

9c3c765118f431ca79b906a984c6b221.png

请教,如何实现带虚线的边框?

]]>
https://ask.latexstudio.net/ask/question/17974.html Mon, 08 Dec 2025 15:43:26 +0800
无法在 xeCJKfntef 宏包的 \CJKunderanyline* 命令中使用\zhlipsum 以及 \lisum 命令? 发行版texlive2025 编译命令:xelatex 问题\zhlipsum 以及 \lisum 命令无法使用 xeCJKfntef 宏包的 \CJKunderanyline* 命令?但 \newcommand\testtext 却可以在 \CJKunderanyline* 中使用 MWE: 如下

\documentclass{ctexart}
\usepackage{lipsum,zhlipsum}
\usepackage{xcolor}
\usepackage{xeCJKfntef}
\newcommand{\testtext}{我能吞下玻璃而不伤身体。我能吞下玻璃而不伤身体。我能吞下玻璃而不伤身体。我能吞下玻璃而不伤身体。}
\begin{document}
\CJKunderanyline*{0.5ex}{\color{cyan!10}\rule{2pt}{2.5ex}}{\zhlipsum[1]}
\CJKunderanyline*{0.5ex}{\color{cyan!10}\rule{2pt}{2.5ex}}{\lipsum[1]}

\CJKunderanyline*{0.5ex}{\color{cyan!10}\rule{2pt}{2.5ex}}{\testtext}

\CJKunderanyline*{0.5ex}{\color{cyan!10}\rule{2pt}{2.5ex}}{我能吞下玻璃而不伤身体。我能吞下玻璃而不伤身体。我能吞下玻璃而不伤身体。我能吞下玻璃而不伤身体。}
\end{document}

效果如下: image.png

]]>
https://ask.latexstudio.net/ask/question/17972.html Sat, 06 Dec 2025 08:34:19 +0800
行内盒子断行问题解决? 发行版:texlive2025overleaf) 编译方式:xelatex(或者 lualatex) 问题:想要在 elegantbook 文档类中实现行内盒子断行,但是 tcolorbox 行内盒子无法自动断行? 效果如下: image.png

盒子实现如下:

% 英文单词背景框(微调内边距,更舒展美观)
\newtcbox{\englishbox}{
    on line,
    boxrule=0pt,
    boxsep=1.5pt, % 盒内文字与边框的间距(比1pt舒展、比2pt紧凑)
    top=1pt,
    bottom=1pt,
    left=3pt, % 盒左侧内边距(比2pt更舒展)
    right=3pt, % 盒右侧内边距(比2pt更舒展)
    colback=cyan!10,
    colframe=cyan!10,
    arc=3pt,
    enhanced jigsaw
}

% 核心命令(保留你原有的写法)
\newcommand{\wordbox}[2]{%
    \englishbox{\textbf{#1}}% 
    \textcolor{blue!70!black}{(#2)}% 
}
]]>
https://ask.latexstudio.net/ask/question/17971.html Fri, 05 Dec 2025 22:57:35 +0800
为什么不能顺利绑定手机?一直点不到正确位置? 为什么不能顺利绑定手机?一直点不到正确位置?19843945548

]]>
https://ask.latexstudio.net/ask/question/17968.html Mon, 01 Dec 2025 19:58:36 +0800
circuitikz宏包绘制滑动电阻问题及微调元件位置 老师们好!请教一个绘制滑动电阻的问题及微调元件位置,要绘制的图片效果如下: PixPin_2025-11-30_19-53-41.jpg

目前绘制的效果如下: PixPin_2025-11-30_19-57-15.jpg

代码如下:

\documentclass{ctexbook}
\usepackage{circuitikz}

\begin{document}

\begin{circuitikz}[european]
    \draw(0,0)to[rmeter,t=A](0,2)to[R,l_=$R$](3,2)to[pR,l_=$R'$,n=pr](5,2);
    \draw(0,0)to[normal open switch](6,0)|-(pr.wiper);
\end{circuitikz}

\end{document}

不知道去除多余的线,不知道怎么调元件的位置。

]]>
https://ask.latexstudio.net/ask/question/17966.html Sun, 30 Nov 2025 19:58:35 +0800
使用exam-zh模板在windows下编译\subject命令出现字体警告?
  • win11
  • texlive2025
  • vscode
  • xelatex
  • \documentclass{exam-zh}
    \begin{document}
    % 设置试卷标题和科目
    \title{数学测试}
    \subject{数学}
    \maketitle
    % 第一道选择题
    \begin{question}
    $1 + 1 = $ \paren[C]
    \end{question}
    \end{document}

    取消\subject{},没有报错。

    LaTeX Font: Font shape `TU/SimHei(0)/b/n' undefined
    (Font)  using `TU/SimHei(0)/m/n' instead.

    不知道是什么原因,就是想解决他。

    ]]>
    https://ask.latexstudio.net/ask/question/17964.html Sat, 29 Nov 2025 09:57:50 +0800