Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I capitalize the first letter while using '\cref'? [closed]

Tags:

latex

I use package cleveref to refercence a figure or table in latex.

\usepackage{hyperref}
\usepackage{cleveref}

\cref{sim_figure}

The result is some like fig. 1, table I.

However, my expected result is Fig. 1 or Table I which is required by IEEEtran. How can I capitalize the first letter?

like image 820
SparkAndShine Avatar asked Jul 06 '15 06:07

SparkAndShine


People also ask

How do I automatically capitalize the first letter?

To use a keyboard shortcut to change between lowercase, UPPERCASE, and Capitalize Each Word, select the text and press SHIFT + F3 until the case you want is applied.

How do you capitalize the first letter of a sentence in python?

The first letter of a string can be capitalized using the capitalize() function. This method returns a string with the first letter capitalized. If you are looking to capitalize the first letter of the entire string the title() function should be used.

How do you capitalize the first letter of a sentence in Excel?

In cell B2, type =PROPER(A2), then press Enter. This formula converts the name in cell A2 from uppercase to proper case. To convert the text to lowercase, type =LOWER(A2) instead. Use =UPPER(A2) in cases where you need to convert text to uppercase, replacing A2 with the appropriate cell reference.


1 Answers

This is clearly outlines in the cleveref documentation.

You can either use \Cref, or pass the package option capitalise:

enter image description here

\documentclass{ieeetran}
\usepackage{hyperref}
\usepackage[capitalise]{cleveref}
\begin{document}
See \cref{fig:myfigure} or \Cref{fig:myfigure}.
\begin{figure}
  \caption{Some figure}\label{fig:myfigure}
\end{figure}
\end{document}

If you wish to customize the way \Cref prints (output Fig. rather than Figure), add

\Crefname{figure}{Fig.}{Figs.}% {<type>}{<singular>}{<plural>}
like image 199
Werner Avatar answered Oct 04 '22 12:10

Werner