left rule affected if change courier font to other font











up vote
0
down vote

favorite












My code are follows:



documentclass{book}

usepackage{fontspec}
defaultfontfeatures{Ligatures=TeX}
usepackage{unicode-math}%


setmonofont[Path = ./Fonts/ ,
UprightFont= Iosevka ,]{Iosevka}

usepackage{textcomp,xcolor,MNsymbol}

usepackage{listings}

lstdefinestyle{mypyscriptstyle}{%
upquote=true,
language=Python,
% Basic style
basicstyle=ttfamilysmall,
commentstyle=ttfootnotesize, %rmfamily
stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
% Line numbers
%numbers=left,
%numberstyle=footnotesize,
%numbersep=1em,
%stepnumber=3,
% Margins and box
framextopmargin=2em,
framexbottommargin=2em,
frame=l,
backgroundcolor=color{black!10},
xleftmargin=1em,
tabsize=4,
% Show spaces
showspaces=false,
showtabs=false,
showstringspaces=false,
columns=fullflexible,
breaklines=true,
postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
% Comments
morecomment=[s]{"""}{"""},
morecomment=[s]{'''}{'''},
morecomment=[l]{#},
% Keywords
keywordstyle=bfseries,
keywords={},
sensitive=true,
string=[b]',
morestring=[b]",
escapechar={§},
alsoletter={_, .},
% Built-in
emphstyle=color{black!15}bfseries,
emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
}

lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}

begin{document}

begin{testermcode}
In [1]: 2 + 2 # addition of integers
Out[1]: 4
In [2]: 2 * 2 # multiplication
Out[2]: 4
In [3]: 3 / 2 # division (returns floating-point real value)
Out[3]: 1.5
In [4]: 3 // 2 # integer division
Out[4]: 1
In [5]: 2 > 3 # logical operators return a Boolean value
Out[5]: False
In [6]: 2 == 2 # equals
Out[6]: True
In [7]: 2 != 2 # is different
Out[7]: False
In [8]: "my string" # quotes define strings
Out[8]: 'my string'
end{testermcode}

end{document}


Output came as:



enter image description here



Same problem I got as per my previous post Unnecessary white space created if we use other font rather than courier



I've tried what Ulrike suggested, but I got framed box around, but I need the left side rule only,



Please suggest...










share|improve this question




















  • 2




    tcolorbox has a long and good documentation which shows all sort of options -- including how to hide the frame or only show a left rule.
    – Ulrike Fischer
    Jun 23 at 15:51










  • @UlrikeFischer Default round cornered box only created if I follow your suggestion, not able to create as like as my requirement, pl suggest...
    – MadyYuvi
    Jun 25 at 6:11















up vote
0
down vote

favorite












My code are follows:



documentclass{book}

usepackage{fontspec}
defaultfontfeatures{Ligatures=TeX}
usepackage{unicode-math}%


setmonofont[Path = ./Fonts/ ,
UprightFont= Iosevka ,]{Iosevka}

usepackage{textcomp,xcolor,MNsymbol}

usepackage{listings}

lstdefinestyle{mypyscriptstyle}{%
upquote=true,
language=Python,
% Basic style
basicstyle=ttfamilysmall,
commentstyle=ttfootnotesize, %rmfamily
stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
% Line numbers
%numbers=left,
%numberstyle=footnotesize,
%numbersep=1em,
%stepnumber=3,
% Margins and box
framextopmargin=2em,
framexbottommargin=2em,
frame=l,
backgroundcolor=color{black!10},
xleftmargin=1em,
tabsize=4,
% Show spaces
showspaces=false,
showtabs=false,
showstringspaces=false,
columns=fullflexible,
breaklines=true,
postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
% Comments
morecomment=[s]{"""}{"""},
morecomment=[s]{'''}{'''},
morecomment=[l]{#},
% Keywords
keywordstyle=bfseries,
keywords={},
sensitive=true,
string=[b]',
morestring=[b]",
escapechar={§},
alsoletter={_, .},
% Built-in
emphstyle=color{black!15}bfseries,
emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
}

lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}

begin{document}

begin{testermcode}
In [1]: 2 + 2 # addition of integers
Out[1]: 4
In [2]: 2 * 2 # multiplication
Out[2]: 4
In [3]: 3 / 2 # division (returns floating-point real value)
Out[3]: 1.5
In [4]: 3 // 2 # integer division
Out[4]: 1
In [5]: 2 > 3 # logical operators return a Boolean value
Out[5]: False
In [6]: 2 == 2 # equals
Out[6]: True
In [7]: 2 != 2 # is different
Out[7]: False
In [8]: "my string" # quotes define strings
Out[8]: 'my string'
end{testermcode}

end{document}


Output came as:



enter image description here



Same problem I got as per my previous post Unnecessary white space created if we use other font rather than courier



I've tried what Ulrike suggested, but I got framed box around, but I need the left side rule only,



Please suggest...










share|improve this question




















  • 2




    tcolorbox has a long and good documentation which shows all sort of options -- including how to hide the frame or only show a left rule.
    – Ulrike Fischer
    Jun 23 at 15:51










  • @UlrikeFischer Default round cornered box only created if I follow your suggestion, not able to create as like as my requirement, pl suggest...
    – MadyYuvi
    Jun 25 at 6:11













up vote
0
down vote

favorite









up vote
0
down vote

favorite











My code are follows:



documentclass{book}

usepackage{fontspec}
defaultfontfeatures{Ligatures=TeX}
usepackage{unicode-math}%


setmonofont[Path = ./Fonts/ ,
UprightFont= Iosevka ,]{Iosevka}

usepackage{textcomp,xcolor,MNsymbol}

usepackage{listings}

lstdefinestyle{mypyscriptstyle}{%
upquote=true,
language=Python,
% Basic style
basicstyle=ttfamilysmall,
commentstyle=ttfootnotesize, %rmfamily
stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
% Line numbers
%numbers=left,
%numberstyle=footnotesize,
%numbersep=1em,
%stepnumber=3,
% Margins and box
framextopmargin=2em,
framexbottommargin=2em,
frame=l,
backgroundcolor=color{black!10},
xleftmargin=1em,
tabsize=4,
% Show spaces
showspaces=false,
showtabs=false,
showstringspaces=false,
columns=fullflexible,
breaklines=true,
postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
% Comments
morecomment=[s]{"""}{"""},
morecomment=[s]{'''}{'''},
morecomment=[l]{#},
% Keywords
keywordstyle=bfseries,
keywords={},
sensitive=true,
string=[b]',
morestring=[b]",
escapechar={§},
alsoletter={_, .},
% Built-in
emphstyle=color{black!15}bfseries,
emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
}

lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}

begin{document}

begin{testermcode}
In [1]: 2 + 2 # addition of integers
Out[1]: 4
In [2]: 2 * 2 # multiplication
Out[2]: 4
In [3]: 3 / 2 # division (returns floating-point real value)
Out[3]: 1.5
In [4]: 3 // 2 # integer division
Out[4]: 1
In [5]: 2 > 3 # logical operators return a Boolean value
Out[5]: False
In [6]: 2 == 2 # equals
Out[6]: True
In [7]: 2 != 2 # is different
Out[7]: False
In [8]: "my string" # quotes define strings
Out[8]: 'my string'
end{testermcode}

end{document}


Output came as:



enter image description here



Same problem I got as per my previous post Unnecessary white space created if we use other font rather than courier



I've tried what Ulrike suggested, but I got framed box around, but I need the left side rule only,



Please suggest...










share|improve this question















My code are follows:



documentclass{book}

usepackage{fontspec}
defaultfontfeatures{Ligatures=TeX}
usepackage{unicode-math}%


setmonofont[Path = ./Fonts/ ,
UprightFont= Iosevka ,]{Iosevka}

usepackage{textcomp,xcolor,MNsymbol}

usepackage{listings}

