Advertisement
jd666

.tex file lstlisting

Apr 12th, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.25 KB | None | 0 0
  1. %% LyX 2.3.4.4 created this file.  For more info, see http://www.lyx.org/.
  2. %% Do not edit unless you really know what you are doing.
  3. \documentclass[twoside,french]{article}
  4. \usepackage[T1]{fontenc}
  5. \usepackage[utf8]{inputenc}
  6. \usepackage{geometry}
  7. \geometry{verbose,tmargin=1.5cm,bmargin=1.5cm,lmargin=0.5cm,rmargin=0.5cm,headheight=0.5cm,headsep=0.5cm,footskip=0.5cm}
  8. \usepackage{fancyhdr}
  9. \pagestyle{fancy}
  10. \usepackage{babel}
  11. \makeatletter
  12. \addto\extrasfrench{%
  13.    \providecommand{\og}{\leavevmode\flqq~}%
  14.    \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%
  15. }
  16.  
  17. \makeatother
  18. \usepackage[unicode=true,pdfusetitle,
  19. bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
  20. breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
  21. {hyperref}
  22.  
  23. \makeatletter
  24. \@ifundefined{date}{}{\date{}}
  25. \makeatother
  26.  
  27. \usepackage{listings}
  28. \renewcommand{\lstlistingname}{\inputencoding{latin9}Listing}
  29.  
  30. \begin{document}
  31. \title{How to insert a code listing with UTF8-encoding?}
  32.  
  33. \maketitle
  34. Here I try to insert an inline listing: \inputencoding{latin9}\lstinline[language=Python]!print("success")!\inputencoding{utf8}
  35.  
  36. If I put an accent after, I will not work ('ΓΉ' for instance).
  37.  
  38. I'm using Lyx 2.3.4.4 on Windows 10.
  39. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement