Sagittarius Rover
Sagittarius Rover
我要成为Typst糕手/(ㄒoㄒ)/~~

注册于 2年前

回答
195
文章
0
关注者
9

可以使用lscape宏包提供的landscape环境实现

\documentclass[fontset=ubuntu]{ctexart}
\usepackage{lscape}
\usepackage{graphicx}
\usepackage{zhlipsum}
\begin{document}
\zhlipsum[1-2]

\begin{landscape}
\begin{figure}
\centering
\includegraphics[width=.95\linewidth]{figure.png}
\caption{装修结构平面图}
\end{figure}
\end{landscape}

\zhlipsum[1-2]
\end{document}

image.png

不是很优雅...

\documentclass[UTF8]{ctexart}
\usepackage{array,tabularray,geometry,xcolor}
\NewColumnType{W}[1]{>{\centering\arraybackslash}Q[m,wd={#1}]}
\geometry{margin=2pt,papersize={8cm,8cm}}
\pagestyle{empty}
\begin{document}
\vspace*{\fill}\begin{center}
    \begin{tblr}{
        colspec={W{4\ccwd}m{4\ccwd}W{4.5\ccwd}W{3\ccwd}},
        hlines,vlines,
        colsep=0pt,
        % stretch=0,
        cell{1}{3}={red},
        }
        所想即为所得 & 所想即所得 & {\makebox[4.51\ccwd]{所想}   \\即所得}&所想即所得\\
                     &            & 所想即所得                 & \\
    \end{tblr}
\end{center}\vspace*{\fill}
\end{document}

image.png

\exp本来就应该是正体,我的看法是接受他,你既然选择了mtpro2,那么就应该接受它优点和缺点。
或者你应该具体描述你想达到什么效果?

pgfplots不是太了解,follow reference link,尝试给出一个解答:

\documentclass[11pt, border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[
    colormap/jet,% change colormap style here
    scatter,
    scatter src=x,
    only marks,
    clip mode=individual,
    scatter/@pre marker code/.append code={
            \pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}
            \pgfmathsetmacro\negheight{-\pgfplotspointmeta}         
            \fill [draw=black] (axis direction cs:0,0.3) rectangle (axis direction cs:\negheight,-0.3);\pgfplotsset{mark=none}
        },
    width=12cm,
    height=8cm,
    grid=both,
    ytick=data,
    xmin=0,xmax=100, 
    xlabel={Percentage (\%)},          
    ylabel={Categories},               
    % symbolic y coords={A, B, C, D, E},
    yticklabels={A, B, C, D, E},
    ytick style={draw=none},           
    %nodes near coords,
    enlarge y limits=.2,
    xtick={0, 20, 40, 60, 80, 100},
    xticklabel=\pgfmathprintnumber{\tick}\%,
  ]
    \addplot coordinates {(23,1) (45,2) (56,3) (78,4) (89,5)};
  \end{axis}
\end{tikzpicture}
\end{document}

image.png

等宽字体缺少字体├─所致。可以考虑使用\setmonofont{Consolas}修改。

image.png

我感觉你确实应该补充一下你的具体需求(比如一个完整的审稿回复应该是什么样子,你已经实现的是什么样子),我看不出这里的Reviewer为什么是一个计数器Counter,同时在你的聊天记录中似乎也有\ref的需求,但在你上述的代码中并未体现。

你上面出现结果为为Null,是因为你在调用\Rref{o4m35}时仍未经过\setStringCounter{Reviewer}{o4m35},于是为\setStringCounter{Reviewer}{NULL}定义的默认值。

事实上你把这两句放到\RTR{o4m35}之后即可。

我不知道是不是能回答你的问题。而且你的代码中\setStringCounter\getStringCounter给我的感觉就是把你所谓的"字符串"装进宏里面然后再拿出来,个人觉的目的不是很明确。

image.png

首先我有点好奇,是什么需求让你必须调节不同字体横线的粗细。此外,我认为这个问题必须提供截图的预期的粗细效果,并提供两份代码,不要让别人猜测的stix字体是如何调用的...

我目前只知道关于分数线的粗细控制...

另外根号是有左侧部分的,你的描述中只提及了横线,那左侧部分线的粗细呢?

terminal中运行latexdef \frac可得:

\frac :
\long macro:#1#2->{\begingroup #1\endgroup \over #2}

TeX命令\frac实际上是一个带编组的\over命令

In The TeXBook(Page 143), we know that there exist command \above[dim] to control the dim of the fraction bar:

image.png

除此之外,对于分数,amsmath宏包的\genfrac命令也提供了thickness用于控制粗细

image.png

关于\sqrt符号,其形状(应该)由对应的字符\radical "270370控制,是和字体强关联的。

但你也可以用盒子自己画一个(我是不会画的,因此自然是copy的):

\documentclass{article}
\def\radicando#1{%  
    \leavevmode
    \hbox{%
      \vtop{%
        \vbox{%
          \hrule height1.5pt \kern -1.2pt
          \hbox{%
            \kern 1pt \strut#1\kern 0pt
          }%
        }%
        \kern -3pt
      }%
    }
  }
\def\radice#1{\surd\kern-.25pt\radicando{\lower1.5pt\hbox{\mathstrut$#1$}}}
\begin{document}
  $\frac{1}{2}$ ${123\above2pt 456}$

  $\radice{aeiou}$ $\radice{16}$ 
\end{document}

image.png

也许有帮助。

是真的很小吗(?)那你结合图片描述一下预期的大小。

BTW,为什么要调用两次unicode-math,同时在这个mwe中ctex也和fontspec也完全没有必要调用,可删去。

image.png

应该是图书馆提供的【研究生学位论文Latex参考模板.zip】配置上有一些问题

更建议使用这个开源仓库 但使用的时候必须仔细研究其文档和学校有关规范

改正 xetex thuthesis.ins 编译得到的是thuthesis.cls文件

image.png

如果你不介意重复绘制的话,下面也许是可行的...

\documentclass[landscape]{article}
\usepackage[margin=1in,a3paper]{geometry}
\usepackage{tkz-graph}
\begin{document}
\ExplSyntaxOn
\cs_new_protected:Npn \draw_dot_diagram:n #1
{
    \pgfmathtruncatemacro{\NN}{0}
    \str_set:Nn \l_tmpa_str { #1 }
    \seq_clear:N \l_tmpa_seq
    \begin{tikzpicture}[
        line~join=round,line~cap=round,
        VertexStyle/.style = {
            shape=circle,draw,fill,
            minimum~size=5pt,
            inner~sep=0pt,
            outer~sep=0pt,
        }]
        \SetGraphUnit{2}
        \SetVertexNoLabel
        \Vertex{P\NN}
        \str_map_inline:Nn \l_tmpa_str
        {
            \pgfmathtruncatemacro{\tmp}{\NN+1}
            \str_case:nn { ##1 }
            {
                {U} {\NO(P\NN){P\tmp}}
                {D} {\SO(P\NN){P\tmp}}
                {L} {\WE(P\NN){P\tmp}}
                {R} {\EA(P\NN){P\tmp}}
            }
            \Edge(P\NN)(P\tmp)
            \pgfmathtruncatemacro{\NN}{\tmp}
        }
    \end{tikzpicture}
    \par \vspace*{3cm}
}
\draw_dot_diagram:n {RRUDRUDRR}

\draw_dot_diagram:n {RRRUDRUDRUDRR}

\draw_dot_diagram:n {RRRURUDLUUDLRDDDRRLDRURRUUDR}
\ExplSyntaxOff
\end{document}

其实重复绘制的问题应该是有优化空间的,但我下午还有课...

image.png

你的代码太长了,你希望在互联网上找人帮你看长达349行的代码?

你应该使用二分注释等方法找到真正让你"卡死"的那些部分

实际上出问题的有以下两部分:

%Line265~282
    
    \begin{tikzpicture}
        \begin{pie}[
            color={blue!20, red!20, orange!20, green!20, yellow!20},
            text=legend,
            sum=auto,
            explode=0.1,
            radius=3,
            ]
            \pie[
            text=legend]{
                10/民族舞,
                35/英文剧场,
                10/无人机,
                10/数学建模,
                35/辩论
            }
        \end{pie}
    \end{tikzpicture}

是谁教你的\begin{pie}嵌套\pie命令的(?)告诉我,是谁?你是否看过pgf-pie的文档?

image.png

需要修改成以下,只使用\pie创建饼图

    \begin{tikzpicture}
        \pie[
            color={blue!20, red!20, orange!20, green!20, yellow!20},
            text=legend,
            sum=auto,
            explode=0.1,
            radius=3,
        ]{
            10/民族舞,
            35/英文剧场,
            10/无人机,
            10/数学建模,
            35/辩论
        }
    \end{tikzpicture}

第二个问题出现在enumerate的嵌套问题上:

%Line318~347
\begin{enumerate}
        本节包含总体取值规律的估计,总体百分位数的估计,总体集中趋势估计,总体离散程度估计等内容,下面先把涉及到的一些基础知识进行梳理。
    \textbf{频率分布直方图}: 每个小矩形的面积表示数据落在该组的频率, 各小矩形的面积之和为 1.
    \textbf{百分位数}: 一组数据的第 \( p \) 百分位数是这样一个值, 它使得这组数据中至少有 \( p\% \) 的数据小于或等于这个值,且至少有 \( (100-p)\% \) 的数据大于或等于这个值,其计算步骤为:
        \begin{enumerate}
            \item 按从小到大排列原始数据;
            \item 计算 \( i=n \times p\% \), 其中 \( n \) 为样本量;
            \item 若 \( i \) 不是整数, 而大于 \( i \) 的比邻整数为 \( j \), 则第 \( p \) 百分位数为第 \( j \) 项数据; 若 \( i \) 是整数, 则第 \( p \) 百分位数为第 \( i \) 项和第 \( i+1 \) 项数据的平均数.
        \end{enumerate}
        \item \textbf{平均数}: 可反映数据的集中趋势.
        \begin{enumerate}
            \item 一组数据 \( x_1, x_2, \cdots, x_a \) 的平均数 \( \overline{x} = \frac{x_1+x_2+\cdots+x_a}{n} \).
            \item 由频率分布直方图估计样本平均数, 常用每组区间中点值代表落在该区间的数据, 若设各组区间中点为 \( x_1, x_2, \cdots, x_n \), 对应各组的频率为 \( f_1, f_2, \cdots, f_n \), 则可估计样本平均数 \( \bar{x} = \sum_{i=1}^n x_i f_i \).
        \end{enumerate}
        \item \textbf{中位数}: 可反映数据的集中趋势.
        \begin{enumerate}
            \item 对于从小到大排列的一组数据, 若数据个数为奇数, 则中位数为最中间的一个数据; 若数据个数为偶数,则中位数为中间两个数据的平均数.
            \item 由频率分布直方图估计样本中位数, 应在横轴上找到一个数, 使其左右两侧频率各占 0.5.
        \end{enumerate}
        \item \textbf{众数}: 可反映数据的集中趋势.
        \begin{enumerate}
            \item 一组数据中出现次数最多的数据即为该组数据的众数, 若有几个数据出现次数一样多, 且都比其它数据多,则它们都是众数.
            \item 由频率分布直方图估计样本众数, 取最高的小矩形区间中点即可.
        \end{enumerate}
        \item \textbf{极差}: 一组数据的最大值与最小值之差, 它可以一定程度反映数据的离散程度.
        \item \textbf{方差、标准差}: 刻画数据的离散程度. 方差、标准差越大, 数据越分散, 反之越集中.
        \begin{enumerate}
            \item 一组数据 \( x_1, x_2, \cdots, x_n \) 的方差 \( s^2 = \frac{1}{n} \sum_{i=1}^n (x_i - \bar{x})^2 = \frac{1}{n} \sum_{i=1}^n x_i^2 - \bar{x}^2 \), 方差公式的两种形式都需掌握, 计算或证明时都可能用到. 方差的算数平方根 \( s \) 即为标准差. 若数据 \( x_1, x_2, \cdots, x_n \) 有重复, 设其不重复的值为 \( y_1, y_2, \cdots, y_k \), 对应的数据个数依次为 \( f_1, f_2, \cdots, f_k \), 则 \( s^2 = \frac{1}{n} \sum_{i=1}^{k} f_i (y_i - \bar{x})^2 \).
        \end{enumerate}
    \end{enumerate}

你是否看过入门文档lshort-zh-cn(?) 在enumerate环境内必须使用\item....你这几行素在?(告诉我,为什么?)

本节包含总体取值规律的估计,总体百分位数的估计,总体集中趋势估计,总体离散程度估计等内容,下面先把涉及到的一些基础知识进行梳理。
textbf{频率分布直方图}: 每个小矩形的面积表示数据落在该组的频率, 各小矩形的面积之和为 1.
textbf{百分位数}: 一组数据的第 ( p ) 百分位数是这样一个值, 它使得这组数据中至少有 ( p% ) 的数据小于或等于这个值,且至少有 ( (100-p)% ) 的数据大于或等于这个值,其计算步骤为:

image.png

那几行前面必须加上\item

本节包含总体取值规律的估计,总体百分位数的估计,总体集中趋势估计,总体离散程度估计等内容,下面先把涉及到的一些基础知识进行梳理。
    \begin{enumerate}%%%%%%你下面这两个`\textbf`前面为什么不用????告诉我,为什么??
        \item \textbf{频率分布直方图}: 每个小矩形的面积表示数据落在该组的频率, 各小矩形的面积之和为 1.
        \item \textbf{百分位数}: 一组数据的第 \( p \) 百分位数是这样一个值, 它使得这组数据中至少有 \( p\% \) 的数据小于或等于这个值,且至少有 \( (100-p)\% \) 的数据大于或等于这个值,其计算步骤为:
        \begin{enumerate}
            \item 按从小到大排列原始数据;
            \item 计算 \( i=n \times p\% \), 其中 \( n \) 为样本量;
            \item 若 \( i \) 不是整数, 而大于 \( i \) 的比邻整数为 \( j \), 则第 \( p \) 百分位数为第 \( j \) 项数据; 若 \( i \) 是整数, 则第 \( p \) 百分位数为第 \( i \) 项和第 \( i+1 \) 项数据的平均数.
        \end{enumerate}
        %% rest ...

切忌“不懂原理的前提下四处搜罗代码”。 —— OsbertWang

效果如下:
image.png

另外你的最小工作示例还是不规范,你理应提供有问题的,让你报错的最小的那一段代码,不要期望每个人都有时间看你整篇几百行,甚至两千行文档。同时应注意内容的保密性(试卷直接发出来真的好吗...)

另附MWE定义,请仔细阅读并了解围栏代码块的用法。

下次再提问不规范试试看呢? Happy LaTeXing!

image.png

不建议使用xkeyval宏包了,latex2e kernel setup (based on l3keys)已经足够支持键值对的选项。

从你的代码来说,只要删除testclass.cls\ExecuteOptionsX{text={key1=12345, key2=abcde}}的命令即可,\ExecuteOptionsX用于声明默认选项,不应该放在\ProcessOptionsX之后。但即使如此做,虽然可以传递option,但仍会导致出现LaTeX Warning: Unused global option(s):[text={key1=67890}]的提示,这也是不推荐使用的原因。

一个简陋的办法是在\begin{document}后使用\setlength{\oddsidemargin}{-3pt}(不一定准确,我的pdf-viewer没有标尺)微调。

个人认为你这个问题的本质是revtex4-2的双栏布局和单栏的figure之间的冲突。当你使用article文档类时代码并没有什么问题;而使用revtex4-2出错,说明是revtex4-2的问题。好的问题题目会方便其他人检索到。

\caption*用法说明

image.png

要想引用必须有内容
(我不是太理解为什么你一定要藏起来subcaption的(a)(b)(c)(d)?这样读者很难快速定位到Fig.4(d)和Fig.8(e)指的是哪个吧)

https://www.latexstudio.net/index/details/index/mid/3922.html

源代码中的 \onecolumngrid\twocolumngrid 进行切换 (但我不是太懂revtex4-2...)

\documentclass[reprint,aps,amsmath,amssymb,]{revtex4-2}
\usepackage{graphicx}% Include figure files
\usepackage{subcaption} % For subfigure
\usepackage{float}
\usepackage{lipsum}
\usepackage{hyperref}% add hypertext capabilities
\begin{document}

\lipsum[1-9]

\onecolumngrid

\begin{figure*}[htbp]
    \centering
    % First row of images (subfigure 1 and subfigure 2)
    \begin{subfigure}[b]{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth, keepaspectratio]{example-image-a}
        \caption{}\label{a}
    \end{subfigure}%
    \hspace{0.1cm}
    \begin{subfigure}[b]{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth, keepaspectratio]{example-image-b}
        \caption{}\label{b}
    \end{subfigure}
    % Second row of images (subfigure 3 and subfigure 4)
    \begin{subfigure}[b]{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth, keepaspectratio]{example-image-c}
        \caption{}\label{c}
    \end{subfigure}%
    \hspace{0.1cm}
    \begin{subfigure}[b]{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth, keepaspectratio]{example-image}
        \caption{}\label{d}
    \end{subfigure}
    \caption{Overall caption for the entire figure.}
    \label{fig2:mainfig}
\end{figure*}

\twocolumngrid

In Fig.~\ref{fig2:mainfig}~(\ref{a}), (\ref{b}), and (\ref{c}), we show ...

\lipsum[10-12]

\end{document}

image.png

发布
问题