# Horizontal skip between bold small arrows to depict derivation operators of the Galois connection

Typing bold small arrows using bm package leads to the wrong horizontal skip (distance) between them.

Please, help me to set equal horizontal skips between them to depict derivation operators of the Galois connection in Formal Concept Analysis.

The example of good horizontal skips (distance) is presented for derivation operators of the Galois connection in Pattern Structures.

UPD1:actually I need arrows generated by the following commands to be in bold and a little bit smaller:

    \newcommand{\uA}{{^{\uparrow}}} % small and bold \uparrow
\newcommand{\dA}{{^{\downarrow}}} % small and bold \downarrow
\newcommand{\ud}{{^{\uparrow\downarrow}}} % small and bold \uparrow+\downarrow
\newcommand{\du}{{^{\downarrow\uparrow}}} % small and bold \downarrow+\uparrow


If we just use bm package, it will make wrong skips.  See, please, the MWE:

    \documentclass[14pt]{memoir}
\usepackage{bm}
%mu = math unit = 1em
%\mkern-18mu
%%%%%%%%%%%%%%%%%%%%%%% ARROWS from Formal Concept Analysis
\newcommand{\uA}{{^{\bm{\scriptscriptstyle\uparrow\mkern-14mu}}}} % small and bold \uparrow
\newcommand{\dA}{{^{\bm{\scriptscriptstyle\downarrow}}}} % small and bold \downarrow
\newcommand{\ud}{{^{\bm{\scriptscriptstyle\uparrow\mkern-14mu\downarrow}}}} % small and bold \uparrow+\downarrow
\newcommand{\du}{{^{\bm{\scriptscriptstyle\downarrow\mkern-3.5mu\uparrow}}}} % small and bold \downarrow+\uparrow

%%also with too big skips
%\newcommand{\uA}{{^{\bm{\scriptscriptstyle\uparrow}}}} % small and bold \uparrow
%\newcommand{\dA}{{^{\bm{\scriptscriptstyle\downarrow}}}} % small and bold \downarrow
%\newcommand{\ud}{{^{\bm{\scriptscriptstyle\uparrow\downarrow}}}} % small and bold \uparrow+\downarrow
%\newcommand{\du}{{^{\bm{\scriptscriptstyle\downarrow\uparrow}}}} % small and bold \downarrow+\uparrow

