Skip to content

Commit

Permalink
add Portuguese translations
Browse files Browse the repository at this point in the history
- also simplify logic of a few commands
  • Loading branch information
mbertucci47 committed Sep 19, 2024
1 parent c0de571 commit e38f5d9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- add `noteseparator` key
- add `\IfRestatingT`, `\IfRestatingF`
- add `store*` key
- add Portuguese translations

## [v0.1.2]
- Move support for memoir and AMS classes to dedicated files
Expand Down
Binary file modified doc/keytheorems-doc.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions doc/keytheorems-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ \section{Global Options}
{initially \cs{GetTranslation}\ttbraces{keythms\string_continues}\cs{pageref}\ttbraces{\#1}}
The code used to typeset the note produced by the \refKey{continues} key.
If English or an unknown language is used, defaults to \texttt{continuing from p.}\cs{,}\cs{pageref}\ttbraces{\#1}.
Currently (likely inaccurate!) translations exist for French, German, Italian, and Spanish.
Currently (likely inaccurate!) translations exist for French, German, Italian, Portuguese, and Spanish.
\end{docKey}

\begin{docKey}{qed-symbol}
Expand Down Expand Up @@ -868,7 +868,7 @@ \subsection{Keys inherited from \pkg{thmtools}}
{=\meta{text}}
{initially \cs{GetTranslation}\ttbraces{keythms\string_listof\string_title}}
Defaults to ``List of Theorems'' if English or an unknown language is used.
Currently French, German, Italian, and Spanish have (likely inaccurate!) translations.
Currently French, German, Italian, Portuguese, and Spanish have (likely inaccurate!) translations.
A translation can be added with a GitHub pull request or manually with \cs{DeclareTranslation}\marg{lang}\ttbraces{keythms\string_listof\string_title}\marg{text}.
\end{docKey}

Expand Down
2 changes: 1 addition & 1 deletion keytheorems-ideas.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
- [x] also different behavior for tcb theorems and not, namely spaceabove adds space
after section for former but not latter
- [ ] full control over list-of appearance, including name and number
- [ ] option to add list of theorems to TOC
- [x] option to add list of theorems to TOC. No, let user control manually.
- [x] list appearance does not match list of figures in memoir
- [x] make indent configurable in general
- [x] With amsart etc. no-title vert spacing is bad; currently uses empty title
Expand Down
34 changes: 13 additions & 21 deletions keytheorems.sty
Original file line number Diff line number Diff line change
Expand Up @@ -1433,13 +1433,11 @@
%%%%%%%%%%%%%%%%%%%%%

%%% \addtotheoremhook[<envname>]{<hook>}{<code>}
\NewDocumentCommand \addtotheoremhook { o m +m }
\NewDocumentCommand \addtotheoremhook { O{allthms} m +m }
{
\__hook_if_declared:nTF { keytheorems/allthms/#2 }
{
\IfNoValueTF { #1 }
{ \hook_gput_code:nnn { keytheorems/allthms/#2 } { . } { #3 } }
{ \hook_gput_code:nnn { keytheorems/#1/#2 } { . } { #3 } }
\hook_gput_code:nnn { keytheorems/#1/#2 } { . } { #3 }
}
{
\msg_error:nnn { keytheorems } { undefined-thm-hook } { #2 }
Expand Down Expand Up @@ -1900,7 +1898,7 @@

\cs_new_protected:Npn \__keythms_overload_code:
{
\RenewDocumentCommand { \newtheorem } { smomo }
\RenewDocumentCommand { \newtheorem } { s m o m o }
{
\IfBooleanTF { ##1 }
{ \keythms_thm_newkeythm:nn { ##2 } { name=##4, numbered=no } }
Expand Down Expand Up @@ -1943,29 +1941,21 @@
}
}
\ProvideDocumentCommand { \listoftheorems } { } { \listofkeytheorems }
\ProvideDocumentCommand { \addtotheorempreheadhook } { o m }
\ProvideDocumentCommand { \addtotheorempreheadhook } { O{allthms} m }
{
\IfNoValueTF { ##1 }
{ \addtotheoremhook { prehead } { ##2 } }
{ \addtotheoremhook [ ##1 ] { prehead } { ##2 } }
\addtotheoremhook [ ##1 ] { prehead } { ##2 }
}
\ProvideDocumentCommand { \addtotheorempostheadhook } { o m }
\ProvideDocumentCommand { \addtotheorempostheadhook } { O{allthms} m }
{
\IfNoValueTF { ##1 }
{ \addtotheoremhook { posthead } { ##2 } }
{ \addtotheoremhook [ ##1 ] { posthead } { ##2 } }
\addtotheoremhook [ ##1 ] { posthead } { ##2 }
}
\ProvideDocumentCommand { \addtotheoremprefoothook } { o m }
\ProvideDocumentCommand { \addtotheoremprefoothook } { O{allthms} m }
{
\IfNoValueTF { ##1 }
{ \addtotheoremhook { prefoot } { ##2 } }
{ \addtotheoremhook [ ##1 ] { prefoot } { ##2 } }
\addtotheoremhook [ ##1 ] { prefoot } { ##2 }
}
\ProvideDocumentCommand { \addtotheorempostfoothook } { o m }
\ProvideDocumentCommand { \addtotheorempostfoothook } { O{allthms} m }
{
\IfNoValueTF { ##1 }
{ \addtotheoremhook { postfoot } { ##2 } }
{ \addtotheoremhook [ ##1 ] { postfoot } { ##2 } }
\addtotheoremhook [ ##1 ] { postfoot } { ##2 }
}
\clist_new:N \l__keythms_tcbshaded_keys_clist
\clist_new:N \l__keythms_tcbthmbox_keys_clist
Expand Down Expand Up @@ -2287,6 +2277,8 @@
\ProvideTranslation { Italian } { keythms_continues } { continua~da~p.\, }
\ProvideTranslation { Spanish } { keythms_listof_title } { Lista~de~teoremas }
\ProvideTranslation { Spanish } { keythms_continues } { continúa~de~la~p.\, }
\ProvideTranslation { Portuguese } { keythms_listof_title } { Lista~de~teoremas }
\ProvideTranslation { Portuguese } { keythms_continues } { continua~da~p.\, }
}
}

Expand Down

0 comments on commit e38f5d9

Please sign in to comment.