mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-26 18:07:18 +00:00
parent
029cd69df7
commit
0ae337014e
@ -16,6 +16,7 @@
|
|||||||
# - Example
|
# - Example
|
||||||
# - Problem
|
# - Problem
|
||||||
# - Exercise
|
# - Exercise
|
||||||
|
# - Solution
|
||||||
# - Remark
|
# - Remark
|
||||||
# - Claim
|
# - Claim
|
||||||
# - Case (by inclusion)
|
# - Case (by inclusion)
|
||||||
@ -42,6 +43,8 @@ Counter problem
|
|||||||
End
|
End
|
||||||
Counter exercise
|
Counter exercise
|
||||||
End
|
End
|
||||||
|
Counter solution
|
||||||
|
End
|
||||||
Counter remark
|
Counter remark
|
||||||
End
|
End
|
||||||
Counter claim
|
Counter claim
|
||||||
@ -264,6 +267,25 @@ Style Exercise
|
|||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
Style Solution
|
||||||
|
CopyStyle Definition
|
||||||
|
LatexName sol
|
||||||
|
LabelString "Solution \thesolution."
|
||||||
|
Preamble
|
||||||
|
\theoremstyle{definition}
|
||||||
|
\newtheorem{sol}{\protect\solutionname}
|
||||||
|
EndPreamble
|
||||||
|
Requires amsthm
|
||||||
|
LangPreamble
|
||||||
|
\providecommand{\solutionname}{_(Solution)}
|
||||||
|
EndLangPreamble
|
||||||
|
BabelPreamble
|
||||||
|
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
|
||||||
|
EndBabelPreamble
|
||||||
|
LabelCounter solution
|
||||||
|
End
|
||||||
|
|
||||||
|
|
||||||
Style Remark
|
Style Remark
|
||||||
CopyStyle Theorem
|
CopyStyle Theorem
|
||||||
LatexName rem
|
LatexName rem
|
||||||
|
@ -38,6 +38,8 @@ Counter definition
|
|||||||
End
|
End
|
||||||
Counter example
|
Counter example
|
||||||
End
|
End
|
||||||
|
Counter solution
|
||||||
|
End
|
||||||
Counter problem
|
Counter problem
|
||||||
End
|
End
|
||||||
Counter exercise
|
Counter exercise
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
# - Example
|
# - Example
|
||||||
# - Problem
|
# - Problem
|
||||||
# - Exercise
|
# - Exercise
|
||||||
|
# - Solution
|
||||||
# - Remark
|
# - Remark
|
||||||
# - Claim
|
# - Claim
|
||||||
# - Proof
|
# - Proof
|
||||||
@ -232,6 +233,23 @@ Style Exercise
|
|||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
Style Solution
|
||||||
|
CopyStyle Definition
|
||||||
|
LatexName sol
|
||||||
|
LabelString "Solution \thetheorem."
|
||||||
|
Preamble
|
||||||
|
\theoremstyle{definition}
|
||||||
|
\newtheorem{sol}[thm]{\protect\solutionname}
|
||||||
|
EndPreamble
|
||||||
|
LangPreamble
|
||||||
|
\providecommand{\solutionname}{_(Solution)}
|
||||||
|
EndLangPreamble
|
||||||
|
BabelPreamble
|
||||||
|
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
|
||||||
|
EndBabelPreamble
|
||||||
|
End
|
||||||
|
|
||||||
|
|
||||||
Style Remark
|
Style Remark
|
||||||
CopyStyle Theorem
|
CopyStyle Theorem
|
||||||
DependsOn Theorem
|
DependsOn Theorem
|
||||||
|
@ -58,6 +58,12 @@ End
|
|||||||
Style Exercise*
|
Style Exercise*
|
||||||
End
|
End
|
||||||
|
|
||||||
|
Style Solution
|
||||||
|
End
|
||||||
|
|
||||||
|
Style Solution*
|
||||||
|
End
|
||||||
|
|
||||||
Style Remark
|
Style Remark
|
||||||
End
|
End
|
||||||
|
|
||||||
|
@ -38,6 +38,10 @@ IfStyle Exercise
|
|||||||
RefPrefix exer
|
RefPrefix exer
|
||||||
End
|
End
|
||||||
|
|
||||||
|
IfStyle Solution
|
||||||
|
RefPrefix solu
|
||||||
|
End
|
||||||
|
|
||||||
IfStyle Remark
|
IfStyle Remark
|
||||||
RefPrefix rem
|
RefPrefix rem
|
||||||
End
|
End
|
||||||
|
@ -52,6 +52,13 @@ Style Example
|
|||||||
EndPreamble
|
EndPreamble
|
||||||
End
|
End
|
||||||
|
|
||||||
|
Style Solution
|
||||||
|
CopyStyle Solution*
|
||||||
|
DependsOn Solution*
|
||||||
|
Preamble
|
||||||
|
EndPreamble
|
||||||
|
End
|
||||||
|
|
||||||
Style Problem
|
Style Problem
|
||||||
CopyStyle Problem*
|
CopyStyle Problem*
|
||||||
DependsOn Problem*
|
DependsOn Problem*
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
# - Example
|
# - Example
|
||||||
# - Problem
|
# - Problem
|
||||||
# - Exercise
|
# - Exercise
|
||||||
|
# - Solution
|
||||||
# - Remark
|
# - Remark
|
||||||
# - Claim
|
# - Claim
|
||||||
# - Proof
|
# - Proof
|
||||||
@ -225,6 +226,23 @@ Style Exercise*
|
|||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
Style Solution*
|
||||||
|
CopyStyle Definition*
|
||||||
|
LatexName sol*
|
||||||
|
LabelString "Solution."
|
||||||
|
Preamble
|
||||||
|
\theoremstyle{definition}
|
||||||
|
\newtheorem*{sol*}{\protect\solutionname}
|
||||||
|
EndPreamble
|
||||||
|
LangPreamble
|
||||||
|
\providecommand{\solutionname}{_(Solution)}
|
||||||
|
EndLangPreamble
|
||||||
|
BabelPreamble
|
||||||
|
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
|
||||||
|
EndBabelPreamble
|
||||||
|
End
|
||||||
|
|
||||||
|
|
||||||
Style Remark*
|
Style Remark*
|
||||||
CopyStyle Theorem*
|
CopyStyle Theorem*
|
||||||
LatexName rem*
|
LatexName rem*
|
||||||
|
@ -2118,7 +2118,8 @@ def revert_solution(document):
|
|||||||
have_mod = False
|
have_mod = False
|
||||||
mods = document.get_module_list()
|
mods = document.get_module_list()
|
||||||
for mod in mods:
|
for mod in mods:
|
||||||
if mod == "theorems-std" or mod == "theorems-bytype":
|
if mod == "theorems-std" or mod == "theorems-bytype" \
|
||||||
|
or mod == "theorems-ams" or mod == "theorems-ams-bytype":
|
||||||
have_mod = True
|
have_mod = True
|
||||||
continue
|
continue
|
||||||
if not have_mod:
|
if not have_mod:
|
||||||
@ -2146,10 +2147,10 @@ def revert_solution(document):
|
|||||||
document.body[j : j + 1] = put_cmd_in_ert("\\end{sol}") + ["\\end_layout"]
|
document.body[j : j + 1] = put_cmd_in_ert("\\end{sol}") + ["\\end_layout"]
|
||||||
document.body[i : i + 1] = ["\\begin_layout Standard", ""] + begcmd
|
document.body[i : i + 1] = ["\\begin_layout Standard", ""] + begcmd
|
||||||
add_to_preamble(document, "\\providecommand{\solutionname}{Solution}")
|
add_to_preamble(document, "\\providecommand{\solutionname}{Solution}")
|
||||||
if mod == "theorems-std":
|
if mod == "theorems-std" or mod == "theorems-ams":
|
||||||
add_to_preamble(document, "\\theoremstyle{plain}\n" \
|
add_to_preamble(document, "\\theoremstyle{plain}\n" \
|
||||||
"\\newtheorem{sol}[thm]{\\protect\\solutionname}")
|
"\\newtheorem{sol}[thm]{\\protect\\solutionname}")
|
||||||
if mod == "theorems-bytype":
|
if mod == "theorems-bytype" or mod == "theorems-ams-bytype":
|
||||||
add_to_preamble(document, "\\theoremstyle{definition}\n" \
|
add_to_preamble(document, "\\theoremstyle{definition}\n" \
|
||||||
"\\newtheorem{sol}{\\protect\\solutionname}")
|
"\\newtheorem{sol}{\\protect\\solutionname}")
|
||||||
i = j
|
i = j
|
||||||
|
Loading…
x
Reference in New Issue
Block a user