5

How to insert a dot after the theorem environment? I use \newtheorem{exerc}{}.

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}

\usepackage{theorem}
\newtheorem{exerc}{}

\begin{document}
\begin{exerc}
 Exercise
\end{exerc}
\end{document}

I need.

  1. Exercise
  2. Exercise
7

Add

\renewcommand{\theexerc}{\arabic{exerc}.}% #.

just after you declare your new theorem \newtheorem{exerc}{}.

  • 8
    Generally, it's a bad idea to touch \theexerc for that sort of thing as it will also affects the \label/\ref mechanism. Using \theoremseparator{.} from the ntheorem package (which is an expansion of the theorem package) will avoid any side effect. – Philippe Goutet Aug 19 '11 at 20:48
14

I usually use amsthm instead of theorem. It provides \newtheoremstyle in which you can define your own theorem styles:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}

\usepackage{amsthm}
% the following style is based on the example
% found in the amsthm manual
\newtheoremstyle{mystyle}% name
{3pt}% space above
{3pt}% space below
{}% body font
{}% indent amount
{}% theorem head font
{.}% punctuation after theorem head
{.5em}% space after theorem head
{}% theorem head spec

\theoremstyle{mystyle}
\newtheorem{exerc}{}

\begin{document}
\begin{exerc}
Exercise
\end{exerc}
\end{document}

image

Hope it helps. =)

5

Below is a solution using ntheorem. As a side note, if you're making Exercises/Problems with associated solutions, you might like to look up the answers package.

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{ntheorem}

\theoremstyle{plain}
\theorembodyfont{}
\theoremsymbol{}
\theoremprework{}
\theorempostwork{}
\theoremseparator{.}
\newtheorem{exerc}{}

\begin{document}

\begin{exerc}
 Exercise
\end{exerc}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.