0

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

  • landscape issues a \clearpage the the beginning and ending. (\rotatebox can be used on the first page.) You can use \captionof{figure} in a minipage (or table). \changemargin (KOMA) works by using negative \leftskip and \rightskip. Note that landscape does not change the header and footer location. – John Kormylo Oct 5 '18 at 18:24
0

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}
  • Thank you, this is working well and giving pretty much the same input as i had (with the same problems with captions, too^^). I do not know if it's better to use figure or parbox, however. I will try your advice with caption-of in minipage. And maybe with sideway instead of landscape. – Ablia Oct 6 '18 at 13:29
  • Ok, i managed to get the output i wanted, using parbox and only minipage with captionof for the third appendix. I also removed the titlespacing (which was causing some numbering problems to my sections) and used only newgeometry to set margins. However, for some reason, i had to set up a new geometry for each page. Even if my two images on appendix 1 and 2 are pretty much the same (and same size), the margins i set were pretty different to get the same output at the end. I don't really understand, but it works. – Ablia Oct 6 '18 at 15:32
  • BTW, \captionof works better in a minipage than a \parbox. Also, I'd have to see your code to see a reason for multiple \newgeometry. – John Kormylo Oct 7 '18 at 0:35
  • the multiple \newgeometry seems to come from the rest of my tex files. It doesn't happens on my minimal exemple. Just like the blank page with my last chapter title happening after the appendix...i'll try to find out what's doing that ;) thanks! – Ablia Oct 8 '18 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.