I was wondering if anybody knows about Latex symbol for an eye, either frontal or lateral view.
Frontal:
Lateral:
Update I knew about Detexify and searched there. It didn't work. Detexify took the eyes as some malformed alphabetic characters.
graphicssymbols
I was wondering if anybody knows about Latex symbol for an eye, either frontal or lateral view.
Frontal:
Lateral:
Update I knew about Detexify and searched there. It didn't work. Detexify took the eyes as some malformed alphabetic characters.
\textcolor
of package color
adds a level of curly braces that become a subformula in math mode, destroying the spacing. The following example defines \mathcolor
that can be used in the same way as \textcolor
, but without the subformula side effect. It uses \begingroup
and \endgroup
instead of the curly braces that do not cause the trouble in math. A grouping level is needed for LaTeX's color handling that restores the color after the group via \aftergroup
.
\documentclass{article}
\usepackage{color}
\newcommand*{\mathcolor}{}
\def\mathcolor#1#{\mathcoloraux{#1}}
\newcommand*{\mathcoloraux}[3]{%
\protect\leavevmode
\begingroup
\color#1{#2}#3%
\endgroup
}
\begin{document}
$a\ast b$
$a\textcolor{red}{\ast}b$
$a\mathcolor{red}{\ast}b$
\end{document}
The parameter text of \mathcolor
is #1#
with a final hash symbol without number. That means all tokens before the next opening curly brace are put into #1
. In case of \mathcolor
(or \textcolor
) this is the optional argument. Without an optional argument #1
is empty, otherwise it contains the optional argument including the square brackets.
If it's really not in Detexify, check the Comprehensive LaTeX Symbol List to see if your symbol can be found in an existing package. Note, The Comprehensive List is long! Over 300 pages. But it is searchable, well-organized, and has a good table of contents and index.
If that doesn't help, it may be time to design your own symbol. It's probably best to give your new symbol a name so it can be used repeatedly and transported more easily into another document.
If your symbol will be used as an operator with limits (like an integral or summation), you should use the \DeclareMathOperator
or \DeclareMathOperator*
command. Both of these use the amsmath
package. The unstarred version places sub- and superscript limits to the right of the operator; the starred version places limits above and below the operator when it is in displaystyle
. To illustrate:
\DeclareMathOperator*{\squareop}{\square}
\DeclareMathOperator{\triangleop}{\bigtriangleup}
[Note that \square
uses the amssymb
package.]
Then the code
\[
\squareop_{n=1}^{\infty} a_n \qquad \triangleop_{n=1}^{\infty} a_n
\]
will produce the following output:
More information on \DeclareMathOperator
can be found in this answer by @Andrew Swann.
If your symbol is not going to be used in that fashion, you should probably use \newcommand
.
If your symbol is a math symbol: Is it a binary operator (such as +
or \times
)? A binary relation (such as <
or \leq
)? Or an ordinary math symbol (such as !
or \infty
)? The spacing is different for each case. Compare the three versions for the symbol \times
:
\newcommand{\reltimes}{\mathrel{\times}}
\newcommand{\bintimes}{\mathbin{\times}}
\newcommand{\chrtimes}{{\times}}
Then \noindent $a\reltimes b \newline a\bintimes b \newline a\chrtimes b$
will produce the output:
Note the extra set of curly braces in \chrtimes
. If you remove them you'll get the same output as \mathbin{\times}
, since \times
is by default a binary operator. You can enclose most math symbols in {}
to turn them into ordinary math symbols.
Typically, binary relations have slightly more space than binary operators, and significantly more than ordinary symbols. However, the spacing changes when these appear as sub- or superscripts. All three examples above will look like A_{a\times b}
if placed in a subscript.
Many new symbols can be created by modifying or combining existing symbols. To rotate, scale or reflect existing symbols, use the graphicx
or graphics
package. Documentation is here. The commands are \rotatebox
, \scalebox
, \resizebox
and \reflectbox
.
For example, if you want a \cong
symbol (≅), but with the tilde reversed, the \reflectbox
command from graphicx
can be used. The code
\newcommand{\backcong}{\mathrel{\reflectbox{$\cong$}}}
will produce the desired effect with the code $A\backcong B$
.
If you try using this code in a subscript (for example, $X_{A\backcong B}$
), the new symbol will not scale down as it should. This is resolved below below using \mathchoice
.
To combine multiple symbols (math or text) the \ooalign
command can be used. @egreg has a detailed explanation here. The basic idea is that \ooalign
creates a one-column table, with all rows superimposed on one another, and no padding outside the column. Each row of the "table" ends with \cr
. Entries can be centered in the column using \hfil
.
For example, to produce
we superimpose a \circ
symbol with a text T
character. The command
\newcommand{\Tcirc}{\mathbin{%
\ooalign{\hfil$\circ$\hfil\cr\hfil T\hfil\cr}%
}}
together with $A\Tcirc B$
produces the output.
To make sure your symbol looks right whether it's displayed, inline, script or scriptscript, you can use \mathchoice
. (Note mathpalette
(explained here by @egreg and @Werner) can be used when the four versions are identical except for style.)
\mathchoice
{<do this if called in \displaystyle>}
{<do this if called in \textstyle>}
{<do this if called in \scriptstyle>}
{<do this if called in \scriptscriptstyle>}
The above code will produce the corresponding output for each of the four math styles.
To illustrate, here is a solution to the twisted product question that will adjust to scripts and scriptscripts.
\newcommand{\twprod}{\mathbin{\mathchoice%
{\ooalign{\hfil\raisebox{1.15ex}{\mbox{$\scriptstyle\sim$}}\hfil\cr\hfil$\times$\hfil\cr}}%
{\ooalign{\hfil\raisebox{1.15ex}{\mbox{$\scriptstyle\sim$}}\hfil\cr\hfil$\times$\hfil\cr}}%
{\ooalign{\hfil\raisebox{.85ex}{\mbox{$\scriptscriptstyle\sim$}}\hfil\cr\hfil$\scriptstyle\times$\hfil\cr}}%
{\ooalign{\hfil\raisebox{.65ex}{\scalebox{.8}{$\scriptscriptstyle\sim$}}\hfil\cr\hfil$\scriptscriptstyle\times$\hfil\cr}}%
}}
S^2\twprod S^2 \quad F_{S^2\twprod S^2} \quad F_{K_{S^2\twprod S^2}}
I downsized the \sim
in each style so it fit better over the \times
.
Similar effects can be obtained using stackengine
. Documentation is here.
If you can't create your symbol by combining or modifying others, you can design your symbol from scratch using tikz
, together with the ideas above. Here is an example by @marmot.
Best Answer
I have created two eyes symbols with Mathcha➡TikZ that reproduce largely your picture that they can be used in text and in math mode. Your names are
\frontaleye
and\lateraleye
. With\scalebox{<factor>}
you can increase or decrease the size of the symbols.You can see that it is possibile to choose the color of the eye.