When using extended ASCII characters inside the lstlisting environment, i.e. those corresponding to codes 191 - 197 (literally: ┐, └, ┴, ┬, ├, ─, ┼), latex produces the following error:

Package inputenc Error: Unicode char �\lst@EC�\lst@EC� (U+2832C0)(inputenc) not set up for use with LaTeX. ├──

Is there any way to enable the use of such characters inside lstlisting? Using \usepackage[utf8x]{inputenc} instead of \usepackage[utf8]{inputenc} does not solve the problem.

  • Do they work outside of a listlisting environment? In normal text, in \texttt, in a verbatim environment? – Marijn Dec 13 '18 at 15:36
  • 1
    does \usepackage{pmboxdraw} help? – user4686 Dec 13 '18 at 16:17

Use pmboxdraw and the literate key for listings. In the documentation for pmboxdraw there is the full list with the LICR names.




a b c d e f g
┐ └ ┴ ┬ ├ ─ ┼


enter image description here

| improve this answer | |
  • 1
    {│}{\textSFxi}1% is useful too. Great answer, it saved my day and cups of coffee. – mario Sep 5 '19 at 17:33

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.