6
$\begingroup$

I've been struggling to draw the following triangular diagram:

enter image description here

Can I do it in SE or should I forget about it?

Ideally the line for $f'$ should be dashed.

$\endgroup$
1

2 Answers 2

5
$\begingroup$

Here is a MathJax version that works, though it is certainly a hack, and only works well with the MathJax TeX fonts, not the STIX fonts, so some people might see a less satisfactory version.

$$\require{AMScd}
\def\diaguparrow#1{\smash{\raise.6em\rlap{\scriptstyle #1}
   \lower.3em{\mathord{\diagup}}\raise.52em{\!\mathord{\nearrow}}}}
\begin{CD}
&& X'\\
& \diaguparrow{f'} @VVpV \\
Y @>>f> X
\end{CD}$$

which displays as

$$ \require{AMScd} \def\diaguparrow#1{\smash{\raise.6em\rlap{\scriptstyle #1} \lower.3em{\mathord{\diagup}}\raise.512em{\!\mathord{\nearrow}}}} \begin{CD} && X'\\ & \diaguparrow{f'} @VVpV \\ Y @>>f> X \end{CD} $$

Alternatively, you could use

$$\require{AMScd}
\require{cancel}
\def\diaguparrow#1{\smash{\raise.6em\rlap{\ \ \scriptstyle #1}
   \lower.6em{\cancelto{}{\Space{2em}{1.7em}{0px}}}}}
\begin{CD}
&& X'\\
& \diaguparrow{f'} @VVpV \\
Y @>>f> X
\end{CD}$$

which produces

$$ \require{AMScd} \require{cancel} \def\diaguparrow#1{\smash{\raise.6em\rlap{\ \ \scriptstyle #1} \lower.6em{\cancelto{}{\Space{2em}{1.7em}{0px}}}}} \begin{CD} && X'\\ & \diaguparrow{f'} @VVpV \\ Y @>>f> X \end{CD} $$

One could probably adjust the size of the \Space command and the \ \ to improve the result, but I just put this together as an example.

$\endgroup$
7
  • $\begingroup$ copy pasting your second code in SE gives "Unknown environment 'CD'" . This is expected? $\endgroup$ Dec 18, 2017 at 16:23
  • 1
    $\begingroup$ Did you enclose the example code in math delimiters, like $$? I have added them to the code examples above, but originally only listed the TeX code. $\endgroup$ Dec 18, 2017 at 19:54
  • $\begingroup$ There was a recent question on MathOverflow Meta where a user eventually used your diagram but then they also asked whether the diagonal arrow can be made dotted. $\endgroup$ Jan 17, 2019 at 1:38
  • 1
    $\begingroup$ @MartinSleziak, yes, I saw that, and your response. I don't have a good solution for dotted or dashed arrows. The diagonal one I did was just a hack, and I don't see a reasonable way to do it with dashes or dots. $\endgroup$ Jan 17, 2019 at 1:42
  • $\begingroup$ Thanks for the response. (I have added a comment directing the OP to what you said here.) $\endgroup$ Jan 17, 2019 at 1:55
  • $\begingroup$ Which command controls the arrow pointing to the upper right? What if I want an arrow pointing to lower right? $\endgroup$
    – AG learner
    Mar 4, 2020 at 22:16
  • $\begingroup$ @AGlearner, the \cancelto{} command is what creates the arrow here. Unfortunately, there is not a corresponding one for a downward arrow. $\endgroup$ Mar 5, 2020 at 17:22
2
$\begingroup$

As suggested in this answer, one option is to use presheaf and include the image. On this website you can use xypic syntax. (Of course, you can do the same if you have LaTeX - including xy package - on your computer and can convert the result to a picture. Either solution - doing it online and doing it locally - has some advantages and some disadvantages.)

&X' \ar[d]^p\\
Y \ar[ru]^{f'} \ar[r]_f& X

http://presheaf.com/?d=d2bz1i6f6m4w2s3r5e4w6x44443f1h3l

diagram

Ideally the line for $f′$ should be dashed.

This is obtained in xypic by modifier @{-->}

&X' \ar[d]^p\\
Y \ar@{-->}[ru]^{f'} \ar[r]_f& X

http://presheaf.com/?d=d68725l1w6m5r4k6l3s3j45y1i6x6y57

diagram

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .