Theses, Books, Title pagesSubfigures, Landscape pages, appendices.

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Subfigures, Landscape pages, appendices.

Post by byn »

I installed TeXlive and TeXstudio as the editor. It is working fine however I have some errors when it comes to including subfigures from the code below, even when the class is defined, \usepackage{subfigure}, it gives a conflicting error with the class.

Code: Select all

\begin{figure}[h]
\begin{minipage}{\linewidth}
    \centering
    \subfigure[Subfigure caption 1]
    {\includegraphics[width=135pt,height=135pt]{fig1.eps}
        \label{fig:sub1}
    }
    \subfigure[Subfigure caption 2]{ \includegraphics[width=135pt,height=135pt]{fig2.eps}
       \label{fig:sub2}}
    \subfigure[Subfigure caption 3] {\includegraphics[width=135pt,height=135pt]{fig1.eps}
        \label{fig:sub3}}
   
   \vspace{-0.35cm}
       \end{minipage}\\
   
    \begin{minipage}{\linewidth}
    \centering
    \subfigure[Subfigure caption 4]
    {\includegraphics[width=135pt,height=135pt]{fig1.eps}
        \label{fig:sub4}
    }
    \subfigure[Subfigure caption 5]{ \includegraphics[width=135pt,height=135pt]{fig2.eps}
       \label{fig:sub5}}
    \subfigure[Subfigure caption 6] {\includegraphics[width=135pt,height=135pt]{fig1.eps}
        \label{fig:sub6}}
   
   \vspace{-0.35cm}
    \end{minipage}%
   \caption{Caption of the figure}  \label{fig:subfigure}
   
\end{figure}
Problem 2 is with including tables in appendix as landscape , gives an error with class and doesnt compile even when \usepackage{longtable} is defined. See code below.

Code: Select all

\begin{landscape}
\begin{longtable}{p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{5cm}p{4cm}p{5cm}}
\caption{Caption}
\label{label}\\
\hline
\textbf{Chapter}&\textbf{Page}&\textbf{Figure
  No.}&\textbf{Caption}&\textbf{Legend}&\textbf{Graph
  Type}&\textbf{Description}&\textbf{Data} &\textbf{Comments} \\
\hline
\endfirsthead
\hline
\textbf{Chapter}&\textbf{Page}&\textbf{Figure No.}&\textbf{Caption}&\textbf{Legend}&\textbf{Graph Type}&\textbf{Description}&\textbf{Data}
&\textbf{Comments} \\
\hline
\endhead
\hline \multicolumn{9}{r}{\emph{Continued on next page}}
\endfoot
%\hline
\endlastfoot

...
data...
& & & & & & & & \\
...

\end{longtable}
\end{landscape}
The link to my template is here;
https://drive.google.com/file/d/14TM5ME ... sp=sharing and I had asked my question a few days ago here https://latex.org/forum/viewtopic.php?f ... 1&start=20 but it looks like no one has seen it. I believe that I have an error in the class file causing all these errors that I seek you to review.

Ben
Last edited by Stefan Kottwitz on Sun Jun 26, 2022 12:31 pm, edited 1 time in total.
Reason: code marked

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Subfigures, Landscape pages, appendices.

Post by Stefan Kottwitz »

byn wrote:I installed TeXlive and TeXstudio as the editor. It is working fine however I have some errors when it comes to including subfigures from the code below, even when the class is defined, \usepackage{subfigure}, it gives a conflicting error with the class.
What is the error message? Please always tell the error message so we don't have to guess what it might be.

Use the package subfig instead of subfigure. The syntax is a bit different, but subfigure is too old and unmaintained and subfig is the newer version of it.
byn wrote:with including tables in appendix as landscape , gives an error with class and doesnt compile
Again, always copy the error message here.

Wild guess, it may be "LaTeX Error: Environment landscape undefined." In that case, load the pdflscape package (with pdfLaTeX) or lscape (with LaTeX in DVI mode).

Stefan
LaTeX.org admin
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Subfigures, Landscape pages, appendices.

Post by byn »

This is my log file showing the errors.
Attachments
main.log
(33.82 KiB) Downloaded 358 times
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Subfigures, Landscape pages, appendices.

Post by byn »

And I have all landscape packages defined. The issue with landscape is that it creates empty pages and \cleardouble page hasn't been able to delete them.
User avatar
MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

Subfigures, Landscape pages, appendices.

Post by MjK »

Usually I'm not a friend of templates, because several templates are broken by design, outdated, almost not maintained etc. So usually I do not answer questions about templates.

This template is indeed broken. The \tableofcontents in main.tex does already result in an error:

Code: Select all

Runaway argument?
\roman {page} 
./main.tex:178: Paragraph ended before \HyPL@CheckThePage was complete.
<to be read again> 
                   \par 
l.178 \tableofcontents
without any change of the template files. So you should either ask the template author for help or—IMHO better—not use this template.

The template does also use outdated packages. And there is suspicious code. So it could be hard to fix all the issues.

The error I've shown above is the result of:

Code: Select all

    \renewcommand{\thepage}{\roman{page} \par
    }
in the definition of \tableofcontents in thesismodify.cls. Definitely you never should use \par at the definition of \the<counter>. So this is a no-go.

There are also several group-level errors in the template, which also indicates broken code.

And no, I will not correct all these mistakes. This would be too much work.

I would recommend to start with a minimal preamble based either on a standard class or, e.g., a KOMA-Script class, as explained here: How to make a document template based on KOMA-Script. The page is also available in German.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Subfigures, Landscape pages, appendices.

Post by byn »

I need some help with this. I haven't written a class file before.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Subfigures, Landscape pages, appendices.

Post by Stefan Kottwitz »

Either use the school template because you should follow it, then you have the restrictions and cannot do what it doesn't support.

Or use a modern proven template such as https://latextemplates.com/template/mas ... ral-thesis that us compatible to modern LaTeX and modern packages and so it's customizable.

Stefan
LaTeX.org admin
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Subfigures, Landscape pages, appendices.

Post by byn »

This is the template, was given but it seems most people using it are using it haven't used landscape pages and subfigures so this problem hasn't surfaced before.
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Subfigures, Landscape pages, appendices.

Post by byn »

It may just need a quick fix such that I am able to avoid blank pages and have subfigures work,

Thank you.
Post Reply