LaTeXStudio.net 问答 RSS 最新问答 https://ask.latexstudio.net/addons/ask/rss/index Sat, 26 Apr 2025 23:28:07 +0800 如何在latex中将字体改为如图所示的字体? 字体如图所示,目前还没搜到怎么修改,所以来提问. 字体.png

]]>
https://ask.latexstudio.net/ask/question/17757.html Wed, 23 Apr 2025 15:48:54 +0800
在beamer中,用hyperref、cleveref宏包,超链接失效? 我在beamer中,加载了hyperref和cleveref宏包,生成的超链接只是普通的文本,点击却不能跳转,求大佬指点。

\documentclass{beamer}
\usetheme{Berlin}
\usepackage{ctex}
\usepackage{amsmath}
\usefonttheme{serif}
\usepackage{hyperref}
\usepackage{cleveref}

\crefformat{equation}{#2式~(#1#3)}

\title{Title here}
\author{群除我佬}

\date{\today}
\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\section{问题重述}
\begin{frame}{问题重述}
    这是上帝公式
    \begin{equation}
        \mathrm{e}^{\mathrm{i}\pi}+1=0
        \label{eq:1}
    \end{equation}
\end{frame}

\begin{frame}
    \cref{eq:1}是最美的公式。
\end{frame}

\end{document}
]]>
https://ask.latexstudio.net/ask/question/17756.html Tue, 22 Apr 2025 23:42:21 +0800
如何绘制一个能够指定长度的且能够换行的hrule? 如题,想做一个练习册,里面有填空题,编译结果是这样的:

image.png

  1. 答题线的前后行文都不能增减一字,而默认两端对齐且\hrule命令生成受限水平盒子无法换行,所以,第(1)题超出左栏栏宽的答题线,必须能够换行,但是我总不能每次都去数还有几个字的水平距离够我使用,所以这件事需要TeX帮我完成;

  2. 第(2)、(3)两题的答题线虽然被放在分栏内,没有超出栏宽,但\hrule不能换行导致前后行中字数过少,所以两端对齐条件下文字间距变得松散,极不美观,所以希望上下两行的能够换行的答题线长度之和是定值,暂定为9em,考虑到通用性,希望可以指定任意合理的长度;

\documentclass[UTF8]{ctexart}%pdflatex编译
\usepackage[showframe,margin=1in]{geometry}
\usepackage{enumitem}
\setlist[enumerate]{nosep,labelsep=0pt,leftmargin=2em}
\usepackage{multicol}
\setlength{\columnseprule}{.4pt}
\setlength{\columnsep}{1cm}
\begin{document}

\noindent\textbf{16. }补写出下列句子中的空缺部分。(6分)

\begin{multicols}{2}

\begin{enumerate}[label=(\arabic{enumi})]
    \item 
    王湾《次北固山下》的名句“\rule{9em}{.4pt},\rule{9em}{.4pt}”,描写时序交替中的景物,暗示着时光流逝,蕴含着自然理趣。
    \item 
    小慧为朋友家的农家乐餐厅写宣传横幅,直接使用了陆游《游山西村》里的“\rule{9em}{.4pt},\rule{9em}{.4pt}”两句诗,朋友看了觉得很贴切。
    \item 
    行至群山深处,见到一挂瀑布飞泻而下,水石激荡,轰鸣作响,于老师回头对学生们说:“这不就是古诗中写的‘\rule{9em}{.4pt},\rule{9em}{.4pt}’嘛!”
\end{enumerate}

\end{multicols}

\noindent\textbf{参考答案:}

\begin{enumerate}[label=(\arabic{enumi})]
    \item 
    海日生残夜\quad 江春入旧年
    \item 
    山重水复疑无路\quad 柳暗花明又一村
    \item 
    飞流直下三千尺\quad 疑是银河落九天(飞湍瀑流争喧豗\quad 砯崖转石万壑雷)
\end{enumerate}

