44

Has anyone ever drawn a football field in latex? I know that could seem like a strange request. But I'm looking for a package that allows me to draw a football field.

football field

3
  • You'll probably have to do it by hand, it's very unlikely that a package could do that. Do you know TiKz ?
    – Clément
    Commented Feb 11, 2016 at 20:09
  • This can be drawn any packages capable to draw lines, squares and circles, and coloring them. For examplepstriks and TikZ amount of them.
    – Zarko
    Commented Feb 11, 2016 at 20:11
  • 1
    Didn't we have this question before? (I guess this is from 2016, so maybe that was it.)
    – cfr
    Commented Jul 16, 2018 at 2:25

3 Answers 3

25
+50

Just for fun:

enter image description here

\documentclass[tikz,border=2mm]{standalone} 
\usetikzlibrary{positioning, ducks}
\usepackage{tikzducks}

\newcommand{\croacia}[3]{
\begin{scope}[shift={#3}, xscale=-.4, yscale=.4]
\duck
\path[preaction={fill=red}, pattern=checkerboard, pattern color=white] \duckpathjacket;
\node[font=\sffamily\bfseries] at ([xshift=5mm]wing) {#1};
\node[font=\sffamily\bfseries] at (1.1,-.22) {#2};
\end{scope}
}

\newcommand{\france}[3]{
\begin{scope}[shift={#3}, scale=.4]
\duck[jacket=blue]
\node[font=\sffamily\bfseries] at ([xshift=5mm]wing) {#1};
\node[font=\sffamily\bfseries] at (1.1,-.22) {#2};
\end{scope}
}

\definecolor{field}{RGB}{0,156,0}

\newcommand\area[2]{%
\begin{scope}[shift={(#1)}, transform shape, rotate=#2]
\node[minimum width=.55cm,minimum height=1.832cm, anchor=west] (small#2) at (0,0) {};
\node[minimum width=1.65cm,minimum height=4.032cm, anchor=west] (big#2) at (0,0) {};
\node[minimum width=.244cm, minimum height=.732cm, anchor=east] (goal#2) at (0,0) {};
\node[inner sep=.3mm, circle, fill=white] (penalty#2) at (1.1,0) {};
    \begin{scope}
    \tikzset{every path/.style={}}
    \clip (big#2.south east) rectangle ++ (1,5); 
    \draw[white, very thick] (penalty#2) circle (0.915cm);
    \end{scope}
\end{scope}
}


\begin{document}
\begin{tikzpicture}
\begin{scope}[%    
    every node/.style={draw=white, very thick, inner sep=0, outer sep=0},
   every path/.style={draw=white, very thick},
]
\fill[field] (-1,-1) rectangle (13,10);
\node[minimum width=12cm, minimum height=9cm] (contour) at (6,4.5) {};

%\draw (contour.south west) grid (contour.north east);

% Center
\draw (contour.north) -- (contour.south);
\draw (contour.center) circle (0.915cm);
\fill[white] (contour.center) circle (.5mm);

% Areas
\area{contour.west}{0}
\area{contour.east}{180}

% Corners
\foreach \corner [count=\xi starting from 0] in {south west, south east, north east, north west}{
    \begin{scope}[rotate around={90*\xi:(contour.\corner)}]
        \draw ([xshift=1mm]contour.\corner) arc (0:90:1mm);
    \end{scope}
}
\end{scope}

\croacia{23}{Subasic}{(1.25,4.25)}
\croacia{3}{Strinic}{(2.6,7.2)}
\croacia{21}{Vida}{(2.3,5.3)}
\croacia{6}{Lovren}{(2.3,2.9)}
\croacia{2}{Virsalijko}{(2.6,1)}
\croacia{11}{Brozovic}{(3.5,4.25)}
\croacia{4}{Perisic}{(4.5,7.2)}
\croacia{7}{Rakitic}{(4.5,5.25)}
\croacia{10}{Modric}{(4.5,3)}
\croacia{18}{Rebic}{(4.5,1)}
\croacia{17}{Mandzukic}{(5.6,4.25)}

\france{1}{Lloris}{(10.75,4.25)}
\france{2}{Pavard}{(9.5,7.2)}
\france{4}{Varane}{(9.5,5.3)}
\france{5}{Umtiti}{(9.5,2.9)}
\france{21}{Lucas}{(9.5,1)}
\france{13}{Kante}{(8.5,6)}
\france{6}{Pogba}{(8.5,2.3)}
\france{10}{Mbappe}{(7,7)}
\france{7}{Griezman}{(7.8,4.25)}
\france{14}{Matuidi}{(7,1.5)}
\france{9}{Giroud}{(6.4,4.25)}
\end{tikzpicture}
\end{document}

Some comments:

The code for the football field is from Alenanno.

I've copied player names (and positions) from Spanish newspapers which doesn't show correct spelling for Croacian/French players. Please fill free to correct them or let me know the correct spelling.

Update: marmot suggested a tikzmarmots version. Here it is.

enter image description here

\documentclass[tikz,border=2mm]{standalone} 
\usetikzlibrary{positioning}
\usepackage{tikzmarmots}

\newcommand{\croacia}[3]{ \begin{scope}[shift={#3}, scale=.5] \marmot \path[preaction={fill=red}, pattern=checkerboard, pattern color=white] (1.35,0.71) .. controls (1.35,0.41) and (1.17,0.37) .. (0.92,0.37) .. controls (0.69,0.37) and (0.48,0.41) .. (0.48,0.71) .. controls (0.48,1.01) and (0.67,1.26) .. (0.91,1.26) .. controls (1.15,1.26) and (1.3 5,1.01) .. (1.35,0.71) -- cycle; \node[font=\sffamily\bfseries] at (0.95,0.82) {#1}; \node[font=\sffamily\bfseries] at (1.1,-.22) {#2}; \end{scope} }

\newcommand{\france}[3]{ \begin{scope}[shift={#3}, scale=.5] \marmot[body=brown!80!yellow] \path[fill=blue] (1.35,0.71) .. controls (1.35,0.41) and (1.17,0.37) .. (0.92,0.37) .. controls (0.69,0.37) and (0.48,0.41) .. (0.48,0.71) .. controls (0.48,1.01) and (0.67,1.26) .. (0.91,1.26) .. controls (1.15,1.26) and (1.3 5,1.01) .. (1.35,0.71) -- cycle; \node[font=\sffamily\bfseries] at (0.95,0.82) {#1}; \node[font=\sffamily\bfseries] at (1.1,-.22) {#2}; \end{scope} }
\definecolor{field}{RGB}{0,156,0}

\newcommand\area[2]{%
\begin{scope}[shift={(#1)}, transform shape, rotate=#2]
\node[minimum width=.55cm,minimum height=1.832cm, anchor=west] (small#2) at (0,0) {};
\node[minimum width=1.65cm,minimum height=4.032cm, anchor=west] (big#2) at (0,0) {};
\node[minimum width=.244cm, minimum height=.732cm, anchor=east] (goal#2) at (0,0) {};
\node[inner sep=.3mm, circle, fill=white] (penalty#2) at (1.1,0) {};
    \begin{scope}
    \tikzset{every path/.style={}}
    \clip (big#2.south east) rectangle ++ (1,5); 
    \draw[white, very thick] (penalty#2) circle (0.915cm);
    \end{scope}
\end{scope}
}


\begin{document}
\begin{tikzpicture}
\begin{scope}[%    
    every node/.style={draw=white, very thick, inner sep=0, outer sep=0},
   every path/.style={draw=white, very thick},
]
\fill[field] (-1,-1) rectangle (13,10);
\node[minimum width=12cm, minimum height=9cm] (contour) at (6,4.5) {};

%\draw (contour.south west) grid (contour.north east);

% Center
\draw (contour.north) -- (contour.south);
\draw (contour.center) circle (0.915cm);
\fill[white] (contour.center) circle (.5mm);

% Areas
\area{contour.west}{0}
\area{contour.east}{180}

% Corners
\foreach \corner [count=\xi starting from 0] in {south west, south east, north east, north west}{
    \begin{scope}[rotate around={90*\xi:(contour.\corner)}]
        \draw ([xshift=1mm]contour.\corner) arc (0:90:1mm);
    \end{scope}
}
\end{scope}

\croacia{23}{Subasic}{(0.25,4.25)}
\croacia{3}{Strinic}{(1.6,7.2)}
\croacia{21}{Vida}{(1.3,5.3)}
\croacia{6}{Lovren}{(1.3,2.9)}
\croacia{2}{Virsalijko}{(1.6,1)}
\croacia{11}{Brozovic}{(2.5,4.25)}
\croacia{4}{Perisic}{(3.5,7.2)}
\croacia{7}{Rakitic}{(3.5,5.25)}
\croacia{10}{Modric}{(3.5,3)}
\croacia{18}{Rebic}{(3.5,1)}
\croacia{17}{Mandzukic}{(4.6,4.25)}

\france{1}{Lloris}{(10.75,4.25)}
\france{2}{Pavard}{(9.5,7.2)}
\france{4}{Varane}{(9.5,5.3)}
\france{5}{Umtiti}{(9.5,2.9)}
\france{21}{Lucas}{(9.5,1)}
\france{13}{Kante}{(8.5,6)}
\france{6}{Pogba}{(8.5,2.3)}
\france{10}{Mbappe}{(7,7)}
\france{7}{Griezman}{(7.8,4.25)}
\france{14}{Matuidi}{(7,1.5)}
\france{9}{Giroud}{(6.4,4.25)}
\end{tikzpicture}
\end{document}

2nd Update: I almost forgot tikzpeople.

I've been unable to customize Croatian shirt. If you know how to do it, please let me know or feel free to edit the code.

enter image description here

\documentclass[tikz,border=2mm]{standalone} 

\usepackage{tikzpeople}

\newcommand{\croacia}[4][]{%
\begin{scope}[font=\small\sffamily, text=black!70!red]
    \node[person, minimum size=.8cm, anchor=center, shirt=red, #1] (#3) at #4 {#3};
    \path (#3.center)--(#3.south) node[midway]{#2};
\end{scope}
}

\newcommand{\france}[4][]{%
\begin{scope}[font=\small\sffamily, text=black!70!red]
    \node[person, minimum size=.8cm, anchor=center, mirrored, shirt=blue, #1] (#3) at #4 {#3};
    \path (#3.center)--(#3.south) node[midway]{#2};
\end{scope}
}

\definecolor{field}{RGB}{0,156,0}

\newcommand\area[2]{%
\begin{scope}[shift={(#1)}, transform shape, rotate=#2]
\node[minimum width=.55cm,minimum height=1.832cm, anchor=west] (small#2) at (0,0) {};
\node[minimum width=1.65cm,minimum height=4.032cm, anchor=west] (big#2) at (0,0) {};
\node[minimum width=.244cm, minimum height=.732cm, anchor=east] (goal#2) at (0,0) {};
\node[inner sep=.3mm, circle, fill=white] (penalty#2) at (1.1,0) {};
    \begin{scope}
    \tikzset{every path/.style={}}
    \clip (big#2.south east) rectangle ++ (1,5); 
    \draw[white, very thick] (penalty#2) circle (0.915cm);
    \end{scope}
\end{scope}
}


\begin{document}
\begin{tikzpicture}
\begin{scope}[%    
    every node/.style={draw=white, very thick, inner sep=0, outer sep=0},
   every path/.style={draw=white, very thick},
]
\fill[field] (-1,-1) rectangle (13,10);
\node[minimum width=12cm, minimum height=9cm] (contour) at (6,4.5) {};

%\draw[yellow,thin] (contour.south west) grid (contour.north east);

% Center
\draw (contour.north) -- (contour.south);
\draw (contour.center) circle (0.915cm);
\fill[white] (contour.center) circle (.5mm);

% Areas
\area{contour.west}{0}
\area{contour.east}{180}

% Corners
\foreach \corner [count=\xi starting from 0] in {south west, south east, north east, north west}{
    \begin{scope}[rotate around={90*\xi:(contour.\corner)}]
        \draw ([xshift=1mm]contour.\corner) arc (0:90:1mm);
    \end{scope}
}
\end{scope}

\croacia[shirt=orange]{23}{Subasic}{(.5,4.5)}
\croacia{3}{Strinic}{(2,8)}
\croacia{21}{Vida}{(1.8,6)}
\croacia{6}{Lovren}{(1.8,3)}
\croacia{2}{Virsalijko}{(2,1)}
\croacia{11}{Brozovic}{(2.7,4.5)}
\croacia{4}{Perisic}{(4,7.5)}
\croacia{7}{Rakitic}{(4,5.5)}
\croacia{10}{Modric}{(4,3.5)}
\croacia{18}{Rebic}{(4,1.5)}
\croacia{17}{Mandzukic}{(5.2,4.5)}

\france[shirt=yellow]{1}{Lloris}{(11.5,4.5)}
\france{2}{Pavard}{(10.2,8)}
\france{4}{Varane}{(10.2,6)}
\france{5}{Umtiti}{(10.2,3)}
\france{21}{Lucas}{(10.2,1)}
\france{13}{Kante}{(8.8,6.5)}
\france{6}{Pogba}{(8.8,2.5)}
\france{10}{Mbappe}{(7.5,7.5)}
\france{7}{Griezman}{(8,4.5)}
\france{14}{Matuidi}{(7.5,1.5)}
\france{9}{Giroud}{(6.8,4.5)}
\end{tikzpicture}
\end{document}
9
  • 1
    @marmot It's done. Thank you for your command.
    – Ignasi
    Commented Jul 14, 2018 at 9:30
  • 4
    Simply fantastic! Commented Jul 14, 2018 at 14:41
  • 1
    It could have been ducks against marmots.
    – yo'
    Commented Jul 16, 2018 at 9:00
  • 2
    @yo' Yes, but who are ducks and who marmots? I didn't want to start a war ;-)
    – Ignasi
    Commented Jul 16, 2018 at 10:04
  • 1
    Now I need a CTAN package where I can draw football fields,and add the list of players and TiKz will put the name of the players. I'm not sure how to handle different formations (4-4-2 or 3-5-1-1), but you guys are smarter than me. If the same package can draw baseball, hockey, basketball, and... American football, then I will seriously start writing the sport almanac, so the future me becomes rich.
    – phollox
    Commented Jul 19, 2018 at 21:07
77

This is my version of it. I used the official measurements then divided them by 10 and switched from meters to centimeters (otherwise you'd need a really huge piece of paper to print it on).

I have included a command \showmeasures that will print the measures (the real ones).

Output

Regular

enter image description here

With measures

enter image description here

Code

\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, calc}

\definecolor{field}{RGB}{0,156,0}

\tikzset{
    every node/.style={draw=white, very thick, inner sep=0, outer sep=0},
    every path/.style={draw=white, very thick},
}

\newcommand\area[2]{%
\begin{scope}[shift={(#1)}, transform shape, rotate=#2]
\node[minimum width=.55cm,minimum height=1.832cm, anchor=west] (small#2) at (0,0) {};
\node[minimum width=1.65cm,minimum height=4.032cm, anchor=west] (big#2) at (0,0) {};
\node[minimum width=.244cm, minimum height=.732cm, anchor=east] (goal#2) at (0,0) {};
\node[inner sep=.3mm, circle, fill=white] (penalty#2) at (1.1,0) {};
    \begin{scope}
    \tikzset{every path/.style={}}
    \clip (big#2.south east) rectangle ++ (1,5); 
    \draw[white, very thick] (penalty#2) circle (0.915cm);
    \end{scope}
\end{scope}
}

\newcommand\showmeasures{%
    \begin{scope}
    \tikzset{every node/.style={draw=none,fill=field, inner sep=2pt, sloped}}
    \draw[black, {Latex}-{Latex}] ($(contour.north west)+(0,.5)$) -- ($(contour.north east)+(0,.5)$) node[midway] {\textbf{Sideline:} min 90m - max 120m};
    \draw[black, {Latex}-{Latex}] ($(contour.south west)+(-.6,0)$) -- ($(contour.north west)+(-.6,0)$) node[midway] {\textbf{Goal line:} min 45m - max 90m};
    \draw[black, -{Latex}] (penalty0) --++ (-15:0.915cm) node[midway, above, font=\scriptsize, fill=none, yshift=2pt] {r = 9.15m};
    \draw[black, {Latex}-{Latex}] ($(small0.south east)+(-.2,0)$) -- ($(small0.north east)+(-.2,0)$) node[midway,above, fill=none,font=\scriptsize] {18.32m};
    \draw[black] ($(small0.north west)+(0,.2)$) -- ($(small0.north east)+(0,.2)$) node[midway, above, font=\scriptsize, fill=none, xshift=3pt] {5.50m};
    \draw[black] (contour.south east) --++ (135:1mm) node[anchor=south east] {r = 1m};
    \draw[black, {Latex}-{Latex}] ($(big180.south east)+(-.5,0)$) -- ($(big180.north east)+(-.5,0)$) node[midway,above, rotate=180,fill=none,font=\scriptsize] {40.32m};
    \draw[black, {Latex}-{Latex}] ($(big180.south west)+(0,.2)$) -- ($(big180.south east)+(0,.2)$) node[midway,above,fill=none,font=\scriptsize] {16.50m};
    \draw[black] (contour.east) --++ (-11mm,0) node[midway,above, fill=none,font=\scriptsize] {11m};
    \node[font=\small, rotate=-90, yshift=5mm] at (goal180) {\textbf{Goal:} 7.32m $\times$ 2.44m};
    \draw[black, -{Latex}] (contour.center) --++ (0:0.915cm) node[midway, above, fill=none,font=\scriptsize, yshift=2pt] {r = 9.15m};
    \end{scope}
}

\begin{document}
\begin{tikzpicture}
\fill[field] (-1,-1) rectangle (13,10);
\node[minimum width=12cm, minimum height=9cm] (contour) at (6,4.5) {};

% Center
\draw (contour.north) -- (contour.south);
\draw (contour.center) circle (0.915cm);
\fill[white] (contour.center) circle (.5mm);

% Areas
\area{contour.west}{0}
\area{contour.east}{180}

% Corners
\foreach \corner [count=\xi starting from 0] in {south west, south east, north east, north west}{
    \begin{scope}[rotate around={90*\xi:(contour.\corner)}]
        \draw ([xshift=1mm]contour.\corner) arc (0:90:1mm);
    \end{scope}
}

\showmeasures
\end{tikzpicture}
\end{document}
9
  • 3
    Of course Italians are more knowledgeable than Spaniards about soccer. ;-)
    – egreg
    Commented Feb 11, 2016 at 22:51
  • @egreg I'm more of a TikZ fan than I am of soccer though. :P
    – Alenanno
    Commented Feb 11, 2016 at 23:20
  • 8
    @egreg Wait, I thought we were talking about football :) Commented Feb 11, 2016 at 23:49
  • 1
    @innisfree It wouldn't be hard. :D
    – Alenanno
    Commented Feb 12, 2016 at 12:27
  • 1
    @JosephWright: Everybody knows the max sideline length should be 14173,2 barleycorns! :) Commented Jul 14, 2018 at 20:27
36

Adjust next code to correct dimensions:

![enter image description here

\documentclass[tikz,border=2mm]{standalone}

\usetikzlibrary{backgrounds}

\newcommand{\halfcourt}{
\draw (0,0) rectangle (5,6);
\draw (0,1.5) rectangle ++(1.75,3);
\draw (0,2) rectangle ++(0.5,2);
\draw (0,2.5) rectangle ++(-0.1,1);
\draw (0.1,0) arc (0:90:.1);
\draw (0.1,6) arc (0:-90:.1);
\draw[fill] (1.25,3) circle (1pt);
\draw (5,3.8) arc (90:270:.8);
\begin{scope}
\clip (1.75,0) rectangle ++(2,6);
\draw (1.25,3) circle (1cm);
\end{scope}
}

\begin{document}
\begin{tikzpicture}[background rectangle/.style={fill=green}, show background rectangle]

\halfcourt
\begin{scope}[xshift=10cm, xscale=-1]
\halfcourt
\end{scope}
\draw[fill] (5,3) circle (1pt);

\end{tikzpicture}

\end{document}
6
  • 1
    You could even have used symmetry four times instead of two ;-)
    – Clément
    Commented Feb 11, 2016 at 20:27
  • 3
    @Clément So long time wanting to use symmetry and it's not good enough. :-)
    – Ignasi
    Commented Feb 11, 2016 at 20:33
  • 5
    I think that the grass needs watering!
    – user30471
    Commented Feb 11, 2016 at 20:40
  • 2
    Too much water, too much water! Have a look at http://latexcolor.com/ to pick a nice green (for instance, \definecolor{green(html/cssgreen)}{rgb}{0.0, 0.5, 0.0}). And now the lines needs to be in white!
    – Clément
    Commented Feb 11, 2016 at 21:04
  • 3
    @ryuk : the best way to thank Ignassi for his / her answer is to mark it as accepted. See here if you don't know how to do that.
    – Clément
    Commented Feb 11, 2016 at 21:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .