Skip to content
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

Add guideline for TikZ users #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

user202729
Copy link
Contributor

I think this could be useful, as a sizable number of TeX users are familiar with TikZ.

@joerg-lehmann joerg-lehmann requested a review from wobsta May 1, 2024 20:23
@user202729
Copy link
Contributor Author

user202729 commented May 2, 2024

Looking at it:

  • There doesn't seem to be an equivalent of \begin{scope}[scale=2], the equivalent of scaling a whole canvas will also scale text size.
  • There's no easy way to create a box that consists of an enlarged box around text (you can call ⟨text⟩.bbox().enlarge, but enlarge is only available on bbox object, and you can only convert bbox into path.rect, not box.rect it seems

Did I miss something? (It sounds like a good idea to provide method to convert bbox to box.rect instance, although rect() method is already used)

Actually, I think there's no disadvantage in making bbox subclass from box.rect? (But will break backwards compatibility because center method etc.)

@wobsta
Copy link
Contributor

wobsta commented May 4, 2024

I really like and appreciate your documentation efforts.

I am not quite sure whether we should have it as part of the one and single manual, though. Still, we might just merge and maybe split it later on. Jörg, would this be fine with you?

Regarding your request with scaling content: You can insert a canvas (sc) into another canvas (c) while applying transformations to it: c.insert(sc, [trafo.scale(2)]).

I consider the box module and code quite incomplete. It is fine to propose some extensions. For example, we could add .box() methods everywhere. In some sense they could be the official way to work, while bbox'es really should be internal.

@user202729
Copy link
Contributor Author

No, I already included it there. Just that that also scales the line width, which is the equivalent of TikZ' transform canvas and hardly what the user wants.

@joerg-lehmann
Copy link
Member

wobsta wrote:

I am not quite sure whether we should have it as part of the one and single manual, though. Still, we might just merge and maybe split it later on. Jörg, would this be fine with you?

I am also a bit torn - which is why I brought you in the discussion. But for me, merging now and maybe splitting it later would be fine. The documentation per se is useful.

user202729 wrote:

No, I already included it there. Just that that also scales the line width, which is the equivalent of TikZ' transform canvas and hardly what the user wants.

Globally, what you want can be achieved by using unit.set(uscale=2). This scales all "user" lengths by a factor of 2 while leaving both the pre-defined linewidths and TeX sizes invariant. See the documentation of the unit module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants