This is "messed up" and does not have the figure environment:
This is "not messed up" and has the figure environment:
What is causing this?
Thanks!!!
I am setting up a photobook and have everything working except the left pages with included graphics. Graphics on the right side have the bindingoffet, just not on the left side. All text sections and title pages have offset.
\documentclass[openright,twoside,12pt]{book}
Using these commands to insert images:
\newcommand{\addphoto}[1]{
\begin{figure}
\vspace*{.5cm}
\centering
\includegraphics[scale=1]{#1}
\newpage
\end{figure}
}
Which uses these packages:
\usepackage[bindingoffset=0.75in]{geometry}
\usepackage{graphicx}
Inserting test photos after text sections like this:
\section{City One}
\pagestyle{fancy}
\lipsum[1-2]
\newpage
\addphoto{gray_rect.jpg}
\addphoto{gray_rect.jpg}
\addphoto{gray_rect.jpg}
Thank you for all help! I don't know how to get the LHS images to be centered while respecting the bindingoffset which is of course needed for printing.
mark
added:
\documentclass[openright,twoside,12pt]{book}
\usepackage[
paperwidth=8.5in,
paperheight=8.5in,
bindingoffset=0.2in,
left=1.25in,
right=1.25in,
top=1.25in,
bottom=1.11in,
includefoot
]{geometry}
\usepackage{graphicx}
\usepackage[usenames]{xcolor}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\setlength{\footskip}{45pt}
\fancyfoot[C]{\textcolor{gray}{\thepage}}
\pagestyle{fancy}
\graphicspath{ {images/} }
\newcommand{\addphoto}[1]{
\begin{figure}
\vspace*{-.8cm}
\centering
\includegraphics[width=5.5in]{#1}
\newpage
\end{figure}
}
\usepackage{lipsum}
\parindent=0in
\parskip=12pt
\setcounter{secnumdepth}{0}
\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}
\let\oldsection\section
\renewcommand{\section}{\cleardoublepage\oldsection}
\newcommand{\nosection}[1]{%
\refstepcounter{section}%
\addcontentsline{toc}{section}{#1}
\markright{#1}}
\begin{document}
\pagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\frontmatter
\section{Forward}
\lipsum[1-10]
\section{Introduction}
Add content:
\lipsum[1-10]
\mainmatter
\pagestyle{fancy}
\section{City One}
\lipsum[1-3]
\newpage
\addphoto{example-image}
\section{City Two}
\lipsum[1-2]
\newpage
\addphoto{example-image}
\addphoto{example-image}
\section{City Three}
\lipsum[1-2]
\newpage
\addphoto{example-image}
\end{document};


figureenvironment from your\addphotocommand to start with. It doesn't make any sense at all. – Johannes_B May 01 '18 at 05:48figureenvironment places the image for you at a good place. But i guess You want to decide where the images are placed in a photo book? – Johannes_B May 01 '18 at 06:04figureallows latex to take the content out of the text flow and move the content to other pages to help with page breaking so as Johannes says you should not use it here. If you do use it delete the\newpage inside it which is doing nothing as a figure is a box that can not have a page break inside. Please always post complete small documents that people can test not disjointed fragments (you can useexample-image` which is in the distribution for such tests). We can not run your example but presumably latex is warning you about things sticking in to the margin "Overfull box on page ...." – David Carlisle May 01 '18 at 06:40