I am looking for commands that puts marks for line segments, angles, and other geometrical entities around letters in a text. Many geometry books use a line segment with dots at the end and place it over two letters to indicate a particular line segment. Same for an arc between two points on a circle. Plain LaTeX does not allow for this. A package must be downloaded. Please give me these commands and the commands for the symbols for angles, triangle, and parallel lines.
[Tex/LaTex] Geometric markings in the text for line segments and angles
accentstechnical-drawing
Related Solutions
I think the problem here is that you are using inline math mode $..$
as opposed to display mode \[...\]
. Here is the comparison of the output between the two:
with the second one producing better spacing. To obtain that you need to either use one of the following
\[\frac{\bar{p}_1}{\bar{p}_1 + \bar{h}_1}\]
$\displaystyle \frac{\bar{p}_1}{\bar{p}_1 + \bar{h}_1}$
$\dfrac{\bar{p}_1}{\bar{p}_1 + \bar{h}_1}$
Note that \dfrac
requires that the amsmath
package be loaded, either by including it explictly \usepackage{amsmath}
, or as part some other package that already includes amsmath
, such \usepackage{mathtools}
.
Here is the MWE. Note that the center
environment was only used to simplify the image capture.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{center}
$\frac{\bar{p}_1}{\bar{p}_1 + \bar{h}_1}$
\end{center}
\[\frac{\bar{p}_1}{\bar{p}_1 + \bar{h}_1}\]
\begin{center}
$\displaystyle \frac{\bar{p}_1}{\bar{p}_1 + \bar{h}_1}$
\end{center}
\begin{center}
$\dfrac{\bar{p}_1}{\bar{p}_1 + \bar{h}_1}$
\end{center}
\end{document}
To make the bar wider you can use \overline
as in:
$\dfrac{\overline{p}_1}{\overline{p}_1 + \overline{h}_1}$
or adapt the xoverline
from The \bar and \overline commands with which you can adjust the spacing:
$\dfrac{\xoverline{p}_1}{\xoverline{p}_1 + \xoverline{h}_1}$
or specify you want it wider with:
$\dfrac{\xoverline[1.25]{p}_1}{\xoverline[1.25]{p}_1 + \xoverline[1.25]{h}_1}$
Here is a comparison between \bar{p}_1
, \overline{p}_1
, \xoverline[1.25]{p}_1}
, and {\xoverline[1.50]{p}_1
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newsavebox\myboxA
\newsavebox\myboxB
\newlength\mylenA
\newcommand*\xoverline[2][1.00]{%
\sbox{\myboxA}{$\m@th#2$}%
\setbox\myboxB\null% Phantom box
\ht\myboxB=\ht\myboxA%
\dp\myboxB=\dp\myboxA%
\wd\myboxB=#1\wd\myboxA% Scale phantom
\sbox\myboxB{$\m@th\overline{\copy\myboxB}$}% Overlined phantom
\setlength\mylenA{\the\wd\myboxA}% calc width diff
\addtolength\mylenA{-\the\wd\myboxB}%
\ifdim\wd\myboxB<\wd\myboxA%
\rlap{\hskip 0.5\mylenA\usebox\myboxB}{\usebox\myboxA}%
\else
\hskip -0.5\mylenA\rlap{\usebox\myboxA}{\hskip 0.5\mylenA\usebox\myboxB}%
\fi}
\makeatother
\begin{document}
$\dfrac{\bar{p}_1}{\bar{p}_1 + \bar{h}_1}$\quad
$\dfrac{\overline{p}_1}{\overline{p}_1 + \overline{h}_1}$\quad
$\dfrac{\xoverline[1.25]{p}_1}{\xoverline[1.25]{p}_1 + \xoverline[1.25]{h}_1}$
$\dfrac{\xoverline[1.50]{p}_1}{\xoverline[1.50]{p}_1 + \xoverline[1.50]{h}_1}$
\end{document}
This is a work around using \clip
.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\clip (1.3,0.2) -- (1,0) -- (1.3,-0.2) -- (1.3,0.2) -- cycle;
\draw [line width=2pt] (1.3,0.2) to (1,0) to (1.3,-0.2);
\draw (1.3,-0.2) to (1.3,0.2);
\end{tikzpicture}
\end{document}
Note that a line width of 2pt
will give a resultant line width of 1pt
as the other part is clipped off. So you have to adjust properly.
If this forms a part of bigger diagram, the \clip
ping part may be enclosed in a scope
so as to limit the clipping:
\begin{scope}
\clip (1.3,0.2) -- (1,0) -- (1.3,-0.2) -- (1.3,0.2) -- cycle;
\draw [line width=2pt] (1.3,0.2) to (1,0) to (1.3,-0.2);
\draw (1.3,-0.2) to (1.3,0.2);
\end{scope}
Best Answer
Here is one way to do arc symbols
The mnsymbol package contains a "filled spoon" symbol that may do the trick. You can also create symbols using tikz, but that is a huge can of worms to tackle.
BTW, every time you load a package from CTAN you also get documentation, albeit scattered over many folders. I recommend that you create shortcuts (links) to all these documents and put them into a single folder.