1

I get this error, although I'm not able to find the correspondent LaTeX character to declare.

! Package inputenc Error: Unicode char ▁ (U+2581)
(inputenc)                not set up for use with LaTeX.
Sinval
  • 113
  • Question is a bit unclear where you tyried what. Did you have a look at: https://tex.stackexchange.com/questions/137567/getting-unicode-lower-block-series-to-appear – albert Apr 29 '18 at 14:31

1 Answers1

4

In most font I saw, the full block is a square one em wide so positioned as it has the same height above the cap height as its depth. The character U+2581 is the lowest eighth part of it.

\documentclass{article}
\usepackage[utf8]{inputenc}

\newcommand{\block}[1]{%
  \raisebox{\dimexpr(\fontcharht\font`X-1em)/2}{\rule{1em}{#1\dimexpr1em/8}}%
}
\DeclareUnicodeCharacter{2581}{\block{1}}
\DeclareUnicodeCharacter{2582}{\block{2}}
\DeclareUnicodeCharacter{2583}{\block{3}}
\DeclareUnicodeCharacter{2584}{\block{4}}
\DeclareUnicodeCharacter{2585}{\block{5}}
\DeclareUnicodeCharacter{2586}{\block{6}}
\DeclareUnicodeCharacter{2587}{\block{7}}
\DeclareUnicodeCharacter{2588}{\block{8}}

\begin{document}

A▁A▂A▃A▄A▅A▆A▇A█

\end{document}

enter image description here

egreg
  • 1,121,712