该字体编码的默认行为如此。
读!
https://blog.ljguo.top/2024/06/textcircled-numbers 『需要魔法』
https://mp.weixin.qq.com/s/Zk6GvAYIHVKc-b5HXavAVg 『不需要魔法』
该字体编码的默认行为如此。
读!
https://blog.ljguo.top/2024/06/textcircled-numbers 『需要魔法』
https://mp.weixin.qq.com/s/Zk6GvAYIHVKc-b5HXavAVg 『不需要魔法』
随缘改了下...
\documentclass{article}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{fontspec}
\setmainfont{TeX Gyre Pagella}
\definecolor{bg@main}{RGB}{254,216,71}
\definecolor{bg@second}{RGB}{249,241,179}
\definecolor{bg@third}{RGB}{247,234,156}
\definecolor{text@main}{RGB}{254,216,71}
\definecolor{text@second}{RGB}{2,49,102}
\definecolor{text@third}{RGB}{162,148,65}
\usepackage[paperwidth=16.51cm, paperheight=24.77cm]{geometry}
\def\maketitle{%
\newgeometry{margin=0pt}
\begin{titlepage}
\begin{tikzpicture}[remember picture, overlay]
\def\textnode[##1]##2;{%
\node[anchor=west, align=left, ##1] ##2;
}
\fill[left color=bg@second] (current page.north west) rectangle (current page.south east);
\fill[bg@main] (current page.south east) rectangle ++(-0.9\paperwidth, 0.69\paperheight) coordinate (t1);
\fill[bg@third] (t1) rectangle ++(-0.1\paperwidth, -0.137\paperheight);
\draw[white, very thick] (current page.north west) ++ (.1\paperwidth, 0) -- ++ (0, -\paperheight);
\draw[white, very thick] (current page.north west) ++ (0, -.31\paperheight) -- ++ (\paperwidth, 0);
\draw[white, very thick] (current page.north west) ++ (0, -.447\paperheight) -- ++ (.1\paperwidth, 0);
\textnode[text=text@third, font=\LARGE] at ([xshift=0.1\paperwidth + 0.75cm, yshift=-0.75cm]current page.north west) {Graduate Text in Mathematics};
\textnode[text=text@main, scale=5, anchor=north east] at (current page.north east) {GTM};
\textnode[text=text@second, anchor=south west, scale=2.4] at ([xshift=0.75cm]t1) {Mathematician Analysis};
\textnode[text=text@second, anchor=north west, scale=7] at ([xshift=0cm]t1) {Introduction \\ to Real \\ Analysis};
% 插入自定义图片并调整
\node[anchor=south east] at ([shift={(-1cm,1cm)}]current page.south east) {%
\begin{minipage}[b][1.5cm][c]{2cm}
\hfill\includegraphics[width=1.5\linewidth]{springer_horse.png}
\end{minipage}%
\begin{minipage}[b][1.5cm][c]{3cm}
\centering \huge\bfseries Springer
\end{minipage}
};
\end{tikzpicture}
\end{titlepage}
\restoregeometry
}
\begin{document}
\maketitle
\end{document}
\def\textnode[##1]##2;{%
\node[anchor=west, align=left, ##1] ##2;%
}%
怎么到你这里一抄就变成了#1
和#2
(?)你能解释解释吗...
tikz
的node
的用法minipage
环境的用法不会markdown语法不要提问。
P.S. markdown语法是很重要的,问题描述也要完整,清楚。
P.S. 遇到报错最好附上报错信息(给你补上了),更容易被其他人检索到关键词。
\tikzset
不需要;
\tikzset{
declare function={
f(\x)=cos(\x r);
g(\x)=\fpeval{1/3};
h(\x)=-0.5;
}
};
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc,intersections}
\begin{document}
\begin{tikzpicture}
\tikzset{
declare function={
f(\x)=cos(\x r);
g(\x)=\fpeval{1/3};
h(\x)=-0.5;
}
}
\draw[-Stealth] ({-2.1*pi},0)--({2.2*pi},0)node[below]{$x$};
\draw[-Stealth] (0,-1.5)--(0,1.5)node[left]{$y$};
\draw[name path=s,domain=-2*pi:2*pi,samples=600] plot (\x,{f(\x)});
\draw[name path=l,color=cyan,domain=-2*pi:2*pi,samples=600] plot (\x,{g(\x)});
\draw[name path=ll,color=cyan,domain=-2*pi:2*pi,samples=600] plot (\x,{h(\x)});
\fill[name intersections={of=s and l,name=P,total=\t}]
[color=red] \foreach \i in {1,...,\t}{(P-\i) circle (1pt) node[above] {$\i$}};
\end{tikzpicture}
\end{document}
有一点改善,但没有完全解决:
提供一个related issues
也许可供参考(?)但其实问题并没有解决...感觉应该在哪里reported过
\documentclass[aspectratio=169]{beamer}
\usepackage[noindent]{ctexcap}
\usepackage{amsfonts, amsmath}
\usetheme{Madrid}
\usecolortheme{default}
\usefonttheme{professionalfonts}
% \usefonttheme[onlymath]{serif}
% \AtBeginDocument{%
% \DeclareSymbolFont{pureletters}{T1}{\mathfamilydefault}{\mddefault}{it}%
% }
\begin{document}
\begin{frame}
$\dot{H}^{1/2}$
\end{frame}
\end{document}
SwitWu老师 @u20011 指出,使用unicode-math
可以有效解决这一问题:
有关math accent与beamer的爱恨情仇,还可见:这个链接
请按照这个链接的操作确定这是什么字体。或者提供单页的PDF文件作为示例。
related link
\documentclass{beamer}
\usetheme{Berlin}
\usepackage{ctex}
\usepackage{amsmath}
\usefonttheme{serif}
\usepackage{cleveref}
\usepackage{hyperref}
\crefformat{equation}{#2式~(#1#3)}
\let\chyperref\cref
\renewcommand{\cref}[1]{{\hyperlink{#1}{\chyperref{#1}}}}
\begin{document}
\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}
另外,原始MWE带来的警告与这个问题似乎是相同的...
Thebeamer
document class redefines the\label
command in a particularly devious way...
我觉得你不应该用计数器proof
以及\theproof
的值来控制长度。
另外我没看懂『前后无间距以使得悬挂缩进可以实现』,以及subsize
是想实现什么...
如果你需要『悬挂缩进』,其实latex2e
是有类似的quote环境的:
%article.cls
\newenvironment{verse}
{\let\\\@centercr
\list{}{\itemsep \z@
\itemindent -1.5em%
\listparindent\itemindent
\rightmargin \leftmargin
\advance\leftmargin 1.5em}%
\item\relax}
{\endlist}
\newenvironment{quotation}
{\list{}{\listparindent 1.5em%
\itemindent \listparindent
\rightmargin \leftmargin
\parsep \z@ \@plus\p@}%
\item\relax}
{\endlist}
\newenvironment{quote}
{\list{}{\rightmargin\leftmargin}%
\item\relax}
{\endlist}
另外,代码要给完整...同时最好详细描述proof
以及subsize
想达到的预期效果示意图。
提供代码要完整,可编译。
一个也许你的复现如下:
\documentclass{article}
\usepackage[a4paper,showframe]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{xcolor}
\begin{document}
\begin{figure}[h]
\centering
\caption[Sparse-SIM resolves known structures of ~60 nm in size.]{Sparse-SIM resolves known structures of ~60 nm in size.}
\includegraphics[width=.6\linewidth]{example-image}
\begin{minipage}{\textwidth}
{\color{red}\textbf{This is the table notes}}\\
\lipsum[1-6]%
\end{minipage}
\end{figure}
\end{document}
那你确实要么只能缩小字体,要么只能压缩内容。
确实如此,请查看texdoc amsthm
的文档。
\documentclass{article}
\usepackage{amsthm}
\newtheorem{mythmA}{ThmA}
\theoremstyle{definition}
\newtheorem{mythmB}{ThmB}
\setlength{\parindent}{0pt}
\begin{document}
This is a theorem with a custom label.
\begin{mythmA}
This is a theorem with a custom label.
\end{mythmA}
\begin{mythmB}
This is a theorem with a custom label.
\end{mythmB}
This is a theorem with a custom label.
\end{document}
考古....
一个比较方便的办法是使用paracol
提供的\columnratio{.6667}
:
\documentclass{article}
\usepackage{microtype}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage{paracol}
\usepackage{lipsum}
\usepackage{graphicx}
\columnratio{.6667}
\begin{document}
\begin{paracol}{2}
\lipsum[1-5]
\switchcolumn
\lipsum[1]
\noindent\includegraphics[width=5cm]{example-image}
\lipsum[2]
\end{paracol}
\end{document}
希望上下两行的能够换行的答题线长度之和是定值,暂定为9em,考虑到通用性,希望可以指定任意合理的长度
不完全符合OP的需求,但也许可以借用xeCJkfntef
提供的hidden
选项,用多个啊
之间的间隙来实现自动换行。
\documentclass{ctexart}
\usepackage[showframe,margin=1in]{geometry}
\usepackage{enumitem}
\setlist[enumerate]{nosep,labelsep=0pt,leftmargin=2em}
\usepackage{multicol}
\setlength{\columnseprule}{.4pt}
\setlength{\columnsep}{1cm}
\usepackage{xeCJKfntef}
\newcommand{\gentext}[2][啊]{%
\ifnum#2>0\relax%
#1\gentext{\numexpr#2-1}\unskip%
\fi%
}
\newcommand*{\myrule}[2][.4pt]{%
\CJKunderline[hidden,thickness=#1]{\gentext{#2},\gentext{#2}}
}
\begin{document}
\noindent\textbf{16. }补写出下列句子中的空缺部分。(6分)
\begin{multicols}{2}
\begin{enumerate}[label=(\arabic{enumi})]
\item
王湾《次北固山下》的名句“\myrule{5}”,描写时序交替中的景物,暗示着时光流逝,蕴含着自然理趣。
\item
小慧为朋友家的农家乐餐厅写宣传横幅,直接使用了陆游《游山西村》里的“\myrule{7}”两句诗,朋友看了觉得很贴切。
\item
行至群山深处,见到一挂瀑布飞泻而下,水石激荡,轰鸣作响,于老师回头对学生们说:“这不就是古诗中写的‘\myrule{9}’嘛!”
\end{enumerate}
\end{multicols}
\noindent\textbf{参考答案:}
\begin{enumerate}[label=(\arabic{enumi})]
\item
海日生残夜\quad 江春入旧年
\item
山重水复疑无路\quad 柳暗花明又一村
\item
飞流直下三千尺\quad 疑是银河落九天(飞湍瀑流争喧豗\quad 砯崖转石万壑雷)
\end{enumerate}
\end{document}
也许可以试试amsmath
提供的flalign
,找好合适的对齐点位。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{flalign}
\max\enspace &\sum_{i=1}^np_if_i(s_i)&\mathrm{(3-1)}&& \\
\mathrm{s.t.}\enspace&\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},&\mathrm{(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}),&\mathrm{(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{flalign}
\end{document}
Editted:
BTW,如果想要求和号都对齐,还可以用mathtools
宏包的\mathclap
:
感兴趣的自己看看文档吧~可以实现如下效果...
对于原OP的MWE:
\documentclass{article}
\newcommand{\foo}{target}%<-mark1
\AddToHook{cmd/foo/before}{extra }%<-mark2
\begin{document}%<-mark3
\foo%<-mark4
\renewcommand{\foo}{new target}%<-mark5
\foo%<-mark6
\end{document}
我来尝试理解一下每一步发生的过程(我希望我的理解没有大问题):
\foo
\AddToHook
由于Hook不会物理性地在导言区存在,而是会有一个延迟修补的机制,在此时增加extra
的内容尚且不会直接被写入\foo
的定义中begindocument
的钩子自动执行,在此时被延迟写入\foo
的extra
终于被自动修补进\foo
的定义中\foo
结果为extra target
因为对于通用钩子在使用\UseHookWithArguments
进行自动修补的同时会新建这个钩子,而钩子只能被\NewHook
一次,因此可以预见这种自动修补只会进行一次,这里在mark3的时刻,已经由通用钩子cmd/foo/begin
的自动修补机制实现了对cmd/foo/begin
的创建以及补充代码,故后续不会再进行自动修补。
\foo
的同时,覆盖了原先的自动修补内容extra
.且由于cmd/foo/begin
钩子已经存在,不会被再次创建,此时可以使用雾月老师指出的『最佳实践』(也即文档section 2.1.1的第三段):This has the consequence that a command defined or redefined after\begin{document}
only uses generic cmd hook code if\AddToHook
is called for the first time after the definition is made, or if the command explicitly uses the generic hook in its definition by declaring it with\NewHookPair
adding\UseHook
as part of the code.
[kimi翻译版] 这意味着,如果一个命令是在\begin{document}
之后定义或重新定义的,只有在定义后首次调用\AddToHook
,或者命令在定义时明确使用了通用钩子(通过\NewHookPair
声明并包含\UseHook
作为代码的一部分),该命令才会使用通用命令钩子代码。
(O.S.我好像没在哪看到\NewHookPair
的用法,但这里最后一句的说法我猜就是『最佳实践』的方案)
\foo
就仅有最近的一次重定义(\renewcommand
)的内容。对于修改版的MWE:
\renewcommand{\foo}{%
\UseHookWithArguments{cmd/foo/before}{0}%
new target%
\UseHookWithArguments{cmd/foo/after}{0}%
}
要注意的是,如前面介绍,在mark3
时已经通过唯一的一次自动修补机制"\NewHook
"了一个名为cmd/foo/before
的Hook,且其内容为在\foo
之前添加extra
。
于是新的MWE中的\renewcommand
里,使用\UseHook{cmd/foo/before}
或者\UseHookWithArguments{cmd/foo/before}{0}
就可以让cmd/foo/before
里保存的内容(因为已经"\NewHook
"过这个名为cmd/foo/before
的Hook了)“再次”直接发挥作用被\Use
,“手动”修补得到想要的结果extra new target
.
非常感谢雾月老师,同时也有必要再补充一点以方便我的理解:
对于OP已提及的『尝试过的做法』:在\renewcommand
之后再次\AddToHook
:
\documentclass{article}
\newcommand{\foo}{target}
\AddToHook{cmd/foo/before}{extra }%
\begin{document}%
\LogHook{cmd/foo/before}%First
\foo%
\renewcommand{\foo}{new target}%
\AddToHook{cmd/foo/before}{extra }%
\LogHook{cmd/foo/before}%Second
%因为hookname已经被占用,不会自动修补
\foo% 因此在『已进行的尝试』中同样无效
\UseHook{cmd/foo/before}%
\foo%
% 其实就等价于『最佳实践』的做法,当需要对重定义命令多次Hook时,手动把`\UseHook'写入`\renewcommand'
\end{document}
第一处LogHook
结果:
-> The generic hook 'cmd/foo/before':
> Code chunks:
> ---
> Document-level (top-level) code (executed last):
> -> extra
> Extra code for next invocation:
> ---
> Rules:
> ---
> Execution order:
> ---.
第二处LogHook
结果,但因为不会第二次自动修补,进而不生效:
-> The generic hook 'cmd/foo/before':
> Code chunks:
> ---
> Document-level (top-level) code (executed last):
> -> extra extra
> Extra code for next invocation:
> ---
> Rules:
> ---
> Execution order:
> ---.
Happy Hooking!
自行对比。
原来的作者设计\hh
的时候是没有考虑到这种直接挖空在段首的情况的
\documentclass[a4paper]{ctexart}
\usepackage[showframe]{geometry}
\usepackage{zhlipsum}
\RequirePackage{xcolor}
\NewDocumentCommand\hha{g}%
{\IfNoValueTF{#1}{\,\underline{\hbox to 1cm{}}\,}{\nolinebreak\textcolor[rgb]{1,0,0}{\underline{#1}}}}
\NewDocumentCommand\hhb{g}%
{\IfNoValueTF{#1}{\,\underline{\hbox to 1cm{}}\,}{\textcolor[rgb]{1,0,0}{\underline{#1}}}}
\begin{document}
我的答案是什么呢我的答案是什么呢我的答案是什么呢我的答案是什么呢\hha 你好
我的答案是什么呢我的答案是什么呢我的答案是什么呢我的答案是什么呢\hhb 你好
我的答案是什么呢我的答案是什么呢我的答案是什么呢我的答案是什么呢\hha{我能吞下玻璃而不伤身体}
我的答案是什么呢我的答案是什么呢我的答案是什么呢我的答案是什么呢\hhb{我能吞下玻璃而不伤身体}
%\hha{我能吞下玻璃而不伤身体}我的答案是什么呢我的答案是什么呢我的答案是什么呢我的答案是什么呢%<---报错
\hhb{我能吞下玻璃而不伤身体}我的答案是什么呢我的答案是什么呢我的答案是什么呢我的答案是什么呢
\end{document}
在数学模式中,所有常规的字体默认样式均为斜体。
我不太理解你的『教科书』中是什么样子,请截图看看。
Edited:
Thanks to egreg:
\documentclass[tikz]{standalone}
\usepackage{textcomp} % for TS1
\usepackage{amsmath}
\DeclareSymbolFont{textsymbols}{TS1}{\familydefault}{m}{n}
\SetSymbolFont{textsymbols}{bold}{TS1}{\familydefault}{m}{n}
\DeclareMathSymbol{\ulq}{\mathopen}{textsymbols}{39}
\DeclareMathSymbol{\urq}{\mathclose}{textsymbols}{39}
\DeclareMathSymbol{\uprime}{\mathnormal}{textsymbols}{39}
\begin{document}
\begin{tikzpicture}
\node {\(C' \enspace C\text{\textquotesingle} \enspace \ulq C\urq \enspace C\uprime \)};
\end{tikzpicture}
\end{document}
Notes:斜体的C
和upright single quote
感觉很不搭...
Re-Edited:
\documentclass[tikz]{standalone}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
\node {\(A'B'C' \enspace \mathrm{A}'\mathrm{B}'\mathrm{C}'\)};
\end{tikzpicture}
\end{document}
另建议把问题描述为:在数学公式中如何输入正体字符....
或者换一个无衬线的数学字体:
\documentclass[tikz]{standalone}
\usepackage{unicode-math}
\setmathfont{Fira Math}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
\node {\(A'B'C' \enspace \symup{A}'\symup{B}'\symup{C}'\)};
\end{tikzpicture}
\end{document}
要想全局生效,也可以试试math-style=upright
:
\documentclass[tikz]{standalone}
\usepackage[math-style=upright]{unicode-math}
\setmathfont{Fira Math}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
\node {\(A'B'C'\)};
\end{tikzpicture}
\end{document}
问 1编号在$$超出是为什么?如何修改?