Define a and end pair directly rather than define an environment called ?











up vote
3
down vote

favorite












While defining an environment <env> also defines the <env> and end<env> declarations, what are the circumstances where defining those declarations directly (without defining an environment) is preferable?



I see the following use where proof and endproof are defined separately in the informs3 document class file:



%% Use for proper proofs that end with extra space (regardless of the use
%% or non-use of qed (=the black box)
defproof#1{Trivlistitem[hspace*{1em}hskiplabelsep{it #1enskip }]ignorespaces}
defendproof{endTrivlistaddvspace{0pt}}


Is there any reason not to do newenvironment{proof}[1]{...}{...} instead?










share|improve this question


















  • 2




    I'm always amazed when journal styles reinvent the wheel, making it worse than the available models.
    – egreg
    Nov 17 at 16:43










  • @egreg Totally.
    – Fang Jing
    Nov 17 at 17:07






  • 1




    There are pieces of code which you can use both in LaTeX as begin{envname}..end{envname} and, e.g., in plain-TeX (, where you neither have LaTeX 2e's newenvironment-command nor have LaTeX 2e's environment-mechanism,) as envname..endenvname.
    – Ulrich Diez
    Nov 18 at 11:23

















up vote
3
down vote

favorite












While defining an environment <env> also defines the <env> and end<env> declarations, what are the circumstances where defining those declarations directly (without defining an environment) is preferable?



I see the following use where proof and endproof are defined separately in the informs3 document class file:



%% Use for proper proofs that end with extra space (regardless of the use
%% or non-use of qed (=the black box)
defproof#1{Trivlistitem[hspace*{1em}hskiplabelsep{it #1enskip }]ignorespaces}
defendproof{endTrivlistaddvspace{0pt}}


Is there any reason not to do newenvironment{proof}[1]{...}{...} instead?










share|improve this question


















  • 2




    I'm always amazed when journal styles reinvent the wheel, making it worse than the available models.
    – egreg
    Nov 17 at 16:43










  • @egreg Totally.
    – Fang Jing
    Nov 17 at 17:07






  • 1




    There are pieces of code which you can use both in LaTeX as begin{envname}..end{envname} and, e.g., in plain-TeX (, where you neither have LaTeX 2e's newenvironment-command nor have LaTeX 2e's environment-mechanism,) as envname..endenvname.
    – Ulrich Diez
    Nov 18 at 11:23















up vote
3
down vote

favorite









up vote
3
down vote

favorite











While defining an environment <env> also defines the <env> and end<env> declarations, what are the circumstances where defining those declarations directly (without defining an environment) is preferable?



I see the following use where proof and endproof are defined separately in the informs3 document class file:



%% Use for proper proofs that end with extra space (regardless of the use
%% or non-use of qed (=the black box)
defproof#1{Trivlistitem[hspace*{1em}hskiplabelsep{it #1enskip }]ignorespaces}
defendproof{endTrivlistaddvspace{0pt}}


Is there any reason not to do newenvironment{proof}[1]{...}{...} instead?










share|improve this question













While defining an environment <env> also defines the <env> and end<env> declarations, what are the circumstances where defining those declarations directly (without defining an environment) is preferable?



I see the following use where proof and endproof are defined separately in the informs3 document class file:



%% Use for proper proofs that end with extra space (regardless of the use
%% or non-use of qed (=the black box)
defproof#1{Trivlistitem[hspace*{1em}hskiplabelsep{it #1enskip }]ignorespaces}
defendproof{endTrivlistaddvspace{0pt}}


Is there any reason not to do newenvironment{proof}[1]{...}{...} instead?







macros environments






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 17 at 15:48









Fang Jing

5691612




5691612








  • 2




    I'm always amazed when journal styles reinvent the wheel, making it worse than the available models.
    – egreg
    Nov 17 at 16:43










  • @egreg Totally.
    – Fang Jing
    Nov 17 at 17:07






  • 1




    There are pieces of code which you can use both in LaTeX as begin{envname}..end{envname} and, e.g., in plain-TeX (, where you neither have LaTeX 2e's newenvironment-command nor have LaTeX 2e's environment-mechanism,) as envname..endenvname.
    – Ulrich Diez
    Nov 18 at 11:23
















  • 2




    I'm always amazed when journal styles reinvent the wheel, making it worse than the available models.
    – egreg
    Nov 17 at 16:43










  • @egreg Totally.
    – Fang Jing
    Nov 17 at 17:07






  • 1




    There are pieces of code which you can use both in LaTeX as begin{envname}..end{envname} and, e.g., in plain-TeX (, where you neither have LaTeX 2e's newenvironment-command nor have LaTeX 2e's environment-mechanism,) as envname..endenvname.
    – Ulrich Diez
    Nov 18 at 11:23










2




2




I'm always amazed when journal styles reinvent the wheel, making it worse than the available models.
– egreg
Nov 17 at 16:43




I'm always amazed when journal styles reinvent the wheel, making it worse than the available models.
– egreg
Nov 17 at 16:43












@egreg Totally.
– Fang Jing
Nov 17 at 17:07




@egreg Totally.
– Fang Jing
Nov 17 at 17:07




1




1




There are pieces of code which you can use both in LaTeX as begin{envname}..end{envname} and, e.g., in plain-TeX (, where you neither have LaTeX 2e's newenvironment-command nor have LaTeX 2e's environment-mechanism,) as envname..endenvname.
– Ulrich Diez
Nov 18 at 11:23






There are pieces of code which you can use both in LaTeX as begin{envname}..end{envname} and, e.g., in plain-TeX (, where you neither have LaTeX 2e's newenvironment-command nor have LaTeX 2e's environment-mechanism,) as envname..endenvname.
– Ulrich Diez
Nov 18 at 11:23












1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










newenvironment other than checking that the name is "safe" to define does nothing different to the def forms that you show (apart from using longdef unless the * form is used).



Especially in older code you will often see the lower level form, going back to when it could take several minutes to load a style file and not doing the checks in often used but unchanging definitions was a useful saving.






share|improve this answer























  • I realize I can actually do begin{proof}{Proof.} It's obvious. end{proof}.
    – Fang Jing
    Nov 17 at 17:08













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: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
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%2f460467%2fdefine-a-name-and-endname-pair-directly-rather-than-define-an-environment%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote



accepted










newenvironment other than checking that the name is "safe" to define does nothing different to the def forms that you show (apart from using longdef unless the * form is used).



Especially in older code you will often see the lower level form, going back to when it could take several minutes to load a style file and not doing the checks in often used but unchanging definitions was a useful saving.






share|improve this answer























  • I realize I can actually do begin{proof}{Proof.} It's obvious. end{proof}.
    – Fang Jing
    Nov 17 at 17:08

















up vote
4
down vote



accepted










newenvironment other than checking that the name is "safe" to define does nothing different to the def forms that you show (apart from using longdef unless the * form is used).



Especially in older code you will often see the lower level form, going back to when it could take several minutes to load a style file and not doing the checks in often used but unchanging definitions was a useful saving.






share|improve this answer























  • I realize I can actually do begin{proof}{Proof.} It's obvious. end{proof}.
    – Fang Jing
    Nov 17 at 17:08















up vote
4
down vote



accepted







up vote
4
down vote



accepted






newenvironment other than checking that the name is "safe" to define does nothing different to the def forms that you show (apart from using longdef unless the * form is used).



Especially in older code you will often see the lower level form, going back to when it could take several minutes to load a style file and not doing the checks in often used but unchanging definitions was a useful saving.






share|improve this answer














newenvironment other than checking that the name is "safe" to define does nothing different to the def forms that you show (apart from using longdef unless the * form is used).



Especially in older code you will often see the lower level form, going back to when it could take several minutes to load a style file and not doing the checks in often used but unchanging definitions was a useful saving.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 17 at 16:34









Phelype Oleinik

20.9k54380




20.9k54380










answered Nov 17 at 16:33









David Carlisle

478k3811091842




478k3811091842












  • I realize I can actually do begin{proof}{Proof.} It's obvious. end{proof}.
    – Fang Jing
    Nov 17 at 17:08




















  • I realize I can actually do begin{proof}{Proof.} It's obvious. end{proof}.
    – Fang Jing
    Nov 17 at 17:08


















I realize I can actually do begin{proof}{Proof.} It's obvious. end{proof}.
– Fang Jing
Nov 17 at 17:08






I realize I can actually do begin{proof}{Proof.} It's obvious. end{proof}.
– Fang Jing
Nov 17 at 17:08




















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460467%2fdefine-a-name-and-endname-pair-directly-rather-than-define-an-environment%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Probability when a professor distributes a quiz and homework assignment to a class of n students.

Aardman Animations

Are they similar matrix