这是一个基本问题,如果该程序使用的是 CTAN 中没有的最新版本的 tikzmark 库,我深表歉意。我已发布我所掌握的信息以及我试图复制的图像。请协助完成该程序。
\documentclass{article}
\usepackage{amsmath,mathtools,geometry}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\newbox\aebox
\newcommand\aecomment[2][0pt]{%%
\begin{lrbox}\aebox
\begin{minipage}[t]{2.5in}
\raggedright
\textcolor{blue}{#2}%%
\end{minipage}%%
\end{lrbox}%%
\raisebox{#1}[\height][0pt]{\usebox{\aebox}}}
\begin{document}
For $f(x)=\dfrac{1}{x}$, we have
\begin{align*}
f(x+h)&=\dfrac{1}{x+h} \\
\shortintertext{then}\\
f(x+h)-f(x)&=\dfrac{1}{x+h}-\dfrac{1}{x} \\ \\
&=\dfrac{1}{x+h} \cdot \textcolor{red}
{\dfrac{\tikzmarknode{C}{x}}{x}}-\dfrac{1}{x}\cdot \textcolor{red}
{\dfrac{x+h}{x+h}} && \aecomment[1.3ex]{\textcolor{red}{\tikzmarknode{A}
{}Multiplying by $1$ to get a common denominator}}\\
\end{align*}
\begin{tikzpicture}[overlay,remember picture]
\draw[red] ([yshift=3pt,xshift=-5pt]A.west) -- ++(-7pt,0pt)-- ++ (0pt,7pt);
\end{tikzpicture}
\end{document}
我正在尝试重新创建
每次尝试重新创建箭头时我都会不断编译错误.....
答案1
最新的 tikzmarklibrary 现在已经在标准 TeX 发行版中存在一段时间了,所以一切都很好,而且绘制箭头真的很容易。
\documentclass{article}
\usepackage{amsmath,mathtools,geometry}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\newbox\aebox
\newcommand\aecomment[2][0pt]{%%
\begin{lrbox}\aebox
\begin{minipage}[t]{2.5in}
\raggedright
\textcolor{blue}{#2}%%
\end{minipage}%%
\end{lrbox}%%
\raisebox{#1}[\height][0pt]{\usebox{\aebox}}}
\begin{document}
For $f(x)=\dfrac{1}{x}$, we have
\begin{align*}
f(x+h)&=\dfrac{1}{x+h} \\
\shortintertext{then}\\
f(x+h)-f(x)&=\dfrac{1}{x+h}-\dfrac{1}{x} \\ \\
&=\dfrac{1}{x+h} \cdot \textcolor{red}
{\dfrac{\tikzmarknode{C}{x}}{x}}-\dfrac{1}{x}\cdot \textcolor{red}
{\dfrac{x\tikzmarknode{C'}{+}h}{x+h}} && \aecomment[1.3ex]{\textcolor{red}{\tikzmarknode{A}
{}Multiplying by $1$ to get a common denominator}}\\
\end{align*}
\begin{tikzpicture}[overlay,remember picture]
\draw[red,-latex] ([yshift=3pt,xshift=-5pt]A.west) -- ++(-7pt,0pt)-- ++ (0pt,12pt)
coordinate (aux)-| (C.north);
\draw[red,-latex] (aux) -| (C'.north);
\end{tikzpicture}
\end{document}