Text FormattingUnbold algorithm caption

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
sladicg
Posts: 7
Joined: Mon Dec 21, 2009 2:42 pm

Unbold algorithm caption

Post by sladicg »

Hi!
Can anybody tell me how to unbold algorithm caption?

When I use algorithmic and algorithm packages, I got following caption:
Algorithm 1: My first algorithm

What I want is to replace bold "Algorithm" with unbold "Algorithm" and to replace ":" with ".", e.g.
Algorithm 1. My first algorithm

Any help?
Thanks in advance!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Unbold algorithm caption

Post by localghost »

sladicg wrote:[...] When I use algorithmic and algorithm packages, I got following caption [...]
I don't know packages with these names. At least they are not listed on CTAN. Build a minimal working example (MWE) to shows what you are doing.


Best regards
Thorsten¹
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Unbold algorithm caption

Post by sommerfee »

This works for me:

Code: Select all

\documentclass{article}
\usepackage{algorithm,algorithmic}
\usepackage{caption}
\captionsetup[algorithm]{labelfont=rm,labelsep=period}

\begin{document}

\begin{algorithm}[H]
  \caption{Calculate $y = x^n$}
  \label{alg1}
  \begin{algorithmic}
    \REQUIRE $n \geq 0 \vee x \neq 0$
    \ENSURE $y = x^n$
    \\ \ldots
  \end{algorithmic}
\end{algorithm}

\end{document}
sladicg
Posts: 7
Joined: Mon Dec 21, 2009 2:42 pm

Re: Unbold algorithm caption

Post by sladicg »

Thanks, this solve my problem.
Post Reply