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:
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
add a comment |
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:
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
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
add a comment |
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:
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
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:
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
leftrule
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
add a comment |
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
add a comment |
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}
add a comment |
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}
add a comment |
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}
add a comment |
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}
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}
answered Jun 26 at 5:47
MadyYuvi
2,054211
2,054211
add a comment |
add a comment |
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%2f437671%2fleft-rule-affected-if-change-courier-font-to-other-font%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
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