The inserted code has extra blank linesListings code snippet has white horizontal lines across itHighlighting...

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

Can solid acids and bases have pH values? If not, how are they classified as acids or bases?

Pulling the rope with one hand is as heavy as with two hands?

Why do Computer Science majors learn Calculus?

If a warlock with the Repelling Blast invocation casts Eldritch Blast and hits, must the targets always be pushed back?

Is DC-DC (24v to 12v) Buck Conversion typically more efficient than AC-DC (110v to 12v) conversion?

How to stop co-workers from teasing me because I know Russian?

How to back up a running remote server?

How can I change the color of a part of a line?

Examples of non trivial equivalence relations , I mean equivalence relations without the expression " same ... as" in their definition?

Sci-fi novel series with instant travel between planets through gates. A river runs through the gates

US visa is under administrative processing, I need the passport back ASAP

Do I have to worry about players making “bad” choices on level up?

How do Bards prepare spells?

Why the difference in metal between 銀行 and お金?

How can the Zone of Truth spell be defeated without the caster knowing?

Are Boeing 737-800’s grounded?

Can someone publish a story that happened to you?

Why was Germany not as successful as other Europeans in establishing overseas colonies?

Minimum value of 4 digit number divided by sum of its digits

How to make a pipeline wait for end-of-file or stop after an error?

How to pronounce 'C++' in Spanish

What route did the Hindenburg take when traveling from Germany to the U.S.?

Sci-fi book: portals appear in London and send a failed artist towards a designated path where he operate a giant superweapon



The inserted code has extra blank lines


Listings code snippet has white horizontal lines across itHighlighting code introduces extra spaceUnindent code inserted with lstinputlistingIs there a way to ignore the empty lines while for importing matlab code through lstinputlisting for matlab codeCompile error “Missing endcsname inserted.” with code and tcolorboxRemove horizontal lines above and below the code - listings packageListings lstlisting environment has white horizontal linesArgument of @iirsbox has an extra }lstnewenvironment/lstset : using colors conditionally emph/emphstyle - SAS: (in=_x) versus if x in (1,2)listing code has missing some word













1















I'm using listings to format blocks of code in my xeLaTeX.When I insert this picture into Anki's card, the inserted code has extra blank lines. Following is my MWE:



documentclass[tikz]{standalone} 
usepackage{tcolorbox,listings}
usepackage{fontspec}
setmonofont{Consolas}

usepackage{color}
usepackage{tikz}
usepackage{framed}

definecolor{background}{HTML}{EEEEEE}
definecolor{comments}{HTML}{868686}
definecolor{darkred}{RGB}{139,0,0}
definecolor{darkblue}{RGB}{0,0,139}
definecolor{chartreuse}{RGB}{127,255,0}
definecolor{drakgreen}{RGB}{0,128,0}
definecolor{lightgray}{RGB}{238,239,240}


lstset{
language=[LaTeX]Tex,
keywordstyle=color{darkblue},
texcsstyle=*color{blue},
basicstyle=normalfontttfamily,
commentstyle=color{comments}ttfamily,
stringstyle=rmfamily,
frame=lrtb,
%numbers=left,
numbers=none,
numberstyle=scriptsize,
numbersep=8pt,
showstringspaces=false,
breaklines=true,
frameround=ftff,
frame=none,
captionpos=t,
belowcaptionskip=0em,
belowskip=0em,
literate=
*{{}{{textcolor{darkred}{{}}}{1}
{}}{{textcolor{darkred}{}}}}{1}
{[}{{textcolor{darkred}{[}}}{1}
{]}{{textcolor{darkred}{]}}}{1},
}
lstdefinestyle{mystyle}{
language=[LaTeX]Tex,
extendedchars=true,
breaklines=true,
breakatwhitespace=true,
basicstyle=ttfamily,
numbers=none,
keywordstyle=color{darkblue},
keywordstyle=[2]color{blue},
keywordstyle=[3]color{darkblue},
keywordstyle=[4]color{drakgreen},
alsoletter = {!},
keywords=[2]{definecolor,node,addplot},
keywords=[3]{usepackage},
keywords=[4]{begin,end,document,figure,figure*,axis}
}

