Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
1  
It would be really great if you could include a minimal working example (MWE). –  Werner Mar 1 '13 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 '13 at 6:14
    
Yes, i want to resize the entire content –  Dimitri Mar 1 '13 at 19:14

3 Answers 3

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

share|improve this answer

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

share|improve this answer
    
This sounds what i am looking for, but i have a problem, something like: can´t find scalerel.sty file, can you help me? –  Dimitri Mar 1 '13 at 19:33
    
@Dimitri I just uploaded scalerel to ctan the other day, so it may not have propagated to you yet. In the meantime, you can find sty file at tex.stackexchange.com/questions/95047/… –  Steven B. Segletes Mar 1 '13 at 23:28
    
@Dimitri Package can be found also at ctan.org/tex-archive/macros/latex/contrib/scalerel –  Steven B. Segletes Mar 1 '13 at 23:33

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}\].
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.