LaTeXStudio.net 问答 RSS 最新问答 https://ask.latexstudio.net/addons/ask/rss/index Sun, 25 Jan 2026 19:34:37 +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
    关于ieeecolor模板参考文献中缺少doi的问题 如下链接给出的「ieeecolor模板」Alternate-Transactions-Articles-LaTeX-template2.zip 中,使用了「ieeecolor」文档类,现在考虑如下的MWE:

    \documentclass[journal,twoside,web]{ieeecolor}
    \usepackage{generic}
    \usepackage{cite}
    \begin{filecontents*}[overwrite]{refs.bib}
    @article{mahon2017sg,
      title = {{The {5G} effect on {RF} filter technologies}},
      volume = {30},
      number = {4},
      journal = {{IEEE Transactions on Semiconductor Manufacturing}},
      author = {Mahon, Steven},
      year = {2017},
      pages = {494--499},
      doi={10.1109/TSM.2017.2757879},
    }
    @article{lee2018spectrum,
      title = {{Spectrum for {5G}: {Global} status, challenges, and enabling technologies}},
      volume = {56},
      number = {3},
      journal = {{IEEE Communications Magazine}},
      author = {Lee, Juho and Tejedor, Erika and Ranta-aho, Karri and Wang, Hu and Lee, Kyung-Tak and Semaan, Eliane and Mohyeldin, Eman and Song, Juyeon and Bergljung, Christian and Jung, Sangyeob},
      year = {2018},
      pages = {12--18},
      doi={10.1109/MCOM.2018.1700818},
    }
    \end{filecontents*}
    \bibliographystyle{IEEEtran}
    \begin{document}
    
    Hello world\cite{mahon2017sg} ahahahha\cite{lee2018spectrum} ahaha!
    
    \bibliography{refs}
    
    \end{document}

    这将得到:

    image.png

    但现在编辑要求在参考文献列表中增加「DOI」的字段信息,在当前的模板和.bib的框架下,满足编辑这一需求的最佳实践是什么?

    Edit

    需要指出的是,在上述链接里使用的模板根本没有考虑「DOI」的问题,但是编辑却要你考虑。

    这本身就是个非常不合理的要求!!!

    不是(不能、也不应该)让所有的投稿者都是「bibtex」砖家(至少我不是)

    ]]>
    https://ask.latexstudio.net/ask/question/17963.html Fri, 28 Nov 2025 13:21:13 +0800
    想问一下如何在居右的情况下,转行后“这”与“需”对齐 QQ20251128-101716.png

    \documentclass{ctexbook}
    \usepackage{titlesec,color,calc}
    
    \newcommand{\HZSBH}{\sffamily\bfseries\Large}
    \newcommand{\HYXSQS}{}
    
    \newlength{\chapterhang}
    
    \titleformat{\chapter}[hang]
      {\raggedleft\HZSBH\HYXSQS\color[cmyk]{1,1,0,0}}
      {第\thechapter 章}
      {1em}
      {\setlength{\chapterhang}{\widthof{第\thechapter 章}+1em}% 改动:+3em
       \makebox[0pt][r]{%
         \parbox[t]{\dimexpr\linewidth-\chapterhang-1em\relax}{%
           \setlength{\parindent}{0pt}%
           \parshape=2
             0pt \hsize
             \chapterhang \dimexpr\hsize-\chapterhang\relax
         }}}
    
    \titlespacing{\chapter}{0mm}{-6mm}{30mm}
    
    \begin{document}
    \chapter{这是一个很长的章节标题\\ 需要自动换行}
    \chapter{TCP服装参数优化}
    \end{document}
    ]]>
    https://ask.latexstudio.net/ask/question/17962.html Fri, 28 Nov 2025 10:19:22 +0800
    TeXstudio中无法使用asymptote来绘图 我准备在TeXstudio中使用asymptote来绘图。但pdf中无生成的图片。 Latex代码如下:

    \documentclass{article}
    \usepackage[pdftex]{graphicx}
    \usepackage{asymptote}
    \begin{document}
        Hello.  
        I like to make pics with Asymptote like this one:
        \begin{figure}[h]
            \begin{asy}
            import graph;
            size(1inch);
            filldraw(circle((0,0),1),yellow,black);
            fill(circle((-.3,.4),.1),black);
            fill(circle((.3,.4),.1),black);
            draw(arc((0,0),.5,-140,-40));
            \end{asy}
        \end{figure}
        \par It makes me happy, 
        since I can still type my normal LaTeX stuff around it: 
        \(\int_0^{\pi}{\sin{x}}\,dx=2\)
    \end{document}

    如果编译成功,pdf应为这样: 1.png

    但我用自己的TeXstudio编译,asymptote的图却无法显示. 2.png

    在文件夹中生成了一个.Asy文件 3.png

    打开这个.Asy的文档,里面内容如下:

    if(!settings.multipleView) settings.batchView=false;
    settings.tex="pdflatex";
    defaultfilename="例1-1";
    if(settings.render < 0) settings.render=4;
    settings.outformat="";
    settings.inlineimage=true;
    settings.embed=true;
    settings.toolbar=false;
    viewportmargin=(2,2);
    
    import graph;
    size(1inch);
    filldraw(circle((0,0),1),yellow,black);
    fill(circle((-.3,.4),.1),black);
    fill(circle((.3,.4),.1),black);
    draw(arc((0,0),.5,-140,-40));
    

    求助大佬,有什么建议和解决方法吗?非常感谢

    ]]>
    https://ask.latexstudio.net/ask/question/17959.html Mon, 17 Nov 2025 23:38:59 +0800