tcolorbox listing in XeLaTex compiler











up vote
1
down vote

favorite












I want to write a document whose main language is Arabic with listings by using the package usepackage{polyglossia}



documentclass[14pt]{extarticle}
usepackage[listings,minted,breakable,skins]{tcolorbox}
usepackage{polyglossia}
newfontfamilyarabicfont[Script=Arabic,Scale=1,Path=fonts/]{flat.ttf} %my
favortie main font
newfontfamilytimesnewroman[Script=Arabic,Scale=1,Path = fonts/]{times.ttf}
setmainlanguage[numerals=maghrib]{arabic} %My main & native language
setotherlanguage{english}
begin{document}
هذا كود برمجي بسيط
begin{english}
begin{tcblisting}{enhanced,listing only,minted language=latex}
my name is textcolor{red}{Muhammad}
hi
end{tcblisting}
end{english}
end{document}


However, I encountered two problems:





  1. Although the output itself is not problematic as shown below,

    I get the following message after compiling:



    Package polyglossia Error: the current roman font does not contain the  Arabic script


    As an attempt to solve this error, I changed the monofont into an existing custom font and it quite workssetmonofont[Scale=1,Path = fonts/]{times.ttf},
    but the output looks ugly and there is a problem with the curly brackets as shown below. Is there a way to avoid this error without changing the default mono font or the traditional one?




  2. Nevertheless the polyglossia problem, when I indent the codes by pressing Tab,



    documentclass[14pt]{extarticle}
    usepackage[listings,minted,breakable,skins]{tcolorbox} %very essential package to produce chat boxes
    begin{document}
    begin{tcblisting}{enhanced,listing only,minted language=latex}
    my name is textcolor{red}{Muhammad}
    hi
    end{tcblisting}
    end{document}


    The indented spaced are replaced with ^^I

    However, if I switch the compiler to pdflatex, no indented spaces are produced












share|improve this question




















  • 1




    For the second see tex.stackexchange.com/a/264463/2388
    – Ulrike Fischer
    Dec 5 at 17:24






  • 1




    You do not need Script=Arabic option for times.ttf because it does not contain arabic script, another thing you have defined timesnewroman font but you did not use it in the first example.
    – Salim Bou
    Dec 5 at 17:50










  • @UlrikeFischer In fact, I am newbie in LaTeX using TeXnic center, however I guessed I should put -8bit in command line arguments according to the link you commented and the listing works in xelatex as fine as in pdflatex. One another question: I cannot indent the first line of the code listing, is it normal or there is something wrong?
    – Muhammed Hashim
    Dec 5 at 18:04










  • @SalimBou If you mean setting the mono font, I haven't set the option Script=Arabic.
    – Muhammed Hashim
    Dec 5 at 18:08

















up vote
1
down vote

favorite












I want to write a document whose main language is Arabic with listings by using the package usepackage{polyglossia}



documentclass[14pt]{extarticle}
usepackage[listings,minted,breakable,skins]{tcolorbox}
usepackage{polyglossia}
newfontfamilyarabicfont[Script=Arabic,Scale=1,Path=fonts/]{flat.ttf} %my
favortie main font
newfontfamilytimesnewroman[Script=Arabic,Scale=1,Path = fonts/]{times.ttf}
setmainlanguage[numerals=maghrib]{arabic} %My main & native language
setotherlanguage{english}
begin{document}
هذا كود برمجي بسيط
begin{english}
begin{tcblisting}{enhanced,listing only,minted language=latex}
my name is textcolor{red}{Muhammad}
hi
end{tcblisting}
end{english}
end{document}


However, I encountered two problems:





  1. Although the output itself is not problematic as shown below,

    I get the following message after compiling:



    Package polyglossia Error: the current roman font does not contain the  Arabic script


    As an attempt to solve this error, I changed the monofont into an existing custom font and it quite workssetmonofont[Scale=1,Path = fonts/]{times.ttf},
    but the output looks ugly and there is a problem with the curly brackets as shown below. Is there a way to avoid this error without changing the default mono font or the traditional one?




  2. Nevertheless the polyglossia problem, when I indent the codes by pressing Tab,



    documentclass[14pt]{extarticle}
    usepackage[listings,minted,breakable,skins]{tcolorbox} %very essential package to produce chat boxes
    begin{document}
    begin{tcblisting}{enhanced,listing only,minted language=latex}
    my name is textcolor{red}{Muhammad}
    hi
    end{tcblisting}
    end{document}


    The indented spaced are replaced with ^^I

    However, if I switch the compiler to pdflatex, no indented spaces are produced