lstdefinestyle{mypyscriptstyle}{%
upquote=true,
language=Python,
% Basic style
basicstyle=ttfamilysmall,
commentstyle=ttfootnotesize, %rmfamily
stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
% Line numbers
%numbers=left,
%numberstyle=footnotesize,
%numbersep=1em,
%stepnumber=3,
% Margins and box
framextopmargin=2em,
framexbottommargin=2em,
frame=l,
backgroundcolor=color{black!10},
xleftmargin=1em,
tabsize=4,
% Show spaces
showspaces=false,
showtabs=false,
showstringspaces=false,
columns=fullflexible,
breaklines=true,
postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
% Comments
morecomment=[s]{"""}{"""},
morecomment=[s]{'''}{'''},
morecomment=[l]{#},
% Keywords
keywordstyle=bfseries,
keywords={},
sensitive=true,
string=[b]',
morestring=[b]",
escapechar={§},
alsoletter={_, .},
% Built-in
emphstyle=color{black!15}bfseries,
emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
}

lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}

begin{document}

begin{testermcode}
In [1]: 2 + 2 # addition of integers
Out[1]: 4
In [2]: 2 * 2 # multiplication
Out[2]: 4
In [3]: 3 / 2 # division (returns floating-point real value)
Out[3]: 1.5
In [4]: 3 // 2 # integer division
Out[4]: 1
In [5]: 2 > 3 # logical operators return a Boolean value
Out[5]: False
In [6]: 2 == 2 # equals
Out[6]: True
In [7]: 2 != 2 # is different
Out[7]: False
In [8]: "my string" # quotes define strings
Out[8]: 'my string'
end{testermcode}

end{document}


Output came as:



enter image description here



Same problem I got as per my previous post Unnecessary white space created if we use other font rather than courier



I've tried what Ulrike suggested, but I got framed box around, but I need the left side rule only,



Please suggest...







leftrule






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 27 at 1:40









cfr

155k7182377




155k7182377










asked Jun 23 at 15:37









MadyYuvi

2,054211




2,054211








  • 2




    tcolorbox has a long and good documentation which shows all sort of options -- including how to hide the frame or only show a left rule.
    – Ulrike Fischer
    Jun 23 at 15:51










  • @UlrikeFischer Default round cornered box only created if I follow your suggestion, not able to create as like as my requirement, pl suggest...
    – MadyYuvi
    Jun 25 at 6:11














  • 2




    tcolorbox has a long and good documentation which shows all sort of options -- including how to hide the frame or only show a left rule.
    – Ulrike Fischer
    Jun 23 at 15:51










  • @UlrikeFischer Default round cornered box only created if I follow your suggestion, not able to create as like as my requirement, pl suggest...
    – MadyYuvi
    Jun 25 at 6:11








2




2




tcolorbox has a long and good documentation which shows all sort of options -- including how to hide the frame or only show a left rule.
– Ulrike Fischer
Jun 23 at 15:51




tcolorbox has a long and good documentation which shows all sort of options -- including how to hide the frame or only show a left rule.
– Ulrike Fischer
Jun 23 at 15:51












@UlrikeFischer Default round cornered box only created if I follow your suggestion, not able to create as like as my requirement, pl suggest...
– MadyYuvi
Jun 25 at 6:11




@UlrikeFischer Default round cornered box only created if I follow your suggestion, not able to create as like as my requirement, pl suggest...
– MadyYuvi
Jun 25 at 6:11










1 Answer
1






active

oldest

votes

















up vote
0
down vote













I have solved my issues, below are the updated code:



documentclass{book}

usepackage{fontspec}
defaultfontfeatures{Ligatures=TeX}
usepackage{unicode-math}%


setmonofont[Path = ./Fonts/ ,
UprightFont= Iosevka ,]{Iosevka}

usepackage{textcomp,xcolor,MNsymbol}

usepackage{listings}

