problema di posizionamento con tikz

  • Creatore
    Topic
  • #100840
    claudio
    Partecipante
      Up
      0
      Down
      ::


      Salve
      ho il seguente codice:
      `
      \documentclass[12pt,oneside]{book}
      \usepackage{amsmath}

      \usepackage{amssymb}
      \usepackage{tikz}
      \usetikzlibrary{arrows,positioning}
      \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
      \begin{document}
      \[
      y=R\tikzmark{a}\sin\tikzmark{b}(\tikzmark{c}\omega t+\tikzmark{d}\phi)
      \tikz[overlay,remember picture]{
      \node[above left=of a] (text) {\scriptsize Ampiezza};
      \draw[->,thin] ([xshift=-2.5pt, yshift=5pt] a.north) |- (text.east);

      \node[below left=of b] (text) {\scriptsize Forma};
      \draw[->,thin] ([xshift=-8.pt, yshift=-4pt] b.north) |- (text.east);

      \node[above right=of c] (text) {\scriptsize Pulsazione};
      \draw[->,thin] ([xshift=2pt, yshift=4pt] c.north) |- (text.west);

      \node[below right=of d] (text) {\scriptsize Sfasamento};
      \draw[->,thin] ([xshift=1.5pt, yshift=-4.5pt] d.north) |- (text.west);
      }
      \]
      \end{document}
      `
      come posiziono in maniera corretta l’inizio delle frecce ?
      c’è un modo che risolve il problema senza dover invocare la santa pazienza?
      (per beccare la i di sin …. )
      grazie
      claudio

    Visualizzazione 1 filone di risposte
    • Autore
      Risposte
      • #100841
        Up
        0
        Down
        ::


        Purtroppo bisogna armarsi di pazienza e fare qualche tentativo. Così può andare?
        `
        \documentclass[12pt,oneside]{book}
        \usepackage{amsmath}

        \usepackage{amssymb}
        \usepackage{tikz}
        \usetikzlibrary{arrows,positioning}
        \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
        \begin{document}
        \[
        y=R\tikzmark{a}\sin\tikzmark{b}(\tikzmark{c}\omega t+\tikzmark{d}\phi)
        \tikz[overlay,remember picture]{
        \node[above left=of a] (text) {\scriptsize Ampiezza};
        \draw[->,thin] ([xshift=-2.5pt, yshift=5pt] a.north) |- (text.east);

        \node[below left=of b] (text) {\scriptsize Forma};
        \draw[->,thin] ([xshift=-10.25pt, yshift=-5pt] b.north) |- (text.east);

        \node[above right=of c] (text) {\scriptsize Pulsazione};
        \draw[->,thin] ([xshift=3.75pt, yshift=4pt] c.north) |- (text.west);

        \node[below right=of d] (text) {\scriptsize Sfasamento};
        \draw[->,thin] ([xshift=2.25pt, yshift=-7pt] d.north) |- (text.west);
        }
        \]
        \end{document}
        `

      • #100842
        Up
        0
        Down
        ::


        Oppure puoi provare a cambiare la definizione di [tt]\tikzmark[/tt] perché accetti come argomento il testo. In quel modo il nodo ha esattamente la dimensione del testo per cui puoi accedere alla sua coordinata south (in realtà puoi accedere a tutte le coordinate predefinite…)

        Ciao
        Claudio

    Visualizzazione 1 filone di risposte
    • Devi essere connesso per rispondere a questo topic.

    Go to top