I have a source code file that I want to include in my LaTeX document with \lstinputlisting. However, this source file contains logic symbols like ∃ (it's encoded in UTF-8), which produce errors. I tried using listingsutf8, but it requires that the input file be encodable in an 8-bit fixed-width encoding, and as far as I know, no such encoding in existence supports logic symbols.
I've seen some similar questions on this site but they all seemed to deal exclusively with characters representable in Latin-1/ISO-8859-1.
LaTeX file:
\documentclass[12pt]{report}
\usepackage[latin1]{inputenc}
\usepackage{listings}
\begin{document}
\lstinputlisting{test.txt}
\end{document}
test.txt:
~∃x. S(x) = 0
Error message:
! Package inputenc Error: Keyboard character used is undefined
(inputenc) in inputencoding `latin1'.
Is there any way around this?
\documentclass{...}and ending with\end{document}. I guess you are using LaTeX or pdfLaTeX? Maybe XeLaTeX or LuaLaTeX would be easier? – cfr Mar 25 '15 at 00:11