tcbuselibrary{listings,skins,breakable}
newtcblisting{mycode}{
arc=0mm,
top=0mm,
bottom=0mm,
left=3mm,
right=0mm,
width=textwidth,
boxrule=1pt,
colback=lightgray,
listing only,
%listing options={style=mystyle},
breakable
}

begin{document}
begin{mycode}
begin{tikzpicture}
filldraw [gray] (0,0) circle (2pt)
(1,1) circle (2pt)
(2,1) circle (2pt)
(2,0) circle (2pt);
draw (0,0) .. controls (1,1) and (2,1) .. (2,0);
end{tikzpicture}
end{mycode}

When executed, that is, run via pdflatex or via latex followed by dvips, the resulting will contain something that looks like this:
end{document}


enter image description here



How to eliminate the extra blank lines at the top?



After commenting out this line‘listing only’, it draws a picture of this code.



enter image description here










share|improve this question
















bumped to the homepage by Community 21 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Ŷou should test your own example before posting it ...

    – user2478
    Nov 29 '18 at 7:03











  • Sorry, the code has been modified.

    – mcmxciv
    Nov 29 '18 at 7:19
















1















I'm using listings to format blocks of code in my xeLaTeX.When I insert this picture into Anki's card, the inserted code has extra blank lines. Following is my MWE:



documentclass[tikz]{standalone} 
usepackage{tcolorbox,listings}
usepackage{fontspec}
setmonofont{Consolas}

usepackage{color}
usepackage{tikz}
usepackage{framed}

definecolor{background}{HTML}{EEEEEE}
definecolor{comments}{HTML}{868686}
definecolor{darkred}{RGB}{139,0,0}
definecolor{darkblue}{RGB}{0,0,139}
definecolor{chartreuse}{RGB}{127,255,0}
definecolor{drakgreen}{RGB}{0,128,0}
definecolor{lightgray}{RGB}{238,239,240}


lstset{
language=[LaTeX]Tex,
keywordstyle=color{darkblue},
texcsstyle=*color{blue},
basicstyle=normalfontttfamily,
commentstyle=color{comments}ttfamily,
stringstyle=rmfamily,
frame=lrtb,
%numbers=left,
numbers=none,
numberstyle=scriptsize,
numbersep=8pt,
showstringspaces=false,
breaklines=true,
frameround=ftff,
frame=none,
captionpos=t,
belowcaptionskip=0em,
belowskip=0em,
literate=
*{{}{{textcolor{darkred}{{}}}{1}
{}}{{textcolor{darkred}{}}}}{1}
{[}{{textcolor{darkred}{[}}}{1}
{]}{{textcolor{darkred}{]}}}{1},
}
lstdefinestyle{mystyle}{
language=[LaTeX]Tex,
extendedchars=true,
breaklines=true,
breakatwhitespace=true,
basicstyle=ttfamily,
numbers=none,
keywordstyle=color{darkblue},
keywordstyle=[2]color{blue},
keywordstyle=[3]color{darkblue},
keywordstyle=[4]color{drakgreen},
alsoletter = {!},
keywords=[2]{definecolor,node,addplot},
keywords=[3]{usepackage},
keywords=[4]{begin,end,document,figure,figure*,axis}
}

tcbuselibrary{listings,skins,breakable}
newtcblisting{mycode}{
arc=0mm,
top=0mm,
bottom=0mm,
left=3mm,
right=0mm,
width=textwidth,
boxrule=1pt,
colback=lightgray,
listing only,
%listing options={style=mystyle},
breakable
}

begin{document}
begin{mycode}
begin{tikzpicture}
filldraw [gray] (0,0) circle (2pt)
(1,1) circle (2pt)
(2,1) circle (2pt)
(2,0) circle (2pt);
draw (0,0) .. controls (1,1) and (2,1) .. (2,0);
end{tikzpicture}
end{mycode}

