[Tex/LaTex] Remove prefix from figure caption in tufte-book document class

captionsfloatstufte

I want to get rid of prefixes in figure captions. I use MikTeX, XeLaTeX and tufte-latex style class. I've tried three variants:

\caption*{Foto}
\usepackage[labelformat=empty]{caption}
\captionsetup[figure]{labelformat=empty}

but no one helped. Am I doing something wrong?
Here's MWE:

\documentclass[nofonts]{tufte-book}

\usepackage{polyglossia}
\setdefaultlanguage{russian}

\usepackage{fontspec}
\setmainfont{Palatino Linotype}

\usepackage{caption}

\begin{document}
\begin{figure}
    \includegraphics[scale=0.75]{square.png}
    \caption{Foto}
\end{figure}
\end{document}

Best Answer

If you want to remove only "Fig." (in Russian "Рис."), then

\makeatletter
\renewcommand{\fnum@figure}{\thefigure}
\makeatother

in the document preamble will print the caption as

1: Foto

If instead you want to get rid also of the number and the colon, a slightly more complicated patch is required: the whole \@caption command must be modified.

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@caption}
  {\noindent\csname fnum@#1\endcsname: \ignorespaces}
  {}
  {}{}
\makeatother

With this code you'll get only

Foto

Here's a complete example:

\documentclass[nofonts]{tufte-book}

\usepackage{polyglossia}
\setdefaultlanguage{russian}

\usepackage{fontspec}
\setmainfont{Palatino}
\newfontfamily{\cyrillicfont}{Palatino}

%%% With this code no name and number will appear
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@caption}
  {\noindent\csname fnum@#1\endcsname: \ignorespaces}
  {}
  {}{}
\makeatother

%%% Remove the above code and uncomment the following
%%% three lines if you still want the number
%\makeatletter
%\renewcommand{\fnum@figure}{\thefigure}
%\makeatother



\begin{document}

\begin{figure}
  \includegraphics[scale=0.75]{square.png}
  \caption{Foto}
\end{figure}

\end{document}

The package caption can't be used because tufte-book redefines the code for captions in an incompatible way.


In case you want no prefix and no number, but still want a list of figures (of course without the numbers), add also the following code before \makeatother:

\pretocmd{\@tufte@lof@line}
  {\begingroup\let\numberline\@gobble}
  {}{}
\apptocmd{\@tufte@lof@line}
  {\endgroup}
  {}{}

The captions in the list will be links to the actual figure.