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:
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 works
setmonofont[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?
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
add a comment |
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:
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 works
setmonofont[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?
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
1
For the second see tex.stackexchange.com/a/264463/2388
– Ulrike Fischer
Dec 5 at 17:24
1
You do not needScript=Arabic
option fortimes.ttf
because it does not contain arabic script, another thing you have definedtimesnewroman
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 optionScript=Arabic
.
– Muhammed Hashim
Dec 5 at 18:08
add a comment |
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:
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 works
setmonofont[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?
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
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:
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 works
setmonofont[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?
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
listings tcolorbox minted polyglossia arabic
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 needScript=Arabic
option fortimes.ttf
because it does not contain arabic script, another thing you have definedtimesnewroman
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 optionScript=Arabic
.
– Muhammed Hashim
Dec 5 at 18:08
add a comment |
1
For the second see tex.stackexchange.com/a/264463/2388
– Ulrike Fischer
Dec 5 at 17:24
1
You do not needScript=Arabic
option fortimes.ttf
because it does not contain arabic script, another thing you have definedtimesnewroman
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 optionScript=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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 fortimes.ttf
because it does not contain arabic script, another thing you have definedtimesnewroman
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