loopspace / tikzmark

The dread tikzmark arrives on github
14 stars 3 forks source link

pgfmark in box #5

Closed pablgonz closed 5 years ago

pablgonz commented 5 years ago

Hello, first of all, thanks for the great work with tikzmark. A suggestion, sometimes it is convenient to place the marks inside a box, although it is true you can play with xshift/yshift it is difficult to find the exact dimensions. I propose something like \boxmk[pos]{name}{content} that encapsulate \pgfmark:

\NewDocumentCommand{\boxmk}{ O  m  m }
 {
   \settoheight{\myhh}{$\mathsurround0pt #3$}
   \settodepth {\mydd}{$\mathsurround0pt #3$}
   \settowidth {\myww}{$\mathsurround0pt #3$}
   {#3}
   \hspace{-\myww}%
   % a box command here whit position a,b,l,r,c,al,ar,bl,br
   % like a \makebox(\myww,\myhh)[b]{\pgfmark{#2}}%
   %\makebox[-\myww]{\pgfmark{#2}}
 }

I think it would be quite useful (especially when you have text with ascending and decent letters and you want to place a specific mark). regards

loopspace commented 5 years ago

Hi there,

Thanks for the suggestion. It looks a bit like what the \tikzmarknode command does. Can you try that out and see if it fulfils what you're looking for?

pablgonz commented 5 years ago

You're right, I had not noticed the command \tikzmarknode (I did not update my distribution some time ago) it's just what I was trying to do usingboxes. That if, when using node I lose the ability to use $(pic cs: ..)$ and play with the coordinates (that was the original idea that I had in mind). Muchísimas Gracias