4

I have the diagram of the following form:

\begindc
\obj(1,1){$A$}
\obj(3,1){$B$}
\obj(3,3){$C$}
\mor(1,1)(3,1) {$f$ }[\atright,\solidarrow]
\mor(1,1)(3,3) {$g$ }
\mor(3,1)(3,3) {$h$ }[\atright,\solidarrow]
\enddc

I wonder if the "objects" A,B,C must be in normal math font only, i.e. we can't replace such A with \mathsf{A} or \mathfrak{A} or \mathbf{A}. If this is really a restriction, is there any other package that allows special math fonts as "objects"?

LaRiFaRi
  • 43,807
Pachara
  • 41

2 Answers2

2

You can use

\obj(1,1)[A]{$\mathsf{A}$}

so that the optional argument sets the node name. However, there are more modern and powerful packages than dcpic for any sort of commutative diagram. I've used XY-pic (\usepackage[all,cmtip]{xypic}), but the more recent tikz-cd seems very promising and easy to use.

egreg
  • 1,121,712
1

As proposed by egreg, a more modern package would much easier for such things. The currently best package to learn should be tikz-cd (my recommendation). Here is your diagram using this.

% arara: pdflatex

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsfonts}

\begin{document}
\begin{tikzcd}
                                                                       & C \\
    A\mathsf{A}\mathfrak{A}\mathbf{A} \arrow{r}[swap]{f} \arrow{ur}{g} & B \arrow{u}[swap]{h}   
\end{tikzcd}
\end{document}

enter image description here


In the new version (5.1) of DCpic, this got fixed. You can now write:

% arara: pdflatex

\documentclass{article}
\usepackage{pictexwd,dcpic}
\usepackage{amsfonts}

\begin{document}
\begindc{\commdiag}[500]
\obj(1,1){$A\mathsf{A}\mathfrak{A}\mathbf{A}$}
\obj(3,1){$A\mathsf{B}\mathfrak{B}\mathbf{B}$}
\obj(3,3){$A\mathsf{C}\mathfrak{C}\mathbf{C}$}
\mor(1,1)(3,1)[200,200]{$f$ }[\atright,\solidarrow]
\mor(1,1)(3,3) {$g$ }
\mor(3,1)(3,3) {$h$ }[\atright,\solidarrow]
\enddc
\end{document}

Until it gets uploaded to CTAN, you may need to add this patch to your preamble:

\makeatletter
    \@namedef{!coloca}#1#2{\protected@edef\pilha{#1.#2}}
\makeatother

as proposed by egreg.

enter image description here

LaRiFaRi
  • 43,807