share|improve this question




















  • 1




    For the second see tex.stackexchange.com/a/264463/2388
    – Ulrike Fischer
    Dec 5 at 17:24






  • 1




    You do not need Script=Arabic option for times.ttf because it does not contain arabic script, another thing you have defined timesnewroman font but you did not use it in the first example.
    – Salim Bou
    Dec 5 at 17:50










  • @UlrikeFischer In fact, I am newbie in LaTeX using TeXnic center, however I guessed I should put -8bit in command line arguments according to the link you commented and the listing works in xelatex as fine as in pdflatex. One another question: I cannot indent the first line of the code listing, is it normal or there is something wrong?
    – Muhammed Hashim
    Dec 5 at 18:04










  • @SalimBou If you mean setting the mono font, I haven't set the option Script=Arabic.
    – Muhammed Hashim
    Dec 5 at 18:08















up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to write a document whose main language is Arabic with listings by using the package usepackage{polyglossia}



documentclass[14pt]{extarticle}
usepackage[listings,minted,breakable,skins]{tcolorbox}
usepackage{polyglossia}
newfontfamilyarabicfont[Script=Arabic,Scale=1,Path=fonts/]{flat.ttf} %my
favortie main font
newfontfamilytimesnewroman[Script=Arabic,Scale=1,Path = fonts/]{times.ttf}
setmainlanguage[numerals=maghrib]{arabic} %My main & native language
setotherlanguage{english}
begin{document}
هذا كود برمجي بسيط
begin{english}
begin{tcblisting}{enhanced,listing only,minted language=latex}
my name is textcolor{red}{Muhammad}
hi
end{tcblisting}
end{english}
end{document}


However, I encountered two problems:





  1. Although the output itself is not problematic as shown below,

    I get the following message after compiling:



    Package polyglossia Error: the current roman font does not contain the  Arabic script


    As an attempt to solve this error, I changed the monofont into an existing custom font and it quite workssetmonofont[Scale=1,Path = fonts/]{times.ttf},
    but the output looks ugly and there is a problem with the curly brackets as shown below. Is there a way to avoid this error without changing the default mono font or the traditional one?




  2. Nevertheless the polyglossia problem, when I indent the codes by pressing Tab,



    documentclass[14pt]{extarticle}
    usepackage[listings,minted,breakable,skins]{tcolorbox} %very essential package to produce chat boxes
    begin{document}
    begin{tcblisting}{enhanced,listing only,minted language=latex}
    my name is textcolor{red}{Muhammad}
    hi
    end{tcblisting}
    end{document}


    The indented spaced are replaced with ^^I

    However, if I switch the compiler to pdflatex, no indented spaces are produced












share|improve this question















I want to write a document whose main language is Arabic with listings by using the package usepackage{polyglossia}



documentclass[14pt]{extarticle}
usepackage[listings,minted,breakable,skins]{tcolorbox}
usepackage{polyglossia}
newfontfamilyarabicfont[Script=Arabic,Scale=1,Path=fonts/]{flat.ttf} %my
favortie main font
newfontfamilytimesnewroman[Script=Arabic,Scale=1,Path = fonts/]{times.ttf}
setmainlanguage[numerals=maghrib]{arabic} %My main & native language
setotherlanguage{english}
begin{document}
هذا كود برمجي بسيط
begin{english}
begin{tcblisting}{enhanced,listing only,minted language=latex}
my name is textcolor{red}{Muhammad}
hi
end{tcblisting}
end{english}
end{document}


However, I encountered two problems:





  1. Although the output itself is not problematic as shown below,

    I get the following message after compiling:



    Package polyglossia Error: the current roman font does not contain the  Arabic script


    As an attempt to solve this error, I changed the monofont into an existing custom font and it quite workssetmonofont[Scale=1,Path = fonts/]{times.ttf},
    but the output looks ugly and there is a problem with the curly brackets as shown below. Is there a way to avoid this error without changing the default mono font or the traditional one?




  2. Nevertheless the polyglossia problem, when I indent the codes by pressing Tab,



    documentclass[14pt]{extarticle}
    usepackage[listings,minted,breakable,skins]{tcolorbox} %very essential package to produce chat boxes
    begin{document}
    begin{tcblisting}{enhanced,listing only,minted language=latex}
    my name is textcolor{red}{Muhammad}
    hi
    end{tcblisting}
    end{document}


    The indented spaced are replaced with ^^I

    However, if I switch the compiler to pdflatex, no indented spaces are produced









listings tcolorbox minted polyglossia arabic






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 5 at 17:36









Salim Bou

11.1k1442




11.1k1442










asked Dec 5 at 17:01









Muhammed Hashim

312




312








  • 1




    For the second see tex.stackexchange.com/a/264463/2388
    – Ulrike Fischer
    Dec 5 at 17:24






  • 1




    You do not need Script=Arabic option for times.ttf because it does not contain arabic script, another thing you have defined timesnewroman font but you did not use it in the first example.
    – Salim Bou
    Dec 5 at 17:50










  • @UlrikeFischer In fact, I am newbie in LaTeX using TeXnic center, however I guessed I should put -8bit in command line arguments according to the link you commented and the listing works in xelatex as fine as in pdflatex. One another question: I cannot indent the first line of the code listing, is it normal or there is something wrong?
    – Muhammed Hashim
    Dec 5 at 18:04










  • @SalimBou If you mean setting the mono font, I haven't set the option Script=Arabic.
    – Muhammed Hashim
    Dec 5 at 18:08
















  • 1




    For the second see tex.stackexchange.com/a/264463/2388
    – Ulrike Fischer
    Dec 5 at 17:24






  • 1




    You do not need Script=Arabic option for times.ttf because it does not contain arabic script, another thing you have defined timesnewroman font but you did not use it in the first example.
    – Salim Bou
    Dec 5 at 17:50










  • @UlrikeFischer In fact, I am newbie in LaTeX using TeXnic center, however I guessed I should put -8bit in command line arguments according to the link you commented and the listing works in xelatex as fine as in pdflatex. One another question: I cannot indent the first line of the code listing, is it normal or there is something wrong?
    – Muhammed Hashim
    Dec 5 at 18:04










  • @SalimBou If you mean setting the mono font, I haven't set the option Script=Arabic.
    – Muhammed Hashim
    Dec 5 at 18:08










1




1




For the second see tex.stackexchange.com/a/264463/2388
– Ulrike Fischer
Dec 5 at 17:24




For the second see tex.stackexchange.com/a/264463/2388
– Ulrike Fischer
Dec 5 at 17:24




1




1




You do not need Script=Arabic option for times.ttf because it does not contain arabic script, another thing you have defined timesnewroman font but you did not use it in the first example.
– Salim Bou
Dec 5 at 17:50




You do not need Script=Arabic option for times.ttf because it does not contain arabic script, another thing you have defined timesnewroman font but you did not use it in the first example.
– Salim Bou
Dec 5 at 17:50












@UlrikeFischer In fact, I am newbie in LaTeX using TeXnic center, however I guessed I should put -8bit in command line arguments according to the link you commented and the listing works in xelatex as fine as in pdflatex. One another question: I cannot indent the first line of the code listing, is it normal or there is something wrong?
– Muhammed Hashim
Dec 5 at 18:04




@UlrikeFischer In fact, I am newbie in LaTeX using TeXnic center, however I guessed I should put -8bit in command line arguments according to the link you commented and the listing works in xelatex as fine as in pdflatex. One another question: I cannot indent the first line of the code listing, is it normal or there is something wrong?
– Muhammed Hashim
Dec 5 at 18:04












@SalimBou If you mean setting the mono font, I haven't set the option Script=Arabic.
– Muhammed Hashim
Dec 5 at 18:08






@SalimBou If you mean setting the mono font, I haven't set the option Script=Arabic.
– Muhammed Hashim
Dec 5 at 18:08

















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463346%2ftcolorbox-listing-in-xelatex-compiler%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463346%2ftcolorbox-listing-in-xelatex-compiler%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents