Skip to content

Commit

Permalink
Fixed expansion of month to string
Browse files Browse the repository at this point in the history
Signed-off-by: João Lourenço <[email protected]>
  • Loading branch information
joaomlourenco committed Oct 8, 2024
1 parent 2b287f5 commit 1edf124
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 23 deletions.
32 changes: 13 additions & 19 deletions NOVAthesisFiles/Schools/nova/itqb/nova-itqb-defaults.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@
% \thesiscover(msc,1-1,image):={nova-itqb-cover}
% \thesiscover(msc,N-2,image):={nova-itqb-cover-back}

\providecolor{itqbgray207}{RGB}{207,207,207}
\providecolor{itqbgray189}{RGB}{189,189,189}
\providecolor{itqbgray127}{RGB}{127,127,127}
\providecolor{itqbgray89}{RGB}{89,89,89}
\providecolor{itqbgray38}{RGB}{38,38,38}
\providecolor{itqbgray25}{RGB}{25,25,25}
\providecolor{itqbgreen}{RGB}{39,177,153}

\spine(bg,color)={\theitqbcolor(\option{/novathesis/nova/itqb/cover/color},spine)}
% \thesiscover(spine,image)={spine}



% Spine info
\spine(logo)={\theschool(logo,neg)}

Expand All @@ -72,9 +78,11 @@

% \spine(author)={\thedocauthor(name,short)}
% \spine(title)={\textbf{\thedoctitle(\@LANG@COVER,main)}}
\spine(date):={\textcolor{itqbgray207}{\theoeiras(),} %
\thentdocdate(submission,month,text), \thentdocdate(submission,year)}
% \spine(date,1):={\theoeiras(), \color{cyan}\thentdocdate(month), \thentdocdate(year)}

\spine(date)={\textcolor{itqbgray207}{\theoeiras()},
\csuse{month\romannumeral\thentdocdate(submission,month) name}, \thentdocdate(submission,year)}
% \spine(date2):={\color{itqbgray207}{\theoeiras(),} %
% \thentdocdate(submission,month,text), \thentdocdate(submission,year)}

% \spine(text,angle)={0}
\spine(box,text,color)={white}
Expand Down Expand Up @@ -116,14 +124,6 @@
\margin(cover,right):={2cm}


\providecolor{itqbgray207}{RGB}{207,207,207}
\providecolor{itqbgray189}{RGB}{189,189,189}
\providecolor{itqbgray127}{RGB}{127,127,127}
\providecolor{itqbgray89}{RGB}{89,89,89}
\providecolor{itqbgray38}{RGB}{38,38,38}
\providecolor{itqbgray25}{RGB}{25,25,25}
\providecolor{itqbgreen}{RGB}{39,177,153}

\newdata{itqbcolor}
\itqbcolor(gray,front,bar):={itqbgray89}
\itqbcolor(gray,front,text):={white}
Expand Down Expand Up @@ -195,12 +195,6 @@
{cover,\option{/novathesis/doctype},top},%
{cover,\option{/@nt/document/docclass},top},%
{cover,top})%
% \datamatch{\@MRGN@bottom}{margin}({cover,\option{/novathesis/doctype},#1,bottom},%
% {cover,\option{/@nt/document/docclass},#1,bottom},%
% {cover,\option{/novathesis/doctype},bottom},%
% {cover,#1,bottom},
% {cover,\option{/@nt/document/docclass},bottom},%
% {cover,bottom})%
\datamatch{\@MRGN@left}{margin}({cover,\option{/novathesis/doctype},1-1,left},%
{cover,\option{/@nt/document/docclass},1-1,left},%
{cover,1-1,left},
Expand Down
9 changes: 9 additions & 0 deletions NOVAthesisFiles/Strings/strings-de.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
%%% German - strings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtEndPreamble{
\StartBabelCommands*{german}{date}
\SetStringLoop{month#1name}{%
Januar,Februar,März,April,Mai,Juni,%
Juli,August,September,Oktober,November%
Dezember}
\EndBabelCommands
}

\bkmstring(frontmatter,de):={Startmaterial}
\bkmstring(backmatter,de):={Endmaterial}
\bkmstring(cover,de):={Buchumschlag}
Expand Down
9 changes: 9 additions & 0 deletions NOVAthesisFiles/Strings/strings-en.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
%%% English - strings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtEndPreamble{
\StartBabelCommands*{english}{date}
\SetStringLoop{month#1name}{%
January,February,March,April,May,June,%
July,August,September,October,November,%
December}
\EndBabelCommands
}

\bkmstring(frontmatter,en):={Front Matter}
\bkmstring(backmatter,en):={Back Matter}
\bkmstring(cover,en):={Cover}
Expand Down
9 changes: 9 additions & 0 deletions NOVAthesisFiles/Strings/strings-es.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
%%% Spanish - strings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtEndPreamble{
\StartBabelCommands*{spanish}{date}
\SetStringLoop{month#1name}{%
Enero,Febrero,Marzo,Abril,Mayo,Junio,%.
Julio,Agosto,Septiembre,Octubre,Noviembre,%.
Diciembre}
\EndBabelCommands
}

\bkmstring(frontmatter,es):={Material de Partida}
\bkmstring(backmatter,es):={Material Final}
\bkmstring(cover,es):={Tapa}
Expand Down
9 changes: 9 additions & 0 deletions NOVAthesisFiles/Strings/strings-es2.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
%%% Spanish - strings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtEndPreamble{
\StartBabelCommands*{spanish}{date}
\SetStringLoop{month#1name}{%
Enero,Febrero,Marzo,Abril,Mayo,Junio,%.
Julio,Agosto,Septiembre,Octubre,Noviembre,%.
Diciembre}
\EndBabelCommands
}

\bkmstring(frontmatter,es):={Material de Partida}
\bkmstring(backmatter,es):={Material Final}
\bkmstring(cover,es):={Tapa}
Expand Down
9 changes: 9 additions & 0 deletions NOVAthesisFiles/Strings/strings-fr.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
%%% Acknowledgments to Sara Ferreira <[email protected]>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtEndPreamble{
\StartBabelCommands*{french}{date}
\SetStringLoop{month#1name}{%
Janvier,Février,Mars,Avril,mai,Juin,%
Juillet,Août,Septembre,Octobre,Novembre,%
Décembre}
\EndBabelCommands
}

\bkmstring(frontmatter,fr):={Materiel de Départ}
\bkmstring(backmatter,fr):={Matériel Final}
\bkmstring(cover,fr):={Couverture}
Expand Down
9 changes: 9 additions & 0 deletions NOVAthesisFiles/Strings/strings-gr.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
%%% English - strings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtEndPreamble{
\StartBabelCommands*{english}{date}
\SetStringLoop{month#1name}{%
January,February,March,April,May,June,%
July,August,September,October,November,%
December}
\EndBabelCommands
}

\bkmstring(frontmatter,gr):={Front Matter}
\bkmstring(backmatter,gr):={Back Matter}
\bkmstring(cover,gr):={Cover}
Expand Down
9 changes: 9 additions & 0 deletions NOVAthesisFiles/Strings/strings-it.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
%%% Acknowledgments to Paolo Romano <[email protected]>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtEndPreamble{
\StartBabelCommands*{italian}{date}
\SetStringLoop{month#1name}{%
gennaio,febbraio,marzo,aprile,maggio,giugno,%
luglio,agosto,settembre,ottobre,novembre,%
dicembre}
\EndBabelCommands
}

\bkmstring(frontmatter,it):={Materiale Iniziale}
\bkmstring(backmatter,it):={Materiale Finale}
\bkmstring(cover,it):={Copertina}
Expand Down
9 changes: 9 additions & 0 deletions NOVAthesisFiles/Strings/strings-pt.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
%%% Portuguese - strings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtEndPreamble{
\StartBabelCommands*{portuguese}{date}
\SetStringLoop{month#1name}{%
Janeiro,Fevereiro,Março,Abril,Maio,Junho, %
Julho,Agosto,Setembro,Outubro,Novembro,%
Dezembro}
\EndBabelCommands
}

\bkmstring(frontmatter,pt):={Material Inicial}
\bkmstring(backmatter,pt):={Material Final}
\bkmstring(cover,pt):={Capa}
Expand Down
6 changes: 4 additions & 2 deletions NOVAthesisFiles/spine.tex
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@
\thispagestyle{empty}%
\NTRunHook{spine/pre}%
% \PAUSETHIS
\ifoptionequal{/novathesis/spine/layout}{trim}{\@tempdima=0pt}{\@tempdima=\dimexpr(\stockheight-\@spinewidth)/2\relax}%
\ifoptionequal{/novathesis/spine/layout}{trim}
{\@tempdima=0pt}
{\@tempdima=\dimexpr(\stockheight-\@spinewidth)/2\relax}%
\begin{tikzpicture}[remember picture, overlay,yscale=-1,yshift=-10.75pt+\@tempdima]%
% print spine bg color IF DEFINED
\datamatchtf{\arg}{spine}(%
Expand Down Expand Up @@ -469,7 +471,7 @@
% TEXT
\rotatebox[origin=c]{\@angle}{%
\scalebox{\@fbratio}{%
\datamatchtf{\arg}{spine}({box,#1,text,color},{box,text,color},{text,color}){\color{\arg}}{}%
\datamatchtf{\arg}{spine}({box,#1,text,gz},{box,text,color},{text,color}){\color{\arg}}{}%
\ifdatadefined{spine}(#1,\@UNIV/\@SCHL){%
\tabular{@{}c@{}}\thespine(#1,\@UNIV/\@SCHL)\endtabular%
}{%
Expand Down
7 changes: 5 additions & 2 deletions novathesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,9 @@
\@ifnextchar({\@ntdate@i}{\@ntdate@i(submission)}%
}

\usepackage{pgfcalendar} % For converting month names
% \usepackage{pgfcalendar} % For converting month names

\newcommand{\monthtotext}[1][\month]{\csuse{month\romannumeral#1 name}}

\def\@ntdate@i(#1)#2{%
\StrCut{#2}{-}\@NTDY\@NTDM%
Expand All @@ -1029,7 +1031,8 @@
\IfInteger{\thentdocdate(#1,\myi)}{}
{\ClassError{The \myi in \string\ntdocdate(#1){#2} is not a number!}{}{}}%
}%
\ntdocdate(#1,month,text):={\pgfcalendarmonthname{\thentdocdate(#1,month)}}%
% \ntdocdate(#1,month,text):={\pgfcalendarmonthname{\thentdocdate(#1,month)}}%
\ntdocdate(#1,month,text):={\monthtotext[\@NTDM]}%
}
\ntdocdate(default):={2000-09-01}
\ntdate(submission){\thentdocdate(default)}
Expand Down

0 comments on commit 1edf124

Please sign in to comment.