Hot answers tagged

36

You need to redefine \proofname: \documentclass{amsbook} \usepackage{amsthm} \renewcommand*{\proofname}{Solution} \begin{document} \begin{proof} This is a solution. \end{proof} \end{document}


32

You can put this in the preamble, without the need to define new theorem styles; in fact this redefines the plain and definition theorem styles in order that the theorem title has the same font attributes as the theorem heading: \usepackage{amsthm} \makeatletter \def\th@plain{% \thm@notefont{}% same as heading font \itshape % body font } \def\th@...


22

a manual way to drop to a new line immediately after the proof heading is to insert $ $\newline but it's possible to build on the existing proof definition and thereby retain the ability to use the \qedhere facility to move the "tombstone" up to the actual last line of the proof. \documentclass{article} \usepackage{amsmath,amsthm} \newenvironment{myproof}...


22

Yes, there's an easy way. You can define your solution environment with "Solution" as the optional argument for proof: \documentclass{article} \usepackage{amsthm} \newenvironment{solution} {\begin{proof}[Solution]} {\end{proof}} \begin{document} \begin{proof} test. \end{proof} \begin{solution} test. \end{solution} \end{document}


18

You need to update the way the theorem header is set, since it includes ( ) by default (taken from amsclass.dtx): \def\thmhead@plain#1#2#3{% \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}% \thmnote{ {\the\thm@notefont(#3)}}} \let\thmhead\thmhead@plain Note the use of (#3) above. So, we copy-and-paste the above definition with the adjustment: \...


16

You can put this code to the very end of your preamble: \usepackage{environ} \NewEnviron{killcontents}{} \let\proof\killcontents \let\endproof\endkillcontents It defines the environment killcontents that kills its contents, and then "maps" proof environment to killcontents.


16

it's probable that your proof ends with a list or a display environment. since you're using amsthm, you can put \qedhere just before the end of that environment and the "tombstone" will be moved up onto the last line of the list or display. edit: with the addition of a (non)working example, it became obvious that the problem was caused by a blank line ...


16

If you remove the blank line between This is the concluding line of the proof. and the \end{proof}, the problem disappears.


16

