I have some difficulties in R Sweave so I hope someone could help me.
I want to include two TikZ pictures using minipage and figure to the R Sweave but I get an error:
Overfull \hbox (2.43085pt too wide).
The code I'm using is (I have deleted some rows because the code is too long):
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{figure}[!ht]
\begin{minipage}[c]{0.5\linewidth}
\centering
\begin{tikzpicture}[>=triangle 45, scale=0.85]
\draw[line width=0.2mm] (-0.25,-0.25)--(-0.25,4.5)--(6.25,4.5)--(6.25,-0.25)--(-0.25,-0.25);
\end{tikzpicture}
\end{minipage}
\begin{minipage}[c]{0.5\linewidth}
\centering
\begin{tikzpicture}[>=triangle 45, scale=0.85]
\draw[line width=0.2mm] (-0.25,-0.25)--(-0.25,4.5)--(6.25,4.5)--(6.25,-0.25)--(-0.25,-0.25);
\end{tikzpicture}
\end{minipage}
\caption{Picture}
\label{fig:pic1}
\end{figure}
\end{document}
On page How do you effectively debug overfull \hbox warnings? that if include I found that \showboxdepth=\maxdimen
will tell what the real problem is. But this also shows the same error as before.
So my question is: Why do I get an error? What wrong with my code?
.5\linewidth
wide but won't fit on a line as there is a word space (or a paragraph break if you really have a blank line) between them.\hbox
of a tikzpicture in a.Rnw
or a ` .tex` file. If the.Rnw
extension is the unique relation of R and Sweave with this problem, please change the title and the tags of the question.\documentclass{article}\usepackage{tikz}
but that gave an error about arrows so I guessed\usetikzlibrary{arrows}
but now I get! Package tikz Error: Cannot parse this coordinate. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.9 ...)--(-0.25,4.5)--(6.25,4.5)--(6.25,-0.25)-(-
so I give up sorry, please post a complete example that reproduces the overfull box that you are asking about.-
not--
I'll update your question this time.