Hot answers tagged

33

For simple and complex diagrams, I'd recommend tikz-cd. If you are not comfortable with using the macros, there is also a web-based GUI editor at https://tikzcd.yichuanshen.de/. The following example can be viewed in the editor under this link (click). Let's see an easy triangular diagram. \documentclass{article} \usepackage{tikz-cd} \begin{document} \[ ...


24

Instead of using the fragile option to beamer's frame (which might cause other things to malfunction), it is safer to use the ampersand replacement option of tikzcd. See also Problems with Beamer and diagrams in Tikz and the section “Issues with active ampersand­­” in the tikz-cd manual. \documentclass{beamer} \usepackage{tikz-cd} \begin{document} \begin{...


23

You can lengthen the arrows with the parameters row sep and column sep which define the distance between two nodes/cells in your diagram. Here a quote from the excellent documentation: In your case, large or huge would do the trick if you want to stick to predefined values (nice for consistency): % arara: pdflatex \documentclass{article} \usepackage{...


20

The right way with tikz-cd is to use a "phantom" arrow as in \arrow[dr, phantom, "\square"] MWE (I've used some code to reproduce the picture and not yours): \documentclass{article} \usepackage{amssymb} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} X'' \arrow[r, "g'"] \arrow[d] & X' \arrow[r, "g"] \arrow[d] \arrow[dr, phantom, "\square"] &...


19

The package documentation contains examples of most of this. Section 1.1 gives examples for placing of labels, Section 2 provides ways to adjust the appearence of the diagram and control spacing. However, the package documentation is easiest to understand in conjunction with the manual for tikz and its underlying language pgf: see http://www.ctan.org/pkg/...


17

It's a known problem with TikZ matrices: \documentclass{article} \usepackage{tikz-cd} \newcommand{\myarrow}{% $\begin{tikzcd}[ampersand replacement=\&] A \ar{r} \& B \end{tikzcd}$} \begin{document} \myarrow \end{document} The problem is that tikzpicture wants to do some juggling with the meaning of &, but it's impossible if the & has been ...


17

Yes, it's possible: The code: \documentclass{article} \usepackage{tikz-cd} \definecolor{cof}{RGB}{219,144,71} \definecolor{pur}{RGB}{186,146,162} \definecolor{greeo}{RGB}{91,173,69} \definecolor{greet}{RGB}{52,111,72} \begin{document} \begin{tikzcd}[execute at end picture={ \foreach \Valor/\Nombre in {% tikz@f@1-2-1/a,tikz@f@1-1-2/b,tikz@f@1-1-4/c,...


16

You can add the overlay option to those problematic arrows, so they don't affect the bounding box calculation. I did it in this MWE, now the diagram is centered: \documentclass{article} \usepackage{tikz-cd} \usepackage{amsmath} \DeclareMathOperator{\Tor}{Tor} \begin{document} \begin{tikzcd} \cdots \rar & \Tor_3^A(A, M) \rar & \Tor_3^A(K,M) \rar &...


16

You've got a start, which is good - but I would recommend just the TikZ package, mostly because I think it's easier to understand the code and adjust it as necessary. I went that route, so feel free to disregard this if you would like to stick to tikz-cd. Here's my code: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \...


16

Two solutions, one with “standard” tools, one with tikz-cd and code by LaRiFaRi. \documentclass{article} \usepackage{amsmath,amssymb} % for both solutions \usepackage{graphicx} % for the first solution \usepackage{tikz-cd} % for the second solution % for the first solution \newcommand{\overiso}[2]{% \overset{\substack{\textstyle #1\\[0.5ex]\rotcong\\[0....


14

As I have just learned from Symbol 1, you may modify each column or row separator manually. Just do like the following: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} S_E \arrow[dddd, bend right, two heads] \arrow[ddrrr, bend left, two heads, tail] &[-25pt] & &[-25pt] \\[-15pt] & E \...


13

This solution does not allow you to externalise diagrams produced using the tikzcd environment but it does allow you to externalise other tikz pictures in your document. It is based on a workaround mentioned in the tikz manual in section 50.8.2 (pages 627-8). To make its use more convenient, etoolbox is used to patch the tikzcd environment. Essentially, this ...


13

Update This feature is mentioned in the TikZ manual, namely III.20.3.2. \begin{tikzcd}[column sep={1cm,between origins}] \mathcal{C}\ar{rr}\ar{dr} && S(\tau,..............)\ar{dl} \\ & \mathsf{Set} \end{tikzcd} Old Answer The column-separating symbol & accepts an optional argument. Just like \\[6pt] does, &[6] adds the current ...


11

Like this? Although I must confess I don't have yet the general solution, for this particular case the effect was achieved by drawing the arrow from TN to TM instead of TM to TN. This way the arrow was drawn after the horizontal one. And of course I used leftarrow to get the arrowtip right. \documentclass{article} \usepackage{tikz-cd} \begin{document} \[ \...


11

The problem is the same as that in Problem with environment expansion and the Tikz external library. in that TeX does not see the \end{tikzpicture} inside the \end{tikzcd}. The solution in Problem with environment expansion and the Tikz external library. is to pack everything inside a macro to ensure that the customised end-of-environment is expanded before ...


11

above image exploit option looseness from TikZ: \documentclass[border=3mm, preview ]{standalone} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd} A & \\ BBBBBBBBB \ar{u} & \\ C \ar{u}\ar[uu,"f^*",bend right=90,looseness=2,swap] & \end{tikzcd} \] \end{document}


11

Same principle really. See the diagram as a 4×3 matrix. In the first row you have KF' in the second column, nothing in the first and third col. In the second row you have K and F' in the first and third column, respectively. In rows three and four, you have K\cup F' and F in the second column, and nothing in the first and third column. There will be several ...


11

You need three columns. But also to vertically align \pi and \pi'. With \setheight{x}{y} we typeset x, but as if its vertical dimensions were those of y. \documentclass{article} \usepackage{amsmath} \usepackage{tikz-cd} \newcommand{\setheight}[2]{\smash{#1}\vphantom{#2}} \begin{document} \begin{tikzcd}[column sep=small] E \arrow[rd, "\pi"'] \arrow[rr, "...


11

A solution with stackengine: \documentclass{article} \usepackage{amsmath, amssymb, graphicx} \usepackage[usestackEOL]{stackengine} \begin{document} \[ \stackMath \dotsm \xrightarrow{\enspace\cong\enspace} \Shortstack{\mathbb{Z} \\ \rotatebox[origin=c]{90}{$\cong$} \\ C_3(*)} \xrightarrow{\enspace 0\enspace} \Shortstack{\mathbb{Z} \\ \rotatebox[origin=c]{...


10

The functionality of the top answer can be obtained directly using tikzcd by placing the following command at the end of the diagram: \arrow[from=2-2, to=4-2, pos=0.75, crossing over, "T f"'] So the complete example would be: \documentclass{article} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd}[ampersand replacement=\&,column sep=small] GM ...


10

Section 1.2 of tikz-cd documentation details this; in particular, it sounds like you might want dash % arara: pdflatex \documentclass{standalone} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} A \arrow[dash]{r} & B \end{tikzcd} \end{document} Following the comments, you can apply dash to every arrow for the current environment using \begin{...


10

The reason for this is that the curved arrows define helper coordinates that are placed far outside the drawn parts of the diagram, so the diagram contains a lot of whitespace, and its width is actually wider than the width of the text block. Look in the log and you'll see a warning about an Overfull \hbox (72.53682pt too wide). To visualize this, add the ...


10

The name is already set and can be retrived from the macro \tikzcdmatrixname. To further draw over your tikzcd matrix use execute at end picture. \documentclass{article} \usepackage{tikz} \usetikzlibrary{cd} \begin{document} \begin{tikzcd}[execute at end picture={ \filldraw[red] (\tikzcdmatrixname-1-1) circle[radius=1pt]; \filldraw[blue] (\...


10

with slightly different code syntax as is in nice Sebastiano answer:-) \documentclass[border=3mm]{standalone} \usepackage{tikz-cd} \begin{document} %---------------------------------------------------------------% \begin{tikzcd}[column sep=large, row sep=large] L \arrow{r}{\varepsilon} \arrow[swap]{d}{\forall\delta} & U(L) ...


10

How about you set a customized dashing pattern that skips the part where the text occurs, like so: \documentclass{article} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd} X \ar[r] & A &\\ & C\times D\times F &\\ & &\\ & &\\ & &\\ & & B \ar[luuuuu,...


10

I'm not sure I've interpreted all symbols correctly but I believe this comes more or less close to the intended output \documentclass{article} \usepackage{amsmath,amssymb,graphicx} \begin{document} \[ \ldots \xrightarrow[\quad]{\cong} \begin{array}[b]{c}\mathbb{Z} \\ \rotatebox[origin=c]{90}{$\cong$} \\ C_3(*) \end{array} \xrightarrow[\quad]{0} \begin{...


10

A solution using TikZ (with manual placements): \documentclass[border=3.14,tikz]{standalone} \usetikzlibrary{positioning} \usepackage{amssymb} \begin{document} \begin{tikzpicture} \node at (0,0) (d) {\ldots}; \node[right=of d] (c3) {$C_3(*)$}; \node[right=of c3] (c2) {$C_2(*)$}; \node[right=of c2] (c1) {$C_1(*)$}; \node[right=of c1] (c0) {$C_0(*...


Only top voted, non community-wiki answers of a minimum length are eligible