\end{document}
]]>
https://ask.latexstudio.net/ask/question/17754.html Sat, 19 Apr 2025 16:48:48 +0800
实现如图效果:采用\quad无法实现多行公式的复杂对齐 \documentclass{article} \usepackage{amsmath} \usepackage{lipsum} \begin{document} \begin{align} \mathrm{max}\sum_{i=1}^np_if_i(s_i)\mathrm{(3-1)} \\ \mathrm{s.t.}\sum_{j=1}^{n+1}x_{0,j}=\sum_{i=0}^{n}x_{i,n+1}=1,\mathrm{(3-2)} \\ \sum_{j=0,j\neq i}^nx_{j,i}=\sum_{j=1,j\neq i}^{n+1}x_{i,j}=y_i,\mathrm{(3-3)} \\ \sum_{i=1}^{n}s_{i}+\sum_{i=0}^{n}\sum_{j=1}^{n+1}t_{ij}x_{ij}\leq T_{\max},(3-4) \\ s_{i}\leq\tau_{i}y_{i},\mathrm{(3-5)} \\ 1\leq z_{i}\leq n,\mathrm{(3-6)} \\ z_{i}-z_{j}+1\leq n(1-x_{ij}),(3-7) \\ x_{ij}\in\{0,1\},\mathrm{(3-8)} \\ y_{i}\in\{0,1\},\mathrm{(3-9)} \\ s_{i}\geq0,\mathrm{(3-10)} \end{align} \end{document} ``` 如下效果 ![image.png](https://pics.latexstudio.net/uploads/20250419/ff8b3b0b210b59d072466c93ee4406ce.png) ]]> https://ask.latexstudio.net/ask/question/17753.html Sat, 19 Apr 2025 13:44:16 +0800 USTBExam的v2.0版本继承自exam-zh编译未通过? 这是报错截图

b1ca5c6346a9cc350a86fc889956c6d9.png

代码文件demo.tex

.cls文件 USTBExam.cls

]]>
https://ask.latexstudio.net/ask/question/17745.html Tue, 15 Apr 2025 08:49:38 +0800
在本网站下载的书的封面,编译老出错 \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{intersections,decorations.text} \definecolor{c1}{RGB}{62, 97, 127} \definecolor{c2}{RGB}{104, 182, 182} \definecolor{c3}{RGB}{107, 190, 190} \definecolor{c4}{RGB}{100, 172, 174} \definecolor{c5}{RGB}{95, 162, 162} \begin{document} \thispagestyle{empty} \begin{tikzpicture}[overlay,remember picture,font=\sffamily\bfseries] \draw[ultra thick,c4,name path=big arc] ([xshift=-2mm]current page.north) arc(150:285:11) coordinate[pos=0.225] (x0); \begin{scope} \clip ([xshift=-2mm]current page.north) arc(150:285:11) --(current page.north east); \fill[c4!50,opacity=0.25] ([xshift=4.55cm]x0) circle (4.55); \fill[c4!50,opacity=0.25] ([xshift=3.4cm]x0) circle (3.4); \fill[c4!50,opacity=0.25] ([xshift=2.25cm]x0) circle (2.25); \draw[ultra thick,c4!50] (x0) arc(-90:30:6.5); \draw[ultra thick,c4] (x0) arc(90:-30:8.75); \draw[ultra thick,c4!50,name path=arc1] (x0) arc(90:-90:4.675); \draw[ultra thick,c4!50] (x0) arc(90:-90:2.875); \path[name intersections={of=big arc and arc1,by=x1}]; \draw[ultra thick,c4,name path=arc2] (x1) arc(135:-20:4.75); \draw[ultra thick,c4!50] (x1) arc(135:-20:8.75); \path[name intersections={of=big arc and arc2,by={aux,x2}}]; \draw[ultra thick,c4!50] (x2) arc(180:50:2.25); \end{scope} \path[decoration={text along path,text color=c4, raise = -2.8ex, text along path, text = {|\sffamily\bfseries|02/18/2019}, text align = center, }, decorate ] ([xshift=-2mm]current page.north) arc(150:245:11); % \begin{scope} \path[clip,postaction={fill=c3}] ([xshift=2cm,yshift=-8cm]current page.center) rectangle ++ (4.2,7.7); \draw[c5,ultra thick,fill=c2] ([xshift=0.5cm,yshift=-8cm]current page.center) ([xshift=0.5cm,yshift=-8cm]current page.center) arc(180:60:2) |- ++ (-3,6) --cycle; \draw[ultra thick,c5] ([xshift=-1.5cm,yshift=-8cm]current page.center) arc(180:0:2); \draw[ultra thick,c5] ([xshift=0.5cm,yshift=-8cm]current page.center) arc(180:0:2); \draw[ultra thick,c5] ([xshift=2.5cm,yshift=-8cm]current page.center) arc(180:0:2); \draw[ultra thick,c5] ([xshift=4.5cm,yshift=-8cm]current page.center) arc(180:0:2); \fill[red] ([xshift=2.5cm,yshift=-8cm]current page.center) +(60:2) circle(1.5mm) node[above right=2mm,text=c5!80!black]{$\rho:=\dfrac{1+\sqrt{-3}}{2}$}; \end{scope} % \fill[c1] ([xshift=2cm,yshift=-8cm]current page.center) rectangle ++ (-12.7,7.7); \node[text=white,anchor=west,scale=5,inner sep=0pt] at ([xshift=-8cm,yshift=-3.25cm]current page.center) {Some text}; \node[text=white,anchor=west,scale=2.5,inner sep=0pt] at ([xshift=-8cm,yshift=-6cm]current page.center) {Some text}; % \draw[gray,line width=5mm] ([xshift=2mm,yshift=-1mm]current page.south west) rectangle ([xshift=-2mm,yshift=1mm]current page.north east); \end{tikzpicture} \end{document}
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections,decorations.text}
\definecolor{c1}{RGB}{62, 97, 127}
\definecolor{c2}{RGB}{104, 182, 182}
\definecolor{c3}{RGB}{107, 190, 190}
\definecolor{c4}{RGB}{100, 172, 174}
\begin{document}
    \thispagestyle{empty}
    \begin{tikzpicture}[overlay,remember picture,font=\sffamily\bfseries]
        \draw[very thick,c4,name path=big arc] ([xshift=-2mm]current page.north) arc(150:285:11)
        coordinate[pos=0.225] (x0);
        \begin{scope}
            \clip ([xshift=-2mm]current page.north) arc(150:285:11) --(current page.north
            east);
            \fill[c4!50,opacity=0.25] ([xshift=4.55cm]x0) circle (4.55);
            \fill[c4!50,opacity=0.25] ([xshift=3.4cm]x0) circle (3.4);
            \fill[c4!50,opacity=0.25] ([xshift=2.25cm]x0) circle (2.25);
            \draw[very thick,c4!50] (x0) arc(-90:30:6.5);
            \draw[very thick,c4] (x0) arc(90:-30:8.75);
            \draw[very thick,c4!50,name path=arc1] (x0) arc(90:-90:4.675);
            \draw[very thick,c4!50] (x0) arc(90:-90:2.875);
            \path[name intersections={of=big arc and arc1,by=x1}];
            \draw[very thick,c4,name path=arc2] (x1) arc(135:-20:4.75);
            \draw[very thick,c4!50] (x1) arc(135:-20:8.75);
            \path[name intersections={of=big arc and arc2,by={aux,x2}}];
            \draw[very thick,c4!50] (x2) arc(180:50:2.25);
        \end{scope}
        \path[decoration={text along path,text color=c4,
            raise = -2.8ex,
            text  along path,
            text = {|\sffamily\bfseries|02/18/2019},
            text align = center,
        },
        decorate
        ] ([xshift=-2mm]current page.north) arc(150:245:11);
        %
        \begin{scope}
            \path[clip,postaction={fill=c3}]
            ([xshift=2cm,yshift=-8cm]current page.center) rectangle ++ (4.2,7.7);
            \fill[c2] ([xshift=0.5cm,yshift=-8cm]current page.center)
            ([xshift=0.5cm,yshift=-8cm]current page.center)  arc(180:60:2)
            |- ++ (-3,6) --cycle;
            \draw[very thick,c4] ([xshift=-1.5cm,yshift=-8cm]current page.center)
            arc(180:0:2);
            \draw[very thick,c4] ([xshift=0.5cm,yshift=-8cm]current page.center)
            arc(180:0:2);
            \draw[very thick,c4] ([xshift=2.5cm,yshift=-8cm]current page.center)
            arc(180:0:2);
            \draw[very thick,c4] ([xshift=4.5cm,yshift=-8cm]current page.center)
            arc(180:0:2);
            \fill[red] ([xshift=2.5cm,yshift=-8cm]current page.center) +(60:2) circle(1.5mm)
            node[above right=2mm]{$\displaystyle\rho=\frac{1+\sqrt{-3}}{2}$};
        \end{scope}
        %
        \fill[c1] ([xshift=2cm,yshift=-8cm]current page.center) rectangle ++ (-12.7,7.7);
        \node[text=white,anchor=west,scale=5,inner sep=0pt] at
        ([xshift=-8cm,yshift=-3.25cm]current page.center) {Some text};
        \node[text=white,anchor=west,scale=2.5,inner sep=0pt] at
        ([xshift=-8cm,yshift=-6cm]current page.center) {Some text};
        %
        \draw[gray,line width=5mm]
        ([xshift=2mm,yshift=-1mm]current page.south west) rectangle ([xshift=-2mm,yshift=1mm]current
        page.north east);
    \end{tikzpicture}
\end{document}

上面是在本网站下载的一个封面,编译提示:

xkeyval.sty: 错误: : Emergency stop.

工具是texstudio,新手请大家不吝赐教。不止是这一个,我在咱们这个网站上下载的书籍封面编译都有这个错误!

]]>
https://ask.latexstudio.net/ask/question/17742.html Sun, 13 Apr 2025 22:41:32 +0800
关于wrapstuff宏包与tabto宏包的兼容问题 当tabto宏包遇到wrapstuff时,部分文本不显示。该怎么处理呢

\documentclass{article}                                                                           \usepackage{wrapstuff}
\usepackage{tabto}

\begin{document}
\NumTabs{3} A \tab B\tab C \newline   

\begin{wrapstuff}[type=figure,width=3cm,r]
  \centering
  {AAA BBB BBB} \\
  {AAA BBB BBB}\\
\end{wrapstuff}
\NumTabs{3} A \tab B\tab C \newline                                                                                                                                                                 \end{document}   

image.png

问题补充: @u40 指出 \wrapstuffclear,可以消除文本不显示影响。 是的,这解决了我的问题。

如果我想要这样的效果: image.png

是否有可行性呢。

\documentclass[a4paper]{article}                                                                  \usepackage{wrapstuff}
\usepackage{tabto}

\begin{document}
\NumTabs{5}
\begin{wrapstuff}[width=\linewidth, r]
  \centering
  {AAA BBB BBB} \\  %fake figure
  {AAA BBB BBB}
\end{wrapstuff}
%\wrapstuffclear
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 text text text
text text text text text text text text text text text \newline
 A \tab B \tab C  \newline
 A \tab B \tab C  \newline
 A \tab B \tab C  \newline
text text text text text text text text text text text \newline
 A \tab B \tab C  \newline                                                                        \end{document}    
]]>
https://ask.latexstudio.net/ask/question/17741.html Thu, 10 Apr 2025 18:06:15 +0800
排化学式,这种对齐的有简单的方法调齐吗? image.png

]]>
https://ask.latexstudio.net/ask/question/17740.html Thu, 10 Apr 2025 13:57:41 +0800
关于lstlisting代码块文本框宽度的控制 这是节标题的自定义

\titleformat{\section}[frame]
    {\color{藏花红}}
    {\centering\footnotesize\enspace 节 \thesection\enspace}
    {8pt}
    {\bfseries\filcenter\songti}
    [\vspace{-10pt}]

这是对lstlisting环境的控制

% 代码排版配置
% 自定义VBA语法高亮
\lstdefinelanguage{VBA}{
    morekeywords={Sub, End, Dim, As, Set, Range, Worksheet, MsgBox, If, Then, Else, For, Next, Do, While, Loop, Integer, String},
    sensitive=true,
    morecomment=[l]{'},       % 单行注释
    morestring=[b]{"},        % 字符串定义
    keywordstyle=\codefont\color[HTML]{0184bc},
    stringstyle=\codefont\color[HTML]{41a977},
    basicstyle=\codefont\small,
    keepspaces=true,
    numbers=left,
    % 边距控制
    xleftmargin=2em,                     % 左边界距
    xrightmargin=2em,                     % 右边界距
    framexleftmargin=1em,                % 框线左间距
    framexrightmargin=1em,               % 框线右间距
    framextopmargin=1em,                 % 上边距(边框到代码)
    framexbottommargin=1em,              % 下边距(边框到代码)
    columns=fullflexible            %非等宽
}
% 调整代码框的左右边距和宽度
\lstset{
    language=VBA,
    frame=single,
    linewidth=\dimexpr\textwidth + 2em, % 总宽度减去左右边框间距
    xleftmargin=2em,                         % 左内容边距
    xrightmargin=2em,                        % 右内容边距
    framexleftmargin=1em,                    % 左边框到内容的间距
    framexrightmargin=1em,                   % 右边框到内容的间距
    numbersep=-1.5em,                        % 行号位置调整
    escapeinside=``                          % 中文注释处理

效果非常糟糕!!!!如何改进呢?

image.png

最小工作示例

\documentclass[UTF8]{ctexbook}
\usepackage{zhlipsum}
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{pagecolor} 
\usepackage{layout}
\usepackage{chemfig,subcaption,graphicx,float}
\usepackage{listings}
\usepackage{titletoc}
\usepackage{titlesec}
\usepackage{fontspec}
\definecolor{藏花红}{RGB}{236,45,122}
\titleformat{\section}[frame]
    {\color{藏花红}}
    {\centering\footnotesize\enspace 节 \thesection\enspace}
    {8pt}
    {\bfseries\filcenter\songti}
    [\vspace{-10pt}]

% 代码排版配置
% 自定义VBA语法高亮
\lstdefinelanguage{VBA}{
    morekeywords={Sub, End, Dim, As, Set, Range, Worksheet, MsgBox, If, Then, Else, For, Next, Do, While, Loop, Integer, String},
    sensitive=true,
    morecomment=[l]{'},       % 单行注释
    morestring=[b]{"},        % 字符串定义
    keywordstyle=\color[HTML]{0184bc},
    stringstyle=\color[HTML]{41a977},
    basicstyle=\small,
    keepspaces=true,
    numbers=left,
    % 边距控制
    xleftmargin=2em,                     % 左边界距
    xrightmargin=2em,                     % 右边界距
    framexleftmargin=1em,                % 框线左间距
    framexrightmargin=1em,               % 框线右间距
    framextopmargin=1em,                 % 上边距(边框到代码)
    framexbottommargin=1em,              % 下边距(边框到代码)
    columns=fullflexible            %非等宽
}
% 调整代码框的左右边距和宽度
\lstset{
    language=VBA,
    frame=single,
    linewidth=\dimexpr\textwidth + 2em, % 总宽度减去左右边框间距
    xleftmargin=2em,                         % 左内容边距
    xrightmargin=2em,                        % 右内容边距
    framexleftmargin=1em,                    % 左边框到内容的间距
    framexrightmargin=1em,                   % 右边框到内容的间距
    numbersep=-1.5em,                        % 行号位置调整
    escapeinside=``                          % 中文注释处理
}

\begin{document}
\section{初步}
\begin{lstlisting}[caption={生成斐波那契数列},label={code:fib}]
'斐波那契数列生成函数
Sub GenerateFibonacci()
\end{lstlisting}
\end{document}
]]>
https://ask.latexstudio.net/ask/question/17738.html Wed, 09 Apr 2025 16:36:32 +0800
查询后仍然不懂调用字体 Package fontspec: The font "思源黑体" cannot be found.

我尝试的调用方法:

  • \newfontface{\titlefont}{思源黑体}

  • \newfontfamily{\titlefont}{思源黑体}

]]>
https://ask.latexstudio.net/ask/question/17737.html Wed, 09 Apr 2025 16:32:06 +0800
\ctexset设置空行以及\contentsname定义后Not Allow in LR mode的错误 报错信息为:

Something's wrong--perhaps a missing \item.

在删去\ctexset的空行之后,报错变为:

Not allowed in LR mode.

以下是我的代码:

\documentclass[UTF8]{ctexbook}
\usepackage{zhlipsum}
\usepackage{titletoc}
\usepackage{titlesec}
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{pagecolor} 
\usepackage{layout}
\usepackage{chemfig,subcaption,graphicx,float}
\usepackage{listings}
\usepackage{titletoc} % 必须加载宏包
\usepackage{fontspec}
\definecolor{background}{RGB}{215, 247, 250}
\definecolor{藏花红}{RGB}{236,45,122}
\definecolor{石绿}{RGB}{87,195,194}
\geometry{a4paper,centering,scale=0.9}
%自定义“目录名称”
\renewcommand{\contentsname}{%
  \begin{center}
    \normalfont\songti\bfseries 文章目录
  \end{center}
}

\newfontfamily\codefont{Times New Roman}


\setcounter{chapter}{-1} % 初始化为-1,使第一个章节显示

\ctexset{
    chapter = {
        name = {\S},   % 将"第X章"改为"§ X"
        number = \arabic{chapter},    % 阿拉伯数字编号
        format = \songti\large\bfseries\centering, % 标题格式
        beforeskip = 2.5ex,          % 标题前间距
        afterskip = 2.5ex,           % 标题后间距

      }
 }
%针对章(chapter)的目录格式
\titlecontents{chapter}[0pt]                     % 作用对象:章
    {\songti\bfseries}        % 全局格式:间距+右对齐+粗体
    {\thecontentslabel} % 带编号格式
    {}                                           % 无编号格式(空)
    {\titlerule*[8pt]{.}\contentspage}           % 页码引导符+页码



\titleformat{\section}[frame]
{\color{藏花红}}
{\centering
\footnotesize
\enspace 节 \thesection\enspace}
{8pt}
{\bfseries\filcenter\songti}
[\vspace{-10pt}]


% 代码排版配置
% 自定义VBA语法高亮
\lstdefinelanguage{VBA}{
    morekeywords={Sub, End, Dim, As, Set, Range, Worksheet, MsgBox, 
        If, Then, Else, For, Next, Do, While, Loop, Integer, String},
    sensitive=true,
    morecomment=[l]{'},       % 单行注释
    morestring=[b]{"},        % 字符串定义
    keywordstyle=\codefont\color{blue},
    stringstyle=\codefont\color{red},
    basicstyle=\codefont\small,
    keepspaces=true,
    numbers=left,
    % 边距控制
    xleftmargin=2em,                     % 左边界距
    xrightmargin=2em,                     % 右边界距
    framexleftmargin=1em,                % 框线左间距
    framexrightmargin=1em,               % 框线右间距
    columns=fullflexible
}
\lstset{
    language=VBA,
    backgroundcolor=\color{gray!10},
    escapeinside=``,           % 中文注释处理
}

\begin{document}
\title{XVBA教程}
\author{吕旋延}
\date{\today}
\maketitle

\tableofcontents

\chapter{哈哈哈}
\section{初步}
\begin{lstlisting}[caption={生成斐波那契数列},label={code:fib}]
'`斐波那契数列生成函数`
Sub GenerateFibonacci()
    Dim n As Integer
    Dim i As Integer
    Dim fib() As Long

    n = InputBox("请输入数列项数:", "输入", 10)
    ReDim fib(n)

    fib(0) = 0
    fib(1) = 1

    For i = 2 To n - 1
        fib(i) = fib(i - 1) + fib(i - 2)
    Next i

    '`输出结果`
    MsgBox "前" & n & "项斐波那契数列:" & vbCrLf & Join(fib, ", ")
End Sub

\end{lstlisting}
\end{document}
]]>
https://ask.latexstudio.net/ask/question/17736.html Wed, 09 Apr 2025 14:28:07 +0800
如何控制这个foreach产生的node内容限定在框内? image.png

取消ifnum这三行注释后,会报错; 保持注释时,在PDF中存在透明的node内容,若复制,会得到隐藏的node内容。 我想TeX不输出框外的那几个坐标,而不仅是隐藏它! 这样在选择复制的时候就不会得到隐藏的node内容。 主要是不会写判断条件,恳请大佬指点!

\documentclass[border=2pt,tikz]{standalone}
\begin{document}
\begin{tikzpicture}
    \foreach \x in {1,2}
    \foreach \y in {1,...,6}
        \node at (\x-.5,\y-.5) [scale=.75] {$(\x,\y)$};

    \draw (0,0) grid ([xshift=-.01pt]2,6);
    \clip [xshift={2cm-.01pt}] (0,0) -- (45:{3*sqrt(2)}) -- (90:6) -- cycle;
    \draw [xshift=2cm,rotate=45,step={sqrt(2)/2}] (0,0) grid (6,6);

    \foreach \x in {2.5,3.5,4.5}
    \foreach \y in {1,...,5}
        \node at (\x,\y) [scale=.5] {$(\x,\y)$};
    \foreach \x in {3,4}
    \foreach \y in {1.5,2.5,3.5,4.5} {
        \node at (\x,\y) [scale=.5,text=red] {$(\x,\y)$};
%        \ifnum \x+\y<8 and \x-\y<2 \relax
%        \breakforeach
%        \fi
    }
\end{tikzpicture}
\end{document}
]]>
https://ask.latexstudio.net/ask/question/17735.html Tue, 08 Apr 2025 22:39:35 +0800
你会采用哪种方式输入中文语境下二字宽的破折号? TeX中连用三个-可以得到一个破折号,但是它的字符宽度只有(约?)一个汉字宽,很明显不符合中文语境的需求,但是如果只是使用scalebox水平缩放为2倍的话,似乎垂直方向又不在一个汉字的垂直中心,不得不用raisebox来调整位置,还有破折号的线宽,在这种条件下似乎无法轻易调整。有没有更方便或更完善的方法?

]]>
https://ask.latexstudio.net/ask/question/17734.html Tue, 08 Apr 2025 14:35:45 +0800
有没有简单的方法对三线表完成下标注和单位注释 针对这种表格如何实现在它的右上角插入一个指定字号的单位标注如:(单位:mm),然后再在其下方插入五号字的类似脚注的字母abc标注以及整体的注释,来对表格中的指定内容完成标注。

\begin{table}[h]
  \centering
  \caption{表号和表题在表的正上方} 
  \label{tab:exampletable}
  \begin{tabular}{cc}
    \toprule
    类型   & 描述                                       \\
    \midrule
    挂线表 & 挂线表也称系统表、组织表,用于表现系统结构 \\
    无线表 & 无线表一般用于设备配置单、技术参数列表等   \\
    卡线表 & 卡线表有完全表,不完全表和三线表三种       \\
    \bottomrule
  \end{tabular}

\end{table}
]]>
https://ask.latexstudio.net/ask/question/17731.html Sat, 05 Apr 2025 20:26:40 +0800
关于footmisc的perpage选项在某些数学环境里与\footnotemark冲突的问题? 现象描述

这个问题来自: https://ask.latexstudio.net/ask/question/17727.html

如题,对于正常的equation\[\])环境,上个问题的实现不受footmisc的影响

\documentclass[landscape]{article}
\usepackage[perpage]{footmisc}
\begin{document}
\begin{eqnarray}
foo && foo \footnotemark\\
foo && foo \footnotemark
\end{eqnarray}
\addtocounter{footnote}{-1}
\footnotetext{something}
\stepcounter{footnote}
\footnotetext{something else}
\end{document}

image.png

但对于使用cases环境的嵌套时,下面的MWE一旦加上footmisc宏包就会出现footnote编号错乱的问题...

\documentclass[11pt,landscape,a4paper]{article}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage[perpage]{footmisc}
\begin{document}
\[
\text{something something}
\begin{cases}
    \text{something\footnotemark}
    \begin{cases}
        \text{something\footnotemark}
        \begin{cases}
            \text{something}\\
            \text{something}
            \begin{cases}
                \text{something}\\
                \text{something}
            \end{cases}\\
        \end{cases}\\
        \text{something}\\
    \end{cases}\\
    \text{something\footnotemark}
    \begin{cases}
        \text{something}\\
        \text{something\footnotemark}\\
    \end{cases}
\end{cases}
\]

\addtocounter{footnote}{-3}
\footnotetext{something}
\stepcounter{footnote}
\footnotetext{something else}
\stepcounter{footnote}
\footnotetext{something else}
\stepcounter{footnote}
\footnotetext{something else}

\end{document}

image.png

问题

希望找到什么样的数学环境下想使用\footnotetext会出现如此冲突,以及出现这一现象的原因是什么?

]]>
https://ask.latexstudio.net/ask/question/17728.html Fri, 04 Apr 2025 15:11:43 +0800
图片插图报错:Assertion failed: !indirect-&amp;gt;pf, file pdfobj.c, line 995 这个图片插图提示这个错误,测试环境:

TeXLive2025

Assertion failed: !indirect->pf, file pdfobj.c, line 995

提交大家研究下。

MWE 0403.zip

]]>
https://ask.latexstudio.net/ask/question/17725.html Thu, 03 Apr 2025 22:39:10 +0800
如何确保使用命令封装的英文文本与前后文本之间有正确的间距 因为一些实际需求,所以需要对一些英文文本样式进行简单的命令封装。如将文本及样式\emph{AAA}定义为\mycommond,然后在正文中通过使用\mycommond进行调用。但是这一方式存在一定问题,也就是通过此命令生成的文本,无法确保与前后文本之间存在正确的间距。所以请问如何避免手动加空格来解决这一问题? image.png

\documentclass{article}

\newcommand\mycommond{\emph{AAA}}

\begin{document}
  \emph{AAA} BBB     %斜体AAA之后有空格

  \mycommond BBB  %以命令形式调用时,虽然也产生斜体AAA,但是之后没有空格
\end{document}
]]>
https://ask.latexstudio.net/ask/question/17724.html Thu, 03 Apr 2025 00:07:22 +0800
Wiley模版下面的横线一直删不掉,麻烦大佬帮忙解答一下 希望删除Wiley模版模板下方的横线。

QQ20250328-155345.png

]]>
https://ask.latexstudio.net/ask/question/17717.html Fri, 28 Mar 2025 16:05:16 +0800
如何给页面添加边框,实现类似如图效果? image.png

我用tblr实现的,不够优美

是否有更好的解决办法?

\documentclass[12pt]{ctexart}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=2cm]{geometry}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{tabularray}
\usepackage{caption}
\usepackage{adjustbox}
\usepackage{mdframed}
\usepackage{tikz}
\captionsetup[table]{labelformat=empty}
\doublespacing
\begin{document}

\newpage

\begin{table}[!htbp]
    \centering
    \caption{\zihao{2}\heiti 项目一 “荧幕上的历史回响”主题实践活动}
    \begin{tblr}{
        width = \linewidth,
        colspec = {|Q[c,wd=0.7cm]X[c]Q[c,wd=0.5cm]|},
        hline{1,2},
        hline{4-27} = {2}{},
        cell{1}{1} = {c=3}{c},%顶部对齐t
        rows = {ht=.66cm},
        row{1} = {ht=1cm},
    }
    观看《十月围城》、\,《建党伟业》等影片(选一)\,,并与真实的历史事件相互印证,写出观后感。& & \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \hline
    \end{tblr}
\end{table}

\newpage
\begin{table}[!htbp]
    \centering
    \begin{tblr}{
        width = \linewidth,
        colspec = {|Q[c,wd=0.7cm]X[c]Q[c,wd=0.5cm]|},
        hline{2-29} = {2}{},
        rows = {ht=.66cm},
    }
    \hline
    & & \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \\
    \hline
    \end{tblr}
\end{table}

\end{document}
]]>
https://ask.latexstudio.net/ask/question/17716.html Fri, 28 Mar 2025 15:21:18 +0800
怎么给宁夏大学毕业论文模板添加英文封面? 我想给宁夏大学毕业论文模板添加英文封面,格式已经放在压缩包内,添加后的格式为 第一页,中文封面 第二页,空白页 第三页,英文封面 第四页,空白页 操作系统:Windows 10 安装的发行版:TEX Live 2023 编辑器:WinEdt 编译命令:XeLatex MWE.zip

]]>
https://ask.latexstudio.net/ask/question/17715.html Fri, 28 Mar 2025 00:41:38 +0800