When executed, that is, run via pdflatex or via latex followed by dvips, the resulting will contain something that looks like this:
end{document}


enter image description here



How to eliminate the extra blank lines at the top?



After commenting out this line‘listing only’, it draws a picture of this code.



enter image description here










share|improve this question
















bumped to the homepage by Community 21 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Ŷou should test your own example before posting it ...

    – user2478
    Nov 29 '18 at 7:03











  • Sorry, the code has been modified.

    – mcmxciv
    Nov 29 '18 at 7:19














1












1








1


0






I'm using listings to format blocks of code in my xeLaTeX.When I insert this picture into Anki's card, the inserted code has extra blank lines. Following is my MWE:



documentclass[tikz]{standalone} 
usepackage{tcolorbox,listings}
usepackage{fontspec}
setmonofont{Consolas}

usepackage{color}
usepackage{tikz}
usepackage{framed}

definecolor{background}{HTML}{EEEEEE}
definecolor{comments}{HTML}{868686}
definecolor{darkred}{RGB}{139,0,0}
definecolor{darkblue}{RGB}{0,0,139}
definecolor{chartreuse}{RGB}{127,255,0}
definecolor{drakgreen}{RGB}{0,128,0}
definecolor{lightgray}{RGB}{238,239,240}


lstset{
language=[LaTeX]Tex,
keywordstyle=color{darkblue},
texcsstyle=*color{blue},
basicstyle=normalfontttfamily,
commentstyle=color{comments}ttfamily,
stringstyle=rmfamily,
frame=lrtb,
%numbers=left,
numbers=none,
numberstyle=scriptsize,
numbersep=8pt,
showstringspaces=false,
breaklines=true,
frameround=ftff,
frame=none,
captionpos=t,
belowcaptionskip=0em,
belowskip=0em,
literate=
*{{}{{textcolor{darkred}{{}}}{1}
{}}{{textcolor{darkred}{}}}}{1}
{[}{{textcolor{darkred}{[}}}{1}
{]}{{textcolor{darkred}{]}}}{1},
}
lstdefinestyle{mystyle}{
language=[LaTeX]Tex,
extendedchars=true,
breaklines=true,
breakatwhitespace=true,
basicstyle=ttfamily,
numbers=none,
keywordstyle=color{darkblue},
keywordstyle=[2]color{blue},
keywordstyle=[3]color{darkblue},
keywordstyle=[4]color{drakgreen},
alsoletter = {!},
keywords=[2]{definecolor,node,addplot},
keywords=[3]{usepackage},
keywords=[4]{begin,end,document,figure,figure*,axis}
}

tcbuselibrary{listings,skins,breakable}
newtcblisting{mycode}{
arc=0mm,
top=0mm,
bottom=0mm,
left=3mm,
right=0mm,
width=textwidth,
boxrule=1pt,
colback=lightgray,
listing only,
%listing options={style=mystyle},
breakable
}

begin{document}
begin{mycode}
begin{tikzpicture}
filldraw [gray] (0,0) circle (2pt)
(1,1) circle (2pt)
(2,1) circle (2pt)
(2,0) circle (2pt);
draw (0,0) .. controls (1,1) and (2,1) .. (2,0);
end{tikzpicture}
end{mycode}

When executed, that is, run via pdflatex or via latex followed by dvips, the resulting will contain something that looks like this:
end{document}


enter image description here



How to eliminate the extra blank lines at the top?



After commenting out this line‘listing only’, it draws a picture of this code.



enter image description here










share|improve this question
















I'm using listings to format blocks of code in my xeLaTeX.When I insert this picture into Anki's card, the inserted code has extra blank lines. Following is my MWE:



documentclass[tikz]{standalone} 
usepackage{tcolorbox,listings}
usepackage{fontspec}
setmonofont{Consolas}

usepackage{color}
usepackage{tikz}
usepackage{framed}

definecolor{background}{HTML}{EEEEEE}
definecolor{comments}{HTML}{868686}
definecolor{darkred}{RGB}{139,0,0}
definecolor{darkblue}{RGB}{0,0,139}
definecolor{chartreuse}{RGB}{127,255,0}
definecolor{drakgreen}{RGB}{0,128,0}
definecolor{lightgray}{RGB}{238,239,240}


lstset{
language=[LaTeX]Tex,
keywordstyle=color{darkblue},
texcsstyle=*color{blue},
basicstyle=normalfontttfamily,
commentstyle=color{comments}ttfamily,
stringstyle=rmfamily,
frame=lrtb,
%numbers=left,
numbers=none,
numberstyle=scriptsize,
numbersep=8pt,
showstringspaces=false,
breaklines=true,
frameround=ftff,
frame=none,
captionpos=t,
belowcaptionskip=0em,
belowskip=0em,
literate=
*{{}{{textcolor{darkred}{{}}}{1}
{}}{{textcolor{darkred}{}}}}{1}
{[}{{textcolor{darkred}{[}}}{1}
{]}{{textcolor{darkred}{]}}}{1},
}
lstdefinestyle{mystyle}{
language=[LaTeX]Tex,
extendedchars=true,
breaklines=true,
breakatwhitespace=true,
basicstyle=ttfamily,
numbers=none,
keywordstyle=color{darkblue},
keywordstyle=[2]color{blue},
keywordstyle=[3]color{darkblue},
keywordstyle=[4]color{drakgreen},
alsoletter = {!},
keywords=[2]{definecolor,node,addplot},
keywords=[3]{usepackage},
keywords=[4]{begin,end,document,figure,figure*,axis}
}

tcbuselibrary{listings,skins,breakable}
newtcblisting{mycode}{
arc=0mm,
top=0mm,
bottom=0mm,
left=3mm,
right=0mm,
width=textwidth,
boxrule=1pt,
colback=lightgray,
listing only,
%listing options={style=mystyle},
breakable
}

begin{document}
begin{mycode}
begin{tikzpicture}
filldraw [gray] (0,0) circle (2pt)
(1,1) circle (2pt)
(2,1) circle (2pt)
(2,0) circle (2pt);
draw (0,0) .. controls (1,1) and (2,1) .. (2,0);
end{tikzpicture}
end{mycode}

When executed, that is, run via pdflatex or via latex followed by dvips, the resulting will contain something that looks like this:
end{document}


enter image description here



How to eliminate the extra blank lines at the top?



After commenting out this line‘listing only’, it draws a picture of this code.



enter image description here







listings






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 29 '18 at 8:42







mcmxciv

















asked Nov 29 '18 at 6:52









mcmxcivmcmxciv

647




647





bumped to the homepage by Community 21 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 21 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Ŷou should test your own example before posting it ...

    – user2478
    Nov 29 '18 at 7:03











  • Sorry, the code has been modified.

    – mcmxciv
    Nov 29 '18 at 7:19



















  • Ŷou should test your own example before posting it ...

    – user2478
    Nov 29 '18 at 7:03











  • Sorry, the code has been modified.

    – mcmxciv
    Nov 29 '18 at 7:19

















Ŷou should test your own example before posting it ...

– user2478
Nov 29 '18 at 7:03





Ŷou should test your own example before posting it ...

– user2478
Nov 29 '18 at 7:03













Sorry, the code has been modified.

– mcmxciv
Nov 29 '18 at 7:19





Sorry, the code has been modified.

– mcmxciv
Nov 29 '18 at 7:19










1 Answer
1






active

oldest

votes


















0














try:



newtcblisting{mycode}{
arc=0mm,
top=0mm,
bottom=0mm,
left=3mm,
right=0mm,
width=textwidth,
boxrule=1pt,
colback=lightgray,
% listing only,
listing options={style=mystyle},
breakable
}


The listing only option is the problem.






