[pstricks] Designing the US Flag with PSTricks

Luis Sequeira lfsequeira at gmail.com
Thu Oct 25 12:07:34 CEST 2012


> 
> Dear list,
> 
> is there anybody within the list, who already investigated some time in 
> generating the US Flag with PSTricks in the prescribed dimensions and 
> prescribed colors?
> 
> Any hints or already existing PSTricks solutions are appreciated.
> 
> Best regards,
> 
> J?rgen
> 
> -- 
> J?rgen Gilg
> Austr. 59
> 70376 Stuttgart
> 
> tel   0711 59 27 88
> email gilg at acrotex.net
> 
> 

I found the rules for the design of the flag in wikipedia: http://en.wikipedia.org/wiki/Flag_of_the_United_States

Following those rules it took me about half an hour to produce the following version.

I cannot attest to the exactness of the rules, and I am not an American, but it looks all right to me :-)


Feel free to use it.

Luis Sequeira

%%%% begin complete latex document for the US flag


\documentclass[11pt]{scrartcl}


\usepackage{pst-all,pstricks-add}

\begin{document}

\definecolor{oldgloryred}{rgb}{.698 .132 .203}
\definecolor{oldgloryblue}{rgb}{.234 .233 .403}

\newcommand{\A}{1} % height of the flag
\newcommand{\B}{1.9} % width of the flag
\newcommand{\C}{0.538461538462} % 7/13 - the height of the union; equal to the height of seven stripes
\newcommand{\D}{0.76} % B *2/5 - the width of the union
\newcommand{\K}{0.0616} % diameter of each star
\newcommand{\hK}{0.0308} % radius of each star
\newcommand{\G}{0.0633} % D/12
\newcommand{\twoG}{0.1266} % 2G
\newcommand{\E}{0.0538} % C/10
\newcommand{\twoE}{0.1076} % 2E
\newcommand{\AminusE}{0.9462} % A-E
\newcommand{\AminustwoE}{0.8924} % A-2E


\newcommand{\aStar}{\pspolygon*[linecolor=white](\hK;90)(\hK;234)(\hK;378)(\hK;522)(\hK;666)}
\newcommand{\sixStars}{\multirput(0,0)(\twoG,0){6}{\aStar}}
\newcommand{\fiveStars}{\multirput(0,0)(\twoG,0){5}{\aStar}}

\psset{unit=3cm}
\begin{pspicture}(0,0)(1.9,1)
\SpecialCoor
%The red stripes
%\multirput(0,0)(0,2/13){7}{\psframe*[linecolor=oldgloryred](0,0)(1.9,1/13)}
\multirput(0,0)(0,0.153846153846){7}{\psframe*[linecolor=oldgloryred](0,0)(1.9,0.0769230769231)}
\rput[tl](0,\A){\psframe*[linecolor=oldgloryblue](0,-\C)(\D,0)}
\multirput(\G,\AminusE)(0,-\twoE){5}{\sixStars}
\multirput(\twoG,\AminustwoE)(0,-\twoE){4}{\fiveStars}
\end{pspicture}

\end{document}  
%%%% end complete document




More information about the PSTricks mailing list