[Tex/LaTex] figure in landscape in appendix

appendicesfloatslandscape

I have some hard time setting my appendix pages in latex.
They are in landscape since there's big images in it, and i'm resizing the page (because the images are really big).

Here is my code:

\documentclass{wissdoc}
\usepackage[english]{babel}

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{dsfont}

\usepackage{titlesec}
\usepackage{pdflscape}
\usepackage{tabularx}
\usepackage{moreverb}
\usepackage{subcaption}

\input{macros}

\begin{document}

    \graphicspath{{images/}}

    \selectlanguage{english}
    \chapter{first Chapter}
    let me introduce the chapter
    ~\cite{IDC}
    \section{first section of chapter 1}
    this is my text
    \section{second section of chapter 1}
    i have a lot of sections

    \titleformat{\chapter}[hang]
    {\normalfont\huge\bfseries}{\thechapter.}{0.4em}{\Huge}
    \appendix

        %%%%%%%%%%%%%%%%%%%%%%%
        % Anhang A
        %%%%%%%%%%%%%%%%%%%%%%%
        \begin{landscape}
            \begin{figure}      
                \begin{changemargin}{-1cm}{-1cm}

                    \titlespacing*{\chapter}{0pt}{-1.5cm}{2pt}
                    \chapter{Client UML diagramm}
                    \label{chap:Client UML diagramm}

                    \includegraphics[width=0.9\paperheight, height=0.76\paperwidth]{Package_Client.png}

                \end{changemargin}
            \end{figure}
        \end{landscape}

        %%%%%%%%%%%%%%%%%%%%%%%
        % Anhang B
        %%%%%%%%%%%%%%%%%%%%%%%

        \begin{landscape}
            \begin{figure}
                \begin{changemargin}{-1cm}{-1cm}

                    \titlespacing*{\chapter}{0pt}{-2cm}{2pt}
                    \chapter{Server UML diagramm}
                    \label{chap:Server UML diagramm}

                    \includegraphics[width=0.9\paperheight, height=0.76\paperwidth]{Package_Server.png}

                \end{changemargin}
            \end{figure}
        \end{landscape}

        %%%%%%%%%%%%%%%%%%%%%%%
        % Anhang C
        %%%%%%%%%%%%%%%%%%%%%%%

        \begin{landscape}
            \begin{figure}
                \begin{changemargin}{-1cm}{-1cm}
                    \titlespacing*{\chapter}{0pt}{-1.5cm}{2pt}
                    \chapter{E-mail splitted according to length}
                    \label{chap:E-mail splitted according to length}

                    \begin{subfigure}{15cm}
                        \verbatimtabinput[3]{mails/119.Block0}
                        \caption{Block 0}
                    \end{subfigure}
                    \begin{subfigure}{12cm}
                        \verbatimtabinput[3]{mails/119.Block1}
                        \caption{Block 1}
                    \end{subfigure}

                    \begin{subfigure}[t]{15cm}
                        \verbatimtabinput[3]{mails/119.Block2}
                        \caption{Block 2}
                    \end{subfigure}

                \end{changemargin}
            \end{figure}
        \end{landscape}

\end{document} 

As it is, the output is…nearly what i want. However, there's much things i don't understand:

1) Why have i to put all the page as figure (the title too!)? If i don't, the titel will be on a page but the figure itself will be on the next page and not in landscape (the page is but not the figure). If i simply remove the \begin{picture} and \end{picture}, it still works but i have 3 blank pages before every appendix page.

2) On the third Appendix, you can see that i don't even have a picture but 3 "verbatimabinput" which are just text files. At first, i put them in 3 minipages and it was working well; but then i wanted caption for it and caption only goes with figures and as said before if i use figure i have to use it on the whole page. I've tried put each text file in one figure: it put the title on one page and each figure in one other page and not in landscape.
So i get rid of the minipage and used figure and subfigure instead. I still have a little problem with it: the caption is not centered and is too little (it's a subfigure caption, i would like a normal figure caption)

3) After my appendix, the header on the next (blank) page have the title of my last chapter. I think it should not have any header (and if one, with the name of the last appendix). For some reason, this doesn't happen with the minimal example i gave here…

If someone can give me some hints to explain that…

PS: i tried to give a minimal example; however the project is huge. As you can see, it uses a documentclass wissdoc that can be found on GIT here. There's a lot of macros but i think the only one needed for my Appendix is the "changemargin" that you can found on the first answer here

Best Answer

This solution takes a totally different approach. It resets the geometry to have no margins whatsoever, then simply centers the contents of each page using \centering, \null\vfil (top) and \newpage (bottom). Titles (and probably captions) don't work well in this situatiion, so I put them into \parboxes with a standard width.

I wasn't sure if you wanted block 0 and block 1 on the same line.

%\documentclass{wissdoc}% not found
\documentclass{book}
\usepackage[english]{babel}

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{dsfont}

\usepackage{titlesec}
\usepackage{pdflscape}
\usepackage{tabularx}
\usepackage{moreverb}
\usepackage{subcaption}

\usepackage{graphicx}
\usepackage{geometry}
\newlength{\normalwidth}

%\input{macros}% not found

\begin{document}

    %\graphicspath{{images/}}% not found

    \selectlanguage{english}
    \chapter{first Chapter}
    let me introduce the chapter
    ~\cite{IDC}
    \section{first section of chapter 1}
    this is my text
    \section{second section of chapter 1}
    i have a lot of sections

    \setlength{\normalwidth}{\textheight}% used for titles
    \newgeometry{margin=0pt,nohead,nofoot}
    \begin{landscape}
      \pagestyle{empty}
      \parindent=0pt
      \centering
      \titleformat{\chapter}[hang]% normal 
        {\normalfont\huge\bfseries}{\thechapter.}{0.4em}{\Huge}
      \appendix
      \titlespacing*{\chapter}{0pt}{0pt}{2pt}

      \null\vfil
      \parbox{\normalwidth}{\chapter{Client UML diagramm}
        \label{chap:Client UML diagramm}}
      \includegraphics[width=0.9\paperheight, height=0.76\paperwidth]{example-image-a}%{Package_Client.png}% not found
      \newpage

        %%%%%%%%%%%%%%%%%%%%%%%
        % Anhang B
        %%%%%%%%%%%%%%%%%%%%%%%

     \null\vfil
     \parbox{\normalwidth}{\chapter{Server UML diagramm}
        \label{chap:Server UML diagramm}}
     \includegraphics[width=0.9\paperheight, height=0.76\paperwidth]{example-image-b}
     \newpage

    \null\vfil
    \parbox{\normalwidth}{\chapter{E-mail splitted according to length}
       \label{chap:E-mail splitted according to length}}
    \begin{figure}[h]
       \centering
       \begin{subfigure}{15cm}
         \hrule
         %\verbatimtabinput[3]{mails/119.Block0}% not found
         \caption{Block 0}
       \end{subfigure}
       \begin{subfigure}{12cm}
         \hrule
         %\verbatimtabinput[3]{mails/119.Block1}% not found
         \caption{Block 1}
       \end{subfigure}
       \begin{subfigure}[t]{15cm}
         \hrule
         %\verbatimtabinput[3]{mails/119.Block2}% not found
         \caption{Block 2}
       \end{subfigure}
   \end{figure}
   \newpage

   \end{landscape}
   \restoregeometry
\end{document}