I am working on a project that will require intense timeline fields and all to keep track of stuff so I am trying to make it all easier by making it automatic. I have made a lot of progress in it however, there is an issue I cannot resolve so I am asking for help. I have created this document that shows it. I apologise for the formatting, I am not familiar with how to format this properly on tex.stackexchange.
\documentclass{article}\usepackage{calc}\usepackage{tikz}\usepackage{xstring}\usepackage{etoolbox}\newcommand{\drawbubble}[3]{ \renewcommand{\rowlng}{\arabic{rowlng}} \renewcommand{\rowh}{\arabic{nrrows}} \node at (#1-0.9,#2) {#3 }; %\StrLen{#3}[\lenstr] \draw [rounded corners, thick, black] (#1-\rowlng/11-0.08,#2) -- (#1-\value{rowlng}/11-0.08,#2-0.6) -- (#1+\rowlng/11+0.08,#2-0.6) -- (#1+\rowlng/11+0.08,#2+0.6) -- (#1-\rowlng/11-0.08,#2+0.6) -- (#1-\rowlng/11-0.08,#2);}%\newcommand{\drawbubble}[3]{\StrLen{#3}[\lenstr] %\draw [rounded corners, thick, black] (#1-\lenstr/11-0.08,#2) -- (#1-\lenstr/11-0.08,#2-0.6) -- (#1+\lenstr/11+0.08,#2-0.6) -- (#1+\lenstr/11+0.08,#2+0.6) -- (#1-\lenstr/11-0.08,#2+0.6) -- (#1-\lenstr/11-0.08,#2);%\node at (#1,#2) {#3};}\newcommand{\tmtxt}{}\newcommand{\rowlng}{0}\newcommand{\rowh}{0}\newcounter{nrrows}\newcounter{rowlng}\newcounter{tstlng}\newcommand{\addtxt}[2]{ \appto#1{#2}}\makeatletter % we need to use kernel commands\newcommand{\starttimetext}{% \renewcommand{\tmtxt}{\begin{tabular}[c]{@{}c@{}}} \setcounter{nrrows}{0} \setcounter{rowlng}{0} \setcounter{tstlng}{0} \@timetexti } \newcommand\@timetexti{\@ifnextchar\stoptimetext{\@timetextend}{\@timetextii}} \newcommand\@timetextii[1]{% \@timetextiii{#1} \stepcounter{nrrows} \@timetexti % restart the recursion } \newcommand\@timetextiii[1]{% \StrLen{#1}[\testlen] \setcounter{tstlng}{\testlen} \ifnum\therowlng<\thetstlng \setcounter{rowlng}{\value{tstlng}} \fi \addtxt{\tmtxt}{#1\\}} \newcommand\@timetextend[1]{% The argument is \stopimages \addtxt{\tmtxt}{\end{tabular}} %\arabic{rowlng}:\arabic{nrrows} \tmtxt}\makeatother\begin{document}\begin{tikzpicture}\drawbubble{0}{4.2}{\starttimetext {test}{altso} \stoptimetext}\drawbubble{0}{1.2}{\starttimetext {vaginas} \stoptimetext}\drawbubble{3}{4.2}{\starttimetext {testingtonomatic} \stoptimetext}\end{tikzpicture}\end{document}
The first one, with two lines, pushes outside the bounds while the latter ones do not with only one row. When I change them around the same thing happens and others. I am trying to make it such that it counts lines and width and makes the area around compensate.
What am I doing that causes it to start shifting the moment more rows are added? The timetext part is to get the rows working which I could not get otherwise.