Code Monkey home page Code Monkey logo

tikzcds.jl's People

Contributors

epatters avatar jpfairbanks avatar mehalter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tikzcds.jl's Issues

Error with call to TikzCD

I had an example in Franklin demos using TikzCD which now fails. The same example works with 0.2.0 (which it's now pinned to). The stack trace is

ERROR: MethodError: no method matching TikzPictures.TikzPicture(::SubString{String}; environment="tikzcd", preamble="\\usepackage{tikz-cd}")
Closest candidates are:
  TikzPictures.TikzPicture(::AbstractString; options, preamble, enableWrite18) at ~/.julia/packages/TikzPictures/1hS0x/src/TikzPictures.jl:66 got unsupported keyword argument "environment"
Stacktrace:
  [1] kwerr(::NamedTuple{(:environment, :preamble), Tuple{String, SubString{String}}}, ::Type, ::SubString{String})
    @ Base ./error.jl:163
  [2] TikzCD(data::SubString{String}; preamble::String, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ TikzCDs ~/.julia/packages/TikzCDs/8Sj6O/src/TikzCDs.jl:21
  [3] TikzCD(data::SubString{String})
    @ TikzCDs ~/.julia/packages/TikzCDs/8Sj6O/src/TikzCDs.jl:14

The code I was using is effectively

save(SVG(outpath), TikzCD(content))

for some appropriate outpath and content is something like

\begin{tikzcd}{tcd1}
A \arrow[r, "\phi"] \arrow[d, red]
  & B \arrow[d, "\psi" red] \\
  C \arrow[r, red, "\eta" blue]
  & D
\end{tikzcd}

Support for quiver diagrams

Would it be easy to add support for using q.uiver.app to draw the diagrams and embed the resulting latex export into a TikzCD object? I think we would just have to provide the quiver.sty file and a reference to it in the preamble of the tikzcd object.

The quiver.sty is short

% *** quiver ***
% A package for drawing commutative diagrams exported from https://q.uiver.app.
%
% This package is currently a wrapper around the `tikz-cd` package, importing necessary TikZ
% libraries, and defining a new TikZ style for curves of a fixed height.
%
% Version: 1.2.0
% Authors:
% - varkor (https://github.com/varkor)
% - AndréC (https://tex.stackexchange.com/users/138900/andr%C3%A9c)

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{quiver}[2021/01/11 quiver]

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}

\endinput

Can you just embed that whole string in the preamble of each object?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.