0

I need to insert character "" in lstlisting and compile it with pdflatex. Other unsupported characters like "ě" I am handling via literate option in \lstset{}. Is there any way how to insert it? Thanks.

1

One possibility is to approximate it using math mode. That character looks a lot like $^{\mathsf{L}}$, so it's possible to just use that in the literate option:

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

\lstset{
    basicstyle=\large\ttfamily,
    breaklines=true,
    breakatwhitespace=true,
    literate=%
        {á}{{\'a}}1
        {ě}{{\v{e}}}1
        {í}{{\'i}}1
        {└}{{\(^{\mathsf L}\)}}1
}

\begin{document}
\begin{lstlisting}
Jsou nadáni rozumem a svědomím a mají spolu jednat v duchu bratrství.

Here is the character: └.
\end{lstlisting}
\end{document}

Here's what the output looks like:

enter image description here

  • 1
    With \usepackage{pmboxdraw} you can say {└}{{\textSFii}}1 in the literal list. – egreg Nov 15 '15 at 16:54
  • @egreg: Package pmboxdraw has more useful characters. That's what I am looking for. Thanks! – user3376620 Nov 15 '15 at 19: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.