Re: Parentesi graffe tratteggiate

#79994
Up
0
Down
::


Fra le altre cose, bisognerebbe anche dire che i due metodi, nuovo ambiente [tt]sistema[/tt] e [tt]cases[/tt], producono output con spaziatura verticale diversa.

Ho prodotto, a partire dall’esempio fornito sull’Arte, un esempio minimo che lo dimostra tenendo presente come altezza di riferimento le variabili di inizio x e y (fra le altre cose è un ottimo esempio che dimostra com TikZ non serva solo a fare figure 😉 ).
`\documentclass{article}
\usepackage{amsmath,tikz}
\usetikzlibrary{calc}

\newenvironment{sistema}%
{\left\lbrace\begin{array}{@{}l@{}}}%
{\end{array}\right.}

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

\begin{document}
\[
\begin{cases}
\tikzmark{cases up}x+y+z=0\\
2x-y=1 \\
\tikzmark{cases down}y-4z=-3
\end{cases}
\hspace{1cm}
\begin{sistema}
\tikzmark{sistema up}x+y+z=0 \\
2x-y=1 \\
\tikzmark{sistema down}y-4z=-3
\end{sistema}
\]

\begin{tikzpicture}[remember picture,overlay]
% Label
\node[yshift=0.5cm,xshift=1cm] at (cases up.north) {Cases};
\node[yshift=0.5cm,xshift=1cm] at (sistema up.north) {Sistema};

% Frecce
\draw[ultra thick,red,stealth-stealth] ([xshift=-0.4cm]cases up.north)–([xshift=-0.4cm]cases down.south);
\draw[ultra thick,red,stealth-stealth] ([xshift=-0.4cm]sistema up.north)–([xshift=-0.4cm]sistema down.south);

% Segmenti di congiunzione
\draw[ultra thick, dotted,red,opacity=0.4]([xshift=-0.4cm]cases up.north)–([xshift=-0.4cm]sistema up.north);
\draw[ultra thick, dotted,red,opacity=0.4]([xshift=-0.4cm]cases down.south)–([xshift=-0.4cm]sistema down.south);

% Segmenti teorici
\draw[ultra thick, dotted,blue,opacity=0.4]
let \p1= (cases up.north), \p2 = (sistema up.north) in ([xshift=-0.4cm]cases up.north)–($([xshift=-2.5cm]cases up.north)+([xshift=-0.4cm]\x2,0)$);
\draw[ultra thick, dotted,blue,opacity=0.4]
let \p1= (cases down.south), \p2 = (sistema down.south) in ([xshift=-0.4cm]cases down.south)–($([xshift=-2.5cm]cases down.south)+([xshift=-0.4cm]\x2,0)$);
\end{tikzpicture}
\end{document}` Nota: si compili due volte per via delle opzioni [tt][remember picture,overlay][/tt].

Il risultato è:

[attachment=514]Immagine_2012-11-10.jpg[/attachment]

Apparentemente il marcatore finale (.. down.south) sembra tener conto non della y, ma della chiusura della parentesi graffa.

Ciao
Claudio

Attachments:
You must be logged in to view attached files.

Go to top