3

I currently have a document with lots of different packages that seem to have problems to work together:

\usepackage{marvosym}
\usepackage{textcomp}
\usepackage{dsfont}
\usepackage{esint}
%\usepackage{gensymb} <- excluded due to error
%\usepackage{wasysym} <- excluded due to error
%\usepackage{tipa} <- excluded due to error

However, I want to use those symbols (most of them only once) in the document.

My current approach is to generate a PDF with only one symbol:

\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage[ngerman]{babel} 
\usepackage[utf8]{inputenc}

%Additional package
\usepackage{ wasysym }

%document
\begin{document}$\Bowtie$
\end{document}

and then include it with

\includegraphics[height=12.3pt, keepaspectratio]{symbols/Bowtie.pdf}

however, I have the feeling that this might change the size of the symbol and its relative position to the baseline (e.g. for a degree symbol).

Is there a better way to use those packages together? Does (for the listed packages) the order influence if I can compile it?

More specific

When I include \usepackage{wasysm} I get:

! LaTeX Error: Command \diameter already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.4 \newcommand{\diameter}{20}

I don't know how to fix that. I tried savesym:

\usepackage{savesym}
\savesymbol{diameter}
\usepackage{wasysym}

however, this did not have any effect.

MWE

This example is not so minimal ... I am working on it to make it smaller

\documentclass[a4paper,landscape]{scrartcl}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{relsize} % mathlarger
\allowdisplaybreaks         % allow align enviornment to break


\usepackage{siunitx}
\sisetup{per-mode=fraction}
\DeclareSIUnit\pixel{px}

\usepackage{subfig}         % multiple figures in one
\usepackage{pgfplots}

\usepackage{tikz}
\usetikzlibrary{shapes, calc, shapes, arrows}

\usepackage{ntheorem}

\usepackage[raiselinks=true,
                        bookmarks=true,
                        bookmarksopenlevel=1,
                        bookmarksopen=true,
                        bookmarksnumbered=true,
                        hyperindex=true,
                        plainpages=false,
                        pdfpagelabels=true,
                        pdfborder={0 0 0.5},
                        colorlinks=false,                       
                        linkbordercolor={0 0.61 0.50},   
                        citebordercolor={0 0.61 0.50}]{hyperref}  %{0.57 0.74 0.57}
\usepackage[nameinlink,noabbrev]{cleveref} % has to be after hyperref, ntheorem, amsthm
\usepackage{multicol}
\usepackage{mathrsfs}

\usepackage{cmll}
\usepackage{stmaryrd}
\usepackage{skull}
\usepackage{longtable}

% Packages for symbols
\usepackage{upgreek}
\usepackage{marvosym}
\usepackage{textcomp}
\usepackage{dsfont}
\usepackage{esint}
\usepackage{gensymb}
\usepackage{wasysym}
\usepackage{tipa}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin document                                                    %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
Here are many symbols:

\begin{itemize}
    \item \Bat from marvosym,
    \item \textblank from textcomp,
    \item $\mathds{1}$ from dsfont,
    \item $\dotsint$ from esint,
    \item $\celsius$ from gensymb
    \item $\diameter$ from wasysym,
\end{itemize}

\end{document}

Error:

LaTeX Font Warning: Font shape `TS1/aer/m/n' undefined
(Font)              using `TS1/cmr/m/n' instead on input line 82.

(/usr/local/texlive/2014/texmf-dist/tex/latex/marvosym/umvs.fd)

! LaTeX Error: Too many math alphabets used in version normal.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.88     \item $\mathds{1}
                          $ from dsfont,
4

If you just need \Bowtie from wasysym, you can just define it by looking what's done in the package:

\def\Bowtie{\mbox{\wasyfamily\char49}}

so you just need to know what \wasyfamily does:

\def\wasyfamily{\fontencoding{U}\fontfamily{wasy}\selectfont}

So you can avoid loading wasysym by doing, in your document:

% a command to access the wasysym font
\newcommand{\moosewasy}{\fontencoding{U}\fontfamily{wasy}\selectfont}
% here the symbols you need from wasysym
\newcommand{\Bowtie}{\mbox{\moosewasy\symbol{49}}}

(using \symbol{...} is preferable to doing \char... that might lead to surprises).

You can do similarly for symbols from other packages like marvosym.

For instance, \Stopsign from marvosym can be defined without loading the package:

% a command to access the marvosym font
\newcommand{\moosemarvo}{\usefont{U}{mvs}{m}{n}}
% here the symbols you need from marvosym
\newcommand{\Stopsign}{\mbox{\moosemarvo\symbol{33}}}

IPA symbols from tipa are much more complex to define without loading the package. I'd avoid gensymb; its symbols are available elsewhere anyhow.

How to find the numbers?

Martin Scharrer's texdef script is very handy for the job of finding out how symbols are defined. From a terminal window do

texdef -t latex -p wasysym Bowtie

and you'll receive the answer

\Bowtie:
macro:->\mbox {\wasyfamily \char 49}

Then

texdef -t latex -p wasysym wasyfamily

prints

\wasyfamily:
macro:->\fontencoding {U}\fontfamily {wasy}\selectfont 

For \Stopsign it's similar

> texdef -t latex -p marvosym Stopsign

\Stopsign:
\long macro:->\mvchr {33}

Then

> texdef -t latex -p marvosym mvchr

\mvchr:
\long macro:#1->{\mvs \char #1}

and finally

> texdef -t latex -p marvosym mvs

\mvs:
\long macro:->\fontfamily {mvs}\fontencoding {U}\fontseries {m}\fontshape {n}\selectfont 

which I converted to the better \usefont{U}{mvs}{m}{n}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.