Properly fix acknowledgment issue part 2/2

Remove acknowledgment theorem types

As we have learned, these shouldn't have been added from the get go.

Documents having it get a local layout definition.
This commit is contained in:
Juergen Spitzmueller 2023-02-05 12:07:37 +01:00
parent 0ab6a5c6d6
commit 6e5b3a1e31
9 changed files with 212 additions and 219 deletions

View File

@ -1,5 +1,5 @@
#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 614
\lyxformat 615
\begin_document
\begin_header
\save_transient_properties true
@ -3856,7 +3856,11 @@ Do we really need to tell you?
\end_layout
\begin_layout Acknowledgement*
\change_deleted -712698321 1675595089
Acknowledgement.
\change_unchanged
\end_layout
\begin_layout Conclusion*
@ -20735,17 +20739,15 @@ Summary
\family default
,
\change_deleted -712698321 1674897978
\change_deleted -712698321 1675594790
\family sans
Acknowledgement
\change_inserted -712698321 1674897978
Acknowledgment
\change_inserted 564990737 1672224959
\family default
,
\change_inserted 564990737 1672224959
\family sans
Conclusion
\family default
@ -20828,15 +20830,15 @@ Summary
\family default
,
\change_deleted -712698321 1675594800
\family sans
Acknowledg
\change_deleted -712698321 1674898178
e
\change_inserted 564990737 1672224959
ment
Acknowledgement
\family default
,
\change_inserted 564990737 1672224959
\family sans
Conclusion
\family default
@ -21055,15 +21057,15 @@ Summary
\family default
,
\change_deleted -712698321 1675594806
\family sans
Acknowledg
\change_deleted -712698321 1674898457
e
\change_inserted 564990737 1672224959
ment
Acknowledgement
\family default
,
\change_inserted 564990737 1672224959
\family sans
Conclusion
\family default
@ -28322,6 +28324,8 @@ status collapsed
\backslash
renewcommand
\change_unchanged
\end_layout
\end_inset
@ -28404,6 +28408,8 @@ star
\end_inset
\change_unchanged
\end_layout
\end_inset
@ -28430,6 +28436,8 @@ status collapsed
\change_inserted -712698321 1674916288
\SpecialChar TeX
Code
\change_unchanged
\end_layout
\end_inset
@ -28450,6 +28458,8 @@ status collapsed
star
\backslash
)
\change_unchanged
\end_layout
\end_inset

View File

@ -1,5 +1,5 @@
#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 614
\lyxformat 615
\begin_document
\begin_header
\save_transient_properties true
@ -2997,10 +2997,6 @@ Für die Erläuterung der Notationskonventionen.
Müssen wir das wirklich erläutern?
\end_layout
\begin_layout Acknowledgement*
Nun ja.
\end_layout
\begin_layout Conclusion*
Manchmal am Ende einer langen Argumentationskette verwendet.
\end_layout
@ -16431,11 +16427,6 @@ Zusammenfassung
\family default
,
\family sans
Danksagung
\family default
,
\family sans
Schlussfolgerung
\family default
@ -16505,11 +16496,6 @@ Zusammenfassung
\family default
,
\family sans
Danksagung
\family default
,
\family sans
Schlussfolgerung
\family default
@ -16636,11 +16622,6 @@ Zusammenfassung
\family default
,
\family sans
Danksagung
\family default
,
\family sans
Schlussfolgerung
\family default

View File

@ -32,8 +32,6 @@ NoStyle LyX-Code
NoStyle Verse
NoStyle Address
NoStyle Right_Address
NoStyle Acknowledgement*
NoStyle Acknowledgment*[[theorem]]
NoStyle Algorithm*
NoStyle Assumption*
NoStyle Axiom*
@ -127,11 +125,15 @@ Style Abstract
InTitle 1
End
Style Acknowledgment[[theorem]]
Style Acknowledgments
Category FrontMatter
LabelString "Acknowledgment[[theorem]]."
Preamble
EndPreamble
LatexType Environment
Align Left
Margin Dynamic
LabelType Static
LabelSep M
LabelString "Acknowledgments."
LatexName acknowledgement
DocBookTag para
DocBookAttr ""
DocBookWrapperTag acknowledgements

View File

