3

Is there a better way to remove the indentation of a tikz figure? What I have so far is this

\documentclass{article}
\usepackage[top=0cm, bottom=0cm, left=0cm, right=0cm]{geometry}
\begin{document}

% \noindent
\begin{tikzpicture}[remember picture, overlay]
    \fill[titlepagecolor] (0, -4) rectangle (15, -8); 
\end{tikzpicture}

\end{document}

If I don't use noindent there is a small white space to the left, which I want to avoid to make a big rectangle across the page

2
  • 1
    I would use a titlepage environment for something like this. (I'm assuming it is a fancy title, judging by the name of the colour used.) And then change the indentation within that environment e.g. use flushleft or \centering or set \parindent to 0pt or whatever. EDIT: Actually, I would use the titling package to help with this.
    – cfr
    Jun 21, 2015 at 19:34
  • 1
    Or you could also specify the absolute position on the page. There's a package/library which you can use to get additional locations i.e. not just things like current page.west but coordinates defined relative to text area and so on. Take a look at titling and tikzpagenodes.
    – cfr
    Jun 21, 2015 at 19:38

1 Answer 1

5

You can redefine the invocation of \tikzpicture to prepend itself with a \noindent which will alleviate the need for you to do it manually each time.

\documentclass{article}
\usepackage[top=0cm, bottom=0cm, left=0cm, right=0cm]{geometry}
\usepackage{tikz}
\let\svtikzpicture\tikzpicture
\def\tikzpicture{\noindent\svtikzpicture}
\begin{document}
% \noindent
\begin{tikzpicture}[remember picture, overlay]
    \fill (0, -4) rectangle (15, -8); 
\end{tikzpicture}
\end{document}

You must log in to answer this question.

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