2

first Stack post :D

I see there's a lot on topic already, but I'm still struggling with Tikz picture margins in LaTeX.

Code (PDFLaTeX):

\documentclass{amsart}

\usepackage{tikz}

% Custom Commands
%buffer window around unit (total window is 1+2*twindow)
\newcommand{\twindow}{0.2}

\begin{document}
\title{Pandemic Legacy: Season 1\\Salt Report Zero}
\author{Noriko ``Dr. Salt'' Shio}
\maketitle

% Tanith Lee quote
\emph{Narasen, the leopard queen of Merh, stood at her window and watched Lady~Plague walking about in the city.}\\{\flushright -\textsc{Tanith Lee}, Tales From The Flat Earth: Death's Master

\begin{tikzpicture}[scale=10.5]
\draw(-\twindow,-\twindow)rectangle(1+\twindow,1+\twindow);
\end{tikzpicture}

\end{document}

Result:

enter image description here

1) Topic question is: Simplest way to horizontally center this tikzpicture square?


Bonus Question:

2) can I control the text margin independently from the picture margin?

  • Welcome! Re. 1: centre with respect to what? You presumably get warnings about bad boxes with this. Do you want it to exceed the size of the text block? Re. 2: what do you mean? Are you talking about the page margins? You can temporarily alter these regardless of what you're typesetting. Or are you asking something else? – cfr Jul 07 '18 at 03:02
  • 4
    One way to do it is to put the tikzpicture into \centerline, i.e. \centerline{\begin{tikzpicture}[scale=10.5] \draw(-\twindow,-\twindow)rectangle(1+\twindow,1+\twindow); \end{tikzpicture}}, but please don't tell egreg that I told you that ;-) –  Jul 07 '18 at 04:14
  • ...and you need to close your {\flushright ... scope ;-), probably with a \par} (to avoid surprises...) – Rmano Jul 07 '18 at 09:44

0 Answers0