3

I am writing a report that has graphics, photos and maps. If I use the figure environment everything is labeled as a figure in the caption. However, what I would like to do is where I have a map to have the map labeled appropriately e.g. Map 1: caption text; Map 2: caption text etc and to be able to refer to it in the text Map \ref{map01}. Same as for Photographs.

I have looked at some of the FAQs but does not seem to have what I want. Is it possible.

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jul 14 '14 at 5:39
  • \renewcommand{figurename}{Map} should do, but you have to change it back later on to \renewcommand{figurename}{Figure}. Usage of the caption package could help – user31729 Jul 14 '14 at 5:40
8

Define yourself new floats that match the type you're using:

enter image description here

\documentclass{article}
\usepackage{float}% http://ctan.org/pkg/float
\newfloat{photo}{htbp}{pho}\floatname{photo}{Photo}
\newfloat{map}{htbp}{map}\floatname{map}{Map}
\setcounter{topnumber}{3}% Just for this example
\begin{document}
Text
\begin{figure}[t] \caption{A figure} \end{figure}
\begin{photo}[t] \caption{A photo} \end{photo}
\begin{map}[t] \caption{A map} \end{map}
\end{document}

The float package provides

\newfloat{<type>}{<placement>}{<ext>}[<within>]
| improve this answer | |
7

If you use the tocbasic package from the KOMA-Script bundle you can also print a list of photos and a list of maps.

\documentclass{article}
\usepackage{tocbasic}
\DeclareNewTOC[%
  type=photo,
  float,
  name=Photo,
  listname={List of Photos},
  ]{pho}
\DeclareNewTOC[%
  type=map,
  float,
  name=Map,
  listname={List of Maps},
  ]{map}
\makeatletter
% entries to the lists should have the same layout like entries to the list of figures
  \renewcommand\l@photo{\l@figure}
  \renewcommand\l@map{\l@figure}
\makeatother
\begin{document}
\listoffigures
\listofphotos
\listofmaps

\begin{figure}[ht] \centering\fbox{Figure}\caption{A figure} \end{figure}
\begin{photo}[ht] \centering\fbox{Photo}\caption{A photo} \end{photo}
\begin{map}[ht] \centering\fbox{Map}\caption{A map} \end{map}
\end{document}

enter image description here

There is also a nonfloat option for \DeclareNewTOC. It defines the (additional) nonfloating environment <name>- (for example photo-).

| improve this answer | |
4

My solution uses the caption package and its \captionsetup facility, however, this way it is necessary to do this in every figure environment where the name should be changed.

This will also not provide different counters or separate lists of maps etc.

\documentclass{report}

\usepackage{caption}%
\usepackage[demo]{graphicx}%


\begin{document}
\listoffigures

\chapter{First}


\begin{figure}
\captionsetup{name=Map}%
\centering
\includegraphics{somefig}%
\caption{Some Text}%
\end{figure}



\begin{figure}
\captionsetup{name=Photo}%
\centering
\includegraphics{somefig}%
\caption{This photograph shows ...}%
\end{figure}


\end{document}

enter image description here

The figure "2" below the 'Map' is the pagenumber ;-)

| improve this answer | |

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.