You can use mdframed: \documentclass{article} \usepackage{amsthm} \usepackage[framemethod=tikz]{mdframed} \usepackage{lipsum} \theoremstyle{plain} \newmdtheoremenv[ linecolor=cyan, roundcorner=5pt, linewidth=1pt ]{theo}{Theorem} \theoremstyle{definition} \newmdtheoremenv[ hidealllines=true, leftline=true, innerleftmargin=10pt, ...


16

This problem isn't so easy to solve. the problem consist in this: hyperref only defines a name if you use \newtheorem{theorem}{<theorem name>} for using with \autoref. This name is Theorem in English (obviously changes if we use babel), it is stored in the macro \theoremautorefname and can be changed using \renewcommand{\theoremautorefname}{<new ...


15

This is a more proper way to do it: \documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amssymb,amsmath,amsthm} \newtheorem{theorem}{Theorem} \usepackage{mathtools} % Bonus \DeclarePairedDelimiter\norm\lVert\rVert \begin{document} \section{Mathematical Methods} \begin{theorem}[Placheral's Theorem] ...


14

A better and simpler solution is to redefine \proofname: \usepackage{amsthm} \let\oldproofname=\proofname \renewcommand{\proofname}{\rm\bf{\oldproofname}} This is better than redefining the proof environment because the environment goes to considerable lengths to position the \qed mark correctly, and to respect the indentation style used in theorems (which ...


14

Here's a complete MWE with description using the amsthm package, see section 4.3 of the documentation for more details \documentclass{article} \usepackage{lipsum} \usepackage{amsthm} \newtheoremstyle{mystyle}% % Name {}% % Space above {}% % Space below {\itshape}% ...


14

This can be solved by using the final argument of \newtheoremstyle. It has an unusual format that is the content of a three argument command for printing the title heading. To get the name, number and optional title you make it be \thmname{#1}\thmnumber{ #2}\thmnote{ (#3)} which is essentially the standard definition \def\thmhead@plain#1#2#3{% \...


14

Loading thmtools and nameref will give you this feature. You will have to use \nameref instead of \cref, but I think most of the time it is you who is the best to decide whether it is the theorem's name or number you want to reference. EDIT Code added with commands \myref and \Myref for single references to automatically add the name in brackets when ...


14

\documentclass[12pt,a4paper]{scrreprt} \usepackage{amsthm} \usepackage{etoolbox} \newtheorem{defn}{Definition} \AfterEndEnvironment{defn}{\noindent\ignorespaces} \begin{document} \begin{defn} Some definition. \end{defn} This sentence isn't indented. \end{document} However this goes against intuition; the sentence after a definition (or any other theorem-...


14

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 from the tex engine itself if \par is seen in math mode. To prevent this latex would have to prevent blank lines generating a \par token (which is tricky to do ...


13

You can change just the end environment via: \let\Oldendex\endex% \def\endex{\qed\Oldendex}% Here is a before and after: Code: \documentclass{book} \usepackage{amssymb, amsmath, amsthm} \newtheorem{ex}{Example}[chapter] \let\Oldendex\endex% \def\endex{\qed\Oldendex}% \begin{document} \begin{ex} This is my example \end{ex} \end{document}


13

Seems to be "by design". Quoting from section 6.1 of the cleveref manual: [With the capitalise option,] [a]ll the default cross-reference formats will [...] have the first letter capitalised, as will the automatically generated \cref variants [...] (However, if you explicitly define a \cref variant to not be capitalised, cleveref will still honour ...


13

amsthm and mathtools are unrelated. mathtools updates and extends amsmath. you still need amsthm if you want the proof environment.


13

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 start a new paragraph inside a single math display, the display math environments were not implemented with paragraph breaks in mind (a simplification, but we ...


12

The following code uses the .aux file for that. It provides a macro \total@problems that sets \totalproblems to its parameter. And calls this macro at the end of document to store the value of counter problem. You need to run twice, and there is 0 stored at the first run. \documentclass{article} \usepackage{amsthm} \newtheorem{problem}{Problem} % STARTS ...


12

Your code can be made to work by modifying both \@totalleftmargin (which controls nested list indentation) and \linewidth as well as issuing a \parshape to take these changes into consideration: \documentclass{article} %\documentclass[fleqn]{article} \usepackage{amsthm} \newcommand{\Blabla}{Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla ...


12

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. I will update hyperref to address this (somehow:-) but meanwhile, this works: \documentclass{article} \usepackage{amsthm} \usepackage{hyperref} \usepackage{...


12

Quite easy! ;-) 1 \documentclass{article} \usepackage{amsthm} \newtheorem{manualtheoreminner}{Theorem} \newenvironment{manualtheorem}[1]{% \renewcommand\themanualtheoreminner{#1}% \manualtheoreminner }{\endmanualtheoreminner} \begin{document} \begin{manualtheorem}{2.3'}[title]\label{foo} This is a theorem. \end{manualtheorem} \begin{manualtheorem}{A}...


11

The code given in How to suppress vertical space between theorem heads and enumitem environments? almost works in this case but amsthm seems to require slightly different space correction otherwise the first item looks too close to the heading to me, try adding this to the preamble after the loading of the packages \makeatletter \def\enumfix{% \if@inlabel ...


11

I think you are looking for \renewcommand\proofSymbol{\ensuremath{\blacksquare}}


11

I think that all theorem-like environments should be treated in the same way, so a solution can be to use list instead of trivlist in the definitions, thus making it possible to use \leftmargin: \usepackage{etoolbox} \makeatletter \patchcmd{\@thm}{\trivlist}{\list{}{\leftmargin=2.5em}}{}{} \patchcmd{\@endtheorem}{\endtrivlist}{\endlist}{}{} \makeatother ...


11

You can redefine it to simply (Thanks to @egreg who pointed out the need for \unskip\nobreak) \renewcommand{\qed}{\unskip\nobreak\quad\qedsymbol}% Here's a (not so minimal) MWE: \documentclass{article} \usepackage{amsmath,amsthm} \renewcommand{\qed}{\unskip\nobreak\quad\qedsymbol}% As suggested by egreg \begin{document} \begin{proof} A Simple Proof Here ...


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