lstdefinestyle{mypyscriptstyle}{%
upquote=true,
language=Python,
% Basic style
basicstyle=ttfamilysmall,
commentstyle=ttfootnotesize, %rmfamily
stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
% Line numbers
%numbers=left,
%numberstyle=footnotesize,
%numbersep=1em,
%stepnumber=3,
% Margins and box
%framextopmargin=2em,
%framexbottommargin=2em,
%frame=l,
%backgroundcolor=color{black!10},
%xleftmargin=1em,
%tabsize=4,
% Show spaces
showspaces=false,
showtabs=false,
showstringspaces=false,
columns=fullflexible,
breaklines=true,
postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
% Comments
morecomment=[s]{"""}{"""},
morecomment=[s]{'''}{'''},
morecomment=[l]{#},
% Keywords
keywordstyle=bfseries,
keywords={},
sensitive=true,
string=[b]',
morestring=[b]",
escapechar={§},
alsoletter={_, .},
% Built-in
emphstyle=color{black!15}bfseries,
emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
}

usepackage[many]{tcolorbox}
tcbuselibrary{listings}


%lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}
newtcblisting{testermcode}{colback=black!16,left=4pt,right=4pt,arc=0pt,leftrule=2pt,rightrule=0pt,toprule=0pt,bottomrule=0pt,listing
options={style=mypyscriptstyle,xleftmargin=4pt},listing only }


begin{document}

begin{testermcode}
In [1]: 2 + 2 # addition of integers
Out[1]: 4
In [2]: 2 * 2 # multiplication
Out[2]: 4
In [3]: 3 / 2 # division (returns floating-point real value)
Out[3]: 1.5
In [4]: 3 // 2 # integer division
Out[4]: 1
In [5]: 2 > 3 # logical operators return a Boolean value
Out[5]: False
In [6]: 2 == 2 # equals
Out[6]: True
In [7]: 2 != 2 # is different
Out[7]: False
In [8]: "my string" # quotes define strings
Out[8]: 'my string'
end{testermcode}

end{document}





