-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve tikz library #29
Comments
|
In fact, Moreover, First of all, we need to decide whether or not |
Also, |
I have merged pull request #554 (Add tikz library) contributed by Jasper Habicht. We can discuss further improvements to this library in this issue. |
I just read issue #27 about PDF tagging and I think it might be a good idea to add another hook directly before |
As far as I know, by default contents not tagged as |
@jasperhabicht From above example, it seems tikz table node is a bit larger than the table box. Any idea? |
You also need
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
% default "outer sep"
\begin{tikzpicture}[line width=3pt]
\node[draw=none, fill=none, inner sep=0pt, text width=3cm, text height=2cm] (a) at (0,0) {};
\draw[red] (a.north east) rectangle (a.south west);
\draw (-1.5, 0) -- (1.5, 0);
\end{tikzpicture}
% "outer sep=0pt"
\begin{tikzpicture}[line width=3pt]
\node[draw=none, fill=none, inner sep=0pt, outer sep=0pt, text width=3cm, text height=2cm] (a) at (0,0) {};
\draw[red] (a.north east) rectangle (a.south west);
\draw (-1.5, 0) -- (1.5, 0);
\end{tikzpicture}
\end{document} As a cross reference, see how Update: I just opened #559 to address this. |
True, I missed that. Thanks! Interesting that the Of course, if the node is empty (which it is supposed to be anyways), the result will be the same. But we also need to take into account depth here, so using the |
The issue with multispan cells is that the anchor As for omitted cells: As long as the hooks are set for the relevant cells, the node is placed. This is not a bug in the library, I think. |
Yes, it is nice that every omitted cell also has a cell node. I think it would be perfect if we can make the cell node zero-width/zero-height if a cell is covered by another multicolumn/multirow cell. But I guess users will not use them, so it is OK to leave them as they are. |
I added a PR that should fix the issue with multispan cells. |
By the way: with Maybe we should add coordinates at the intersections of the borders ... but we need to think about what to do if borders of different width or multiple borders intersect. We should gather more use cases before taking action here, I think. |
For a
Therefore we can create these And from corner-i-1 and corner-1-j users can use corner-i-j directly with
Therefore we don't need to create other corner nodes, which is the case in The only problem is, multispan cells will hinder our calculations above. |
Exactly. I also thought that we should not add more nodes but instead use the existing ones to create coordinates. It should still be possible, I think, to also do this for multispan cells, since the information about how many cols and rows are spanned is accessible for every cell. One could even add an option allowing the user so switch on/off these additional coordinates if needed. |
If we also create a |
I have modified the calculations in #29 (comment) , using only |
Added a PR that adds a coordinate at the lower right corner in every cell (not only in multispan cells, but this could be changed easily), which could be useful to add the other coordinates. I also changed the trim of the box to zero and instead shifted the node and coordinate via TikZ to simplify things a bit. I am unsure when I will be able to contribute more in the next few weeks though. |
It is nice that every cell has a similar coordinate node.
Everyone is busy around new year. Thank you again for your contribution. |
It seems the third tests in library-016.tex fails with PR #566. The background grid now stretches a bit out of the table node at the bottom. I can not figure out the reason. (I am not good at |
Okay, then leave it for now. I will look into it as soon as possible. As for now, we do have a working library with nodes for every cell and the table which is already nice! |
With newly added |
Some remarks on the current implementation:
|
We have to collect the body code of |
You can fix them as long as the reggression tests don't fail.
Just replace my code with yours if you can do coordinate calculation without |
nicematrix
use of names of the cells to play with TikZ for (even if this fine-tunings is used in some rare situations).This could be a feature proposed only when using
\UseTblrLibrary{tikz}
.The text was updated successfully, but these errors were encountered: