Text Formattingdefinition number in round brackets

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
mpaw
Posts: 3
Joined: Thu Nov 22, 2018 10:40 pm

definition number in round brackets

Post by mpaw »

Hello.

I need a way to set definition number (from subsection) in round brackets.

I.E.:
Definition (1.1.2)
Now I use such statement:

Code: Select all

\newtheorem{df}{Definition}[subsection]
\newtheorem{nt}[df]{Note}
\newtheorem{st}[df]{Statement}
It generates me theorems without round brackets. How can I add them?

Thanks
Mike

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

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

definition number in round brackets

Post by rais »

something along the lines of

Code: Select all

\documentclass{article}
\usepackage{amsthm}
\newtheoremstyle{numparens}%
  {}% space above
  {}% space below
  {\itshape}% body font
  {}% indent amount
  {\bfseries}% theorem head font
  {}% punctuation after theorem head
  {\newline}% space after theorem head
  {\thmname{#1}~(\thmnumber{#2})~\thmnote{#3}}% theorem head spec

\theoremstyle{numparens}
\newtheorem{df}{Definition}[subsection]

\theoremstyle{plain}
\newtheorem{nt}[df]{Note}
\newtheorem{st}[df]{Statement}

\begin{document}
\subsection{foo}
\begin{df}[whatever]
$\pi$ is constant.
\end{df}
some text

\begin{nt}
some note
\end{nt}
some text

\begin{st}
some statement
\end{st}
some text
\end{document}
should do.

KR
Rainer
Post Reply