0

So I need to draw a flag with red background and an X in the center. I decided to do this using the \fill command three times in order to make one big red rectangle in the BG and two rectangles to form the shape of an X. The problem is that after I have made the background and one of the rectangles for the X, the second one moves everything to the side. enter image description here

How can I move the black rectangle on top of the red one so that it is in the center without moving all of it to the left or right?

P.S: Looks like this without the black rectangle enter image description here

------ Code Down Below ------
\begin{center}
\section{Flagga}
\begin{tikzpicture}
\fill[red] rectangle (12, 8);
\fill[white, rotate=31] (-3,-2.5)+(1,2) rectangle (15,1);
\fill[black, rotate=141] rectangle (10,1);
\end{tikzpicture}
\end{center}
  • Welcome to TeX.SX! Please make your code compilable. – TeXnician Nov 24 '17 at 9:32
3

Like this?

enter image description here

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

\begin{document}
\begin{tikzpicture}

\clip rectangle (12,8);
\fill[red] rectangle (12,8);
\draw[line width=8mm, white] (0,0)--(12,8); 
\draw[line width=8mm] (0,8)--(12,0); 
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.