Problems with creating a new environment
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I need to create a new environment that works like:
beginexplanation
Here starts the explanation ...
endexplanation
In the document it should look like:
Explanation. Here starts the explanation ...
Still being relatively new to TeX I struggle to get the result I want.
I started with
documentclass[10pt,a4paper]article
usepackage[latin1]inputenc
usepackageamsmath
usepackageamsfonts
usepackageamssymb
usepackagegraphicx
newenvironmentexplanationtextbfExplanation.
begindocument
enddocument
but I don't know how to continue. Does anyone know how to continue?
environments
 |Â
show 1 more comment
up vote
1
down vote
favorite
I need to create a new environment that works like:
beginexplanation
Here starts the explanation ...
endexplanation
In the document it should look like:
Explanation. Here starts the explanation ...
Still being relatively new to TeX I struggle to get the result I want.
I started with
documentclass[10pt,a4paper]article
usepackage[latin1]inputenc
usepackageamsmath
usepackageamsfonts
usepackageamssymb
usepackagegraphicx
newenvironmentexplanationtextbfExplanation.
begindocument
enddocument
but I don't know how to continue. Does anyone know how to continue?
environments
Additshape
and remove the space after the closing brace oftextbf
.
â TeXnician
48 mins ago
I changed it tonewenvironmentexplanationtextbfExplanation.itshape
, which is closer to what I want but the text (in this case: Here starts the explanation) is still not cursive. I get what I want, when I usebeginexplanation textitHere ⦠endexplanation
but ideally I don't want to usetextit
â offline
45 mins ago
1
you are puttingitshape
at wrong location (at end of environment)
â jfbu
43 mins ago
2
You probably want something more likenewenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
. But I guess things should be slightly more sophisticated. Have a look atamsthm
.
â moewe
43 mins ago
1
Indeed. I'd suggestusepackageamsthm theoremstyleplain newtheorem*explanationExplanation
.
â moewe
42 mins ago
 |Â
show 1 more comment
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I need to create a new environment that works like:
beginexplanation
Here starts the explanation ...
endexplanation
In the document it should look like:
Explanation. Here starts the explanation ...
Still being relatively new to TeX I struggle to get the result I want.
I started with
documentclass[10pt,a4paper]article
usepackage[latin1]inputenc
usepackageamsmath
usepackageamsfonts
usepackageamssymb
usepackagegraphicx
newenvironmentexplanationtextbfExplanation.
begindocument
enddocument
but I don't know how to continue. Does anyone know how to continue?
environments
I need to create a new environment that works like:
beginexplanation
Here starts the explanation ...
endexplanation
In the document it should look like:
Explanation. Here starts the explanation ...
Still being relatively new to TeX I struggle to get the result I want.
I started with
documentclass[10pt,a4paper]article
usepackage[latin1]inputenc
usepackageamsmath
usepackageamsfonts
usepackageamssymb
usepackagegraphicx
newenvironmentexplanationtextbfExplanation.
begindocument
enddocument
but I don't know how to continue. Does anyone know how to continue?
environments
environments
edited 49 mins ago
asked 52 mins ago
offline
254
254
Additshape
and remove the space after the closing brace oftextbf
.
â TeXnician
48 mins ago
I changed it tonewenvironmentexplanationtextbfExplanation.itshape
, which is closer to what I want but the text (in this case: Here starts the explanation) is still not cursive. I get what I want, when I usebeginexplanation textitHere ⦠endexplanation
but ideally I don't want to usetextit
â offline
45 mins ago
1
you are puttingitshape
at wrong location (at end of environment)
â jfbu
43 mins ago
2
You probably want something more likenewenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
. But I guess things should be slightly more sophisticated. Have a look atamsthm
.
â moewe
43 mins ago
1
Indeed. I'd suggestusepackageamsthm theoremstyleplain newtheorem*explanationExplanation
.
â moewe
42 mins ago
 |Â
