I am compiling some figures as supplementary material and would like to have figure captions follow the convention:
Figure S1, Figure S2, Figure S3, …
How can I achieve this?
Minimal example:
\setuppapersize[A6]
\setupexternalfigures[location=default]
\setupcaptions[way=bytext]
\placefigure
{Cow}
{\externalfigure[cow][width=2cm]}
\placefigure
{Another Cow}
{\externalfigure[cow][width=2cm]}
\setuppapersize[A6]
\setupexternalfigures[location=default]
\setupcaptions[way=bytext, numbercommand=S]
\placefigure
{Cow}
{\externalfigure[cow][width=2cm]}
\placefigure
{Another Cow}
{\externalfigure[cow][width=2cm]}
Related
How can I start the numbering of figures at a specific digit in ConTeXt.
Minimal example:
\setuppapersize[A6]
\setupexternalfigures[location=default]
\setupcaptions[way=bytext]
\placefigure
{Cow}
{\externalfigure[cow][width=2cm]}
\placefigure
{Another Cow}
{\externalfigure[cow][width=2cm]}
\setuppapersize[A6]
\setupexternalfigures[location=default]
\setupcaptions[way=bytext]
\setnumber[figure][2]
\placefigure
{Cow}
{\externalfigure[cow][width=2cm]}
\placefigure
{Another Cow}
{\externalfigure[cow][width=2cm]}
I would like to know how I can add a figure to the caption of a figure. I want to keep the Figure number prefix.
I'm doing the following:
\begin{figure*}[!ht]
\centerline{\includegraphics{results.pdf}}
\caption{Caption, \includegraphics{arrow.pdf} caption.}
\label{fig:01}
\end{figure*}
But latex does not allow \includegraphics in the caption.
Thanks for your help.
Cheers,
ukrania
I just found the solution. It is necessary to use the \protect statement.
Like the following example:
\begin{figure*}[!ht]
\centerline{\includegraphics{results.pdf}}
\caption{Caption, \protect\includegraphics{arrow.pdf} caption.}
\label{fig:01}
\end{figure*}
Hope it helps other people with the same problem.
Cheers,
ukrania
How can i give another name to the main sections of a scientific paper in Latex? So instead of 'References' i wanna write a different title, instead of 'Abstract' another, and so on.
Regards
Redefine any of the following commands:
Abstract: \abstractname
Appendix: \appendixname
Bibliography: \bibname
Chapter: \chaptername
Contents: \contentsname
Index: \indexname
List of Figures: \listfigurename
List of Tables: \listtablename
Part: \partname
References: \refname
So, for example,
\renewcommand\refname{My References}
The list comes from The LaTeX Companion, 2nd edition, page 34.
For references \bibname is defined in the book class, but not in the article class. The latter is using \refname.
thanks! helped me a lot.
Just to help other fellas, it did not work for me before \begin{document}
I did it just before \part as below:
\renewcommand\partname{Capítulo}
\part{\textit{Conjuntura regulatória}}
\chapter{\large MATRIZ ENERGÉTICA BRASILEIRA}
worked as a charm.
I'm using packages subfigure and float to create figures and tables that I want to create and I'm trying to create my own environment graph with its own counter and caption (solved there, thanks to dmckee). Now I'd like to create \subgraph command which will do exactly the same as \subfigure command.
I tried create my own command with propreate counter (Assisted here, thanks to Alexey). But problem appears with using \ref command. Reference to \subfigure returns 2.1(a) but reference to \subgraph returns 1.
As I tried to find out how to solve this I read subfig manual, where I've found \newsubfloat command with an example. First error was in use of subfig's commands in subfigure and I got stuck there. If I use subfigure I can access \subfigure but can't force \subgraph working, when I use subfig I can acces \subfloat in graph but not in figure and \ref returns 1.0a instead of 1.1 (a).
definition by subfig package:
\newfloat{graph2}{tbph}{lom}[chapter]
\restylefloat*{graph2}
\floatstyle{plain}
\floatname{grap2}{Graph2}
\captionsetup[graph2]{position=top}
\newcommand{\listofGraphs}{\listof{Graph2}{List of Graphs}}
\newsubfloat[position=bottom,listofformat=subsimple]{graph2}
definition my own \subgraph
\newfloat{graph1}{H}{lop}[chapter]
\floatname{graph1}{Graph1}
\newcounter{GraphOne}[graph1]
\def\theGraphOne{\alph{GraphOne}}
\newcommand{\subgraph}[2][]{
\captionof{subGraph}{#1} #2
}
\newfloat{subGraph}{H}{lop}[graph1]
\floatname{subGraph}{}
Please help me with understanding how \label and \ref commands work (I think my solution collapses because \label is before \caption) and/or with forcing subfig package to work as I want.
Thank you for any idea and be merciful to my english.
Crowley
Improvement:
By using caption package I can create new counter (subGraph) and use it outside its environment. Only way how to have both counter (subgraph and graph) correcly referred is using \captionof{graph} before \subgraph.
So, my new question is: How to execute \captionof{graph} before subgraphs and typeset in below them? And how to force \ref to show 1.1-a instead of 1.1.1
Atachements:
Code for subfigure: (Returns <chapter>.<figure> (<subfigure>) correct.
\begin{figure}
\subfigure[sub-caption]{\includegraphics{fig1}\label{fig:1}}
\caption{main caption}
\end{figure}
\ref{fig:1}
Code for subfig: (Returns <chapter>.<graph2>-1<subfigure>) incorrect.
\begin{graph2}
\subfloat[sub-caption]{\includegraphics{fig1}\label{fig:2}}
\caption{main caption}
\end{graph2}
\ref{fig:2}
My code: (Returns <chapter>.<graph1>.<subgraph> but caption shows the same "adress")
\begin{graph1}
\captionof{graph1}{main caption}
\subgraph[sub-caption]{\includegraphics{fig1}\label{fig:3}}
\end{graph1}
\ref{fig:3}
I think your subfig solution should work (subfigure is deprecated anyway). The issue with the wrong references might have to do with you using \label incorrectly. You must have the \label command after the \caption, or as a part of it:
\begin{figure}
\caption{A Figure}
\label{fig}
\end{figure}
or
\begin{figure}
\caption{A Figure%
\label{fig}}
\end{figure}
Edit: the following "works for me". As I said, the \label is after the \caption:
\documentclass{report}
\usepackage{float}
\usepackage{subfig}
\newfloat{graph2}{tbph}{lom}[chapter]
\restylefloat*{graph2}
\floatstyle{plain}
\floatname{grap2}{Graph2}
\captionsetup[graph2]{position=top}
\newcommand{\listofGraphs}{\listof{Graph2}{List of Graphs}}
\newsubfloat[position=bottom,listofformat=subsimple]{graph2}
\begin{document}
\chapter{Test}
\section{Test s}
\begin{graph2}
\subfloat[sub-caption]{\fbox{Fig 1}}
\caption{main caption}
\label{fig:1}
\end{graph2}
\begin{graph2}
\subfloat[sub-caption]{\fbox{Fig 2}}
\caption{main caption}
\label{fig:2}
\end{graph2}
Graph~\ref{fig:1} is the first graph, and~\ref{fig:2} is the second.
\end{document}
This produces:
Graph 1.1 is the first graph, and 1.2 is the second.
I can't elaborate right now, but you want to use \refstepcounter instead of \addtocounter.
Most things I've wanted to do in LaTeX have either been straight-forward, or easily found on the web, but this one has been stumping me.
I have a macro 'solution': to apply some common formatting to each solution:
\newcommand\solution[1]{{\\ \\* \bf Solution.}#1\qed \newpage}
Which has worked nicely so far, but now I wanted to include a drawing which I've done quickly using 'ASCII Art' so I'd like to use \verbatim. But it doesn't work, it produces the following errors:
Runaway argument?
...
! File ended while scanning use of \#xverbatim.
From what I read in the "Not So Short introduction to LaTeX", \verbatim can't be used this way. I assume there is a better way to do what I'm trying to do?
This is a FAQ.
You could try changing \newcommand to \newenvironment and then use something like
\begin{solution}
\begin{verbatim}
[ascii art here]
\end{verbatim}
\end{solution}
Use the package cprotect
e.g. ( with tcolorbox but it is working with most of the newcommand created)
\usepackage{tcolorbox}
\usepackage{cprotect}
\newcommand{\tcb}[1] {
\begin{tcolorbox} [arc=0mm,colback=bginf,coltitle=black!70!black,colframe=black!30!white,width=\linewidth,fontupper=\bfseries\small,halign title=flush center,halign upper=center]
#1
\end{tcolorbox}
}
\cprotect\tcb{\scriptsize
\begin{verbatim}
...
\end{verbatim}
}