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

Added custom environments to support tikz-cd #59

Merged
merged 4 commits into from
Aug 27, 2020

Conversation

mehalter
Copy link
Member

Takes a stab at #58. Currently all I have done is added a new field in the TikzPicture struct for the environment where the default is tikzpicture so that it doesn't break any past TikzPictures.jl code. I also added a couple tests to verify that the environment is working correctly and that it successfully outputs a pdf of a TikzPicture and a TikzDocument that uses tikz-cd. Didn't add too many tests for this to not have too much duplicate code, I think there could be a new function here to generate tests for both a tikzpicture and a tikzcd example.

Heres a working example using the new code:

julia> using TikzPictures
julia> tp = TikzPicture("A\\arrow[rd]\\arrow[r, \"\\phi\"] & B \\\\& C", environment="tikzcd", preamble="\\usepackage{tikz-cd}")
julia> save(SVG("test"), tp)

@epatters
Copy link
Contributor

Thank you @mehalter!

@mykelk
Copy link
Member

mykelk commented Aug 27, 2020

Great! It looks like the test is failing?

@mehalter
Copy link
Member Author

Yeah, I'm taking a look at this now to try and figure out what's going on. It seems like the tikz-cd doesn't like my latex code i provided. with the error

! Package tikz-cd Error: Arrow direction argument must contain only the charact

ers u, d, l, r.

See the tikz-cd package documentation for explanation.

Type  H <return>  for immediate help.

 ...                                              

                                                  

l.5 A\arrow[rd]\arrow

                   [r] & B \\& C

@mehalter
Copy link
Member Author

It seems like the version of tikz-cd that is being installed is a very old version in Travis and uses an outdated sytnax. Hopefully this change will get the test to pass at least for the CI/CD

https://tex.stackexchange.com/questions/393944/tikzcd-package-error-arrow-direction-argument

@mykelk
Copy link
Member

mykelk commented Aug 27, 2020

I'm happy to merge if you think it's good to go!

@mehalter
Copy link
Member Author

Yeah I think this looks good!

@mykelk mykelk merged commit f75c93b into JuliaTeX:master Aug 27, 2020
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