show 1 more comment
Additshape
and remove the space after the closing brace oftextbf
.
â TeXnician
48 mins ago
I changed it tonewenvironmentexplanationtextbfExplanation.itshape
, which is closer to what I want but the text (in this case: Here starts the explanation) is still not cursive. I get what I want, when I usebeginexplanation textitHere ⦠endexplanation
but ideally I don't want to usetextit
â offline
45 mins ago
1
you are puttingitshape
at wrong location (at end of environment)
â jfbu
43 mins ago
2
You probably want something more likenewenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
. But I guess things should be slightly more sophisticated. Have a look atamsthm
.
â moewe
43 mins ago
1
Indeed. I'd suggestusepackageamsthm theoremstyleplain newtheorem*explanationExplanation
.
â moewe
42 mins ago
Add
itshape
and remove the space after the closing brace of textbf
.â TeXnician
48 mins ago
Add
itshape
and remove the space after the closing brace of textbf
.â TeXnician
48 mins ago
I changed it to
newenvironmentexplanationtextbfExplanation.itshape
, which is closer to what I want but the text (in this case: Here starts the explanation) is still not cursive. I get what I want, when I use beginexplanation textitHere ⦠endexplanation
but ideally I don't want to use textit
â offline
45 mins ago
I changed it to
newenvironmentexplanationtextbfExplanation.itshape
, which is closer to what I want but the text (in this case: Here starts the explanation) is still not cursive. I get what I want, when I use beginexplanation textitHere ⦠endexplanation
but ideally I don't want to use textit
â offline
45 mins ago
1
1
you are putting
itshape
at wrong location (at end of environment)â jfbu
43 mins ago
you are putting
itshape
at wrong location (at end of environment)â jfbu
43 mins ago
2
2
You probably want something more like
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
. But I guess things should be slightly more sophisticated. Have a look at amsthm
.â moewe
43 mins ago
You probably want something more like
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
. But I guess things should be slightly more sophisticated. Have a look at amsthm
.â moewe
43 mins ago
1
1
Indeed. I'd suggest
usepackageamsthm theoremstyleplain newtheorem*explanationExplanation
.â moewe
42 mins ago
Indeed. I'd suggest
usepackageamsthm theoremstyleplain newtheorem*explanationExplanation
.â moewe
42 mins ago
 |Â
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
You will want to start a new paragraph for your environment and you need an itshape
. You could try
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
But I'd rather suggest to use a theorem package like amsthm
. Things are much easier there
documentclass[10pt,a4paper]article
usepackage[latin1]inputenc
usepackageamsmath
usepackageamssymb
usepackagekantlipsum% for the example text
% with amsthm
usepackageamsthm
theoremstyleplain
newtheorem*explanationExplanation
% manually
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
begindocument
kant[1]
beginexplanation
Here starts the explanation ...
endexplanation
kant[2]
beginpexplanation
Here starts the explanation ...
endpexplanation
kant[3]
enddocument
You can have your explanations counted with amsthm
if you use
newtheoremexplanationExplanation
(without the star) instead of newtheorem*
.
If you use pexplanation
you'll need more code
newcounterpexplanation
newenvironmentpexplanation%
par
refstepcounterpexplanation%
textbfExplanation thepexplanation. %
itshape
ignorespaces
par
Is there a way to count the Explanations like Explanation 1. ... Explanation 2. â¦
â offline
14 mins ago
1
@offline That is very easy withamsthm
: just remove the*
innewtheorem*
.
â moewe
14 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
You will want to start a new paragraph for your environment and you need an itshape
. You could try
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
But I'd rather suggest to use a theorem package like amsthm
. Things are much easier there
documentclass[10pt,a4paper]article
usepackage[latin1]inputenc
usepackageamsmath
usepackageamssymb
usepackagekantlipsum% for the example text
% with amsthm
usepackageamsthm
theoremstyleplain
newtheorem*explanationExplanation
% manually
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
begindocument
kant[1]
beginexplanation
Here starts the explanation ...
endexplanation
kant[2]
beginpexplanation
Here starts the explanation ...
endpexplanation
kant[3]
enddocument
You can have your explanations counted with amsthm
if you use
newtheoremexplanationExplanation
(without the star) instead of newtheorem*
.
If you use pexplanation
you'll need more code
newcounterpexplanation
newenvironmentpexplanation%
par
refstepcounterpexplanation%
textbfExplanation thepexplanation. %
itshape
ignorespaces
par
Is there a way to count the Explanations like Explanation 1. ... Explanation 2. â¦
â offline
14 mins ago
1
@offline That is very easy withamsthm
: just remove the*
innewtheorem*
.
â moewe
14 mins ago
add a comment |Â
up vote
3
down vote
accepted
You will want to start a new paragraph for your environment and you need an itshape
. You could try
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
But I'd rather suggest to use a theorem package like amsthm
. Things are much easier there
documentclass[10pt,a4paper]article
usepackage[latin1]inputenc
usepackageamsmath
usepackageamssymb
usepackagekantlipsum% for the example text
% with amsthm
usepackageamsthm
theoremstyleplain
newtheorem*explanationExplanation
% manually
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
begindocument
kant[1]
beginexplanation
Here starts the explanation ...
endexplanation
kant[2]
beginpexplanation
Here starts the explanation ...
endpexplanation
kant[3]
enddocument
You can have your explanations counted with amsthm
if you use
newtheoremexplanationExplanation
(without the star) instead of newtheorem*
.
If you use pexplanation
you'll need more code
newcounterpexplanation
newenvironmentpexplanation%
par
refstepcounterpexplanation%
textbfExplanation thepexplanation. %
itshape
ignorespaces
par
Is there a way to count the Explanations like Explanation 1. ... Explanation 2. â¦
â offline
14 mins ago
1
@offline That is very easy withamsthm
: just remove the*
innewtheorem*
.
â moewe
14 mins ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
You will want to start a new paragraph for your environment and you need an itshape
. You could try
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
But I'd rather suggest to use a theorem package like amsthm
. Things are much easier there
documentclass[10pt,a4paper]article
usepackage[latin1]inputenc
usepackageamsmath
usepackageamssymb
usepackagekantlipsum% for the example text
% with amsthm
usepackageamsthm
theoremstyleplain
newtheorem*explanationExplanation
% manually
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
begindocument
kant[1]
beginexplanation
Here starts the explanation ...
endexplanation
kant[2]
beginpexplanation
Here starts the explanation ...
endpexplanation
kant[3]
enddocument
You can have your explanations counted with amsthm
if you use
newtheoremexplanationExplanation
(without the star) instead of newtheorem*
.
If you use pexplanation
you'll need more code
newcounterpexplanation
newenvironmentpexplanation%
par
refstepcounterpexplanation%
textbfExplanation thepexplanation. %
itshape
ignorespaces
par
You will want to start a new paragraph for your environment and you need an itshape
. You could try
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
But I'd rather suggest to use a theorem package like amsthm
. Things are much easier there
documentclass[10pt,a4paper]article
usepackage[latin1]inputenc
usepackageamsmath
usepackageamssymb
usepackagekantlipsum% for the example text
% with amsthm
usepackageamsthm
theoremstyleplain
newtheorem*explanationExplanation
% manually
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
begindocument
kant[1]
beginexplanation
Here starts the explanation ...
endexplanation
kant[2]
beginpexplanation
Here starts the explanation ...
endpexplanation
kant[3]
enddocument
You can have your explanations counted with amsthm
if you use
newtheoremexplanationExplanation
(without the star) instead of newtheorem*
.
If you use pexplanation
you'll need more code
newcounterpexplanation
newenvironmentpexplanation%
par
refstepcounterpexplanation%
textbfExplanation thepexplanation. %
itshape
ignorespaces
par
edited 12 mins ago
answered 27 mins ago
moewe
76.2k797289
76.2k797289
Is there a way to count the Explanations like Explanation 1. ... Explanation 2. â¦
â offline
14 mins ago
1
@offline That is very easy withamsthm
: just remove the*
innewtheorem*
.
â moewe
14 mins ago
add a comment |Â
Is there a way to count the Explanations like Explanation 1. ... Explanation 2. â¦
â offline
14 mins ago
1
@offline That is very easy withamsthm
: just remove the*
innewtheorem*
.
â moewe
14 mins ago
Is there a way to count the Explanations like Explanation 1. ... Explanation 2. â¦
â offline
14 mins ago
Is there a way to count the Explanations like Explanation 1. ... Explanation 2. â¦
â offline
14 mins ago
1
1
@offline That is very easy with
amsthm
: just remove the *
in newtheorem*
.â moewe
14 mins ago
@offline That is very easy with
amsthm
: just remove the *
in newtheorem*
.â moewe
14 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451971%2fproblems-with-creating-a-new-environment%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Add
itshape
and remove the space after the closing brace oftextbf
.â TeXnician
48 mins ago
I changed it to
newenvironmentexplanationtextbfExplanation.itshape
, which is closer to what I want but the text (in this case: Here starts the explanation) is still not cursive. I get what I want, when I usebeginexplanation textitHere ⦠endexplanation
but ideally I don't want to usetextit
â offline
45 mins ago
1
you are putting
itshape
at wrong location (at end of environment)â jfbu
43 mins ago
2
You probably want something more like
newenvironmentpexplanationpartextbfExplanation. itshapeignorespacespar
. But I guess things should be slightly more sophisticated. Have a look atamsthm
.â moewe
43 mins ago
1
Indeed. I'd suggest
usepackageamsthm theoremstyleplain newtheorem*explanationExplanation
.â moewe
42 mins ago