@ -3,7 +3,7 @@
#DescriptionBegin
#Defines some additional theorem environments for use with the
#AMS theorems packages. Includes Criterion, Algorithm, Axiom,
#Condition, Note, Notation, Summary, Acknowledgment[[theorem]], Conclusion,
#Condition, Note, Notation, Summary, Conclusion,
#Assumption, and Case, in both numbered and non-numbered forms.
#Contrary to the plain AMS-Extended module, the different theorem
#types provided here each have a separate counter (e.g., criterion 1,
@ -31,7 +31,6 @@ Requires amsmath
# - Note
# - Notation
# - Summary
# - Acknowledgment (with LaTeX name acknowledgement for compatib.)
# - Conclusion
# - Assumption
# - Question
@ -322,57 +321,6 @@ Style Summary*
End
Style Acknowledgment[[theorem]]
CopyStyle Remark
LatexName acknowledgement
LabelString "Acknowledgment[[theorem]] \theacknowledgement."
Preamble
\theoremstyle{remark}
\newtheorem{acknowledgement}{\protect\acknowledgementname}
EndPreamble
LangPreamble
\providecommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}}
EndBabelPreamble
LabelCounter acknowledgement
DocBookTag para
DocBookAttr role='acknowledgement'
DocBookItemTag ""
End
Style Acknowledgement
ObsoletedBy Acknowledgment[[theorem]]
End
Style Acknowledgment*[[theorem]]
CopyStyle Remark*
LatexName acknowledgement*
LabelString "Acknowledgment[[theorem]]."
Preamble
\theoremstyle{remark}
\newtheorem*{acknowledgement*}{\protect\acknowledgementname}
EndPreamble
LangPreamble
\providecommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}}
EndBabelPreamble
DocBookTag para
DocBookAttr role='acknowledgement'
DocBookItemTag ""
End
Style Acknowledgement*
ObsoletedBy Acknowledgment*[[theorem]]
End
Style Conclusion
CopyStyle Remark
LatexName conclusion

View File

@ -3,7 +3,7 @@
#DescriptionBegin
#Defines some additional theorem environments for use with the
#AMS theorems packages. Includes Criterion, Algorithm, Axiom,
#Condition, Note, Notation, Summary, Acknowledgment[[theorem]], Conclusion,
#Condition, Note, Notation, Summary, Conclusion,
#Assumption, and Case, in both numbered and non-numbered forms.
#Contrary to the plain AMS-Extended module, the different theorem
#types provided here each have a separate counter, restarted with each
@ -32,7 +32,6 @@ Requires amsmath
# - Note
# - Notation
# - Summary
# - Acknowledgment (with LaTeX name acknowledgement for compatib.)
# - Conclusion
# - Assumption
# - Question
@ -59,9 +58,6 @@ End
Counter summary
Within chapter
End
Counter acknowledgement
Within chapter
End
Counter conclusion
Within chapter
End
@ -389,61 +385,6 @@ Style Summary*
End
Style Acknowledgment[[theorem]]
CopyStyle Remark
LatexName acknowledgement
LabelString "Acknowledgment[[theorem]] \theacknowledgement."
Preamble
\theoremstyle{remark}
\ifx\thechapter\undefined
\newtheorem{acknowledgement}{\protect\acknowledgementname}
\else
\newtheorem{acknowledgement}{\protect\acknowledgementname}[chapter]
\fi
EndPreamble
LangPreamble
\providecommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}}
EndBabelPreamble
LabelCounter acknowledgement
DocBookTag para
DocBookAttr role='acknowledgement'
DocBookItemTag ""
End
Style Acknowledgement
ObsoletedBy Acknowledgment[[theorem]]
End
Style Acknowledgment*[[theorem]]
CopyStyle Remark*
LatexName acknowledgement*
LabelString "Acknowledgment[[theorem]]."
Preamble
\theoremstyle{remark}
\newtheorem*{acknowledgement*}{\protect\acknowledgementname}
EndPreamble
LangPreamble
\providecommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}}
EndBabelPreamble
DocBookTag para
DocBookAttr role='acknowledgement'
DocBookItemTag ""
End
Style Acknowledgement*
ObsoletedBy Acknowledgment*[[theorem]]
End
Style Conclusion
CopyStyle Remark
LatexName conclusion

View File

@ -3,7 +3,7 @@
#DescriptionBegin
#Defines some additional theorem environments for use with the
#AMS theorems packages. Includes Criterion, Algorithm, Axiom,
#Condition, Note, Notation, Summary, Acknowledgment[[theorem]], Conclusion,
#Condition, Note, Notation, Summary, Conclusion,
#Fact, Assumption, Case, and Question, in both numbered and non-numbered
#forms.
#DescriptionEnd
@ -27,7 +27,6 @@ Requires amsmath
# - Note
# - Notation
# - Summary
# - Acknowledgment (with LaTeX name acknowledgement for compatib.)
# - Conclusion
# - Fact
# - Assumption
@ -313,56 +312,6 @@ Style Summary*
End
Style Acknowledgment[[theorem]]
CopyStyle Remark
LatexName acknowledgement
LabelString "Acknowledgment[[theorem]] \thetheorem."
Preamble
\theoremstyle{remark}
\newtheorem{acknowledgement}[thm]{\protect\acknowledgementname}
EndPreamble
LangPreamble
\providecommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}}
EndBabelPreamble
DocBookTag para
DocBookAttr role='acknowledgement'
DocBookItemTag ""
End
Style Acknowledgement
ObsoletedBy Acknowledgment[[theorem]]
End
Style Acknowledgment*[[theorem]]
CopyStyle Remark*
LatexName acknowledgement*
LabelString "Acknowledgment[[theorem]]."
Preamble
\theoremstyle{remark}
\newtheorem*{acknowledgement*}{\protect\acknowledgementname}
EndPreamble
LangPreamble
\providecommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgment[[theorem]])}}
EndBabelPreamble
DocBookTag para
DocBookAttr role='acknowledgement'
DocBookItemTag ""
End
Style Acknowledgement*
ObsoletedBy Acknowledgment*[[theorem]]
End
Style Conclusion
CopyStyle Remark
LatexName conclusion

View File

@ -24,9 +24,6 @@ End
Counter summary
GuiName Summary
End
Counter acknowledgement
GuiName Acknowledgement[[theorem]]
End
Counter conclusion
GuiName Conclusion
End

View File

@ -82,10 +82,6 @@ ModifyStyle Summary
RefPrefix sum
End
ModifyStyle Acknowledgment[[theorem]]
RefPrefix ack
End
ModifyStyle Conclusion
RefPrefix conc
End
@ -94,7 +90,6 @@ ModifyStyle Assumption
RefPrefix assu
End
ModifyStyle Question
RefPrefix que
End

View File

