0
% arara: lualatex: { synctex: yes, shell: yes } 
% arara: biber
% arara: lualatex: { synctex: yes, shell: yes } if changed('bbl')
% arara: lualatex: { synctex: yes, shell: yes } if changed('toc')
\documentclass[a4paper,12pt]{scrartcl}

\usepackage{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{listingsutf8,amssymb}
\usepackage{xcolor}
\usepackage{matlab-prettifier}
\usepackage{scrhack}

\lstset{literate ={↑}{$\uparrow$}1}

\begin{document}

\section{Introduction to MATLAB}

\subsection*{Exercise 1.3}
\begin{lstlisting}[style=Matlab-editor]
>> z = 25-(100-7exp(5+cos(pi/3))
 z = 25-(100-7exp(5+cos(pi/3))
             ↑
Error: Invalid use of operator.

Did you mean: z = 25-(100-7*exp  (5+cos(pi/3)))
>> z = 25-(100-7*exp  (5+cos(pi/3)))

z =

   1.6378e+03
\end{lstlisting}

\end{document}

I've tried following this answer and still my upwards arrow is invisible:

Screenshot of the listing in PDF form

Edit

After changing my first two usepackage lines to:

\usepackage{fontspec}
\usepackage[utf8]{inputenc}

And removing the lstset, all Unicode characters now properly show, but the arrow is not put where it should be (it is at the end of the previous line, not pointing from the d to the 7):

Screenshot

Aly
  • 111
  • 4
  • 1
    I just copied your code into Overleaf and it worked (I've got an upwards arrow pointing from the "d" of invalid to the 7 above)... – Manuel Popp Apr 10 '20 at 08:36
  • I'm using TeXWorks on Windows with MiKTeX and compiling with arara via LuaHBLaTeX – Aly Apr 10 '20 at 23:24

0 Answers0