PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : minipage



frymor
25-10-2007, 14:20
Hi there,

I'm trying to place two photos next to each other using the mini page option. This is also not a problem at all. Were it's getting difficult is to get the descriptions of both photos next to each other

For no apperent reason I'm getting the description of only the second foto (the left one)

the script of my minipage:


\begin{figure}[t]
\begin{minipage}[t]{.4\linewidth}
\includegraphics[width=\linewidth]{images/1.eps}
\caption{text right}
\label{2}
\end{minipage}\hfill
\hspace{.1\linewidth}
\begin{minipage}[t]{.4\linewidth}
\includegraphics[width=\linewidth]{images/2.eps}
\caption{text left}
\label{3}
\end{minipage}
\end{figure}



Both photo are exactly were i want them to be, but the caption part is no were to be seen.

Isn't it possible to have the two descriptions under their own fotos, but not over the whole page?

THX for any help.

Assa

localghost
25-10-2007, 14:34
Just forget the minipage environments and try the subfig (http://dante.ctan.org/CTAN/help/Catalogue/entries/subfig.html) package. It gives you better control of alignment and caption of the two images.

sommerfee
25-10-2007, 15:03
For no apperent reason I'm getting the description of only the second foto (the left one)

It seems you have a \restylefloat{figure} in your document. If you don't know if you actually really need this, just delete this line.

Axel

frymor
25-10-2007, 15:38
To be honest, I'm not exactly sure what it is. :D

This is my header for the caption part:

\usepackage[leftcaption]{sidecap} %Beschriftung an der Seite der Tabellen
\usepackage[flushleft, footnotesize, nooneline]{caption}
\renewcommand{\captionlabelfont}{\rmfamily\bfserie s} %macht "Abbildung X.X" fett
\renewcommand{\captionfont}{\rmfamily} % setzt die Schrift auf family
%damit nicht jedes mal alle Befehle geschrieben werden müssen
\makeatletter
\newenvironment{sfigure}{\SC@float[t]{figure}[100][htb]}{\endSC@float}
\newenvironment{stable}{\SC@float[t]{table}[70][htb]}{\endSC@float}
\makeatother

\makeatletter % Zur Erstellung der Linien unterhalb und oberhalb der Abbildungen bzw. Tabellen
\newlength{\figrulesep}
\setlength{\figrulesep}{0.5\textfloatsep}
\newcommand{\topfigrule}{\vspace*{1pt}% eine Linie unter dem float am Anfang der Seite
\noindent\rule[-\figrulesep]{\columnwidth}{1pt}}
\newcommand{\botfigrule}{\vspace*{1pt}% eine Linie über dem float am Ende der Seite
\noindent\rule[\figrulesep]{\columnwidth}{1pt}}
\makeatother


It works for me in my diploma and I was hoping to use it here too. :(:(:(

I tried subfig, but I'm getting the error message:

Latex Error: Option clash for package caption

Is the reason for it tha fact that I'm still using older arguments for caption?
They're working just fine.

Assa

sommerfee
25-10-2007, 16:21
I tried subfig, but I'm getting the error message:

Latex Error: Option clash for package caption

For (bad) design reasons the subfig package must be loaded after the caption package, otherwise you'll get this error.

See also: ftp://ftp.dante.de/tex-archive/macros/latex/contrib/caption/caption-eng.pdf (section "Errors") and ftp://ftp.dante.de/tex-archive/macros/latex/contrib/subfig/subfig.pdf .

Axel

frymor
25-10-2007, 16:24
but why is it, that I get both fotos next to each other, but only one caption?

I don't get the second caption at all in my page

:mad::mad::mad::mad::mad::mad::mad::mad::mad:

Q: can I get it with the subfig package?

localghost
25-10-2007, 17:51
[…] Q: can I get it with the subfig package?

A: Yes. Just study the documentation carefully.

Xenara
25-10-2007, 18:00
Just guessing, but maybe it's a problem with the minipages. Did you try the package capt-of yet?
It allows you to use the captions also in minipages by using \captionof{figure}[optional text]{text} (figure adds it to the table of figures, table to the list of tables).

sommerfee
26-10-2007, 08:28
A complete but short example could help, so we don't have to guess and so we have something to play around with.

See also: http://www.minimalbeispiel.de/mini-en.html

Axel

frymor
26-10-2007, 09:17
I'm sorry to say that everything I tried to change didn't work.

I used the capt-of option:


\begin{figure}[t]
\parbox{.4\linewidth}{%
\includegraphics[width=\linewidth]{images.eps}
\captionof{figure}{text}
\label{heat2}}%
\hspace{.1\linewidth}%
\parbox{.4\linewidth}{
\includegraphics[width=\linewidth]{images.eps}
\captionof{figure}{text}
\label{heat3}}%

\end{figure}


but it didn't change anything.

I tried with parbox to set limits to the caption text (without the captionof option),



\begin{figure}[t]
\parbox{.4\linewidth}{%
\includegraphics[width=\linewidth]{images.eps}
\caption[]{text}%
\label{heat2}}%
\hspace{.1\linewidth}%
\parbox{.4\linewidth}{
\includegraphics[width=\linewidth]{images.eps}
\caption[]{text}%
\label{heat3}}%

\end{figure}%


but it also fail to show any results.

And I did the same for the minipage without success.

It just doesn't working.

Imust admit, i didn't try it yet with subfig, becuase i was hoping to fix it without. I like the caption package and i know the options.

to start a new one is alweays a bit exhausting.
But I guess I don't have any other option. :confused:

sommerfee
26-10-2007, 09:33
This one is working fine here:



\documentclass{article}
\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}[t]
\parbox{.4\linewidth}{%
\includegraphics[width=\linewidth]{images.eps}
\caption{text}
\label{heat2}}%
\hspace{.1\linewidth}%
\parbox{.4\linewidth}{%
\includegraphics[width=\linewidth]{images.eps}
\caption{text}
\label{heat3}}%

\end{figure}

\end{document}


Even your very first code snipped is working fine when used in a minimal document:


\documentclass{article}
\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}[t]
\begin{minipage}[t]{.4\linewidth}
\includegraphics[width=\linewidth]{images/1.eps}
\caption{text right}
\label{2}
\end{minipage}\hfill
\hspace{.1\linewidth}
\begin{minipage}[t]{.4\linewidth}
\includegraphics[width=\linewidth]{images/2.eps}
\caption{text left}
\label{3}
\end{minipage}
\end{figure}

\end{document}


If this is not working in your document, there must be something in your document which prevents this from working. But we can't find this out unless you send us a complete example (which can be run through LaTeX, and especially not just code snippets) which shows your problem. Without a complete example we only can guess, which is not very effective when a problem should be solved.

frymor
26-10-2007, 11:10
O.k. I i've up. here is my complete header with the extra pages commented out. I tried it exactly as i send it here and it still don't do what i need.

When I'm trying to run it by itself in a separate document. it works perfectly fine, but I'm running it in my thesis file, I just get the caption of the second grafic with the text "test left"

So my header is:



\documentclass[oneside,a4paper]{book}
\usepackage{ngerman}
\usepackage[german,ngerman]{babel} % die nächsten drei Zeilen ermöglichen die
\usepackage[T1]{fontenc} % Verwendung von Umlauten, ohne diese
\usepackage[latin1]{inputenc} % besonders Quoten zu müssen.
\usepackage{nomencl}


%Alles, was mit den graphischen Einstellungen zu tun hat.
\usepackage[dvips,demo]{graphicx} % Hiermit werden ps-Dateien integriert.
\usepackage[dvips]{color} % Definiee farben, um den Text zu markieren
\definecolor{green}{cmyk}{1,0,1,0}
\definecolor{blue}{cmyk}{1,1,0,0}
\definecolor{red}{cmyk}{0,1,1,0}
\usepackage{pst-all}
\usepackage{multido}

%Seitenlayout
\usepackage{geometry}
\geometry{verbose,top=3cm,bottom=2cm,inner=2cm,out er=3cm,includefoot}
\setlength{\baselineskip}{1.5ex}
\setlength{\headsep}{5ex}
\usepackage{floatrow}
\usepackage{longtable}
\usepackage{supertabular}


\usepackage{fancyhdr}% das Paket, um Kopf und Fusszeilen zu gestalten
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.5pt}% Kopflinie
\renewcommand{\footrulewidth}{0pt}%Fußlinie
% der Befehl \sectionamrk wird umgeändert, um die Zeilen zu enthalten, die ich möchte
\renewcommand{\sectionmark}[1]{\markright{\thechapter : #1}}
\rhead{\textbf{\leftmark}}%die linke Seite wird ausgegeben. - hier der neue Befehl
\lhead{\bf \thepage} % Auf der rechte Seite kommt die Seitennumerierung.
\cfoot{}% Fußzeile bleibt leer.

%comments longer than one line can be put in the comment environment
\usepackage{verbatim}
\usepackage{pstricks}
\usepackage{float}
\usepackage{textcomp}
\usepackage[leftcaption]{sidecap} %Beschriftung an der Seite der Tabellen
\usepackage[justification=raggedright, font={footnotesize, rm}, singlelinecheck=off,labelfont=bf]{caption}

%Mathematic package
\usepackage{amsmath}

% font layout
\usepackage{times}

\begin{document}
{\fontfamily{ptm}\fontsize{12}{20pt} % macht das ganze etwas größer
\selectfont
\tableofcontents
\listoffigures
\listoftables
\newpage
%\pagenumbering{arabic}%Die Numerierung verflogt arabische Ziffern (1,2,3...)
%\setlength{\parskip}{6pt} % Abstand zwischen den Absätzen

%\input{Einleitung}

\newpage

%\input{methodik}

\newpage

%\input{results}

\newpage

%\input{Ausblick}

\newpage

%\input{Diskussion}
\begin{figure}[t]
\begin{minipage}[t]{.4\linewidth}
\includegraphics[width=\linewidth]{images.eps}
\caption{text right}
\label{2}
\end{minipage}\hfill
\hspace{.1\linewidth}
\begin{minipage}[t]{.4\linewidth}
\includegraphics[width=\linewidth]{images.eps}
\caption{text left}
\label{3}
\end{minipage}
\end{figure}

\newpage

%\input{Zusammenfassung}

\newpage

\bibliography{bibliography}
\bibliographystyle{plain}
\addcontentsline{toc}{chapter}{{\bf Literaturverzeichnis}}
\newpage
} %close the bracketts for the font definition - \fontfamily{ptm}\fontsize{12}{20pt} - Zeile 65
\end{document}


As I said I commented out all the input pages and copied the figure environment to the basic file. it still didn't work. I don't know if I'm missing something.

Can it be connected to the warning message I'm getting:
Package caption Warning: Unused \captionsetup[floatfoot]?

Please have a go.

THX

Assa

sommerfee
26-10-2007, 17:22
Thanks for your example.

The problem is in the line



\usepackage{floatrow}


The floatrow package redefines figure & table so special formatting options are avail, but at the cost that only one caption can be typeset per figure/table. (See floatrow documentation for details.)

As a solution you could either put


\RawFloats[figure]

right after \begin{document}, or you could use the subfig package for formatting and captioning the both figures.

Axel

frymor
27-10-2007, 14:23
THX,

it's working now just fine.

:rolleyes::rolleyes::rolleyes: