0

I would like to use the following symbol (from this answer, see the "Symbola" in the picture):
enter image description here

Ideally, I would like to have a command which make it appear without loading a package which may change the fonts in my text.
It is however very unclear to me how to adapt this answer in order to do so. Actually, I can't even find a package where the above pictured symbol is contained. Detexify doesn't help me.

Surb
  • 319
  • Try texdoc symobols-a4. There are several \precneq symbols in different fonts. I would just load a package as in most cases then disruption to existing fonts is minimal. –  Sep 28 '18 at 21:28
  • Which answer are you referring to? The link points to one that doesn't feature that symbol. – egreg Sep 28 '18 at 21:44
  • @egreg sorry, I got confused with the links, let me edit the question. – Surb Sep 28 '18 at 21:46
  • @Surb Below the answer you'd like to link to there is a “share” link: click on it and copy the URL, then paste it here. – egreg Sep 28 '18 at 21:47
  • @egreg done :).. – Surb Sep 28 '18 at 21:49
  • Are you using pdflatex or XeLaTeX/LuaLaTeX? If the former, then the answer you refer to cannot help. Unless you'd like to use the STIX symbol. – egreg Sep 28 '18 at 21:51
  • @egreg "Are you using pdflatex or XeLaTeX/LuaLaTeX? " Honestly, I don't know and I don't know how to check that. I use Texstudio with the default compilation setting (double green arrow) – Surb Sep 28 '18 at 21:54
  • @egreg It seems to be pdflatex if I'm not mistaking. – Surb Sep 28 '18 at 21:55
  • @Surb Then it's most likely pdflatex. Symbola is out of the question, unless you make a PDF with the symbol and use it as a graphic inclusion. – egreg Sep 28 '18 at 21:56
  • @egreg ah... and I guess that this graphic inclusion will be complicated and dramatically slow down the compilation..? – Surb Sep 28 '18 at 21:58

2 Answers2

1

Here is a way:

\documentclass{article}
\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{ <-6> mathb5 <6-7> mathb6 <7-8>
mathb7 <8-9> mathb8 <9-10> mathb9 <10-12> mathb10 <12-> mathb12 }{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}

\DeclareMathSymbol{\precneq}{\mathrel}{mathb}{"AC}


\begin{document}

\[ a \precneq b\]%

\end{document} 

enter image description here

Bernard
  • 271,350
  • Thank you for your answer, but this is not the symbol I want. The "\prec" has a different shape in your answer. I managed to import \precneq but again, the output is not the one desired. – Surb Sep 28 '18 at 21:42
  • I borrowed it from mathabx. Where did you find your symbol? The answer you linked to also uses mathabx. – Bernard Sep 28 '18 at 21:44
  • This is the point. I found it in this answer (Symbola version) but it is unclear to me how it is related to any package – Surb Sep 28 '18 at 21:48
  • I don't think it's related to a package, since the answer uses fontspec (hence it works with lualatex or xelatex). – Bernard Sep 28 '18 at 21:58
  • Indeed, it seems that there is no "simple" solution to my problem.. – Surb Sep 28 '18 at 22:00
  • Maybe I should just import \prec and \preceq from mathbx so they all look the same. – Surb Sep 28 '18 at 22:10
  • May be indeed. It's not so curly, but it's not too far. The documentation provides the hexadecimal code of the symbols, so it's easy to do. – Bernard Sep 28 '18 at 22:19
1

Download the Symbola font (it's free) and place it in a working directory.

Prepare the following document and call it precneq.tex:

\documentclass{standalone}
\usepackage{fontspec}
\setmainfont{Symbola}[Path=./,Extension=.ttf]

\begin{document}
\symbol{"2AB1}
\end{document}

Compile it with XeLaTeX to obtain precneq.pdf.

Now copy this PDF file in the same directory as your main document. The code for using it is between \makeatletter and \makeatother (included) in the following test file.

\documentclass{article}
\usepackage{amsmath,graphicx}

\makeatletter
\DeclareRobustCommand{\precneq}{\mathrel{\mathpalette\use@precneq\relax}}
\newcommand\use@precneq{%
  \text{%
    \raisebox{-0.5ex}{%
      \scalebox{\f@size}{%
        \includegraphics[scale=0.1]{precneq}%
      }%
    }%
  }%
}
\makeatother

\begin{document}

$a\precneq b$ $a\preceq b$ $x_{\precneq}y_{\preceq}$

\medskip

{\Large $a\precneq b$ $a\preceq b$ $x_{\precneq}y_{\preceq}$}

\end{document}

enter image description here

Is it worth the pain? I'd simply import all the “prec” symbols from mathabx.

egreg
  • 1,121,712
  • Sorry, it is late here and so I will try your solution tomorrow. Your pictures look great and exactly what I want. As it it for my thesis, I think it is worth the pain. If this slows down the compilation I'll just make the change for the last compilation. Thanks already for your answer. – Surb Sep 28 '18 at 23:07