I make a next newenvironment to insert the code of a tikzfigure in the document


\usetikzlibrary{babel, arrows, external, calc}


   style = friendly,
    frame = lines,
    framesep = 2mm, 
    baselinestretch = 1.2,
    bgcolor = codeback!15,

\section{Un vector}

scale = .75,
vector/.style = {>=latex, ->, line width = 1.5pt},
\tkzInit[xmin = -1, xmax = 4, ymin = -1, ymax = 4]
\draw[vector] (0, 0) -- (2, 3);
\tkzPointShowCoord[xlabel = $2$, ylabel = $3$, color = gray!50](2, 3);


The result should be

enter image description here

but I want pass as an argument the caption to the figure, then the question is, how I can pass the caption of the figure as an argument of the newenvitonment.

Thanks a lot.

  • @Skillmon - I'm always happy to upvote a working answer. :-)
    – Mico
    Sep 2, 2017 at 9:18

1 Answer 1


The following approach can work:




I used this MWE since your provided code can't be run on my machine, since it lacks the \documentclass and \usepackages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.