JuliaTeX / TikzPictures.jl

Creating PGF/TikZ pictures and saving them in various formats
Other
89 stars 28 forks source link

helper function for easy creation of tikz-cd diagrams #60

Closed mehalter closed 4 years ago

mehalter commented 4 years ago

After playing around with the new environments, I came up with a good shortcut function that makes working with tikz-cd environment a lot nicer specifically with LaTeXStrings and automatically setting the environment and preamble. Let me know what you think!

mykelk commented 4 years ago

Nice! I think this is a bit too specific to this one tikz-cd package. I think it makes more sense to create a separate package specifically for tikz-cd that has TikzPictures.jl as a dependency.

mehalter commented 4 years ago

Yeah I was wondering if this would be considered too specific as well. Looking at other popular projects for converting TikZ to images like (https://github.com/distler/tex2svg), many of these solutions include support for only 2 environments, tikzpictures and tikzcd. It seems like a natural pairing to include together that other solutions have also gone with. I also don't know if there are other environments that are widlely used, but tikzpictures and tikz-cd are very commonly used packages and the required code to implement is minimal, and is just a single function. Are there other environments that you foresee proliferation to?

mykelk commented 4 years ago

I think you'll want to do something like TikzGraphs.jl, which provides a somewhat thin wrapper around TikzPictures.jl. There are other examples like TreeView.jl and (a not so thin wrapper) PGFPlots.jl. You can find these examples here: https://github.com/JuliaTeX I think a lot of people would be very excited to have a nice Julia package that makes working with commutative diagrams easy. If you'd like to take a crack at this and want to add it to the JuliaTeX org, just let me know.

mehalter commented 4 years ago

Ah ok! Thanks for linking me all of these examples. I would love to give this a crack, if you could add me to the JuliaTex org that would be great and I can get started on it. Thanks for your help!

mykelk commented 4 years ago

Great! I just added you to the org. I look forward to seeing what you come up with.

mykelk commented 4 years ago

Nice work! You might consider making a little domain specific language through Julia's metaprogramming capability, similar to what was done in PGFPlotsX.jl (see the manual for an example).

mehalter commented 4 years ago

Yeah I would like to do something like that, probably a nice little macro of some kind. Figured this simple single function is a good starting point.

mehalter commented 4 years ago

@mykelk what do you think of the current state of https://github.com/JuliaTeX/TikzCDs.jl for an initial release? I am planning on adding features over time, but want to do just a simple wrapper release. Is there a good place for me to contact the organization as a whole and see what they think of the package before pushing to general?

mykelk commented 4 years ago

It looks great! Yes, it is good to start off with a "low-level" API and then gradually add higher-level functionality later on. I think it's good to go.