Math & ScienceCommand for custom Symbol

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
financialwar
Posts: 29
Joined: Wed Jul 18, 2012 4:55 pm

Command for custom Symbol

Post by financialwar »

Hello.

Does anyone know the command for the symbol in the attached picture?
Attachments
Capture.PNG
Capture.PNG (3.28 KiB) Viewed 6714 times
MiKTex 2.9, Texmaker 3.5 on Windows 7
Learning LaTeX for Finance and Actuarial Studies.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
tommytex
Posts: 39
Joined: Wed Jan 23, 2013 10:04 pm

Command for custom Symbol

Post by tommytex »

hi,

why don't you define a new command to insert the symbol using includegraphics?

Code: Select all

\newcommand{\ai}{
 {\mathchoice
  { \includegraphics[height = 1.6ex]{yoursymbol}}
  { \includegraphics[height = 1.6ex]{yoursymbol}}
  { \includegraphics[height = 1.2ex]{yoursymbol}}
  { \includegraphics[height = 0.9ex]{yoursymbol}}
 }}
works properly on my tex system
Attachments
symbol.png
symbol.png (26.79 KiB) Viewed 6692 times
YourSymbol.pdf
(67.09 KiB) Downloaded 462 times
YourSymbol.tex
(566 Bytes) Downloaded 431 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Command for custom Symbol

Post by Stefan Kottwitz »

\includegraphics is a good idea if the a symbol is in pdf or eps format. A bitmap could be blurry.

When I need such special things, I use TikZ, since I know how to draw with it, also inline. Here, I would define an operator for example like this:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\DeclareRobustCommand{\newop}[2]{%
  \vcenter{\hbox{\tikz[node distance=2.5ex]{%
    \node (nominator) {\scriptsize $#1$};
    \node[below of=nominator] {\scriptsize $#2$};
    \draw[shorten <=0.5ex, shorten >=0.5ex, yshift=0.5ex]
      (current bounding box.west) -| (current bounding box.south east);
}}}}
\begin{document}
\[
    a\newop{i}{4} \qquad b\newop{i+j}{10}
\]
\end{document}
The line length is adjusted to width and height, for varying symbol dimensions.
symbol.png
symbol.png (2.23 KiB) Viewed 6687 times
Change some dimensions if you like. I already used dimensions relative to the font size for automatic fitting.

Stefan
LaTeX.org admin
User avatar
tommytex
Posts: 39
Joined: Wed Jan 23, 2013 10:04 pm

Re: Command for custom Symbol

Post by tommytex »

Nice One, Stefan!

I sometimes use this WYSIWYG-tool to optimize my drawings:

http://www.tikzedt.org/index.html

greez, tommy
Post Reply