3

Is there a pair of symbols in some package which appear as $\boxtimes$, but each without one diagonal?

If not, what is the best way to render such a symbol? (To be completely explicit, I'm looking for symbols which are a square plus either diagonal.)

Detexify doesn't come up with anything; the only idea I have is to somehow overlay a diagonal line with $\square$, but I'm also not sure what a good way is to do that.

Mensch
  • 65,388
zjs
  • 271

3 Answers3

8

They are in mathabx package:

\documentclass{article}
\usepackage{mathabx}
\begin{document}
\verb|\boxbackslash|: $\boxbackslash$

\verb|\boxslash|: $\boxslash$ \end{document}

enter image description here

Pay attention: mathabx changes the shape of all symbols.

CarLaTeX
  • 62,716
4

mathabx introduces some extra trouble as egreg mentioned, so here is a way to "steal" directly the symbol without using a family.

\newcommand\genmathchar[6]{%
    \newcommand*#1{#3{%
        \mathchoice
            {\hbox{#4\char#2}}%
            {\hbox{#4\char#2}}%
            {\hbox{#5\char#2}}%
            {\hbox{#6\char#2}}%
    }}%
}

\font\sixmathb=mathb6 \font\eightmathb=mathb8 \font\twelvemathb=mathb12 \genmathchar {\boxslash} {"6D} {\mathbin} {\twelvemathb} {\eightmathb} {\sixmathb} \genmathchar {\boxbackslash} {"6E} {\mathbin} {\twelvemathb} {\eightmathb} {\sixmathb}

$ P \boxslash Q \boxbackslash R $

output

plante
  • 1,349
  • 2
    See also questions like https://tex.stackexchange.com/questions/586507/importing-bigplus-and-bigtimes-from-mathabx-package, for a more LaTeX-oriented syntax for importing glyphs from mathabx. – Steven B. Segletes Sep 16 '21 at 10:39
3

From the link suggest by the user @Steven B. Segletes, I add my MWE importing just only two symbols, from the specific slot into this link:

https://mirror.las.iastate.edu/tex-archive/fonts/mathabx/texinputs/mathabx.dcl,

Here you can see the slots to take only two request symbols. All the others symbol are of amssmymb.

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}

\DeclareFontFamily{U}{mathb}{\hyphenchar\font45} \DeclareFontShape{U}{mathb}{m}{n}{ <5> <6> <7> <8> <9> <10> gen * mathb <10.95> mathb10 <12> <14.4> <17.28> <20.74> <24.88> mathb12 }{} \DeclareSymbolFont{mathb}{U}{mathb}{m}{n} \DeclareMathSymbol{\boxslash}{2}{mathb}{"6D}%%%%%% imported only two symbol of mathabx; here there are the slot of this package: https://mirror.las.iastate.edu/tex-archive/fonts/mathabx/texinputs/mathabx.dcl \DeclareMathSymbol{\boxbackslash}{2}{mathb}{"6E}

\begin{document} $a\boxslash \triangle \cup \cap \square BCD$ and $acfh \boxbackslash \sum \triangle \cup \cap BCD$ \end{document}

enter image description here

Sebastiano
  • 54,118