Using varwidth within an environment definition with minted The Next CEO of Stack OverflowUsing minted to define a new environmentNew environment with mintedminted Environment Inside minipage Environmentminted Environment Inside varwidth EnvironmentMinted In A New EnvironmentCombining varwidth with hangindentHow to let minted break across pages but keep the caption together with the end of listing?Minted in new environmentVertical padding for multiline cells using varwidthproblem with varwidth package
Is a distribution that is normal, but highly skewed considered Gaussian?
Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?
Won the lottery - how do I keep the money?
Is there always a complete, orthogonal set of unitary matrices?
Grabbing quick drinks
Can we say or write : "No, it'sn't"?
Is there a way to save my career from absolute disaster?
Math-accent symbol over parentheses enclosing accented symbol (amsmath)
Why did CATV standarize in 75 ohms and everyone else in 50?
What was the first Unix version to run on a microcomputer?
How is this set of matrices closed under multiplication?
Proper way to express "He disappeared them"
If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?
How did people program for Consoles with multiple CPUs?
Is it convenient to ask the journal's editor for two additional days to complete a review?
Is it ever safe to open a suspicious HTML file (e.g. email attachment)?
Which one is the true statement?
Is it professional to write unrelated content in an almost-empty email?
How to count occurrences of text in a file?
The exact meaning of 'Mom made me a sandwich'
Should I tutor a student who I know has cheated on their homework?
Domestic-to-international connection at Orlando (MCO)
Newlines in BSD sed vs gsed
Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis
Using varwidth within an environment definition with minted
The Next CEO of Stack OverflowUsing minted to define a new environmentNew environment with mintedminted Environment Inside minipage Environmentminted Environment Inside varwidth EnvironmentMinted In A New EnvironmentCombining varwidth with hangindentHow to let minted break across pages but keep the caption together with the end of listing?Minted in new environmentVertical padding for multiline cells using varwidthproblem with varwidth package
I'm trying to create a new environment which holds a centered code snippet using minted
. Firstly I came across to a minipage
package, however it needs the width specification. I just want it to be dynamic according to it's content length. So I picked varwidth
which seemed doing exactly what I need. But when I try to put it like:
newenvironmentra[3][]
endminted
endvarwidth
endcenter
endlisting
It just behaves the same way as minipage
does. Does not adjust at all. Usage:
beginrasome captioncode:label
Example
endra
Am I doing anything wrong? Thanks
environments minipage minted varwidth
New contributor
add a comment |
I'm trying to create a new environment which holds a centered code snippet using minted
. Firstly I came across to a minipage
package, however it needs the width specification. I just want it to be dynamic according to it's content length. So I picked varwidth
which seemed doing exactly what I need. But when I try to put it like:
newenvironmentra[3][]
endminted
endvarwidth
endcenter
endlisting
It just behaves the same way as minipage
does. Does not adjust at all. Usage:
beginrasome captioncode:label
Example
endra
Am I doing anything wrong? Thanks
environments minipage minted varwidth
New contributor
add a comment |
I'm trying to create a new environment which holds a centered code snippet using minted
. Firstly I came across to a minipage
package, however it needs the width specification. I just want it to be dynamic according to it's content length. So I picked varwidth
which seemed doing exactly what I need. But when I try to put it like:
newenvironmentra[3][]
endminted
endvarwidth
endcenter
endlisting
It just behaves the same way as minipage
does. Does not adjust at all. Usage:
beginrasome captioncode:label
Example
endra
Am I doing anything wrong? Thanks
environments minipage minted varwidth
New contributor
I'm trying to create a new environment which holds a centered code snippet using minted
. Firstly I came across to a minipage
package, however it needs the width specification. I just want it to be dynamic according to it's content length. So I picked varwidth
which seemed doing exactly what I need. But when I try to put it like:
newenvironmentra[3][]
endminted
endvarwidth
endcenter
endlisting
It just behaves the same way as minipage
does. Does not adjust at all. Usage:
beginrasome captioncode:label
Example
endra
Am I doing anything wrong? Thanks
environments minipage minted varwidth
environments minipage minted varwidth
New contributor
New contributor
New contributor
asked 7 hours ago
marthin23marthin23
111
111
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You want to make Verbatim
into BVerbatim
:
documentclassarticle
usepackageminted
newenvironmentra[3][]
%
VerbatimEnvironment
beginlisting%
caption#2label#3%
centering
RecustomVerbatimEnvironmentVerbatimBVerbatim%
beginminted[
escapeinside=
%
endminted
endlisting
begindocument
beginrasome captioncode:label
Example
endra
enddocument
add a 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
);
);
marthin23 is a new contributor. Be nice, and check out our Code of Conduct.
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%2f482333%2fusing-varwidth-within-an-environment-definition-with-minted%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
You want to make Verbatim
into BVerbatim
:
documentclassarticle
usepackageminted
newenvironmentra[3][]
%
VerbatimEnvironment
beginlisting%
caption#2label#3%
centering
RecustomVerbatimEnvironmentVerbatimBVerbatim%
beginminted[
escapeinside=
%
endminted
endlisting
begindocument
beginrasome captioncode:label
Example
endra
enddocument
add a comment |
You want to make Verbatim
into BVerbatim
:
documentclassarticle
usepackageminted
newenvironmentra[3][]
%
VerbatimEnvironment
beginlisting%
caption#2label#3%
centering
RecustomVerbatimEnvironmentVerbatimBVerbatim%
beginminted[
escapeinside=
%
endminted
endlisting
begindocument
beginrasome captioncode:label
Example
endra
enddocument
add a comment |
You want to make Verbatim
into BVerbatim
:
documentclassarticle
usepackageminted
newenvironmentra[3][]
%
VerbatimEnvironment
beginlisting%
caption#2label#3%
centering
RecustomVerbatimEnvironmentVerbatimBVerbatim%
beginminted[
escapeinside=
%
endminted
endlisting
begindocument
beginrasome captioncode:label
Example
endra
enddocument
You want to make Verbatim
into BVerbatim
:
documentclassarticle
usepackageminted
newenvironmentra[3][]
%
VerbatimEnvironment
beginlisting%
caption#2label#3%
centering
RecustomVerbatimEnvironmentVerbatimBVerbatim%
beginminted[
escapeinside=
%
endminted
endlisting
begindocument
beginrasome captioncode:label
Example
endra
enddocument
answered 6 hours ago
egregegreg
730k8819283242
730k8819283242
add a comment |
add a comment |
marthin23 is a new contributor. Be nice, and check out our Code of Conduct.
marthin23 is a new contributor. Be nice, and check out our Code of Conduct.
marthin23 is a new contributor. Be nice, and check out our Code of Conduct.
marthin23 is a new contributor. Be nice, and check out our Code of Conduct.
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.
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%2f482333%2fusing-varwidth-within-an-environment-definition-with-minted%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