diff options
Diffstat (limited to 'graphics/pgf/contrib/worldflags/doc/worldflags.tex')
-rw-r--r-- | graphics/pgf/contrib/worldflags/doc/worldflags.tex | 224 |
1 files changed, 192 insertions, 32 deletions
diff --git a/graphics/pgf/contrib/worldflags/doc/worldflags.tex b/graphics/pgf/contrib/worldflags/doc/worldflags.tex index e80d633df4..6209b6a41b 100644 --- a/graphics/pgf/contrib/worldflags/doc/worldflags.tex +++ b/graphics/pgf/contrib/worldflags/doc/worldflags.tex @@ -1,7 +1,7 @@ % ============================================================================= -% Flags of the world with TikZ Wilhelm Haager, 2021-04-30 +% Flags of the world with TikZ Wilhelm Haager, 2021-05-12 % ============================================================================= -\documentclass[11pt,a4paper,headsepline]{scrreprt} +\documentclass[11pt,a4paper,headsepline,fleqn]{scrreprt} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[american]{babel} @@ -55,15 +55,25 @@ \parskip\bigskipamount \parindent0pt + + +% Befehle zur tabellarischen Flaggendarstellung: +% ---------------------------------------------- \newcount\zaehler\zaehler0 +\newcount\flaggenproz\flaggenproz4 +\newdimen\spaltenbreite\spaltenbreite\textwidth +\divide\spaltenbreite by\flaggenproz + \def\show#1#2{% - \advance\zaehler by 1 - \parbox{0.23\textwidth}{% +\spaltenbreite\textwidth\divide\spaltenbreite by\flaggenproz + \advance\zaehler by 1% + \parbox{\spaltenbreite}{% \centering - \worldflag{#2}\\ - {\small #1\\[-\smallskipamount](#2)}} - \ifnum\zaehler=4\zaehler=0\par\fi + \makebox[0pt]{\worldflag{#2}}{\small \ifx.#1.\else\\#1\fi\ifx.#2.\else + \\(#2)\fi}}% + \ifnum\zaehler=\flaggenproz\zaehler0\par\fi } +\def\flaggenprozeile#1{\flaggenproz#1\zaehler0} % ------------------------------------------------------------------------ % Frames @@ -112,7 +122,7 @@ \author{\slshape Wilhelm Haager\\\slshape wilhelm.haager@htlstp.ac.at} \vfill \vfill -\date{2021-04-30} +\date{2021-05-12} \vfill \maketitle @@ -454,7 +464,8 @@ The following example illustrates the usage of the special coordinates: \codebox{0.63}{% \tb begin{tikzpicture}[draw=cyan,>=stealth,x=1mm,y=1mm]\\ \tb pic (de) [country=DE,emblem] \{worldflag\};\\ - \tb draw (de-e){-}-++(45:5) node [above right,cyan] \{fly\};\\ + \tb draw (de-e){-}-++(45:5)\\ + \xx6 node [above right,cyan] \{fly\};\\ \tb draw (de-w)--++(45:14)\\\mbox{}~~~~~~node [above right,cyan] \{hoist\};\\ \tb draw (de-0)--++(45:14)\\\mbox{}~~~~~~node [above right,cyan] \{coat of arms\};\\ \tb draw (de-nw)--++(-5,0) (de-sw)--++(-5,0);\\ @@ -589,7 +600,7 @@ Every flag description file has the following structure: \xx9\makebox[0pt]{$\vdots$}\\ \xx9{\makebox[0pt]{\normalsize\color{black}\ding{194}}}\\ \xx9\makebox[0pt]{$\vdots$}\\ -\tt{\tb framecode}~~~{\normalsize\color{black}\ding{195}}\\ +\tt{\tb framecode\{}\ti{code}\tt{\}}~~~{\normalsize\color{black}\ding{195}}\\ \tt{\tb end\{flagdescription\}}~~~{\normalsize\color{black}\ding{196}}\\ } @@ -612,6 +623,10 @@ The outer scope sets the drawing unit to \command{\tb flagwidth} and performs the coordinate transformation according to the options \command{turn} and \command{hang}. The inner scope shifts the coordinate system to the flag center. +That shift is only for rotation and positioning of the flag within a +TikZ-picture. +For the flag description the origin of the coordinate system remains on the +lower left corner of the flag. In the sequel, the special coordinates \command{-0}, \command{-n}, \command{-ne}, \command{-e}, \command{-se}, @@ -629,13 +644,15 @@ A couple of macros (see section \ref{SEC_MACROS}) for common geometric figures facilitate the creation of the flag image. \item[\ding{195}] -This command draws a rectangular frame around the flag. +\emph{\color{emphcolor}code} is the drawing path for te frame around the flag. +In (the most common) case of a rectangular shape of the flag +(an exception is e.\,g. the flag of Nepal) \ti{code} can be left empty; +a rectangular frame is drawn automatically in that case. + The line width, set with the option \command{framewidth}, is stored in the dimension register \command{\tb flagframe}; the frame color, set with the option \command{framecolor}, is stored in the macro \command{\tb framecolor}. -For non-rectangular flags (e.\,g. Nepal) the flag frame has to be programmed -``manually''. \item[\ding{196}] At the end of the environment a millimeter-grid is drawn onto the flag, if invoked with the option @@ -684,8 +701,69 @@ in the flag description. \command{\tb stretchfactor} is a factor for stretching certain \ti{x}-coordinates, when the whole flag is stretched (or compressed), i.\,e. when the aspect ratio differs from its proper value. -It is calculated from the user option \command{stretch} and can be used in -the flag description. +It is calculated from the user option \command{stretch} +(stored in the macro \command{\tb flagstretch}) +as follows and can be used in the flag description: +\[ +f_s = 1 + \frac{l-l_0}{l_0}\cdot s, \quad +\parbox[t]{0.7\textwidth}{% +with\quad +\begin{tabular}[t]{@{}l@{~\dots~}l} +$f_s$ & the variable \tt{\tb stretchfactor} \\ +$l_0$ & proper aspect ratio of the flag \\ +$l$ & actual aspect ratio of the flag \\ +$s$ & value of the user specified option \tt{stretch} \\ +\end{tabular}} +\] + +In the following example the yellow diamonds keep their +\emph{distances} to the +borders of the flag (hoist and fly, respectively), when the flag is stretched +or compressed, +the white diamonds keep their \emph{relative positions} on the flag +in that case. + +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\codebox{0.70}{% + \tb def\tb diamond\#1\#2\{\tb begin\{scope\}[shift=\{\#2\}] \\ + \xx4\tb fill [\#1] (3/20,0)--(0,4/20)--(-3/20,0)--(0,-4/20); \\ + \xx4\tb end\{scope\}\}\% \\ + \tb def\tb drawflag\{\% \\ + \xx4\tb begin\{tikzpicture\} \\ + \xx4\tb begin\{flagdescription\}\{2/3\} \\ + \xx4\xx3\tb background\{cyan\} \\ + \xx4\xx3\tb diamond\{yellow\}\{(0.5,0.75)\} \\ + \xx4\xx3\tb diamond\{yellow\}\{(\$(\tb flaglength,0.75)-(0.5,0)\$)\} \\ + \xx4\xx3\tb diamond\{white\}\{(0.5*\tb stretchfactor,0.25)\} \\ + \xx4\xx3\tb diamond\{white\}\\\xx7\xx3\{(\$(\tb flaglength,0.25)-(0.5*\tb stretchfactor,0)\$)\} + \xx4\tb end\{flagdescription\} \\ + \xx4\tb end\{tikzpicture\}\}\% \\ + \tb drawflag\tb par\tb medskip \\ + \tb newdimen\tb flaglength\tb flaglength=40mm \\ + \tb def\tb flagstretch\{1\}% \\ + \tb drawflag + } +\resultbox{0.29}{% + \def\diamond#1#2{% + \begin{scope}[shift={#2}] + \fill [#1] (3/20,0)--(0,4/20)--(-3/20,0)--(0,-4/20); + \end{scope}}% + \def\drawflag{% + \begin{tikzpicture} + \begin{flagdescription}{2/3} + \background{cyan} + \diamond{yellow}{(0.5,0.75)} + \diamond{yellow}{($(\flaglength,0.75)-(0.5,0)$)} + \diamond{white}{(0.5*\stretchfactor,0.25)} + \diamond{white}{($(\flaglength,0.25)-(0.5*\stretchfactor,0)$)} + \end{flagdescription} + \end{tikzpicture}}% + \drawflag\par\medskip + \newdimen\flaglength\flaglength=40mm + \def\flagstretch{1}% + \drawflag +} +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \section{Commands}\label{SEC_MACROS} % ---------------------------------- @@ -700,21 +778,21 @@ the visibility of those commands is confined to the environment % +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \wideframe{ \begin{tabularx}{\textwidth}{@{}>{\RaggedRight}p{\colwidth}>{\RaggedRight}X@{}} -{\m\color{emphcolor}\tt{\tb begin\{flagdescription\}\{}\ti{y}\tt{\}\{}\ti{x}\tt{\}}} +{\m\color{emphcolor}\tt{\tb begin\{flagdescription\}\{}$\xi$\tt{\}}} & \\ \qquad $\vdots$ & \\ {\m\color{emphcolor}\tt{\tb end\{flagdescription\}}} & -environment for the flag description\\[\medskipamount] +environment for the flag with aspect ratio $\xi$\\[\medskipamount] \end{tabularx} \bigskip \begin{tabularx}{\textwidth}{@{}>{\RaggedRight}p{\colwidth}X@{}} \textsl{Geometric flag elements:} \\[\medskipamount] % -------------------------- -{\m\color{emphcolor}\tt{\tb framecode}} -&draws the rectangular frame around the flag. +{\m\color{emphcolor}\tt{\tb framecode\{}\ti{path}\tt{\}}} +& drawing path for the frame around the flag; if \emph{path} is empty, a rectangular frame is drawn. \\[\medskipamount] % -------------------------- {\m\color{emphcolor}\tt{\tb hstripesII\{}{$c_1$}\tt{\}\{}{$c_2$}\tt{\}}} & partitions the flag into two horizontal stripes with the colors $c_1$ and $c_2$. @@ -814,7 +892,7 @@ the hoist. \tb begin\{tikzpicture\} \tb begin\{flagdescription\}\{3/4\} \xx3\tb chevron\{cyan\}\{1\} \\ - \xx3\tb framecode \\ + \xx3\tb framecode{} \\ \tb end\{flagdescription\} \tb end\{tikzpicture\} }\hfill @@ -830,7 +908,7 @@ the hoist. \begin{tikzpicture} \begin{flagdescription}{3/4} \chevron{cyan}{1} - \framecode + \framecode{} \end{flagdescription} \end{tikzpicture} } @@ -858,7 +936,7 @@ can be redefined arbitrarily. \tb colorlet\{blue\}\{black\} \\ \tb definecolor\{red\}\{rgb\}\{0.9,0.6,0\} \\ \tb unionjack\{0mm\}\{5mm\}\{10mm\}\{\tb flagwidth\}\\ - \tb framecode\\ + \tb framecode{}\\ \tb end\{flagdescription\} \tb end\{tikzpicture\} \\ } @@ -874,7 +952,7 @@ can be redefined arbitrarily. \colorlet{blue}{black} \definecolor{red}{rgb}{0.9,0.6,0} \unionjack{0mm}{5mm}{10mm}{\flagwidth} - \framecode + \framecode{} \end{flagdescription} \end{tikzpicture} } @@ -892,7 +970,7 @@ are overlayed with the generating circles. \xx3\tb background\{cyan\}\\ \xx3\tb starV\{white\}\{(1,0.5)\}\{0.3\}\{0\}\\ \xx3\tb starVI\{white\}\{(2,0.5)\}\{0.3\}\{0\}\\ -% \xx3\tb framecode\\ +% \xx3\tb framecode{}\\ \tb end\{flagdescription\} \tb end\{tikzpicture\}\\ \tb par\tb medskip\\ @@ -903,7 +981,7 @@ are overlayed with the generating circles. \xx3\tb draw (2,0.5)circle(0.4) (2,0.5)circle(0.15); \\ \xx3\tb moon\{white\}\{(1,0.45)\}\{0.4\}\{(1.1,0.6)\}\{0.36\}\\ \xx3\tb draw (1,0.45)circle(0.4) (1.1,0.6)circle(0.36);\\ -% \xx3\tb framecode\\ +% \xx3\tb framecode{}\\ \tb end\{flagdescription\} \tb end\{tikzpicture\} } @@ -913,7 +991,7 @@ are overlayed with the generating circles. \background{cyan} \starV{white}{(1,0.5)}{0.3}{0} \starVI{white}{(2,0.5)}{0.3}{0} -% \framecode +% \framecode{} \end{flagdescription} \end{tikzpicture} \par\medskip @@ -924,7 +1002,7 @@ are overlayed with the generating circles. \draw (2,0.5)circle(0.4) (2,0.5) circle(0.15); \moon{white}{(1,0.45)}{0.4}{(1.1,0.6)}{0.36} \draw (1,0.45)circle(0.4) (1.1,0.6)circle(0.36); -% \framecode +% \framecode{} \end{flagdescription} \end{tikzpicture} } @@ -934,11 +1012,11 @@ are overlayed with the generating circles. \chapter{Flags}\label{FLAGS} % -------------------------------------------------------------------------- -\section{National Flags of sovereign states} -% ------------------------------------------ - \flagsdefault[width=18mm,length=30mm,stretch=0.5] +\section{National Flags of sovereign states} +% ------------------------------------------ +\flaggenprozeile{4} \show{Afghanistan}{AF} \show{Albania}{AL} \show{Algeria}{DZ} @@ -1140,31 +1218,113 @@ are overlayed with the generating circles. \section{Flags of other countries and territories} % ------------------------------------------------ -\zaehler0 +\flaggenprozeile{4} \show{Abkhazia}{Abkhazia} +\show{\AA land}{AX} \show{Antarctica}{AQ} \show{Artsakh}{Artsakh} +\show{Bonaire}{Bonaire} +\show{Faroe Islands}{FO} \show{French Guiana}{GF} +\show{Gibraltar}{GI} \show{Greenland}{GL} +\show{Guernsey}{GG} +\show{Isle of Man}{IM} +\show{Jersey}{JE} \show{Niue}{NU} +\show{Puerto Rico}{PR} +\show{Reunion}{RE} +\show{St.\,Eustasius}{StEustasius} \show{Somaliland}{Somaliland} +\show{Tibet}{Tibet} \show{Transnistria}{Transnistria} \show{Western Sahara}{EH} +\section{Austrian federal states} +% ------------------------------- + +\flaggenprozeile{4} +\show{Vienna}{AT-W} +\show{Lower Austria}{AT-N} +\show{Upper Austria}{AT-O} +\show{Salzburg}{AT-S} +\show{The Tyrol}{AT-T} +\show{Vorarlberg}{AT-V} +\show{Carinthia}{AT-K} +\show{Styria}{AT-St} +\show{Burgenland}{AT-B} + + \section{Other Flags} % ---------------------- -\zaehler0 +\flaggenprozeile{4} \show{European Union}{EU} \show{United Nations}{UNO} +\show{WHO}{WHO} +\show{UNESCO}{UNESCO} \show{NATO}{NATO} +\show{Christian Flag}{Christian} +\show{Buddhist Flag}{Buddhism} \show{Red Cross}{RedCross} +\show{Red Crescent}{RedCrescent} +\show{Red Crystal}{RedCrystal} \show{Olympics}{Olympics} \show{Jolly Roger}{JollyRoger} \show{Rainbow flag}{Rainbow} \show{Esperanto Movement}{Esperanto} + +\section{Nautical Signal Flags} +% ----------------------------- + +\flagsdefault[width=18mm,length=25mm] +\flaggenprozeile{5} +\show{}{A} +\show{}{B} +\show{}{C} +\show{}{D} +\show{}{E} +\show{}{F} +\show{}{G} +\show{}{H} +\show{}{I} +\show{}{J} +\show{}{K} +\show{}{L} +\show{}{M} +\show{}{N} +\show{}{O} +\show{}{P} +\show{}{Q} +\show{}{R} +\show{}{S} +\show{}{T} +\show{}{U} +\show{}{V} +\show{}{W} +\show{}{X} +\show{}{Y} +\show{}{Z}\par\bigskip + +\flagsdefault[width=0mm,length=25mm] +\flaggenprozeile{5} +\show{}{0} +\show{}{1} +\show{}{2} +\show{}{3} +\show{}{4} +\show{}{5} +\show{}{6} +\show{}{7} +\show{}{8} +\show{}{9} + + + + + % -------------------------------------------------------------------------- % Links % -------------------------------------------------------------------------- |