share|improve this answer


























  • I tried it according to your method, still the same.

    – mcmxciv
    Nov 29 '18 at 7:34











  • After commenting out this line, it draws a picture of this code.

    – mcmxciv
    Nov 29 '18 at 8:40











  • As far as I see the two lines listing only and breakable are problematic with standalone

    – user2478
    Nov 29 '18 at 8:41












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',
autoActivateHeartbeat: false,
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%2f462321%2fthe-inserted-code-has-extra-blank-lines%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









0














try:



newtcblisting{mycode}{
arc=0mm,
top=0mm,
bottom=0mm,
left=3mm,
right=0mm,
width=textwidth,
boxrule=1pt,
colback=lightgray,
% listing only,
listing options={style=mystyle},
breakable
}


The listing only option is the problem.






share|improve this answer


























  • I tried it according to your method, still the same.

    – mcmxciv
    Nov 29 '18 at 7:34











  • After commenting out this line, it draws a picture of this code.

    – mcmxciv
    Nov 29 '18 at 8:40











  • As far as I see the two lines listing only and breakable are problematic with standalone

    – user2478
    Nov 29 '18 at 8:41
















0














try:



newtcblisting{mycode}{
arc=0mm,
top=0mm,
bottom=0mm,
left=3mm,
right=0mm,
width=textwidth,
boxrule=1pt,
colback=lightgray,
% listing only,
listing options={style=mystyle},
breakable
}


The listing only option is the problem.






share|improve this answer


























  • I tried it according to your method, still the same.

    – mcmxciv
    Nov 29 '18 at 7:34











  • After commenting out this line, it draws a picture of this code.

    – mcmxciv
    Nov 29 '18 at 8:40











  • As far as I see the two lines listing only and breakable are problematic with standalone

    – user2478
    Nov 29 '18 at 8:41














0












0








0







try:



newtcblisting{mycode}{
arc=0mm,
top=0mm,
bottom=0mm,
left=3mm,
right=0mm,
width=textwidth,
boxrule=1pt,
colback=lightgray,
% listing only,
listing options={style=mystyle},
breakable
}


The listing only option is the problem.






share|improve this answer















try:



newtcblisting{mycode}{
arc=0mm,
top=0mm,
bottom=0mm,
left=3mm,
right=0mm,
width=textwidth,
boxrule=1pt,
colback=lightgray,
% listing only,
listing options={style=mystyle},
breakable
}


The listing only option is the problem.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 29 '18 at 8:06

























answered Nov 29 '18 at 7:03







user2478




















  • I tried it according to your method, still the same.

    – mcmxciv
    Nov 29 '18 at 7:34











  • After commenting out this line, it draws a picture of this code.

    – mcmxciv
    Nov 29 '18 at 8:40











  • As far as I see the two lines listing only and breakable are problematic with standalone

    – user2478
    Nov 29 '18 at 8:41



















  • I tried it according to your method, still the same.

    – mcmxciv
    Nov 29 '18 at 7:34











  • After commenting out this line, it draws a picture of this code.

    – mcmxciv
    Nov 29 '18 at 8:40











  • As far as I see the two lines listing only and breakable are problematic with standalone

    – user2478
    Nov 29 '18 at 8:41

















I tried it according to your method, still the same.

– mcmxciv
Nov 29 '18 at 7:34





I tried it according to your method, still the same.

– mcmxciv
Nov 29 '18 at 7:34













After commenting out this line, it draws a picture of this code.

– mcmxciv
Nov 29 '18 at 8:40





After commenting out this line, it draws a picture of this code.

– mcmxciv
Nov 29 '18 at 8:40













As far as I see the two lines listing only and breakable are problematic with standalone

– user2478
Nov 29 '18 at 8:41





As far as I see the two lines listing only and breakable are problematic with standalone

– user2478
Nov 29 '18 at 8:41


















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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462321%2fthe-inserted-code-has-extra-blank-lines%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

Universidad Autónoma de Occidente Índice Historia Campus Facultades Programas Académicos Medios de...

Heba Hefny Palmarés internacional Referencias Menú de navegaciónHeba HefnyHeba Hefny

Stadion Čair Historia Referencias Enlaces externos Menú de navegación43°18′56″N 21°54′31″E...