3

The question title says pretty all. I need a half-filled square symbol which can't be found in the amssymb package: something between \blacksquare and \square.

enter image description here

I've tried to read the source files at http://tug.ctan.org/fonts/amsfonts/source/amssymb.dtx, but it seems that I will have to use the TikZ/PGF anyway. How to proceed?

[edit] The minimal working example

\documentclass{article}
\usepackage{Alegreya}
\usepackage{amssymb} 
% \usepackage{stix} % uncomment this line
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\section{Introduction}
Symbols used here include $\blacksquare$ and $\square$.
\end{document}

shows that stix changes font used in whole document. Including stix before Alegreya changes appearance of \square, which is not desired.

  • 1
    Hi, Have you seen at the link tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf? There is \squarellblack or \squarelrblack with stixpackage Geometric Shapes. – Sebastiano May 13 '17 at 9:05
  • @Sebastiano, the Stix package offers \squarelrblack which is exactly what I wanted. Unfortunately, it breaks compatibility with other packages in my preamble, for example Alegreya. – Santiago May 13 '17 at 9:08
  • Could you kindly add your complete code, please? – Sebastiano May 13 '17 at 9:10
  • @Sebastiano the MWE has been added. – Santiago May 13 '17 at 9:14
  • 1
    Santiago thanks a lot lot for your collaboration. – Sebastiano May 13 '17 at 9:28
3
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{stix}
\usepackage{Alegreya}
\usepackage{amssymb} 
\usepackage[utf8]{inputenc}
\begin{document}
    \section{Introduction}
    Symbols used here include $\blacksquare$ and $\square$
    and $\squarelrblack$.
\end{document}

enter image description here

or load stix as \usepackage[notextcomp]{stix} if you want it after amssymb. It is also possible to use only the \squarelrblack from stix, but then the symbol is bigger than the ones from amssymb:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{Alegreya}
\usepackage{amssymb} 
\makeatletter
\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS2}{stix}{m}{n}
\DeclareSymbolFont{arrows3}{LS2}{stixtt}{m}{n}
\DeclareMathSymbol{\squarelrblack}{\mathord}{arrows3}{"89}
\makeatother
\usepackage[utf8]{inputenc}
\begin{document}
    \section{Introduction}
    Symbols used here include $\blacksquare$ and $\square$
    and $\squarelrblack$.
\end{document}

enter image description here

  • Stix before Alegreya changes appearance of \square and \blacksquare. – Santiago May 13 '17 at 9:18
  • 1
    Herbert I was doing the same thing myself. I vote +1 for your answer. :-) – Sebastiano May 13 '17 at 9:20
  • 1
    @Santiago: sure, they are from stix, too. I f you do not like it, the write your own command \SquarelrBlack – user2478 May 13 '17 at 9:23

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.