@ -4717,6 +4717,7 @@ ack_layouts_new = {
"aastex62" : "Acknowledgments",
"achemso" : "Acknowledgments",
"acmart" : "Acknowledgments",
"AEA" : "Acknowledgments",
"apa" : "Acknowledgments",
"copernicus" : "Acknowledgments",
"egs" : "Acknowledgments",# + Acknowledgment
@ -4739,6 +4740,7 @@ ack_layouts_old = {
"aastex62" : "Acknowledgement",
"achemso" : "Acknowledgement",
"acmart" : "Acknowledgements",
"AEA" : "Acknowledgement",
"apa" : "Acknowledgements",
"copernicus" : "Acknowledgements",
"egs" : "Acknowledgements",# + Acknowledgement
@ -4799,6 +4801,174 @@ def revert_acknowledgment(document):
break
document.body[i] = "\\begin_layout Acknowledgement"
ack_theorem_def = [
r'### Inserted by lyx2lyx (ams extended theorems) ###',
r'### This requires theorems-ams-extended module to be loaded',
r'Style Acknowledgement',
r' CopyStyle Remark',
r' LatexName acknowledgement',
r' LabelString "Acknowledgement \thetheorem."',
r' Preamble',
r' \theoremstyle{remark}',
r' \newtheorem{acknowledgement}[thm]{\protect\acknowledgementname}',
r' EndPreamble',
r' LangPreamble',
r' \providecommand{\acknowledgementname}{_(Acknowledgement)}',
r' EndLangPreamble',
r' BabelPreamble',
r' \addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgement)}}',
r' EndBabelPreamble',
r' DocBookTag para',
r' DocBookAttr role="acknowledgement"',
r' DocBookItemTag ""',
r'End',
]
ackStar_theorem_def = [
r'### Inserted by lyx2lyx (ams extended theorems) ###',
r'### This requires a theorems-ams-extended-* module to be loaded',
r'Style Acknowledgement*',
r' CopyStyle Remark*',
r' LatexName acknowledgement*',
r' LabelString "Acknowledgement."',
r' Preamble',
r' \theoremstyle{remark}',
r' \newtheorem*{acknowledgement*}{\protect\acknowledgementname}',
r' EndPreamble',
r' LangPreamble',
r' \providecommand{\acknowledgementname}{_(Acknowledgement)}',
r' EndLangPreamble',
r' BabelPreamble',
r' \addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgement)}}',
r' EndBabelPreamble',
r' DocBookTag para',
r' DocBookAttr role="acknowledgement"',
r' DocBookItemTag ""',
r'End',
]
ack_bytype_theorem_def = [
r'### Inserted by lyx2lyx (ams extended theorems) ###',
r'### This requires theorems-ams-extended-bytype module to be loaded',
r'Counter acknowledgement',
r' GuiName Acknowledgment',
r'End',
r'Style Acknowledgement',
r' CopyStyle Remark',
r' LatexName acknowledgement',
r' LabelString "Acknowledgement \theacknowledgement."',
r' Preamble',
r' \theoremstyle{remark}',
r' \newtheorem{acknowledgement}{\protect\acknowledgementname}',
r' EndPreamble',
r' LangPreamble',
r' \providecommand{\acknowledgementname}{_(Acknowledgement)}',
r' EndLangPreamble',
r' BabelPreamble',
r' \addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgement)}}',
r' EndBabelPreamble',
r' DocBookTag para',
r' DocBookAttr role="acknowledgement"',
r' DocBookItemTag ""',
r'End',
]
ack_chap_bytype_theorem_def = [
r'### Inserted by lyx2lyx (ams extended theorems) ###',
r'### This requires theorems-ams-extended-chap-bytype module to be loaded',
r'Counter acknowledgement',
r' GuiName Acknowledgment',
r' Within chapter',
r'End',
r'Style Acknowledgement',
r' CopyStyle Remark',
r' LatexName acknowledgement',
r' LabelString "Acknowledgement \theacknowledgement."',
r' Preamble',
r' \theoremstyle{remark}',
r' \ifx\thechapter\undefined',
r' \newtheorem{acknowledgement}{\protect\acknowledgementname}',
r' \else',
r' \newtheorem{acknowledgement}{\protect\acknowledgementname}[chapter]',
r' \fi',
r' EndPreamble',
r' LangPreamble',
r' \providecommand{\acknowledgementname}{_(Acknowledgement)}',
r' EndLangPreamble',
r' BabelPreamble',
r' \addto\captions$$lang{\renewcommand{\acknowledgementname}{_(Acknowledgement)}}',
r' EndBabelPreamble',
r' DocBookTag para',
r' DocBookAttr role="acknowledgement"',
r' DocBookItemTag ""',
r'End',
]
def convert_ack_theorems(document):
"""Put removed acknowledgement theorems to local layout"""
haveAck = False
haveStarAck = False
if "theorems-ams-extended-bytype" in document.get_module_list():
i = 0
while True:
if haveAck and haveStarAck:
break
i = find_token(document.body, '\\begin_layout Acknowledgement', i)
if i == -1:
break
if document.body[i] == "\\begin_layout Acknowledgement*" and not haveStarAck:
document.append_local_layout(ackStar_theorem_def)
haveStarAck = True
elif not haveAck:
document.append_local_layout(ack_bytype_theorem_def)
haveAck = True
i += 1
elif "theorems-ams-extended-chap-bytype" in document.get_module_list():
i = 0
while True:
if haveAck and haveStarAck:
break
i = find_token(document.body, '\\begin_layout Acknowledgement', i)
if i == -1:
break
if document.body[i] == "\\begin_layout Acknowledgement*" and not haveStarAck:
document.append_local_layout(ackStar_theorem_def)
haveStarAck = True
elif not haveAck:
document.append_local_layout(ack_chap_bytype_theorem_def)
haveAck = True
i += 1
elif "theorems-ams-extended" in document.get_module_list():
i = 0
while True:
if haveAck and haveStarAck:
break
i = find_token(document.body, '\\begin_layout Acknowledgement', i)
if i == -1:
break
if document.body[i] == "\\begin_layout Acknowledgement*" and not haveStarAck:
document.append_local_layout(ackStar_theorem_def)
haveStarAck = True
elif not haveAck:
document.append_local_layout(ack_theorem_def)
haveAck = True
i += 1
def revert_ack_theorems(document):
"""Remove acknowledgement theorems from local layout"""
if "theorems-ams-extended-bytype" in document.get_module_list():
document.del_local_layout(ackStar_theorem_def)
document.del_local_layout(ack_bytype_theorem_def)
elif "theorems-ams-extended-chap-bytype" in document.get_module_list():
document.del_local_layout(ackStar_theorem_def)
document.del_local_layout(ack_chap_bytype_theorem_def)
elif "theorems-ams-extended" in document.get_module_list():
document.del_local_layout(ackStar_theorem_def)
document.del_local_layout(ack_theorem_def)
##
# Conversion hub
#
@ -4875,10 +5045,10 @@ convert = [
[612, [convert_starred_refs]],
[613, []],
[614, [convert_hyper_other]],
[615, [convert_acknowledgment]]
[615, [convert_acknowledgment,convert_ack_theorems]]
]
revert = [[614, [revert_acknowledgment]],
revert = [[614, [revert_ack_theorems,revert_acknowledgment]],
[613, [revert_hyper_other]],
[612, [revert_familydefault]],
[611, [revert_starred_refs]],