0

I have a problem regarding jlcode package.

The package documentation can be found here: https://github.com/m3g/jlcode_example/blob/master/jlcode.sty

I have modified the default color theme to match my liking. This includes, a green colour for the comments and a grey-ish colour for the base as shown below:

\definecolor{jlbase}{HTML}{444444}%         % julia's base 
\definecolor{jlcomment}{HTML}{00B359}%      % julia's comments
 

The problem is that toned greek characters (e.g. ά, έ) have the "jlbase" colour, even when they are used after the "#" command, which marks a comment, as written in the package. All the other greek characters have the "jlcomment colour" as they should. In addition to that, the toned greek characters are being put to the front of every greek word !?

Here's a picture to visualise the problem :

enter image description here

The code used is written down below:

\documentclass[11pt]{article}
\usepackage[a4paper, width=160mm, top=25mm, bottom=25mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{fontspec}
\usepackage{xltxtra,xunicode}
\setmainfont[Mapping=tex-text]{Times New Roman}
\newfontfamily\greekfont[Script=Greek]{Times New Roman}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Futura}
\usepackage[theme=defult]{jlcode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\begin{jllisting}[language=julia, style=jlcodeuccstyle]
#MAIN PROCESS
function    #Ακέραιο μέρος
if abs(n)<1
    aker = [0]
else  
    while (flag==0) #το πολύ 23 bits για αποθήκευση   αριθμού(επειδή 1ο ψηφίο κατά την αποθήκευση 
        #το 1, μπορώ να θεωρήσω ότι θα αποθηκεύσω άλλα 23 ψηφία)
        append! VS apend #(aker,mod(AkeraioMeros,b)) 
       global AkeraioMeros = div(AkeraioMeros,b) #πηλίκο διαίρεσης ακεραίου μέρους με b
        if (AkeraioMeros==0)
            flag=1; #break 
        end
    end
    aker=reverse(aker)  #αναποδογυρίζουμε  διάνυσμα με ψηφία ακε̇ραιου μέρους
end 
println('θέλω να σε') 
% 
\end{jllisting}
\end{document}

I would like the text to be shown as written in the code above (with the same order of the letters inside every word) and ALL the characters following the "#" command to have a green colour(jlcomment colour)

Any help will be greatly appreciated!

10
  • sorry your question is impossible to understand please make an example that shows the issue. you just show a fragment of tex code using undefined commands, what is \lst@mode or \lst@Pmode ? Also the code shown doesn't appear to be related to Unicode, it just compares to integers and if they are equal sets something in a color. Commented Mar 27, 2022 at 20:52
  • It's a part from the jlcode package which at the beginning loads listings and xcolor package and the" jlbase colour" is already defined Commented Mar 27, 2022 at 21:01
  • But you need to say that in the question, and provide an example that people can run, but as I said in a comment on your last question the code seems fundamentally mistaken it is using math mode accents to typeset Greek text. Also you need to give a link to jlcode.sty as it is not in the standard tex distributions Commented Mar 27, 2022 at 21:06
  • It doesn't seem quite right to me as well, but I am lost trying to understand what causes the problems I am facing. That's why I approach the problem like that. Thanks a lot for helping me to improve the question! Commented Mar 27, 2022 at 21:19
  • rather than posting two lines of code with no context that allows anyone to run it you should provide a top level description of what you actually want to do and provide a complete small document that has the desired input and say what output you expect. As it is I can't see how anyone can help. Commented Mar 27, 2022 at 21:22

1 Answer 1

0

The pacakges you are using do not appear to b designed for a Unicode TeX. I go this ouput with minted (and `xlatx --shell-escape)

enter image description here

\documentclass[11pt]{article}
\usepackage[a4paper, width=160mm, top=25mm, bottom=25mm]{geometry}
% no \usepackage[utf8]{inputenc}
\usepackage{fontspec}
% no \usepackage{xltxtra,xunicode}
\setmainfont[Mapping=tex-text]{Times New Roman}
\newfontfamily\greekfont[Script=Greek]{Times New Roman}
% I don't have this \setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Futura}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Arial}
\setmonofont{Noto Sans Mono} % a tt font that has Greek
% probably not \usepackage[theme=defult]{jlcode}
\usepackage{minted}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\small
\begin{minted}{julia}
#MAIN PROCESS
function    #Ακέραιο μέρος
if abs(n)<1
    aker = [0]
else  
    while (flag==0) #το πολύ 23 bits για αποθήκευση   αριθμού(επειδή 1ο ψηφίο κατά την αποθήκευση 
        #το 1, μπορώ να θεωρήσω ότι θα αποθηκεύσω άλλα 23 ψηφία)
        append! VS apend #(aker,mod(AkeraioMeros,b)) 
       global AkeraioMeros = div(AkeraioMeros,b) #πηλίκο διαίρεσης ακεραίου μέρους με b
        if (AkeraioMeros==0)
            flag=1; #break 
        end
    end
    aker=reverse(aker)  #αναποδογυρίζουμε  διάνυσμα με ψηφία ακε̇ραιου μέρους
end 
println('θέλω να σε') 
% 
\end{minted}
\end{document}
1
  • This seems to solve all the problems mentioned above. Thanks a lot! Your suggestions, also helped me fix all the problems I had without using the \usepackage{minted}. However, I would also like to know if there is a way to change what's being selected as "basic style " when using the command \lstdefinestyle{stylename}{basicstyle=..........} Commented Mar 27, 2022 at 23:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .