Minted Linenos not working after using RecustomVerbatimEnvironment
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:
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:
So is there any way how i can achieve both options? Centered and numbered?
Hopefully someone has an answer! :)
verbatim minted
add a comment |
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:
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:
So is there any way how i can achieve both options? Centered and numbered?
Hopefully someone has an answer! :)
verbatim minted
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
add a comment |
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:
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:
So is there any way how i can achieve both options? Centered and numbered?
Hopefully someone has an answer! :)
verbatim minted
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:
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:
So is there any way how i can achieve both options? Centered and numbered?
Hopefully someone has an answer! :)
verbatim minted
verbatim minted
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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}
@egreg Oh I see you found the solution, thanks.
– Ulrike Fischer
Dec 9 at 23:22
The definition oftheFancyVerbLine
isdeftheFancyVerbLine{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
|
show 1 more comment
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
});
}
});
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%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
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}
@egreg Oh I see you found the solution, thanks.
– Ulrike Fischer
Dec 9 at 23:22
The definition oftheFancyVerbLine
isdeftheFancyVerbLine{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
|
show 1 more comment
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}
@egreg Oh I see you found the solution, thanks.
– Ulrike Fischer
Dec 9 at 23:22
The definition oftheFancyVerbLine
isdeftheFancyVerbLine{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
|
show 1 more comment
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}
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}
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 oftheFancyVerbLine
isdeftheFancyVerbLine{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
|
show 1 more comment
@egreg Oh I see you found the solution, thanks.
– Ulrike Fischer
Dec 9 at 23:22
The definition oftheFancyVerbLine
isdeftheFancyVerbLine{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
|
show 1 more 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%2f463954%2fminted-linenos-not-working-after-using-recustomverbatimenvironment%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
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