0

I want to use mdframed package and I was watching some examples from a template by Marion Lachaise & François Févotte from LaTeX templates

But I found this: (in the tikz part)

\mdfdefinestyle{file}{
    innertopmargin=1.6\baselineskip,
    innerbottommargin=0.8\baselineskip,
    topline=false, bottomline=false,
    leftline=false, rightline=false,
    leftmargin=2cm,
    rightmargin=2cm,
    singleextra={%
        \draw[fill=black!10!white](P)++(0,-1.2em)rectangle(P-|O);
        \node[anchor=north west]
        at(P-|O){\ttfamily\mdfilename};
        %
        \def\l{3em}
        \draw(O-|P)++(-\l,0)--++(\l,\l)--(P)--(P-|O)--(O)--cycle;
        \draw(O-|P)++(-\l,0)--++(0,\l)--++(\l,0);
    },
    nobreak,
}

And I don't know what P and O nodes are. I tried searching on the documentation and here in TeX.SX and I only found out that everyone writes a line like this: (in the tikz part)

\path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);

but I haven't found what P, O, \p1, \p2 are. So can anyone tell me what they are and how to use them?

AmadoC
  • 435
  • Documentation? You sure it isn't mentioned in mdframed documentation? Would be weird if it's the case... – user202729 Jan 07 '22 at 01:23
  • Also try to include a [example]. Could be something defined in the template somewhere above too – user202729 Jan 07 '22 at 01:23
  • I tried in the documentation searching \p1, but the only times it appears is in the examples and even searched in the .mdf that is loaded when the framemethod=tikz is used md-frame-1.mdf – AmadoC Jan 07 '22 at 01:39
  • No, the p1/p2 is a TeX thing, see manual (4.1.3 the circle around A) P and O I can't find however, but try just drawing their location to see where they are. – user202729 Jan 07 '22 at 02:50
  • 1
    this should clarify your doubt -- https://tex.stackexchange.com/a/588315/197451 – js bibra Jan 07 '22 at 04:20
  • Thans @jsbibra it was just what I need to know about the coordinates, and also thanks to @user202729 I found all the \p1 stuff in the TikZ manual. – AmadoC Jan 07 '22 at 04:49
  • Unrelated but I would recommend that you use tcolorbox instead of mdframed. – Ulrike Fischer Jan 07 '22 at 08:16
  • Thanks for the recommendation @UlrikeFischer , can I ask why do you recommend that? – AmadoC Jan 07 '22 at 08:25
  • Well compare the documentation and the dates of the last updates. The difference between both are quite obvious. Tcolorbox is much more powerful and it actively maintained. – Ulrike Fischer Jan 07 '22 at 08:28
  • I hadn't noticed! Thanks for your recommendation, I will read the documentation and pass what I have done to tcolorbox. It seems better as you said. – AmadoC Jan 07 '22 at 08:58

0 Answers0