share|improve this answer





















    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%2f437671%2fleft-rule-affected-if-change-courier-font-to-other-font%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I have solved my issues, below are the updated code:



    documentclass{book}

    usepackage{fontspec}
    defaultfontfeatures{Ligatures=TeX}
    usepackage{unicode-math}%


    setmonofont[Path = ./Fonts/ ,
    UprightFont= Iosevka ,]{Iosevka}

    usepackage{textcomp,xcolor,MNsymbol}

    usepackage{listings}

    lstdefinestyle{mypyscriptstyle}{%
    upquote=true,
    language=Python,
    % Basic style
    basicstyle=ttfamilysmall,
    commentstyle=ttfootnotesize, %rmfamily
    stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
    % Line numbers
    %numbers=left,
    %numberstyle=footnotesize,
    %numbersep=1em,
    %stepnumber=3,
    % Margins and box
    %framextopmargin=2em,
    %framexbottommargin=2em,
    %frame=l,
    %backgroundcolor=color{black!10},
    %xleftmargin=1em,
    %tabsize=4,
    % Show spaces
    showspaces=false,
    showtabs=false,
    showstringspaces=false,
    columns=fullflexible,
    breaklines=true,
    postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
    % Comments
    morecomment=[s]{"""}{"""},
    morecomment=[s]{'''}{'''},
    morecomment=[l]{#},
    % Keywords
    keywordstyle=bfseries,
    keywords={},
    sensitive=true,
    string=[b]',
    morestring=[b]",
    escapechar={§},
    alsoletter={_, .},
    % Built-in
    emphstyle=color{black!15}bfseries,
    emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
    join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
    }

    usepackage[many]{tcolorbox}
    tcbuselibrary{listings}


    %lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}
    newtcblisting{testermcode}{colback=black!16,left=4pt,right=4pt,arc=0pt,leftrule=2pt,rightrule=0pt,toprule=0pt,bottomrule=0pt,listing
    options={style=mypyscriptstyle,xleftmargin=4pt},listing only }


    begin{document}

    begin{testermcode}
    In [1]: 2 + 2 # addition of integers
    Out[1]: 4
    In [2]: 2 * 2 # multiplication
    Out[2]: 4
    In [3]: 3 / 2 # division (returns floating-point real value)
    Out[3]: 1.5
    In [4]: 3 // 2 # integer division
    Out[4]: 1
    In [5]: 2 > 3 # logical operators return a Boolean value
    Out[5]: False
    In [6]: 2 == 2 # equals
    Out[6]: True
    In [7]: 2 != 2 # is different
    Out[7]: False
    In [8]: "my string" # quotes define strings
    Out[8]: 'my string'
    end{testermcode}

    end{document}





    share|improve this answer

























      up vote
      0
      down vote













      I have solved my issues, below are the updated code:



      documentclass{book}

      usepackage{fontspec}
      defaultfontfeatures{Ligatures=TeX}
      usepackage{unicode-math}%


      setmonofont[Path = ./Fonts/ ,
      UprightFont= Iosevka ,]{Iosevka}

      usepackage{textcomp,xcolor,MNsymbol}

      usepackage{listings}

      lstdefinestyle{mypyscriptstyle}{%
      upquote=true,
      language=Python,
      % Basic style
      basicstyle=ttfamilysmall,
      commentstyle=ttfootnotesize, %rmfamily
      stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
      % Line numbers
      %numbers=left,
      %numberstyle=footnotesize,
      %numbersep=1em,
      %stepnumber=3,
      % Margins and box
      %framextopmargin=2em,
      %framexbottommargin=2em,
      %frame=l,
      %backgroundcolor=color{black!10},
      %xleftmargin=1em,
      %tabsize=4,
      % Show spaces
      showspaces=false,
      showtabs=false,
      showstringspaces=false,
      columns=fullflexible,
      breaklines=true,
      postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
      % Comments
      morecomment=[s]{"""}{"""},
      morecomment=[s]{'''}{'''},
      morecomment=[l]{#},
      % Keywords
      keywordstyle=bfseries,
      keywords={},
      sensitive=true,
      string=[b]',
      morestring=[b]",
      escapechar={§},
      alsoletter={_, .},
      % Built-in
      emphstyle=color{black!15}bfseries,
      emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
      join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
      }

      usepackage[many]{tcolorbox}
      tcbuselibrary{listings}


      %lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}
      newtcblisting{testermcode}{colback=black!16,left=4pt,right=4pt,arc=0pt,leftrule=2pt,rightrule=0pt,toprule=0pt,bottomrule=0pt,listing
      options={style=mypyscriptstyle,xleftmargin=4pt},listing only }


      begin{document}

      begin{testermcode}
      In [1]: 2 + 2 # addition of integers
      Out[1]: 4
      In [2]: 2 * 2 # multiplication
      Out[2]: 4
      In [3]: 3 / 2 # division (returns floating-point real value)
      Out[3]: 1.5
      In [4]: 3 // 2 # integer division
      Out[4]: 1
      In [5]: 2 > 3 # logical operators return a Boolean value
      Out[5]: False
      In [6]: 2 == 2 # equals
      Out[6]: True
      In [7]: 2 != 2 # is different
      Out[7]: False
      In [8]: "my string" # quotes define strings
      Out[8]: 'my string'
      end{testermcode}

      end{document}





      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I have solved my issues, below are the updated code:



        documentclass{book}

        usepackage{fontspec}
        defaultfontfeatures{Ligatures=TeX}
        usepackage{unicode-math}%


        setmonofont[Path = ./Fonts/ ,
        UprightFont= Iosevka ,]{Iosevka}

        usepackage{textcomp,xcolor,MNsymbol}

        usepackage{listings}

        lstdefinestyle{mypyscriptstyle}{%
        upquote=true,
        language=Python,
        % Basic style
        basicstyle=ttfamilysmall,
        commentstyle=ttfootnotesize, %rmfamily
        stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
        % Line numbers
        %numbers=left,
        %numberstyle=footnotesize,
        %numbersep=1em,
        %stepnumber=3,
        % Margins and box
        %framextopmargin=2em,
        %framexbottommargin=2em,
        %frame=l,
        %backgroundcolor=color{black!10},
        %xleftmargin=1em,
        %tabsize=4,
        % Show spaces
        showspaces=false,
        showtabs=false,
        showstringspaces=false,
        columns=fullflexible,
        breaklines=true,
        postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
        % Comments
        morecomment=[s]{"""}{"""},
        morecomment=[s]{'''}{'''},
        morecomment=[l]{#},
        % Keywords
        keywordstyle=bfseries,
        keywords={},
        sensitive=true,
        string=[b]',
        morestring=[b]",
        escapechar={§},
        alsoletter={_, .},
        % Built-in
        emphstyle=color{black!15}bfseries,
        emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
        join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
        }

        usepackage[many]{tcolorbox}
        tcbuselibrary{listings}


        %lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}
        newtcblisting{testermcode}{colback=black!16,left=4pt,right=4pt,arc=0pt,leftrule=2pt,rightrule=0pt,toprule=0pt,bottomrule=0pt,listing
        options={style=mypyscriptstyle,xleftmargin=4pt},listing only }


        begin{document}

        begin{testermcode}
        In [1]: 2 + 2 # addition of integers
        Out[1]: 4
        In [2]: 2 * 2 # multiplication
        Out[2]: 4
        In [3]: 3 / 2 # division (returns floating-point real value)
        Out[3]: 1.5
        In [4]: 3 // 2 # integer division
        Out[4]: 1
        In [5]: 2 > 3 # logical operators return a Boolean value
        Out[5]: False
        In [6]: 2 == 2 # equals
        Out[6]: True
        In [7]: 2 != 2 # is different
        Out[7]: False
        In [8]: "my string" # quotes define strings
        Out[8]: 'my string'
        end{testermcode}

        end{document}





        share|improve this answer












        I have solved my issues, below are the updated code:



        documentclass{book}

        usepackage{fontspec}
        defaultfontfeatures{Ligatures=TeX}
        usepackage{unicode-math}%


        setmonofont[Path = ./Fonts/ ,
        UprightFont= Iosevka ,]{Iosevka}

        usepackage{textcomp,xcolor,MNsymbol}

        usepackage{listings}

        lstdefinestyle{mypyscriptstyle}{%
        upquote=true,
        language=Python,
        % Basic style
        basicstyle=ttfamilysmall,
        commentstyle=ttfootnotesize, %rmfamily
        stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
        % Line numbers
        %numbers=left,
        %numberstyle=footnotesize,
        %numbersep=1em,
        %stepnumber=3,
        % Margins and box
        %framextopmargin=2em,
        %framexbottommargin=2em,
        %frame=l,
        %backgroundcolor=color{black!10},
        %xleftmargin=1em,
        %tabsize=4,
        % Show spaces
        showspaces=false,
        showtabs=false,
        showstringspaces=false,
        columns=fullflexible,
        breaklines=true,
        postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
        % Comments
        morecomment=[s]{"""}{"""},
        morecomment=[s]{'''}{'''},
        morecomment=[l]{#},
        % Keywords
        keywordstyle=bfseries,
        keywords={},
        sensitive=true,
        string=[b]',
        morestring=[b]",
        escapechar={§},
        alsoletter={_, .},
        % Built-in
        emphstyle=color{black!15}bfseries,
        emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
        join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
        }

        usepackage[many]{tcolorbox}
        tcbuselibrary{listings}


        %lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}
        newtcblisting{testermcode}{colback=black!16,left=4pt,right=4pt,arc=0pt,leftrule=2pt,rightrule=0pt,toprule=0pt,bottomrule=0pt,listing
        options={style=mypyscriptstyle,xleftmargin=4pt},listing only }


        begin{document}

        begin{testermcode}
        In [1]: 2 + 2 # addition of integers
        Out[1]: 4
        In [2]: 2 * 2 # multiplication
        Out[2]: 4
        In [3]: 3 / 2 # division (returns floating-point real value)
        Out[3]: 1.5
        In [4]: 3 // 2 # integer division
        Out[4]: 1
        In [5]: 2 > 3 # logical operators return a Boolean value
        Out[5]: False
        In [6]: 2 == 2 # equals
        Out[6]: True
        In [7]: 2 != 2 # is different
        Out[7]: False
        In [8]: "my string" # quotes define strings
        Out[8]: 'my string'
        end{testermcode}

        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 26 at 5:47









        MadyYuvi

        2,054211




        2,054211






























            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%2f437671%2fleft-rule-affected-if-change-courier-font-to-other-font%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?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

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