The reason has to do with an oversize image. As LaTeX cannot fit it on a page it will float to the end. These type of figures are best to insert them manually
. You will need to define a different environment for this. Try modifying the \twopagepicture
by copying it a renaming it and just comment out the begin{figure}
and \end{figure}
.
\newcommand*{\twopagepicture}[4]{% copy twopagepicture an comment out
.....
% \begin{figure}[#1]
....
% \end{figure}%
% \begin{figure}[#1]
.....
% \end{figure}%
......
}
This ensures that the images will be shown exactly where placed.
To have a correctly placed two page spread firstly, one needs a method to clear to an even page, normally I would code it as follows:
\usepackage[strict]{changepage}
\makeatletter
\newcommand{\cleartoevenpage}{%
\clearpage%
\ifoddpage\c@page\hbox{}\clearpage\fi}
The second issue to take into consideration, is that the image width is always larger than the \textwidth
dimension and hence any scaling must be done on the \textheight
. This is important, otherwise you will get a new page.
The even page image is simply placed normally but issuing a \cleartoevenpage
before the placement and a \newpage after
it, producing the image shown above.
\cleartoevenpage
\includegraphics[height=0.95\textheight]{petra}
\newpage
The odd page image, will have to be shifted to the left by \textwidth
.
\hspace*{-\textwidth}\includegraphics[height=0.95\textheight]{petra}\hspace{1em}
The caption can be placed using a parbox
or a minipage
. In this case I have used a parbox
. If your captions will have more than a paragraph of text, then use a minipage. Depending on the amount of text you have it may look better if you shift it slightly up or down. This can be done either using a vspace
command or use a rule (I prefer the latter as I can have a visual clue and only zero the width at the final copy).
\parbox[b]{0.25\textwidth}{\lipsum*[1-2]\par\rule{1pt}{50pt}}
You can see the rule in the last image below.
Full MWE
\documentclass{book}
\usepackage[left=0pt,right=0pt,top=0.5in,bottom=0.5in]{geometry}
\usepackage{graphicx,lipsum,caption,crop}
\usepackage[strict]{changepage}
\makeatletter
\newcommand{\cleartoevenpage}{%
\clearpage%
\ifoddpage\c@page\hbox{}\clearpage\fi}
\begin{document}
First page
\cleartoevenpage
\includegraphics[height=0.95\textheight]{petra}
\newpage
\hspace*{-\textwidth}\includegraphics[height=0.95\textheight]{petra}\hspace{1em}
\parbox[b]{0.25\textwidth}{\lipsum*[1-2]\par\rule{1pt}{50pt}}
\end{document}
Hope this helps.
I don't really get the question so I hope this is what you wanted. If you include a full document (such that we copy paste and see the problem on our systems) things are much more easier.
Here, you can change the default setting within a scope but your block
style had a node distance
which was resetting every time it is issued. I've made it 2mm such that we can see the difference easier.
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,shapes.geometric,positioning}
\begin{document}
\begin{tikzpicture}[decision/.style={diamond, draw, text width=4.5em, text badly centered, node distance=3.5cm, inner sep=0pt},
block/.style ={rectangle, draw, text width=6em, text centered, rounded corners, minimum height=4em, minimum height=2em},
cloud/.style ={draw, ellipse, minimum height=2em},
line/.style ={draw,-latex'},
node distance = 1cm,
auto]
\node [block] (1st) {1st};
\node [block, right= of 1st] (2nd1) {2nd1};
\begin{scope}[node distance=2mm and 10mm]%Here we change it for everything inside this scope
\node [block, above= of 2nd1] (2nd2) {2nd2};
\node [block, below= of 2nd1] (2nd3) {2nd3};
\node [block, right= of 2nd1] (3rd1) {3rd1};
\node [block, above= of 3rd1] (3rd2) {3rd2};
\node [block, above= of 3rd2] (3rd3) {3rd3};
\end{scope}
\node [block, below= of 3rd1] (3rd4) {3rd4};
\node [block, below= of 3rd4] (3rd5) {3rd5};
\path [line] (1st) -- (2nd1);
\path [line] (2nd1) -- (2nd2);
\path [line] (2nd1) -- (2nd3);
\path [line] (2nd2) -- (3rd3);
\path [line] (2nd1) -- (3rd1);
\path [line] (1st) -- (2nd1);
\end{tikzpicture}
\end{document}
Best Answer
figure
instead offigure*
.