我采用了 Steven B. Segletes 编写的用于在字母上方绘制箭头以表示射线的代码;他回复了 tex.stackexchange.com 上的一篇帖子“在字母对上方排版箭头以表示一条线”。当我将字体更改为 时\footnotesize
,箭头前面似乎有一条破折号。如何正确绘制箭头 - 并且更长?目前,箭头的箭头直接绘制在字母“r”、“s”和“t”上方。
当射线用单个字母表示时,通常将素数排版在箭头下方还是旁边?
\documentclass{article}
\usepackage{amsmath, mathtools, amssymb, amsthm}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{scalerel}
\def\shrinkage{-2.4mu}
\def\vecsign#1{\rule[1.388\LMex]{\dimexpr#1-2.5pt}{.36\LMpt}%
\kern-6.0\LMpt\mathchar"017E}
\def\dvecsign#1{\smash{\stackon[-1.989\LMpt]{\SavedStyle\mkern-\shrinkage\vecsign{#1}}%
{\rotatebox{180}{$\SavedStyle\mkern-\shrinkage\vecsign{#1}$}}}}
\def\dvec#1{\ThisStyle{\setbox0=\hbox{$\SavedStyle#1$}%
\def\useanchorwidth{T}\stackon[-4.2\LMpt]{\SavedStyle#1}{\,\dvecsign{\wd0}}}}
\def\theraysign#1{\rule[1.384\LMex]{\dimexpr#1-2.5pt}{.40\LMpt}%
\kern-6.0\LMpt\mathchar"017E}
\def\raysign#1{\smash{\SavedStyle\mkern-\shrinkage\theraysign{#1}}}
\def\ray#1{\ThisStyle{\setbox0=\hbox{$\SavedStyle#1$}%
\def\useanchorwidth{T}\stackon[-4.2\LMpt]{\SavedStyle#1}{\,\raysign{\wd0}}}}
\usepackage{stackengine,amsmath}
\stackMath
\usepackage{graphicx}
\begin{document}
\begin{center}
\begin{tikzpicture}
%An angle and its angle bisector are drawn.
\path (0,0) coordinate (A');
\path ($(A') +({(3/11)*(10)},0)$) coordinate (O') ($(O') +({(3/11)*9*(3/5)},{(3/11)*9*(4/5)})$) coordinate (B');
\node[anchor={180-1/2*(acos(-3/5))}, inner sep=0, font=\footnotesize] at ($(O') +({(180-1/2*(acos(-3/5)))+180}:0.1)$){$O{\makebox[0pt][l]{\smash{${}^{\prime}$}}}$};
\draw[-latex] (O') -- ($(A')!-0.75cm!(O')$);
\path node[anchor=east, inner sep=0, font=\footnotesize] at ($(A')!-0.85cm!(O')$){$\ray{r{\makebox[0pt][l]{\smash{${}^{\prime}$}}}}$};
\draw[-latex] (O') -- ($(B')!-0.75cm!(O')$);
\path node[anchor={(180-acos(-3/5))+180}, inner sep=0, font=\footnotesize] at ($(B')!-0.75cm!(O')$){$\ray{s{\makebox[0pt][l]{\smash{${}^{\prime}$}}}}$};
\coordinate (C') at ($(O') +({(3/11)*(-36/19)},{(3/11)*72/19})$);
\draw[-latex, dashed] (O') -- ($(C')!-1cm!(O')$);
\path node[anchor={(180-1/2*(acos(-3/5)))+180}, inner sep=0, font=\footnotesize] at ($($(C')!-1cm!(O')$)!-0.05cm!(O')$){$\ray{t{\makebox[0pt][l]{\smash{${}^{\prime}$}}}}$};
\end{tikzpicture}
\end{center}
\end{document}
答案1
您借用的代码是用于箭头,该箭头的长度可以根据需要而定。由于您只需要一个字母,所以我不太明白您为什么要使用该代码。以下是排版代码中四个标签的四种不同方法。(我已将标签从 TikZ 图片中移除,因为这与您要做的事情无关。)
- 您的方法,其中箭头与脚注大小的字母太接近。
- TeX 定义
\vec
,其中素数太靠近向量。 \vec
,然后使用 Jasper 建议的\mkern2mu
。- 使用
\,
,TeX 将其定义为\mkern3mu
。
选项 3 和 4 对我来说看起来不错。请注意,只有选项 1 才有前导码;选项 2、3 和 4 根本不需要前导码。
\documentclass{article}
% this entire preample is only necessary for defining \ray
\usepackage{scalerel}
\def\shrinkage{-2.4mu}
\def\vecsign#1{\rule[1.388\LMex]{\dimexpr#1-2.5pt}{.36\LMpt}%
\kern-6.0\LMpt\mathchar"017E}
\def\dvecsign#1{\smash{\stackon[-1.989\LMpt]{\SavedStyle\mkern-\shrinkage\vecsign{#1}}%
{\rotatebox{180}{$\SavedStyle\mkern-\shrinkage\vecsign{#1}$}}}}
\def\dvec#1{\ThisStyle{\setbox0=\hbox{$\SavedStyle#1$}%
\def\useanchorwidth{T}\stackon[-4.2\LMpt]{\SavedStyle#1}{\,\dvecsign{\wd0}}}}
\def\theraysign#1{\rule[1.384\LMex]{\dimexpr#1-2.5pt}{.40\LMpt}%
\kern-6.0\LMpt\mathchar"017E}
\def\raysign#1{\smash{\SavedStyle\mkern-\shrinkage\theraysign{#1}}}
\def\ray#1{\ThisStyle{\setbox0=\hbox{$\SavedStyle#1$}%
\def\useanchorwidth{T}\stackon[-4.2\LMpt]{\SavedStyle#1}{\,\raysign{\wd0}}}}
\usepackage{stackengine}
\stackMath
\begin{document}
\renewcommand{\arraystretch}{1.3}
\begin{tabular}{lll}\hline
& Normal size & Footnote size\\\hline
your approach
& $O{\makebox[0pt][l]{\smash{${}^{\prime}$}}}$, $\ray{r{\makebox[0pt][l]{\smash{${}^{\prime}$}}}}$, $\ray{s{\makebox[0pt][l]{\smash{${}^{\prime}$}}}}$, $\ray{t{\makebox[0pt][l]{\smash{${}^{\prime}$}}}}$
& {\footnotesize $O{\makebox[0pt][l]{\smash{${}^{\prime}$}}}$, $\ray{r{\makebox[0pt][l]{\smash{${}^{\prime}$}}}}$, $\ray{s{\makebox[0pt][l]{\smash{${}^{\prime}$}}}}$, $\ray{t{\makebox[0pt][l]{\smash{${}^{\prime}$}}}}$} \\
naive approach
& $O'$, $\vec r'$, $\vec s'$, $\vec t'$
& {\footnotesize $O'$, $\vec r'$, $\vec s'$, $\vec t'$} \\
Jasper's suggested kern
& $O'$, $\vec r\mkern2mu'$, $\vec s\mkern2mu'$, $\vec t\mkern2mu'$
& {\footnotesize $O'$, $\vec r\mkern2mu'$, $\vec s\mkern2mu'$, $\vec t\mkern2mu'$} \\
thinmuskip
& $O'$, $\vec r\,'$, $\vec s\,'$, $\vec t\,'$
& {\footnotesize $O'$, $\vec r\,'$, $\vec s\,'$, $\vec t\,'$} \\\hline
\end{tabular}
\end{document}