0

I tend to use overleaf for most of my latex porjects, but recently have been forced to work on a local tex editor. I work a lot with R code and use the following settings on overleaf:

\usepackage{listings}
\lstset{language=R,
breaklines=true,
postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space},
basicstyle=\small\ttfamily,
stringstyle=\color{DarkGreen},
otherkeywords={0,1,2,3,4,5,6,7,8,9},
morekeywords={TRUE,FALSE},
deletekeywords={data,frame,length,as,character},
keywordstyle=\color{blue},
commentstyle=\color{DarkGreen},}

The code works well on overleaf, but whenever I try to work with these settings offline on a native mac Latex Editor, I am forced to remove the post break linee:

  postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space}

in order for the code to compile

I generally compile my code with LuaLatex, both in overleaf and when I work offline.

the results vary as follows:

overleaf version:

enter image description here

Local tex editor version: enter image description here

As you can see, the arrows are missing form the local version and, if i insert the very same command in my native mac editor, the editor refuses to compile the file and display a pdf preview:

enter image description here

and those errors are gone once I remove the line:

enter image description here

Am I setting up something wrong?

Thanks in advanced.

PD: Full Code for testing purposes

\documentclass[usletterpaper]{article}
\usepackage{graphicx}
\usepackage[spanish]{babel}
\selectlanguage{spanish}
\usepackage{changepage}
\usepackage{ragged2e}
\usepackage{amsmath}
\usepackage{titling}
\setlength{\droptitle}{-7em} 
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{unicode-math}
\usepackage{color}
\usepackage{enumerate}
\usepackage[svgnames]{xcolor}
\usepackage{listings}
\lstset{language=R,
    breaklines=true,
    postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space},
    basicstyle=\small\ttfamily,
    stringstyle=\color{DarkGreen},
    otherkeywords={0,1,2,3,4,5,6,7,8,9},
    morekeywords={TRUE,FALSE},
    deletekeywords={data,frame,length,as,character},
    keywordstyle=\color{blue},
    commentstyle=\color{DarkGreen},}


\title{Test}
\author{NA}
\date{Feb 19 2019}

\begin{document}

\begin{lstlisting}[showstringspaces=false,language=R, title= Anexo Codigo en R , frame=single]
rm(list=ls())
##Taller 2 Estadística y Probabilidad Fundamental##
##Preliminares##
options(scipen = 999)
##Punto 1##
##Literal II##
Personas = 0:15; Probabilidad=dpois(Personas, 3)
Probabilidad 
plot(Personas, Probabilidad, type="h", lwd=3, col="red", 
     main="Funcion de Probabilidad: Numero de Personas que Entran a un Banco por Minuto")
##Literal III##
ppois(5,3)-ppois(2,3)
##Literal IV##
ppois(4,3,lower.tail=FALSE)
##Punto 2##
rm(list=ls())
##Literal I##
Puntajes=0:1000
Probabilidad=dnorm(Puntajes, mean = 500, sd = 100,log = FALSE)
plot(Puntajes, Probabilidad, col="red", main="Funcion de Densidad: 
     Puntajes de Examen de Admisión a Universidad")
rm(list=ls())
Puntajes=0:1000
Probabilidad=pnorm(Puntajes, mean = 500, sd = 100,log = FALSE)
plot(Puntajes, Probabilidad, col="red", 
     main="Funcion de Distribución de Probabilidad: Puntajes de Examen de Admisión a Universidad")
##Literal II##
rm(list=ls())
Puntajes=0:1000
Probabilidad=dnorm(Puntajes, mean = 500, sd = 100,log = FALSE)
pnorm(600, mean=500, sd =100, lower.tail = FALSE , log = FALSE)
##Literal III##
qnorm(0.75, mean = 500, sd =100, lower.tail = FALSE, log.p = FALSE)
##FIN##
\end{lstlisting}
\end{document}
4
  • 2
    As always on this site please post a full minimal example. That makes it a lot easier for others to test your code
    – daleif
    Mar 3, 2019 at 19:23
  • Tested with your editor (Texpad app for Mac), I don't have error if I add \usepackage[svgnames]{xcolor} in the preamble, and use Green color instead DarkGreen (how is this color defined?). See my screenshot here: imgur.com/C0kfpzw (but you can see that numbers in comments are in blue...). Please provide a Minimum Working Example, this can help we to help you.
    – quark67
    Mar 4, 2019 at 0:31
  • Minimum working example added Mar 4, 2019 at 0:57
  • @SebastiánAcosta I have compiled without problem with Texpad (except 3 warnings, but the pdf is fine). Can you provide screenshots from your settings in the Texpad app? First, when you click on the toothed wheel with down triangle (for the typeset settings), and second in the preferences of the app, in the "Typesetting section", in "External typesetter". Can you also provide from the log section of the main window the first lines. For me, it begins with /Library/TeX/texbin/lualatex -file-line-error -interaction=nonstopmode -synctex=1 root.tex This is LuaTeX, Version 1.07.0 (TeX Live 2018).
    – quark67
    Mar 4, 2019 at 16:53

0

You must log in to answer this question.

Browse other questions tagged .