%%%%%%%%%%%%%%%%%%%%%%% DIAMONDS from so-called Pattern Structures
%http://tex.stackexchange.com/questions/254618/how-to-use-only-selected-math-symbols-of-the-stix-fonts
\makeatletter
\DeclareFontEncoding{LS1}{}{}
\makeatother
\DeclareFontSubstitution{LS1}{stix}{m}{n}
\DeclareSymbolFont{symbols4} {LS1}{stixbb} {m}{it}
%\stix@MathSymbol{\diamondtopblack}     {\mathord}{symbols4}{"D3}
\DeclareMathSymbol{\diamondtopblack}{\mathord}{symbols4}{"D3}
\DeclareMathSymbol{\diamondbotblack}{\mathord}{symbols4}{"D4}

\newcommand{\uD}{{^{\bm{\scriptscriptstyle\diamondtopblack}}}} % small and bold \uparrow
\newcommand{\dD}{{^{\bm{\scriptscriptstyle\diamondbotblack}}}} % small and bold \uparrow
\newcommand{\udD}{{^{\bm{\scriptscriptstyle\diamondtopblack\diamondbotblack}}}} % small and bold \uparrow
\newcommand{\duD}{{^{\bm{\scriptscriptstyle\diamondbotblack\diamondtopblack}}}} % small and bold \uparrow

\begin{document}
Usage of derivation operators of the Galois connection (Formal Concept Analysis):

$(\cdot)\ud\uA$

$(\cdot)\ud\dA$

$(\cdot)\du\uA$

$(\cdot)\du\dA$

Usage of derivation operators of the Galois connection (Pattern Structures):

$(\cdot)\udD\uD$

$(\cdot)\udD\dD$

$(\cdot)\duD\uD$

$(\cdot)\duD\dD$
\end{document}


The output pdf (with additional remarks) is the following:

For horizontal align in math mode, you can place \! between math symbols, and it will decrease the space within them. According to the information on this question, the parameter \! is a negative thin space (normally 1/6 of a quad).

In the other hand, and taking insights from this answer, you can vertical align the custom math symbols with \raisebox{dimension value}{content} declaration. For instance, you can create \newcommand{\va}[1]{\raisebox{-4pt}{$#1$}} and use it for these specific symbols in your document.

\documentclass[14pt]{memoir}
\usepackage{bm}

\newcommand{\uA}{\phantom{}^{\bm{\scriptscriptstyle\uparrow\!\!\!}}} % small and bold \uparrow
\newcommand{\dA}{\phantom{}^{\bm{\scriptscriptstyle\downarrow}}} % small and bold \downarrow
\newcommand{\ud}{\phantom{}^{\bm{\scriptscriptstyle\uparrow\!\!\!\downarrow}}} % small and bold \uparrow+\downarrow
\newcommand{\du}{\phantom{}^{\bm{\scriptscriptstyle\downarrow\uparrow\!\!\!}}} % small and bold \downarrow+\uparrow

\newcommand{\va}[1]{\raisebox{-4pt}{$#1$}} %<--- New command for vertical alignment

\makeatletter
\DeclareFontEncoding{LS1}{}{}
\makeatother

\DeclareFontSubstitution{LS1}{stix}{m}{n}
\DeclareSymbolFont{symbols4} {LS1}{stixbb} {m}{it}
%\stix@MathSymbol{\diamondtopblack}{\mathord}{symbols4}{"D3}
\DeclareMathSymbol{\diamondtopblack}{\mathord}{symbols4}{"D3}
\DeclareMathSymbol{\diamondbotblack}{\mathord}{symbols4}{"D4}

\newcommand{\uD}{{^{\bm{\scriptscriptstyle\diamondtopblack}}}} % small and bold \uparrow
\newcommand{\dD}{{^{\bm{\scriptscriptstyle\diamondbotblack}}}} % small and bold \uparrow
\newcommand{\udD}{{^{\bm{\scriptscriptstyle\diamondtopblack\diamondbotblack}}}} % small and bold \uparrow
\newcommand{\duD}{{^{\bm{\scriptscriptstyle\diamondbotblack\diamondtopblack}}}} % small and bold \uparrow

\parindent=0mm %<--- Indentation

\begin{document}

Usage of derivation operators of the Galois connection (Formal Concept Analysis): \\

$(\cdot)\va{\ud\uA}$  % <--- Usage
$(\cdot)\va{\ud\dA}$
$(\cdot)\va{\du\!\!\uA}$  % <--- Horizontal alignment
$(\cdot)\va{\du\!\!\dA}$

\vspace{7mm}

Usage of derivation operators of the Galois connection (Pattern Structures): \\

$(\cdot)\,\va{\udD\uD}$
$(\cdot)\,\va{\udD\dD}$
$(\cdot)\,\va{\duD\uD}$
$(\cdot)\,\va{\duD\dD}$

\end{document}

• thank you so much for the answer, however the problem is in horizontal, not vertical alignment, i.e. the distance between the arrows. Sep 4 '17 at 16:49
• Yes. I have updated my answer with some other information. Sep 4 '17 at 17:17
• the question was updated. Your approach is good, however using \! in the text will be too hard. This command should be implemented directly in \uA etc. Sep 4 '17 at 21:21
• Ok, I understand. I have made the corrections in my answer's code and I think now it can meet your expectations. Sep 4 '17 at 22:54

It's a bug in the metrics of cmbsy7, which is also present in cmbsy8, cmbsy6 and cmbsy5 (curiously, not in cmbsy9). The glyph for \uparrow is in position “octal 42” (hexadecimal 22); with base size 14pt the second level subscripts use cmbsy7 which has

(CHARACTER O 42
(CHARWD R 0.65516)
(CHARHT R 0.694445)
(CHARDP R 0.194445)
(CHARIC R 0.714683)
)


Compare with the similar entry forn cmbsy10:

(CHARACTER O 42
(CHARWD R 0.574997)
(CHARHT R 0.694445)
(CHARDP R 0.194443)
)


The rules of TeX prescribe that the italic correction is inserted. It has nothing to do with \bm: if you try

\begingroup
\setlength{\fboxsep}{0pt}
\fbox{\boldmath$\scriptscriptstyle\uparrow$}
\endgroup


you will see the space in the framed box.

You can fix this by adding a dummy subscript (and backing up by \scriptspace), because a subscript prevents the insertion of the italic correction.

\documentclass[14pt]{memoir}
\usepackage{bm}
%mu = math unit = 1em
%\mkern-18mu
\newcommand{\fcaarrow}[1]{%
{}^{\scriptscriptstyle\bm{#1_{}\kern-\scriptspace}}
}
%%%%%%%%%%%%%%%%%%%%%%% ARROWS from Formal Concept Analysis
% small and bold \uparrow
\newcommand{\uA}{\fcaarrow{{\uparrow}}}
% small and bold \downarrow
\newcommand{\dA}{\fcaarrow{\downarrow}}
% small and bold \uparrow+\downarrow
\newcommand{\ud}{\fcaarrow{\uparrow}\fcaarrow{\downarrow}}
% small and bold \downarrow+\uparrow
\newcommand{\du}{\fcaarrow{\downarrow}\fcaarrow{\uparrow}}

\begin{document}
Usage of derivation operators of the Galois connection (Formal Concept Analysis):

$(\cdot)\ud\uA$

$(\cdot)\ud\dA$

$(\cdot)\du\uA$

$(\cdot)\du\dA$

\end{document}
`

• your explanation is more detailed, thank you so much. However Cragfelt presented the decision earlier. Both variants are working good. Sep 5 '17 at 16:00
• @VladimirParkhomenko Don't worry about the points, I have more than enough. 😉 I have informed the authorities about the bug. Sep 5 '17 at 16:27