%===============================================================================
% Source: pst-flags-doc.tex
% Remark: Manual for flags drawn using LaTeX package <pst-flags.sty>
% Author: Amit Manohar Manthanwar
% Mailer: manthanwar@hotmail.com
% WebURL: https://manthanwar.github.io
% GitHub: https://github.com/manthanwar/PST-Flags
% Rights: Copyright (c)2022-2023 Amit Manohar Manthanwar
%-------------------------------------------------------------------------------
% This program can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN archives
% in directory macros/latex/base/lppl.txt or web url
% https://www.latex-project.org/lppl.txt
%===============================================================================
%---------------+---------+----------------------------------------------------
% Revision Log  | Author  | Description
%---------------+---------+----------------------------------------------------
% 14-Dec-2022   | AMM     | Initial Version
%---------------+---------+----------------------------------------------------
% 25-Dec-2022   | AMM     | CTAN Review Updates
%---------------+---------+----------------------------------------------------
% 09-Jan-2023   | AMM     | Removed xcolor
%---------------+---------+----------------------------------------------------
%---------------+---------+----------------------------------------------------
%---------------+---------+----------------------------------------------------
%===============================================================================
\documentclass{amm-pst-doc}
\usepackage{pst-flags}
\title{\vspace*{-10mm}
\texttt{pst-flags}: A PSTricks Package for Drawing Flags of Countries\\[2mm]
\Large{Version 2022/01/09}}
\author{Amit M. Manthanwar}
\date{}

\begin{document}
\maketitle
%\tableofcontents

