4

I am using the package amscd to make commutative diagrams, with CD environment and I want to know how can I change the size of the result (especially make it bigger).

I try this

\[
\scalebox{1.4}{  
\begin{CD}  
C @>\phi>> C'=\phi(C)\\  
@V\textnormal{Dual}VV\\  
C^{\perp}@>\phi>> C=\phi(C^{\perp})  
\end{CD}  
}  
\]  

And it works, except that i get an error, something like missing $ or extra }, can anyone help me?

4
  • 2
    It would be really great if you could include a minimal working example (MWE).
    – Werner
    Mar 1, 2013 at 6:10
  • Do you want to resize the entire contents? Or just make the structure larger while keeping the same font size?
    – Werner
    Mar 1, 2013 at 6:14
  • Yes, i want to resize the entire content
    – Dimitri
    Mar 1, 2013 at 19:14
  • Is your question answered by one of the posts? If not, please edit your question. If yes, please accept one answer here by clicking the check mark to its left and I will delete my comment here. Thank you.
    – LaRiFaRi
    May 3, 2016 at 11:49

4 Answers 4

5

This is a possibility: define a key-value interface for CD and modify how the vertical arrows are built.

However, using a dedicated package such as xy or the more recent TikZ based tikz-cd is recommended.

\documentclass{article}
\usepackage{amscd,keyval}

\makeatletter
\define@key{modCD}{cols}{\setlength{\minCDarrowwidth}{#1}}
\define@key{modCD}{rows}{\setlength{\modCD@rowsep}{#1}}
\newlength{\modCD@rowsep}

\renewenvironment{CD}[1][]
 {\modCD@rowsep=20\ex@ % default
  \setkeys{modCD}{#1}%
  \CDat
  \bgroup\relax\iffalse{\fi\let\ampersand@&\iffalse}\fi
  \CD@true\vcenter\bgroup\let\\\math@cr\restore@math@cr\default@tag
  \tabskip\z@skip\baselineskip20\ex@
  \lineskip3\ex@\lineskiplimit3\ex@\halign\bgroup
  &\hfill$\m@th##$\hfill\crcr}
 {\crcr\egroup\egroup\egroup}
\atdef@ V#1V#2V{\CD@check{V..V..V}{%
  \llap{$\m@th\vcenter{\hbox{$\scriptstyle#1$}}$}%
  \left\downarrow\vbox to.5\modCD@rowsep{}\right.\kern-\nulldelimiterspace
  \rlap{$\m@th\vcenter{\hbox{$\scriptstyle#2$}}$}&&}}
\atdef@ A#1A#2A{\CD@check{A..A..A}{%
  \llap{$\m@th\vcenter{\hbox{$\scriptstyle#1$}}$}%
  \left\uparrow\vbox to.5\modCD@rowsep{}\right.\kern-\nulldelimiterspace
  \rlap{$\m@th\vcenter{\hbox{$\scriptstyle#2$}}$}&&}}
\makeatother

\begin{document}
\[
\begin{CD}
A @>f>> B \\
@VxVV @AAyA\\
C @>g>> D
\end{CD}
\]
\[
\begin{CD}[rows=30ex,cols=10em]
A @>f>> B \\
@VxVV @AAyA\\
C @>g>> D
\end{CD}
\]
\end{document}

The row separation is approximately what's specified in rows=, while cols= specifies the minimum horizontal arrow width.

enter image description here

2

Sure you can scale it, if a total resize of the diagram is what is desired:

\documentclass{article}
\usepackage{amscd}
\usepackage{scalerel}
\begin{document}
Voila!~~~~~~~$
  \scaleto{%
    \begin{CD}
    A @>f>> B \\
    @VxVV @AAyA\\
    C @>g>> D
  \end{CD}
}{150pt}
$
\end{document}

enter image description here

3
1

It would be easier to switch to tikz-cd. If you do so, you can use any answer from this post. The \makemathbox{} commands are optional. They just give every edge a certain width in order to get the arrows to the same length. As asked by the OP, I scaled the whole image, say, arrows, characters, and linethickness.

% arara: pdflatex

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

\begin{document}     
\[
\begin{tikzcd}[transform canvas={scale=5}]
\mathmakebox[1em][c]{C} \arrow{r}{\phi} \arrow{d}[swap]{\text{Dual}} & \mathmakebox[5em][c]{C^{\prime}=\phi(C)}\\
\mathmakebox[1em][c]{C^\perp} \arrow{r}{\phi}& \mathmakebox[5em][c]{C=\phi(C^{\perp})}
\end{tikzcd}
\]
\end{document}

enter image description here

0

You can't change the size of amscd commutative diagrams internally, except that you can increase the minimum length of a horizontal arrow:

\[\minCDarrowwidth55pt\begin{CD}...\end{CD}\].
1
  • Please complete your answer by a full MWE. Thanks.
    – LaRiFaRi
    May 3, 2016 at 11:49

You must log in to answer this question.

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