TeX - LaTeX Asked on February 16, 2021
I would like to draw the following new symbol, so that I can use it in sentences.
Which tool would you advise? TikZ?
Thanks
Before someone comes with a TikZ solution...
documentclass{article}
% usepackage{amsmath}
makeatletter
newcommand*{foo}{mathpalette@foo}
newcommand*{@foo}[2]{%
% rule thickness
@tempdima=fontdimen8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
% spacing around the symbols 0.5ex
@tempdimb=0.5fontdimen5
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 2
sbox0{m@thkern@tempdimb$#1#2$kern@tempdimb}%
ht0=dimexprht0+@tempdimbrelax
dp0=dimexprdp0+@tempdimbrelax
lowerdimexprdp0+@tempdimarelax
hbox{%
vrule@width@tempdima
vbox{offinterlineskip
hb@xt@wd0{vrule@height@tempdima@width@tempdimbhfilvrule@height@tempdima@width@tempdimb}%
box0
hrule@height@tempdima
}%
vrule@width@tempdima
}%
}
makeatother
begin{document}
$foo{a,b}$
$scriptstylefoo{a,b}$
$scriptscriptstylefoo{a,b}$
medskip
$displaystylefoo{-frac{a}{2},frac{a}{2}}$
$foo{-frac{a}{2},frac{a}{2}}$
$scriptstylefoo{-frac{a}{2},frac{a}{2}}$
$scriptscriptstylefoo{-frac{a}{2},frac{a}{2}}$
end{document}
The two lengths scale accordingly to the current math style: @tempdima
is the standard rule thickness, while @tempdimb
is basicall half ex
(the latter could be fixed without resorting to fontdimen
).
If you uncomment amsmath
then the result will differ slightly in scriptscriptstyle
, where you get
Correct answer by campa on February 16, 2021
If your symbols don't have excessive depth (no fractions, for instance), you can get away with
documentclass{article}
usepackage{amsmath,array}
makeatletter
newcommand{segment}[1]{%
biglceilcolas@segment{#1}bigrceil
}
newcommand{colas@segment}[1]{%
mspace{-4.85mu}%
underline{mspace{5mu}#1vphantom{j}mspace{5mu}}%
mspace{-4.85mu}%
}
makeatother
begin{document}
Huge
indentrlap{vrule height0pt depth0.1pt width 4cm}%
$segment{a,b}={ta+(1-t)b: tin[0,1]}$
indentrlap{vrule height0pt depth0.1pt width 4cm}%
$segment{p,q}={tp+(1-t)q: tin[0,1]}$
end{document}
Answered by egreg on February 16, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP