As mentionned in Martin's comment, the trick is to draw the line twice. One of the constraints on paths in Tikz/PGF is that the color is global to the path.
Other than drawing a solid line covered by a dashed line, you may draw two dashed lines, with spaces between the dashes, as given by the following example (you can find more information in the Tikz manual) :
\begin{tikzpicture}
\draw[blue,dash pattern= on 3pt off 5pt] (0,0) |- (1,1) to[out=0,in=90] (2,0);
\draw[red,dash pattern= on 3pt off 5pt,dash phase=4pt] (0,0) |- (1,1) to[out=0,in=90] (2,0);
\end{tikzpicture}
The outcome is
(Following a comment by Caramdir) : The same result can be achieved with a postaction, and the path only has to be specified once :
\draw[postaction={draw,red,dash pattern= on 3pt off 5pt,dash phase=4pt,thick}]
[blue,dash pattern= on 3pt off 5pt,thick] (0,0) |- (1,1) to[out=0,in=90] (2,0);
(Following a request for a rectangle) * I'm not sure this answers the question in the comment *
For a rectangle you would type in the command
\draw[postaction={draw,red,dash pattern= on 3pt off 5pt,dash phase=4pt,thick}]
[blue,dash pattern= on 3pt off 5pt,thick] (0,0) rectangle (3,2);
This rectangle does not have rounded corners, it is a "normal" rectangle. If ever you do want rounded corners, add rounded corners
to the options :
\draw[postaction={draw,red,dash pattern= on 3pt off 5pt,dash phase=4pt,thick,rounded corners}]
[blue,dash pattern= on 3pt off 5pt,thick,rounded corners] (0,0) rectangle (3,2);
amsart
doesn't really have a separate title page, but you can create one
according to the style you need. a few patches are needed, but this example
should get you started.
i've assumed that, in addition to the separate title page, you do want the
title and author "as usual" on the first page of the body.
\documentclass[titlepage]{amsart}
\usepackage{etoolbox}
\renewenvironment{titlepage}{%
\thispagestyle{empty}\setcounter{page}{0}
\centering
\vspace*{\fill}
}{%
\vspace{3\baselineskip}
\vspace*{\fill}
\newpage
}
\makeatletter
\patchcmd{\@maketitle}
{\if@titlepage \newpage \else}
{\if@titlepage
\vspace{\baselineskip}
\else}
{}{}
\makeatother
\begin{document}
\begin{titlepage}
{\Large The Title\par}
\vspace{2\baselineskip}
The Author\par
\vspace{2\baselineskip}
\today
\end{titlepage}
\title{The Title}
\author{The Author}
\begin{abstract}
The abstract. Make it longer so that it fills more than one line.
\end{abstract}
\maketitle
some text
\end{document}
without the patch to omit the \newpage
from \maketitle
, there will be a
page break (not wanted!) after the abstract. also, for an unknown reason, the usual space between abstract and body text is suppressed, so i've
inserted a blank line. this shouldn't have to happen; i'll add a note about
these adjustments to things that should be looked into when amsart
is
overhauled (someday).
re centering material vertically on a page, it always looks out of balance
to me, so i've added a few extra blank lines on the title page before the
final \vspace
; you can omit it (or change its height) as you wish.
for some reason that i can't
Best Answer
You don't have to do everything with
tikz
. In fact, it is not advisable. Draw the shaded region withtikz
and type every thing else usingtitlepage
environment. This way you get more control.