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

注册于 2年前

回答
128
文章
0
关注者
6

绘制正方体调整角度用的是什么宏包的什么命令呢?也许需要一个更具体的绘图框架。

文档其实写的很详细了
使用命令行编译后可以发现需要在当前目录下新建一个solutions文件夹,tbc会将solution写入该文件夹
这是由savelowerto命令指定的
image.png
你不能编译的一大原因是找不到solutions文件夹

你还有其他一些问题
例如没有引入amsmath,调用skins和xparse库的方式都不对等原因

目录结构应如下【注意应自己建一个solutions文件夹】
image.png

下面是实测可以运行的MWE

\documentclass{ctexart}
\usepackage[margin=1.5cm]{geometry}
\usepackage{amsmath}
\usepackage{tcolorbox}
\usepackage{xcolor}
\tcbuselibrary{skins,xparse}

\NewTColorBox[auto counter,number within=section]{exercise}{+!O{}}{%
    enhanced,colframe=green!20!black,colback=yellow!10!white,coltitle=green!40!black,
    fonttitle=\bfseries,
    underlay={\begin{tcbclipinterior}
    \shade[inner color=green!80!yellow,outer color=yellow!10!white]
    (interior.north west) circle (2cm);
    \draw[help lines,step=5mm,yellow!80!black,shift={(interior.north west)}]
    (interior.south west) grid (interior.north east);
    \end{tcbclipinterior}},
    title={Exercise~\thetcbcounter:},
    label={exercise@\thetcbcounter},
    attach title to upper=\quad,
    after upper={\par\hfill\textcolor{green!40!black}%
    {\itshape Solution on page~\pageref{solution@\thetcbcounter}}},
    lowerbox=ignored,
    savelowerto=solutions/exercise-\thetcbcounter.tex,
    record={\string\solution{\thetcbcounter}{solutions/exercise-\thetcbcounter.tex}},
    #1
}
\NewTotalTColorBox{\solution}{mm}{%
enhanced,colframe=red!20!black,colback=yellow!10!white,coltitle=red!40!black,
fonttitle=\bfseries,
underlay={\begin{tcbclipinterior}
\shade[inner color=red!50!yellow,outer color=yellow!10!white]
(interior.north west) circle (2cm);
\draw[help lines,step=5mm,yellow!80!black,shift={(interior.north west)}]
(interior.south west) grid (interior.north east);
\end{tcbclipinterior}},
title={Solution of Exercise~\ref{exercise@#1} on page~\pageref{exercise@#1}:},
phantomlabel={solution@#1},
attach title to upper=\par,
}{\input{#2}}
\tcbset{no solution/.style={no recording,after upper=}}

\tcbstartrecording\relax
\begin{document}
\begin{exercise}
    Compute the derivative of the following function:
    \begin{equation*}
        f(x)=\sin((\sin x)^2)
    \end{equation*}
    \tcblower
    The derivative is:
    \begin{align*}
        f'(x) & = \left( \sin((\sin x)^2) \right)'
        =\cos((\sin x)^2) 2\sin x \cos x.
    \end{align*}
\end{exercise}
\begin{exercise}[no solution]
    It holds:
    \begin{equation*}
        \frac{d}{dx}\left(\ln|x|\right) = \frac{1}{x}.
    \end{equation*}
\end{exercise}
\begin{exercise}
    Compute the derivative of the following function:
    \begin{equation*}
        f(x)=(\sin(\sin x))^2
    \end{equation*}
    \tcblower
    The derivative is:
    \begin{align*}
        f'(x) & = \left( (\sin(\sin x))^2 \right)'
        =2\sin(\sin x)\cos(\sin x)\cos x.
    \end{align*}
\end{exercise}
\begin{exercise}
    Compute the derivative of the following function:
    \begin{equation*}
        f(x)=\sqrt{x^3-6x^2+2x}
    \end{equation*}
    \tcblower
    The derivative is:
    \begin{align*}
        f'(x) & = \left( \sqrt{x^3-6x^2+2x} \right)'
        = \frac{3x^2-12x+2}{2\sqrt{x^3-6x^2+2x}}.
    \end{align*}
\end{exercise}
\begin{exercise}
    Compute the derivative of the following function:
    \begin{equation*}
        f(x)=\left(\frac{2+3x}{1-2x}\right)^3
    \end{equation*}
    \tcblower
    The derivative is:
    \begin{align*}
        f'(x) & = \left( \left(\frac{2+3x}{1-2x}\right)^3 \right)'
        = 3 \left(\frac{2+3x}{1-2x}\right)^2 \frac{(1-2x)3-(2+3x)(-2)}{(1-2x)^2}
        = \frac{21(2+3x)^2}{(1-2x)^4}.
    \end{align*}
\end{exercise}
\begin{exercise}
    Compute the derivative of the following function:
    \begin{equation*}
        f(x)=\frac{\cos x}{(\tan 2x)^2}
    \end{equation*}
    \tcblower
    The derivative is:
    \begin{align*}
        f'(x) & = \left( \frac{\cos x}{(\tan 2x)^2} \right)'
        = \left( \frac{\cos x (\cos 2x)^2}{(\sin 2x)^2} \right)'                       \\
              & = \frac{(\sin 2x)^2 [(-\sin x)(\cos 2x)^2+(\cos x)4\cos 2x (-\sin 2x)]
        - \cos x (\cos 2x)^2 4\sin 2x \cos 2x}{(\sin 2x)^4}                            \\
              & = -\frac{\cos(2x) [\sin x \sin 2x \cos 2x+ 4\cos x(\sin 2x)^2
        + 4 \cos x (\cos 2x)^2]}{(\sin 2x)^3}                                          \\
              & = -\frac{\cos(2x) [\sin x \sin 2x \cos 2x+ 4\cos x]}{(\sin 2x)^3}.
        152
    \end{align*}
\end{exercise}
\begin{exercise}
    Compute the derivative of the following function:
    \begin{equation*}
        f(x)=\cos((2x^2+3)^3)
    \end{equation*}
    \tcblower
    The derivative is:
    \begin{align*}
        f'(x) & = \left( \cos((2x^2+3)^3) \right)'
        =-\sin((2x^2+3)^3) 3(2x^2+3)^2 2\cdot 2x   \\
              & =-12x(2x^2+3)^2\sin((2x^2+3)^3).
    \end{align*}
\end{exercise}
\begin{exercise}
    Compute the derivative of the following function:
    \begin{equation*}
        f(x)=(x^2+1)\sqrt{x^4+1}
    \end{equation*}
    \tcblower
    The derivative is:
    \begin{align*}
        f'(x) & = \left( (x^2+1)\sqrt{x^4+1} \right)'
        = 2x\sqrt{x^4+1} + \frac{2x^3(x^2+1)}{\sqrt{x^4+1}}.
    \end{align*}
\end{exercise}
\tcbstoprecording

\tcbinputrecords

\end{document}

多看看文档,多看看lshort,你给的MWE实际上还有一些自己乱添加的东西,注意MWE的定义
MWE.jpg

同时还要注意要得到page的索引还得至少进行两次xelatex的编译....
以及尽量避免 弄了半天还是不行 这种信息量很低的话,具体是哪里不行?命令行运行的报错是什么?你的期望效果是什么?
下面是压缩包文件,Happy Texing!

mmmwe.zip

不太清楚上述现象出现的原因:
但可以使用usepackage{ctex}其会默认设置行距为1.3倍可以解决你的问题;或者直接使用linespread{1.3}获得如下的效果。

image.png

\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\begin{document}
\linespread{1.3} %设置行距
\begin{table}[htbp]
    \begin{tblr}{*{5}{Q[c,m]}}
        \toprule
        \SetCell[r=2]{c} hASDFp
                & \SetCell[c=2]{m} {hZXCVp} &        &  & \SetCell[c=2]{m} {hIUYTp} &        \\
        \cmidrule{2-3} \cmidrule{5-6}
                & hOIUYTfp                  & hCVFRp &  & hSDEWp                    & PLOIKp \\
        \midrule
        hZXCVBp & 0.30                      & 0.64   &  & 0.25                      & 0.48   \\
        \bottomrule
    \end{tblr}
\end{table}%

\end{document}

建议使用tabularray宏包精细化排版表格
下面是一个MWE

\documentclass[12pt]{ctexart}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\begin{document}
\begin{table}[htbp]
    \begin{tblr}{Q[c,m]*{2}{Q[c,m,7em]}} % texdoc tabularray中的Q列格式设置
        \toprule
         & value1 & value2        \\
        \midrule
        {par par par par par      \\par text} & 114 &  514 \\
        {par par                  \\ par par par par text} & 114 &  514 \\
        {想在这里换行同时保持居中 \\ 文本} & 114 &  514 \\
        \bottomrule
    \end{tblr}
\end{table}
\end{document}

image.png

非常感谢鱼老师!
我有查询了一下ctex的文档,发现默认的中文字体的行距是1.3,在整篇行文中是只需要在使用longdivision时修改为linespread{1},但我觉得手动调整linespread{1.3}不够优雅(是因为如果忘记了,每次要调回默认都要查看文档)而我在ctex文档里没找到直接设置其为默认值1.3的命令,不知道是否有不用显式指定1.3这个值的方法?谢谢!
image.png

image.png

经过Eureka大神的提示,简单探索了两种可行的处理方式
肥肠感谢帮助!

\documentclass{article}
\usepackage{lmodern}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\begin{document}
xyzxyz\_abcabc@123.com
\renewcommand{\_}{{\fontfamily{ptm}\selectfont\textunderscore}}

xyzxyz\_abcabc@123.com
\renewcommand{\_}{\raisebox{.5pt}{\underline{\phantom{x}}}}

xyzxyz\_abcabc@123.com
\end{document}{}

image.png

发布
问题