Minted Linenos not working after using RecustomVerbatimEnvironment












2














Currently I am trying to work with the minted package. My aim is to have a code snippet with the numbering for each line, which is centered in a figure.



My top level configuration looks like following:



documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}

usepackage{graphicx}
usepackage{minted}
setminted{linenos=true}
RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}

begin{document}
begin{figure}[!htb]
centering
begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
end{minted}
end{figure}
end{document}


The result looks like this:
Minted package looses numbering



The good thing is that it is centered in the document but the bad thing is that the numbering is missing.



If i comment out following line i get the numbering but the code is not centered anymore.



%RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}


Result looks like following then:
enter image description here



So is there any way how i can achieve both options? Centered and numbered?
Hopefully someone has an answer! :)










share|improve this question




















  • 2




    Don't show only snippets but a complete document that can be compiled and tested.
    – Ulrike Fischer
    Dec 9 at 15:36










  • I Changed it! :)
    – Dariusch
    Dec 9 at 17:29
















2














Currently I am trying to work with the minted package. My aim is to have a code snippet with the numbering for each line, which is centered in a figure.



My top level configuration looks like following:



documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}

usepackage{graphicx}
usepackage{minted}
setminted{linenos=true}
RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}

begin{document}
begin{figure}[!htb]
centering
begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
end{minted}
end{figure}
end{document}


The result looks like this:
Minted package looses numbering



The good thing is that it is centered in the document but the bad thing is that the numbering is missing.



If i comment out following line i get the numbering but the code is not centered anymore.



%RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}


Result looks like following then:
enter image description here



So is there any way how i can achieve both options? Centered and numbered?
Hopefully someone has an answer! :)










share|improve this question




















  • 2




    Don't show only snippets but a complete document that can be compiled and tested.
    – Ulrike Fischer
    Dec 9 at 15:36










  • I Changed it! :)
    – Dariusch
    Dec 9 at 17:29














2












2








2







Currently I am trying to work with the minted package. My aim is to have a code snippet with the numbering for each line, which is centered in a figure.



My top level configuration looks like following:



documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}

usepackage{graphicx}
usepackage{minted}
setminted{linenos=true}
RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}

begin{document}
begin{figure}[!htb]
centering
begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
end{minted}
end{figure}
end{document}


The result looks like this:
Minted package looses numbering



The good thing is that it is centered in the document but the bad thing is that the numbering is missing.



If i comment out following line i get the numbering but the code is not centered anymore.



%RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}


Result looks like following then:
enter image description here



So is there any way how i can achieve both options? Centered and numbered?
Hopefully someone has an answer! :)










share|improve this question















Currently I am trying to work with the minted package. My aim is to have a code snippet with the numbering for each line, which is centered in a figure.



My top level configuration looks like following:



documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}

usepackage{graphicx}
usepackage{minted}
setminted{linenos=true}
RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}

begin{document}
begin{figure}[!htb]
centering
begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
end{minted}
end{figure}
end{document}


The result looks like this:
Minted package looses numbering



The good thing is that it is centered in the document but the bad thing is that the numbering is missing.



If i comment out following line i get the numbering but the code is not centered anymore.



%RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}


Result looks like following then:
enter image description here



So is there any way how i can achieve both options? Centered and numbered?
Hopefully someone has an answer! :)







verbatim minted






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 9 at 20:38









AndréC

7,57011440




7,57011440










asked Dec 9 at 14:53









Dariusch

133




133








  • 2




    Don't show only snippets but a complete document that can be compiled and tested.
    – Ulrike Fischer
    Dec 9 at 15:36










  • I Changed it! :)
    – Dariusch
    Dec 9 at 17:29














  • 2




    Don't show only snippets but a complete document that can be compiled and tested.
    – Ulrike Fischer
    Dec 9 at 15:36










  • I Changed it! :)
    – Dariusch
    Dec 9 at 17:29








2




2




Don't show only snippets but a complete document that can be compiled and tested.
– Ulrike Fischer
Dec 9 at 15:36




Don't show only snippets but a complete document that can be compiled and tested.
– Ulrike Fischer
Dec 9 at 15:36












I Changed it! :)
– Dariusch
Dec 9 at 17:29




I Changed it! :)
– Dariusch
Dec 9 at 17:29










1 Answer
1






active

oldest

votes


















3














I don't think that BVerbatim can be numbered in the standard way, but you could try this



documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}

usepackage{graphicx}
usepackage{minted}
setminted{linenos=true}
newcommandmynumberformat{defFancyVerbFormatLine##1{{theFancyVerbLine} ##1}}
RecustomVerbatimEnvironment{Verbatim}{BVerbatim}
{formatcom=mynumberformat}

begin{document}

begin{figure}[!htb]
centering
begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
end{minted}
end{figure}
end{document}


enter image description here






share|improve this answer























  • @egreg Oh I see you found the solution, thanks.
    – Ulrike Fischer
    Dec 9 at 23:22










  • The definition of theFancyVerbLine is deftheFancyVerbLine{rmfamilytinyarabic{FancyVerbLine}} and you can guess what the problem was.
    – egreg
    Dec 9 at 23:23










  • @egreg grumpf. Who makes such definitions? I think I will complain ...
    – Ulrike Fischer
    Dec 9 at 23:27










  • That works for me! Thank you very much :)
    – Dariusch
    Dec 10 at 9:35






  • 1




    @thymaro an additional pair of braces is missing, as it is it implicitly assumes that the rmfamily has no side effects.
    – Ulrike Fischer
    Dec 10 at 10:09











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%2f463954%2fminted-linenos-not-working-after-using-recustomverbatimenvironment%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









3














I don't think that BVerbatim can be numbered in the standard way, but you could try this



documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}

usepackage{graphicx}
usepackage{minted}
setminted{linenos=true}
newcommandmynumberformat{defFancyVerbFormatLine##1{{theFancyVerbLine} ##1}}
RecustomVerbatimEnvironment{Verbatim}{BVerbatim}
{formatcom=mynumberformat}

begin{document}

begin{figure}[!htb]
centering
begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
end{minted}
end{figure}
end{document}


enter image description here






share|improve this answer























  • @egreg Oh I see you found the solution, thanks.
    – Ulrike Fischer
    Dec 9 at 23:22










  • The definition of theFancyVerbLine is deftheFancyVerbLine{rmfamilytinyarabic{FancyVerbLine}} and you can guess what the problem was.
    – egreg
    Dec 9 at 23:23










  • @egreg grumpf. Who makes such definitions? I think I will complain ...
    – Ulrike Fischer
    Dec 9 at 23:27










  • That works for me! Thank you very much :)
    – Dariusch
    Dec 10 at 9:35






  • 1




    @thymaro an additional pair of braces is missing, as it is it implicitly assumes that the rmfamily has no side effects.
    – Ulrike Fischer
    Dec 10 at 10:09
















3














I don't think that BVerbatim can be numbered in the standard way, but you could try this



documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}

usepackage{graphicx}
usepackage{minted}
setminted{linenos=true}
newcommandmynumberformat{defFancyVerbFormatLine##1{{theFancyVerbLine} ##1}}
RecustomVerbatimEnvironment{Verbatim}{BVerbatim}
{formatcom=mynumberformat}

begin{document}

begin{figure}[!htb]
centering
begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
end{minted}
end{figure}
end{document}


enter image description here






share|improve this answer























  • @egreg Oh I see you found the solution, thanks.
    – Ulrike Fischer
    Dec 9 at 23:22










  • The definition of theFancyVerbLine is deftheFancyVerbLine{rmfamilytinyarabic{FancyVerbLine}} and you can guess what the problem was.
    – egreg
    Dec 9 at 23:23










  • @egreg grumpf. Who makes such definitions? I think I will complain ...
    – Ulrike Fischer
    Dec 9 at 23:27










  • That works for me! Thank you very much :)
    – Dariusch
    Dec 10 at 9:35






  • 1




    @thymaro an additional pair of braces is missing, as it is it implicitly assumes that the rmfamily has no side effects.
    – Ulrike Fischer
    Dec 10 at 10:09














3












3








3






I don't think that BVerbatim can be numbered in the standard way, but you could try this



documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}

usepackage{graphicx}
usepackage{minted}
setminted{linenos=true}
newcommandmynumberformat{defFancyVerbFormatLine##1{{theFancyVerbLine} ##1}}
RecustomVerbatimEnvironment{Verbatim}{BVerbatim}
{formatcom=mynumberformat}

begin{document}

begin{figure}[!htb]
centering
begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
end{minted}
end{figure}
end{document}


enter image description here






share|improve this answer














I don't think that BVerbatim can be numbered in the standard way, but you could try this



documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}

usepackage{graphicx}
usepackage{minted}
setminted{linenos=true}
newcommandmynumberformat{defFancyVerbFormatLine##1{{theFancyVerbLine} ##1}}
RecustomVerbatimEnvironment{Verbatim}{BVerbatim}
{formatcom=mynumberformat}

begin{document}

begin{figure}[!htb]
centering
begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
end{minted}
end{figure}
end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 9 at 23:21









egreg

708k8618813163




708k8618813163










answered Dec 9 at 20:36









Ulrike Fischer

186k7290669




186k7290669












  • @egreg Oh I see you found the solution, thanks.
    – Ulrike Fischer
    Dec 9 at 23:22










  • The definition of theFancyVerbLine is deftheFancyVerbLine{rmfamilytinyarabic{FancyVerbLine}} and you can guess what the problem was.
    – egreg
    Dec 9 at 23:23










  • @egreg grumpf. Who makes such definitions? I think I will complain ...
    – Ulrike Fischer
    Dec 9 at 23:27










  • That works for me! Thank you very much :)
    – Dariusch
    Dec 10 at 9:35






  • 1




    @thymaro an additional pair of braces is missing, as it is it implicitly assumes that the rmfamily has no side effects.
    – Ulrike Fischer
    Dec 10 at 10:09


















  • @egreg Oh I see you found the solution, thanks.
    – Ulrike Fischer
    Dec 9 at 23:22










  • The definition of theFancyVerbLine is deftheFancyVerbLine{rmfamilytinyarabic{FancyVerbLine}} and you can guess what the problem was.
    – egreg
    Dec 9 at 23:23










  • @egreg grumpf. Who makes such definitions? I think I will complain ...
    – Ulrike Fischer
    Dec 9 at 23:27










  • That works for me! Thank you very much :)
    – Dariusch
    Dec 10 at 9:35






  • 1




    @thymaro an additional pair of braces is missing, as it is it implicitly assumes that the rmfamily has no side effects.
    – Ulrike Fischer
    Dec 10 at 10:09
















@egreg Oh I see you found the solution, thanks.
– Ulrike Fischer
Dec 9 at 23:22




@egreg Oh I see you found the solution, thanks.
– Ulrike Fischer
Dec 9 at 23:22












The definition of theFancyVerbLine is deftheFancyVerbLine{rmfamilytinyarabic{FancyVerbLine}} and you can guess what the problem was.
– egreg
Dec 9 at 23:23




The definition of theFancyVerbLine is deftheFancyVerbLine{rmfamilytinyarabic{FancyVerbLine}} and you can guess what the problem was.
– egreg
Dec 9 at 23:23












@egreg grumpf. Who makes such definitions? I think I will complain ...
– Ulrike Fischer
Dec 9 at 23:27




@egreg grumpf. Who makes such definitions? I think I will complain ...
– Ulrike Fischer
Dec 9 at 23:27












That works for me! Thank you very much :)
– Dariusch
Dec 10 at 9:35




That works for me! Thank you very much :)
– Dariusch
Dec 10 at 9:35




1




1




@thymaro an additional pair of braces is missing, as it is it implicitly assumes that the rmfamily has no side effects.
– Ulrike Fischer
Dec 10 at 10:09




@thymaro an additional pair of braces is missing, as it is it implicitly assumes that the rmfamily has no side effects.
– Ulrike Fischer
Dec 10 at 10:09


















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%2f463954%2fminted-linenos-not-working-after-using-recustomverbatimenvironment%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?