Hello, how are you? :)
In this post I talk about
- How to declaretheorem like environments
Introduction
In past post I have talked about macros, but these just are instructions, they are shortens to do something bigger and avoid writing the same instruction many times, what about if we want to create environments?
Thetheorem like environment is an environment which you can personalize to be numbered according to a certain enumeration, this is useful because you can have the same format to different mathematical proofs, theorems, lemmas, etc, and instead of declaring or writing the same instruction, you just call the environment and it's all
Thetheorem
environment
We say that it is a
theorem
environment because it is the name of the command, as you are about to notice, but you can create Lemmas, Proofs, and many other stuff, it is just a matter that you put the appropriate name to that
The general instruction is
\newtheorem{name}{print}[numbered]
Where
name
is the name of the environmentprint
is the word to be shown in the documentnumbered
is the sectional unit based onwhich the environments is to be numbered (this is optional, you can see it because it has[]
instead of{}
An example
Produces
See? the environment puts a default enumeration, in this case, it has not any reference, but, innumbered
we can put according to what we want that enumeration, for example
section
for sectionsubsection
for subsection
Produces
You can play with this!!
Referencing to atheorem
Remember that we saytheorem because it is the name of the command
Do you remember the instructionref
andlabel
, if not you can check themhere andhere, there are good news, you can refer theorems too, the suggested way to call theorems and mathematical stuff is
\eqref{name}
Remember to import the
amsmath
package in the preamble
Wherename
is the name of the label, let's see some examples
Produces
Did you see, theeqref
adds some parentheses
Some conventions to use whilelabeling thetheorem are
thm
theoremprop
propositiondfn
definitionprf
proofcor
corollaryprinc
principlelem
lemma
Useful Tricks
Names of thetheorems
What if we want to be more specific in a theorem? What if we want to add aname, well we have two options, use[]
or()
Produces
Delete the cursive
When we are using any math theorem it puts the mathematical equations in cursive, and thetheorems are in cursive, it is a mess because sometimes it is difficult to differentiate between normal text and math stuff, so, if we want to delete the cursive in thetheorems we just need to add
\usepackage{amsthm}\theoremstyle{definition}
Produces
We need to import theamsthm
package and if we put the environment before\theoremstyle{definition}
it won't be affected, but if we put the environment after it it will be affected
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse