Problems with creating a new environment

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question























  • 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







  • 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 at amsthm.
    – moewe
    43 mins ago







  • 1




    Indeed. I'd suggest usepackageamsthm theoremstyleplain newtheorem*explanationExplanation.
    – moewe
    42 mins ago














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?










share|improve this question























  • 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







  • 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 at amsthm.
    – moewe
    43 mins ago







  • 1




    Indeed. I'd suggest usepackageamsthm theoremstyleplain newtheorem*explanationExplanation.
    – moewe
    42 mins ago












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?










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 49 mins ago

























asked 52 mins ago









offline

254




254











  • 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







  • 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 at amsthm.
    – moewe
    43 mins ago







  • 1




    Indeed. I'd suggest usepackageamsthm theoremstyleplain newtheorem*explanationExplanation.
    – moewe
    42 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







  • 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 at amsthm.
    – moewe
    43 mins ago







  • 1




    Indeed. I'd suggest usepackageamsthm 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










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


screenshot of the MWE: The first **Explanation.** is shown in bold on a new line without indentation. The explanation is set off from the surrounding paragraphs by vertical space. The second **Explanation.** is indented like the beginning of a normal paragraph, it is not set off by vertical space.




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





share|improve this answer






















  • Is there a way to count the Explanations like Explanation 1. ... Explanation 2. …
    – offline
    14 mins ago






  • 1




    @offline That is very easy with amsthm: just remove the * in newtheorem*.
    – moewe
    14 mins ago










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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






























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


screenshot of the MWE: The first **Explanation.** is shown in bold on a new line without indentation. The explanation is set off from the surrounding paragraphs by vertical space. The second **Explanation.** is indented like the beginning of a normal paragraph, it is not set off by vertical space.




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





share|improve this answer






















  • Is there a way to count the Explanations like Explanation 1. ... Explanation 2. …
    – offline
    14 mins ago






  • 1




    @offline That is very easy with amsthm: just remove the * in newtheorem*.
    – moewe
    14 mins ago














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


screenshot of the MWE: The first **Explanation.** is shown in bold on a new line without indentation. The explanation is set off from the surrounding paragraphs by vertical space. The second **Explanation.** is indented like the beginning of a normal paragraph, it is not set off by vertical space.




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





share|improve this answer






















  • Is there a way to count the Explanations like Explanation 1. ... Explanation 2. …
    – offline
    14 mins ago






  • 1




    @offline That is very easy with amsthm: just remove the * in newtheorem*.
    – moewe
    14 mins ago












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


screenshot of the MWE: The first **Explanation.** is shown in bold on a new line without indentation. The explanation is set off from the surrounding paragraphs by vertical space. The second **Explanation.** is indented like the beginning of a normal paragraph, it is not set off by vertical space.




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





share|improve this answer














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


screenshot of the MWE: The first **Explanation.** is shown in bold on a new line without indentation. The explanation is set off from the surrounding paragraphs by vertical space. The second **Explanation.** is indented like the beginning of a normal paragraph, it is not set off by vertical space.




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






share|improve this answer














share|improve this answer



share|improve this answer








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 with amsthm: just remove the * in newtheorem*.
    – moewe
    14 mins ago
















  • Is there a way to count the Explanations like Explanation 1. ... Explanation 2. …
    – offline
    14 mins ago






  • 1




    @offline That is very easy with amsthm: just remove the * in newtheorem*.
    – 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

















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Comments

Popular posts from this blog

Long meetings (6-7 hours a day): Being “babysat” by supervisor

What does second last employer means? [closed]

One-line joke