1

Following from another post Margin notes on both left and right? I am having problems while using both MnSymbol and amssymb in the same document. It says ! LaTeX Error: Command\centerdot' already defined.`

I cannot work without amssymb, but if I remove MnSymbol I get yet another error

! Undefined control sequence. \pointer ->\filledmedtriangleleft

Any idea how I could work around this issue?

If I remove amssymb I get ! Missing $ inserted. $ l.2 \item M ix all ingredients together. ?

I'm trying to use the following code proposed by Christian Hupfer

\documentclass{article}
\usepackage{amssymb} 
\usepackage{xcolor}
\usepackage{stackengine}
\usepackage{lipsum}
\usepackage{MnSymbol}
\usepackage{graphicx}

\newcommand*\mnote[3][0pt]{%
  \if l#2\reversemarginpar\def\pointer{\filledmedtriangleright}%
    \def\stackalignment{r}\fi%
  \if r#2\normalmarginpar\def\pointer{\filledmedtriangleleft}%
    \def\stackalignment{l}\fi%
  \marginpar{%
    \topinset{%
      \scalebox{1.5}{\textcolor{blue}{$\pointer$}}}{%
      \belowbaseline[-1.5\baselineskip-#1]{%
        \stackengine%
          {-5pt}%
          {\fcolorbox{blue}{white}{\parbox{1.8cm}%
            {\vspace{3pt}\raggedright#3}}}%
          {~\colorbox{white}{\sffamily Note}}%
          {O}%
          {l}%
          {F}%
          {F}%
          {S}%
        }%
      }{%
      3ex+#1}{%
      -2ex}%
  }%
}

\begin{document}
\lipsum[1-2]
this is a\mnote[2ex]{l}{some text for the mnote box} test%
\par\vspace{-\parskip}\mnote[1ex]{r}{both right and left}

\lipsum[3]
This is another test\mnote{r}{another mnote box test testing the
right side}

\lipsum[4]

Loads and loads of text that need amssymb to work
\end{document}
  • 1
    The code you posted works fine for me, and it cannot give rise to the error you quoted (there is no \item Mix... anywhere). Can you show us the actual code? From the error messages you are quoting I'd say that you are rather loading MnSymbol before amssymb. – campa Jun 23 '16 at 9:15
  • 2
    I suspect you don't want to load the whole MnSymbol, because it changes all math symbols. – egreg Jun 23 '16 at 10:00
  • After extensive work, I managed to narrow it down. It seems that when using amssymb the \checkmark does not need to be in math environment (at least it never gave me an error before), but in MnSymbol it does. And you were right, I had to load amsymb first – Mahoma Jun 23 '16 at 10:24
  • @egreg, yeah, loading just the symbols I need would have been ideal, but I have not figured out how yet. At least now I know what to do if I run into another symbol that fails, but if you know how to load just the symbols I need, that would help me understand the dynamics of '\LaTex' better – Mahoma Jun 23 '16 at 10:28
  • 3
    There are a number of answers on how to import just a few specified MnSymbol glyphs: tex.stackexchange.com/questions/217986/…, and tex.stackexchange.com/questions/3631/…, – Steven B. Segletes Jun 23 '16 at 10:28
2

Per my comments... import from MnSymbol just what is required. You can uncomment the two fonttable lines to see that the desired glyph is in slot 202 of the MnSymbolC font family.

If you have many symbols to import from MnSymbol, my answer at Is there a standard symbol for conditional independence? provides some macros for easing that process.

\documentclass{article}
\usepackage{amssymb}
% =============================================
%Import symbols from font MnSymbol without importing the whole package
% =============================================
\DeclareFontFamily{U} {MnSymbolC}{}

\DeclareFontShape{U}{MnSymbolC}{m}{n}{
  <-6> MnSymbolC5
  <6-7> MnSymbolC6
  <7-8> MnSymbolC7
  <8-9> MnSymbolC8
  <9-10> MnSymbolC9
  <10-12> MnSymbolC10
  <12-> MnSymbolC12}{}
\DeclareFontShape{U}{MnSymbolC}{b}{n}{
  <-6> MnSymbolC-Bold5
  <6-7> MnSymbolC-Bold6
  <7-8> MnSymbolC-Bold7
  <8-9> MnSymbolC-Bold8
  <9-10> MnSymbolC-Bold9
  <10-12> MnSymbolC-Bold10
  <12-> MnSymbolC-Bold12}{}

\DeclareSymbolFont{MnSyC} {U} {MnSymbolC}{m}{n}

\DeclareMathSymbol{\filledmedtriangleleft}{\mathbin}{MnSyC}{202}
% =============================================
%\usepackage{fonttable}
\begin{document}
\centering
$\mathbb{X}\filledmedtriangleleft\mathbb{Y}$
%\fonttable{MnSymbolC10}
\end{document}

enter image description here

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.