16

I have a document with many description environments. I would like to change all these description environments to LaTeXdescription environments, without manually changing all the occurrences of description.

Is there a way to tell LaTeX that I want the description environment to be just a synonym for LaTeXdescription?

gioele
  • 795
  • 1
    @user202729 Actually, the question you suggest was asked 6 month later. So basically this question here can't be the duplicate. – Roland Nov 26 '22 at 03:40
  • 1
    @Roland while the wording of the banner suggests otherwise ("this question has been asked before") it is fine to close a question as a duplicate of a later one. The idea is to choose the best/most complete/easiest to understand question as the duplicate target, which is not necessarily the oldest. See https://meta.stackexchange.com/questions/147643/should-i-vote-to-close-a-duplicate-question-even-though-its-much-newer-and-ha with the answer of Shog9 who is a (now former) Stack Exchange staff member. – Marijn Nov 28 '22 at 09:24
  • @Marijn I'm probably biased, but it seems to me that both the question and the answers in this question ("the one closed as duplicate") are better from the point of view of clarity and conciseness. In fact this question has 10k views compared to 5k views of the other. – gioele Nov 28 '22 at 13:04
  • @gioele either direction of closure would be ok for me in this case, I agree that this question is more concise but the other question provides useful extra information. However, my point in the previous comment was not to give my opinion on which question should be closed, just to remark that the reasoning in Roland's comment (this question is older so it can't be the one closed as duplicate) is not an existing rule or valid argument. – Marijn Nov 28 '22 at 13:51

2 Answers2

19

This should work:

\renewenvironment{description}{%
    \begin{LaTeXdescription}%
}{%
    \end{LaTeXdescription}%
    \ignorespacesafterend%
}
19

It depends a bit on how you define , specifically whether you define it in terms of the existing description but assuming LaTeXdescription is not defined to expand to something involving description you should be able to do

\let\description\LaTeXdescription
\let\enddescription\endLaTeXdescription
David Carlisle
  • 757,742