\section{Introduction}
This document is a reference manual for the \texttt{pst-flags} package. The package and its user manual are available in the CTAN archive \href{https://ctan.org/tex-archive/graphics/pstricks/contrib/pst-flags} {https://ctan.org/tex-archive/graphics/pstricks/contrib/pst-flags}.

\subsection{About \texttt{pst-flags}}
This package provides a number of macros for rendering flags of countries and their associated artefacts drawn using \LaTeX\ PSTricks package. This package further contributes towards a complete implementation of the vector drawing capabilities provided by PSTricks. Formatting of the resulting drawings is entirely controlled by the \TeX\ macros. A good working knowledge of LaTeX should be sufficient to design flags of sovereign countries and adapt them to create new designs. Features such as color or shape customisation and dynamic modifications are possible by cleverly adjusting the options supplied to the \TeX\ macros.

\subsection{License}
Copyright © 2022 Amit M. Manthanwar. Permission is granted to
copy, distribute and/or modify this software under the terms of the LaTeX Project Public License, \href{https://www.latex-project.org/lppl.txt}{LPPL Version 1.3c}.

\subsection{Feedback}
Please use the \texttt{pst-flags} project page on GitHub \href{https://github.com/manthanwar/pst-flags}{https://github.com/manthanwar/pst-flags} to report bugs and submit feature requests. Before making a feature request, please ensure that you have thoroughly studied this manual. If you do not want to report a bug or request a feature but are simply in need of assistance, you might want to consider posting your question on the comp.text.tex newsgroup or  \href{https://tex.stackexchange.com/questions/tagged/pst-flags} {TeX-LaTeX Stack Exchange}.

\subsection{Acknowledgements}
This package would not have been possible without the base \texttt{PSTricks} and its associated packages. The authors would like to acknowledge the valuable contributions made by the main \texttt{PSTricks} authors and by the broader \texttt{PST} community. The colors and construction sheets used to program macros are taken from the websites:   \href{https://www.flagcolorcodes.com/}{flagcolorcodes}, \href{https://en.wikipedia.org/wiki/Wiki}{wikipedia}, and \href{https://www.vexilla-mundi.com}{vexilla-mundi}.

\section{Installation and usage of \texttt{pst-flags}}

\paragraph{Installation:}
As prerequisites for \texttt{pst-flags}, you need working
versions of \LaTeX{} and \texttt{pstricks}. The style file \texttt{pst-flags.sty} and all corresponding \texttt{.tex} and \texttt{.eps} assets must be somewhere
in your \TeX-input path, where \texttt{dvips} can
find it.

\paragraph{Dependencies:} This packages requires expl3, fp, xfp, pstricks and pst-all.

\paragraph{Usage:}
Load the packages \texttt{pstricks} and \texttt{pst-flags}
in that order via the \texttt{usepackage} macro. Now you are ready to use the \texttt{pst-flags} macros within your document body. This macro is described in the next section with all its options. With the help of the following simple \LaTeX-source code, you can test whether you have correctly installed the package:

\begin{verbatim}
\documentclass{article}
\usepackage{pst-flags}
\begin{document}
Flag of US: \rput(0,0){\flagUS[2]}
\end{document}
\end{verbatim}

\section{Sovereign State Flags}
Flags come in many different height-to-width aspect ratios (AR). The flags of India \verb|\flagIN| and UK \verb|\flagUK| use the aspect ratios of 2:3 and 1:2 respectively. These are the most common aspect ratios used by over 80 and 50 countries respectively. The accuracy of colors, shapes, internal objects, and aspect ratio make the flag of a sovereign state unique. Width is the only option needed to draw the flag with macro appended with a two-letter country code which internally determines the corresponding height. To draw a flag with a specific height, use the aspect ratio from the table below to calculate the appropriate width and supply it in centimeters as the first argument of the macro in rectangular brackets. \texttt{PSTricks} macro \verb|\rput| and environment \verb|pspicture| can also be used and encouraged for accurate placement of the flags.

\paragraph{Example:} To draw \SI{1}{\centi\meter} wide flags use macros: \verb|\flagIN[1]|\; \flagIN[1]\ \hspace{10mm} \verb|\rput(0.1,0){\flagUK[1]}| \rput(0.1,0){\flagUK[1]}

\paragraph{Colors:} are defined using country code appended with standard flag color name \texttt{ukRed}, \texttt{inGreen}, \texttt{usBlue}, \texttt{deYellow}, etc. Usage: \verb|\usepackage{pst-flags-colors-html}| \verb|\pscircle[linecolor=usRed](0,0){2}|

\vspace{5mm}
\begin{table}[!ht]
    %\ttfamily
    \centering%
    \setlength{\tabcolsep}{1.5mm}%
    \scriptsize%
    \noindent\resizebox{\textwidth}{!}{%
        \begin{tabular}{@{}ccc@{}}
            \begin{tabular}{@{}lcr}
                \textbf{Country}               & \textbf{Code} & \textbf{AR} \\
                Albania                        & AL            & 5:7         \\
                Algeria                        & DZ            & 2:3         \\
                American Samoa (US)            & AS            & 1:19        \\
                Andorra                        & AD            & 7:1         \\
                Angola                         & AO            & 2:3         \\
                Anguilla (UK)                  & AI            & 1:2         \\
                Antigua and Barbuda            & AG            & 2:3         \\
                Argentina                      & AR            & 5:8         \\
                Armenia                        & AM            & 1:2         \\
                Aruba (Netherlands)            & AW            & 2:3         \\
                Australia                      & AU            & 1:2         \\
                Austria                        & AT            & 2:3         \\
                Azerbaijan                     & AZ            & 1:2         \\
                Bahamas                        & BS            & 1:2         \\
                Bahrain                        & BH            & 3:5         \\
                Bangladesh                     & BD            & 3:5         \\
                Barbados                       & BB            & 2:3         \\
                Belarus                        & BY            & 1:2         \\
                Belgium                        & BE            & 13:15       \\
                Belize                         & BZ            & 3:5         \\
                Benin                          & BJ            & 2:3         \\
                Bermuda (UK)                   & BM            & 1:2         \\
                Bhutan                         & BT            & 2:3         \\
                Bolivia                        & BO            & 15:22       \\
                Bosnia and Herzegovina         & BA            & 1:2         \\
                Botswana                       & BW            & 2:3         \\
                Brazil                         & BR            & 7:1         \\
                British Indian Ocean Territory & IO            & 1:2         \\
                British Virgin Islands         & VG            & 1:2         \\
                Brunei Darussalam              & BN            & 1:2         \\
                Bulgaria                       & BG            & 3:5         \\
                Burkina Faso                   & BF            & 2:3         \\
                Burundi                        & BI            & 3:5         \\
                Cambodia                       & KH            & 16:25       \\
                Cameroon                       & CM            & 2:3         \\
                Canada                         & CA            & 1:2         \\
                Cayman Islands (UK)            & KY            & 1:2         \\
                Central African Republic       & CF            & 2:3         \\
                Chad                           & TD            & 2:3         \\
                Chile                          & CL            & 2:3         \\
                China                          & CN            & 2:3         \\
                Christmas Island (AU)          & CX            & 1:2         \\
                Cocos (Keeling) Islands (AU)   & CC            & 1:2         \\
                Colombia                       & CO            & 2:3         \\
                Comoros                        & KM            & 3:5         \\
                Congo, (Brazzaville) Republic  & CG            & 3:4         \\
                Congo, (Kinshasa) Democratic   & CD            & 2:3         \\
                Cook Islands (New Zealand)     & CK            & 1:2         \\
                Costa Rica                     & CR            & 3:5         \\
                Croatia                        & HR            & 1:2         \\
                Cuba                           & CU            & 1:2         \\
                Cyprus                         & CY            & 2:3         \\
                Czech Republic                 & CZ            & 2:3         \\
                Denmark                        & DK            & 28:37       \\
                Djibouti                       & DJ            & 2:3         \\
                Dominica                       & DM            & 1:2         \\
                Dominican Republic             & DO            & 5:8         \\
                Ecuador                        & EC            & 2:3         \\
                Egypt                          & EG            & 2:3         \\
                El Salvador                    & SV            & 189:335     \\
                Equatorial Guinea              & GQ            & 2:3         \\
                Eritrea                        & ER            & 1:2
            \end{tabular}
             & %
            \begin{tabular}{lcr}
                \textbf{Country} & \textbf{Code} & \textbf{AR} \\
                Estonia          & EE            & 7:11        \\
                Ethiopia         & ET            & 1:2         \\
                Fiji             & FJ            & 1:2         \\
                Finland          & FI            & 11:18       \\
                France           & FR            & 2:3         \\
                Gabon            & GA            & 3:4         \\
                Gambia           & GM            & 2:3         \\
                Georgia          & GE            & 2:3         \\
                Germany          & DE            & 3:5         \\
                Ghana            & GH            & 2:3         \\
                Greece           & GR            & 2:3         \\
                Guinea           & GN            & 2:3         \\
                Guyana           & GY            & 3:5         \\
                Hong Kong (CN)   & HK            & 2:3         \\
                Hungary          & HU            & 1:2         \\
                Iceland          & IS            & 18:25       \\
                India            & IN            & 2:3         \\
                Indonesia        & ID            & 2:3         \\
                Iran             & IR            & 4:7         \\
                Iraq             & IQ            & 2:3         \\
                Ireland          & IE            & 1:2         \\
                Israel           & IL            & 8:11        \\
                Italy            & IT            & 2:3         \\
                Jamaica          & JM            & 1:2         \\
                Japan            & JP            & 2:3         \\
                Jordan           & JO            & 1:2         \\
                Kazakhstan       & KZ            & 1:2         \\
                Kenya            & KE            & 2:3         \\
                Korea, North     & KP            & 1:2         \\
                Korea, South     & KR            & 2:3         \\
                Kuwait           & KW            & 1:2         \\
                Kyrgyzstan       & KG            & 3:5         \\
                Latvia           & LV            & 1:2         \\
                Lebanon          & LB            & 2:3         \\
                Lesotho          & LS            & 2:3         \\
                Liberia          & LR            & 1:19        \\
                Libya            & LY            & 1:2         \\
                Liechtenstein    & LI            & 3:5         \\
                Lithuania        & LT            & 3:5         \\
                Luxembourg       & LU            & 3:5         \\
                Macedonia, North & MK            & 1:2         \\
                Madagascar       & MG            & 2:3         \\
                Malawi           & MW            & 2:3         \\
                Malaysia         & MY            & 1:2         \\
                Maldives         & MV            & 2:3         \\
                Mali             & ML            & 2:3         \\
                Malta            & MT            & 2:3         \\
                Mauritania       & MR            & 2:3         \\
                Mauritius        & MU            & 2:3         \\
                Mexico           & MX            & 4:7         \\
                Moldova          & MD            & 1:2         \\
                Monaco           & MC            & 4:5         \\
                Mongolia         & MN            & 1:2         \\
                Montenegro       & ME            & 1:2         \\
                Morocco          & MA            & 2:3         \\
                Mozambique       & MZ            & 2:3         \\
                Myanmar          & MM            & 2:3         \\
                Namibia          & NA            & 2:3         \\
                Nauru            & NR            & 1:2         \\
                Nepal            & NP            & 5:41        \\
                Netherlands      & NL            & 2:3         \\
                New Zealand      & NZ            & 1:2
            \end{tabular}
             & %
            \begin{tabular}{lcr@{}}
                \textbf{Country}         & \textbf{Code} & \textbf{AR} \\
                Nicaragua                & NI            & 3:5         \\
                Niger                    & NE            & 6:7         \\
                Nigeria                  & NG            & 1:2         \\
                Norway                   & NO            & 8:11        \\
                Oman                     & OM            & 1:2         \\
                Pakistan                 & PK            & 2:3         \\
                Palau                    & PW            & 5:8         \\
                Palestinian Territory    & PS            & 1:2         \\
                Panama                   & PA            & 2:3         \\
                Papua New Guinea         & PG            & 3:4         \\
                Paraguay                 & PY            & 11:2        \\
                Peru                     & PE            & 2:3         \\
                Philippines              & PH            & 1:2         \\
                Poland                   & PL            & 5:8         \\
                Portugal                 & PT            & 2:3         \\
                Puerto Rico (US)         & PR            & 2:3         \\
                Qatar                    & QA            & 11:28       \\
                Romania                  & RO            & 2:3         \\
                Russian Federation       & RU            & 2:3         \\
                Rwanda                   & RW            & 2:3         \\
                Saint Kitts and Nevis    & KN            & 2:3         \\
                Saudi Arabia             & SA            & 2:3         \\
                Senegal                  & SN            & 2:3         \\
                Serbia                   & RS            & 2:3         \\
                Seychelles               & SC            & 1:2         \\
                Sierra Leone             & SL            & 2:3         \\
                Singapore                & SG            & 2:3         \\
                Slovakia                 & SK            & 2:3         \\
                Slovenia                 & SI            & 1:2         \\
                Solomon Islands          & SB            & 1:2         \\
                Somalia                  & SO            & 2:3         \\
                South Africa             & ZA            & 2:3         \\
                South Sudan              & SS            & 1:2         \\
                Spain                    & ES            & 2:3         \\
                Sri Lanka                & LK            & 1:2         \\
                Sudan                    & SD            & 1:2         \\
                Suriname                 & SR            & 2:3         \\
                Sweden                   & SE            & 5:8         \\
                Switzerland              & CH            & 1:1         \\
                Syria                    & SY            & 2:3         \\
                Taiwan                   & TW            & 2:3         \\
                Tajikistan               & TJ            & 1:2         \\
                Tanzania                 & TZ            & 2:3         \\
                Thailand                 & TH            & 2:3         \\
                Timor-Leste              & TL            & 1:2         \\
                Togo                     & TG            & 1:$\phi$    \\
                Tonga                    & TO            & 1:2         \\
                Trinidad and Tobago      & TT            & 3:5         \\
                Tunisia                  & TN            & 2:3         \\
                Turkey                   & TR            & 2:3         \\
                Uganda                   & UG            & 2:3         \\
                Ukraine                  & UA            & 2:3         \\
                United Arab Emirates     & AE            & 1:2         \\
                United Kingdom           & GB            & 1:2         \\
                United States of America & US            & 1:19        \\
                Uruguay                  & UY            & 2:3         \\
                Uzbekistan               & UZ            & 1:2         \\
                Venezuela                & VE            & 2:3         \\
                Viet Nam                 & VN            & 2:3         \\
                Yemen                    & YE            & 2:3         \\
                Zambia                   & ZM            & 2:3         \\
                Zimbabwe                 & ZW            & 1:2
            \end{tabular}
            %
        \end{tabular}
    }%
\end{table}

\clearpage
\input{pst-flags-examples.tex}

\end{document}
