I am very new to LaTeX's usage. I have a very big picture which takes about two pages. I found out how to do it on the following link How to include a picture over two pages, left part on left side, right on right (for books)? It has almost worked with some few exceptions.
As a consequence this has changed my entire text after the figure to Latin and I am not able to get it back to English.
In addition, the image is not appearing where I want it to appear but rather 8 pages after the wished position.
\clearpage
and \cleardoublepage
are not working
here is how I called the image
\lipsum
\lipsum
\twopagepicture{t}{l}{img/myimage.jpeg}{Test}
\lipsum
\lipsum
Below is the code in the preambles
\renewcommand{\topfraction}{.99}
\renewcommand{\bottomfraction}{.99}
\renewcommand{\textfraction}{.01}
\makeatletter
\newcommand*{\twopagepicture}[4]{%
\cleardoublepage
\checkoddpage
\ifoddpage
\expandafter\@firstofone
\else
\expandafter\afterpage
\fi
{\afterpage{%
\if #1t%
\if #2p%
\thispagestyle{empty}%
\afterpage{\thispagestyle{empty}}%
\fi
\fi
\begin{figure}[#1]
\if #2p%
\if #1t%
\vspace*{-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax}%
\fi
\fi
\if #1b%
\caption{#4}%
\fi
\makebox[\textwidth][l]{%
\if #2p\relax
\let\mywidth\paperwidth
\hskip-\dimexpr1in+\hoffset+\evensidemargin\relax
\else
\let\mywidth\linewidth
\fi
\adjustbox{trim=0 0 {.5\width} 0,clip}{\includegraphics[width=2\mywidth]{#3}}}%
\if #1b\else
\caption{#4}%
\fi
\if #2p%
\if #1b%
\vspace*{-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin- \headheight-\headsep\relax}%
\fi
\fi
\end{figure}%
\begin{figure}[#1]
\if #2p%
\if #1t%
\vspace*{-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax}%
\fi
\fi
\makebox[\textwidth][l]{%
\if #2p%
\let\mywidth\paperwidth
\hskip-\dimexpr1in+\hoffset+\oddsidemargin\relax
\else
\let\mywidth\linewidth
\fi
\adjustbox{trim={.5\width} 0 0 0,clip}{\includegraphics[width=2\mywidth]{#3}}}%
\if #2p%
\if #1b%
\vspace*{-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin-\headheight-\headsep\relax}%
\fi
\fi
\end{figure}%
}}%
}
\makeatother
\usepackage{lipsum}
What could I do to solve these two big problems? Does anyone have any idea on what is going wrong? I want to add that I'm viewing the result in pdf
\lipsum
? Why don't you try\twopagepicture{t}{l}{img/myimage.jpeg}{Test}
without lipsum preceding and following it? (\lipsum
generates a bunch of latin text, as 'filler'.)