Hot answers tagged

24 votes
Accepted

New theorem environment with manual theorem number

Quite easy! ;-) 1 \documentclass{article} \usepackage{amsthm} \newtheorem{manualtheoreminner}{Theorem} \newenvironment{manualtheorem}[1]{% \renewcommand\themanualtheoreminner{#1}% \...
egreg's user avatar
  • 1.1m
17 votes
Accepted

cleveref and amsthm -- incorrect environment name

You just need to move the definitions of your theorem-like environments to after the loading of cleveref package: \documentclass{memoir} \usepackage{amsthm} \usepackage[capitalise]{cleveref} % ...
Andrew Swann's user avatar
  • 94.9k
16 votes
Accepted

Why align and equation environment do not tolerate empty lines?

The error message tells exactly why it is problematic: Paragraph ended before \align was complete. In standard (La)TeX, an empty line signifies a paragraph break. Since it does not make sense to ...
Paul Gessler's user avatar
  • 29.4k
15 votes
Accepted

Marking the end of a definition

The amsthm isn't the best on its own; however, thmtools provides a really neat 'front-end' for amsthm and other theorem packages. In particular, thmtools includes a prefoothook and postfoothook which ...
JP-Ellis's user avatar
  • 8,859
15 votes
Accepted

Clash between newtxmath and amsthm packages

\openbox is defined by a number of packages As a quick workaround, you could undefine \openbox before loading amsthm \documentclass[letterpaper, 10pt, oneside]{book} \usepackage{XCharter} \...
samcarter_is_at_topanswers.xyz's user avatar
14 votes

Is there a \renewtheorem equivalent of \renewcommand, using amsthm and not ntheorem?

If one systematically needs different theorems definitions in the same documents, egreg approach is convenient. But many of us might have a mymath.tex with common shortcuts and settings, which is a ...
antonio's user avatar
  • 1,426
14 votes

Why align and equation environment do not tolerate empty lines?

By design latex tries to give commands a consistent syntax, the environment syntax in particular here makes it clear what is intended to be in math, and what is not. However the error message comes ...
David Carlisle's user avatar
12 votes

pdfTeX warning: destination with same identifier has been already used, duplicate ignored (weird behavior)

try \usepackage[hypertexnames=false]{hyperref}
Zhenyao Sun's user avatar
12 votes
Accepted

texlive 2016 hyperref/cleverref incompatibility

UPDATE This is fixed in hyperref release 6.83q 2016-06-24 The change to hyperref was to fix this issue https://github.com/ho-tex/hyperref/issues/11 which I have just re-opened, pointing here. ...
David Carlisle's user avatar
11 votes

amsthm with shared counters messes up autoref references

The package thmtools fixes this. From the documentation: A.1.7 Fixing autoref and friends hyperref’s \autoref command does not work well with theorems that share a counter: it’ll always think ...
Josse's user avatar
  • 437
10 votes
Accepted

Remove dot after theorem with amsthm and hyperref

\documentclass{article} \usepackage{amsthm} \newtheorem{theorem}{Theorem}[section] \usepackage{xpatch} \makeatletter \xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{} \makeatother \begin{...
samcarter_is_at_topanswers.xyz's user avatar
10 votes
Accepted

Do the line breaking algorithms of TeX have a penalty for a QED symbol on a single line?

amsthm defines \qed by \DeclareRobustCommand{\qed}{% \ifmmode \mathqed \else \leavevmode\unskip\penalty9999 \hbox{}\nobreak\hfill \quad\hbox{\qedsymbol}% \fi } so it already assigns ...
David Carlisle's user avatar
10 votes
Accepted

Anti-italic in an Italic Environment

A good idea would be to use enumitem and to define a special environment for “theorem enumerations”, so as to ensure consistency across the document. documentclass{article} \usepackage{amsthm} \...
egreg's user avatar
  • 1.1m
9 votes

Marking the end of a definition

I really can't see the need for it. But since you're asking, \documentclass{article} \usepackage{amsthm} \usepackage{lipsum} \theoremstyle{definition} \newtheorem{defi/}{Definition} \...
egreg's user avatar
  • 1.1m
9 votes
Accepted

Package amsthm Warning: The \qedhere command... in Documenta style

As mentioned in another answer, amsthm should be loaded after amsmath. As described in a comment on that answer, this warning is produced when amsthm is incorrectly loaded before amsmath.
Coby Viner's user avatar
  • 1,919
9 votes
Accepted

Stars left to theorem (for exercises)

The main problem is the double optional argument. I suggest using a different syntax in order to distinguish between them. \documentclass{article} \usepackage{amsthm,xparse} \theoremstyle{definition}...
egreg's user avatar
  • 1.1m
9 votes
Accepted

Reduce font size within all proofs

Welcome! Use \AtBeginEnvironment in your preamble: \documentclass{article} \usepackage{amsthm} \theoremstyle{definition} \newtheorem{theorem}{Theorem} \AtBeginEnvironment{proof}{\footnotesize} \...
Bernard's user avatar
  • 270k
9 votes
Accepted

"Unknown theoremstyle" warning with Springer Nature template

The template is set up with this preamble outline in sn-article.tex: \documentclass[sn-mathphys,Numbered]{sn-jnl}% Math and Physical Sciences Reference % <some more package loading> \usepackage{...
Werner's user avatar
  • 598k
8 votes
Accepted

How to start a list right after the heading in a redefined proof environment?

You have two errors: there should be [...] after \item, whereas you have {...} \hskip\labelsep should go inside the optional argument \makeatletter \renewenvironment{proof}[1][\proofname]{\par \...
egreg's user avatar
  • 1.1m
8 votes

Empty proof as standalone

Embedding the proof inside a minipage works: \documentclass{standalone} \usepackage{amsthm} \begin{document} \begin{minipage}{5cm} \begin{proof} \end{proof} \end{minipage} \end{document}
frougon's user avatar
  • 24k
7 votes

Problem with numbering theorem by section

Actually I have tried the solution of egreg's, and then find out that you don't need to create the command \spnewtheorem{xx}{XX}[section] It is the option envcountsect in the svjour3 class that ...
LanternD's user avatar
7 votes
Accepted

why does proof use trivlist?

Trivlist handles many things not handled by the simpler version for example xxx \begin{proof} zzz \end{proof} xxx \begin{proof} zzz \end{proof} you need to correctly handle ending the previous ...
David Carlisle's user avatar
7 votes
Accepted

\emph not working well in amsthm's "plain" style using XeLaTeX or LuaLaTeX

This has to do with the redefinition of \em performed by fontspec, which doesn't take into account the context, but only nesting of \em inside \em. The following workaround should work: \...
egreg's user avatar
  • 1.1m
7 votes
Accepted

Dash after theorem number: e.g. Theorem 1'

Use the manualtheorem I gave you in another answer. There is no need that the primed theorem immediately follows the original one; it could also come before it, because we use the \label-\ref ...
egreg's user avatar
  • 1.1m
7 votes
Accepted

How to obtain non Italic theorem text

The amsthm package provides several "theorem styles". While the default style, also known as the plain style, is programmed to typeset its body in italics, the remark and definition styles employ ...
Mico's user avatar
  • 495k
7 votes
Accepted

How to avoid an hyperref bug (?) in theorems

That is a known problem, but hyperref can't do much here currently (and don't want to) as the problem is in amsthm. See also https://github.com/latex3/hyperref/issues/48 As mentioned in the comment, ...
Ulrike Fischer's user avatar
6 votes

How to use autoref or cleveref when the theorem environments are in the class file?

You can redefine the theorem-like environments after hyperref and cleveref are loaded, using the same scheme in the class. \documentclass{lmcs} \usepackage{hyperref} \usepackage{cleveref} \...
egreg's user avatar
  • 1.1m
6 votes

Is there a \renewtheorem equivalent of \renewcommand, using amsthm and not ntheorem?

Reducing @antonio's answer: you can get a more robust result with only the first block of code; instead of a \renewtheorem, one can just as easily use a \cleartheorem as below: \makeatletter \def\...
oricha's user avatar
  • 321
6 votes
Accepted

Reset counter at beginning of proof

There are numerous ways to achieve the desired behavior. A relatively clean (and general) way is to use \AtBeginEnvironment from the etoolbox package to reset the counter associated with your claim ...
Guho's user avatar
  • 6,075

Only top scored, non community-wiki answers of a minimum length are eligible