Created
September 24, 2016 07:28
-
-
Save derlin/d3e1f4fc0ff09b20d86d808381ace911 to your computer and use it in GitHub Desktop.
Configure the latex lstlistings package for extended char support (as well as automatic wrapping and monofont)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Use this configuration of lstlistings to support extended characters (i.e. acctents) and automatic line wrapping. | |
\usepackage{listings} | |
\usepackage{listingsutf8} | |
\usepackage{inconsolata} % nicer font | |
\lstset{basicstyle=\footnotesize\ttfamily,breaklines=true} % set default font and line breaks | |
\lstset{% support extended characters | |
inputencoding=utf8, | |
extendedchars=true, | |
literate=% | |
{é}{{\'{e}}}1 | |
{è}{{\`{e}}}1 | |
{ê}{{\^{e}}}1 | |
{ë}{{\¨{e}}}1 | |
{É}{{\'{E}}}1 | |
{Ê}{{\^{E}}}1 | |
{û}{{\^{u}}}1 | |
{ù}{{\`{u}}}1 | |
{â}{{\^{a}}}1 | |
{à}{{\`{a}}}1 | |
{á}{{\'{a}}}1 | |
{ã}{{\~{a}}}1 | |
{Á}{{\'{A}}}1 | |
{Â}{{\^{A}}}1 | |
{Ã}{{\~{A}}}1 | |
{ç}{{\c{c}}}1 | |
{Ç}{{\c{C}}}1 | |
{õ}{{\~{o}}}1 | |
{ó}{{\'{o}}}1 | |
{ô}{{\^{o}}}1 | |
{Õ}{{\~{O}}}1 | |
{Ó}{{\'{O}}}1 | |
{Ô}{{\^{O}}}1 | |
{î}{{\^{i}}}1 | |
{Î}{{\^{I}}}1 | |
{í}{{\'{i}}}1 | |
{Í}{{\~{Í}}}1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment