TU-Dresden » Startseite Forum » Forum

TU-Dresden Forum

Aktuelle Zeit: Sonntag 28. November 2021, 07:57

Alle Zeiten sind UTC + 1 Stunde




Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: How to customize pagestyle of parts pages with tudscr?
BeitragVerfasst: Samstag 25. Juni 2016, 17:42 
Offline

Registriert: Samstag 25. Juni 2016, 17:32
Beiträge: 3
Hi,

While reading the tudscr manual, I came across cdpart=color. However, for my parts pages I'm looking for a slightly lighter style, similar to cdchapter=color. Consider the following example/hack, which gives a parts page with a logo header and a chapter page with a nice background color:

Code:
\documentclass{tudscrreprt}

\begin{document}

\part{MyPart}

\TUDoptions{cdchapter=color}
\chapter*{{\huge Part I.} \newline MyPart}

\end{document}


How to properly customize the style of \part so it loses the logo header but gains the background color? I already tried various \TUDoptions, though unsuccessfully so far. Maybe there is another way, like defining a custom KOMA pagestyle or using a git snapshot of tudscr?

TIA for any pointers (and the excellent tudscr package...).

Cheers
FX


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: How to customize pagestyle of parts pages with tudscr?
BeitragVerfasst: Sonntag 26. Juni 2016, 11:28 
Offline

Registriert: Freitag 9. September 2011, 14:57
Beiträge: 541
Hello FX,

long story short: With the current version, there's no user interface for changing the background or font color for any certain layout/sectioning item. Maybe, I'm going to provide this possibility in a future release. In the MWE below, I applied a little patch, which should exactly do what you want. Please consider that this patch will only work with the current release v2.04e.

Best regards
Falk

Code:
\documentclass[cdpart=litecolor]{tudscrreprt}
\makeatletter
\patchcmd{\tud@partheadendvskip}{%
  \or% litecolor
    \cs@set@lock{tud@head@bar}{1}%
  \or% barcolor
}{%
  \or% litecolor
    \def\tud@pagecolor{HKS41!10}%
    \cs@set@lock{tud@head@bar}{1}%
  \or% barcolor
}{}{\tud@patch@wrn{tud@partheadendvskip}}
\makeatother
\begin{document}
\part{MyPart}
\renewcommand{\partpagestyle}{plain}
\part{MyPart2}
\end{document}

_________________
TUD-Script-Klassen für das Corporate Design der TU Dresden

Anwenderhandbuch: CTAN-Mirror oder texdoc tudscr
Anwenderleitfaden: CTAN-Mirror oder texdoc treatise
Schriftinstallation: Skripte zum Download

LyX-Layoutdateien und Befehlsvervollständigung für TeXstudio
Übersicht zu allen veröffentlichten Versionen


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: How to customize pagestyle of parts pages with tudscr?
BeitragVerfasst: Sonntag 26. Juni 2016, 14:45 
Offline

Registriert: Samstag 25. Juni 2016, 17:32
Beiträge: 3
Hi Falk,

Thanks, works like a charm! Having learnt about \patchcmd should come in handy next time.

For anybody interested in a more general approach to the issue of customization, here is a rather ugly example I figured out in the meantime (though no way to directly set a color, as noted):

Code:
\documentclass[cd=bicolor, cdfoot=color]{tudscrreprt}

\begin{document}

\newpagestyle{uglypart}{}{}

% no way to set color
% \AddLayersToPageStyle{uglypart}{tudheadings.pagecolor}

\DeclareNewLayer[background, contents={%
  \color{cdorange!10}\rule{\layerwidth}{\layerheight}%
}]{bg}

\AddLayersToPageStyle{uglypart}{bg}
\AddLayersToPageStyle{uglypart}{tudheadings.head.bar}
\AddLayersToPageStyle{uglypart}{tudheadings.foot.back}

\renewcommand{\partpagestyle}{uglypart}

\part{My Ugly Part \footnote{This forum is really helpful for rubber duck debugging ;-)}}

\end{document}



Using scrlayer-scrpage, it is indeed easy to mix and match components of tudscr.

Maybe mentioning the names of these components (for those not reading the sources) along with a pointer to the appropriate chapter of the KOMA manual could make for a helpful addition to the tudscr documentation? It is an edge case, but needed sometimes (e.g. custom part pages, back covers and so on, where you'd want the general tudscr style with some modifications).

Cheers
FX


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: How to customize pagestyle of parts pages with tudscr?
BeitragVerfasst: Montag 27. Juni 2016, 10:03 
Offline

Registriert: Freitag 9. September 2011, 14:57
Beiträge: 541
Hello FX,

actually I was in a hurry yesterday, when I wrote my answer. Your chosen approach is more general indeed. However, you can create your own page style via scrlayer-scrpage and the already existing layers.
Code:
\documentclass[cd=bicolor, cdfoot=color]{tudscrreprt}
\makeatletter
\AfterPackage*{scrlayer-scrpage}{%
  \DeclareNewLayer[background, contents={%
    \color{cdorange!10}\rule{\layerwidth}{\layerheight}%
  }]{custom.bg}
  \DeclareNewPageStyleByLayers[%
    onselect=\tud@ps@onselect,onbackground=\tud@ps@onbackground%
  ]{uglypart}{%
    custom.bg,%
%    tudheadings.head.back,%
%    tudheadings.head.content,%
%    tudheadings.head.bar,%
%    tudheadings.head.text,%
%    tudheadings.head.upline,%
%    tudheadings.head.lowline,%
%    tudheadings.head.uplinewide,%
%    tudheadings.head.lowlinewide,%
%    tudheadings.head.date,%
    tudheadings.foot.back,%
    tudheadings.foot.content,%
    tudheadings.last,%
    scrheadings.foot.odd,%
    scrheadings.foot.even,%
    scrheadings.foot.oneside,%
    scrheadings.foot.above.line,%   
    scrheadings.foot.below.line,%
  }%
}
\makeatother

\begin{document}
\renewcommand{\partpagestyle}{uglypart}
\part{%
  My Ugly Part%
  \footnote{This forum is really helpful for rubber duck debugging ;-)}%
}

\end{document}


Currently I'm working on v2.05 with a new class tudscrposter for posters. In v2.06 I'm going to re-implement all the sectioning stuff with \DeclareNewSectionCommand provided by KOMA-Script. Thereby I'll most likely implement a user interface for customizing the sectioning layout. As this work is done, I'll probably give a short excuse for customization in the appendix of the documentation.

Cheers
Falk

_________________
TUD-Script-Klassen für das Corporate Design der TU Dresden

Anwenderhandbuch: CTAN-Mirror oder texdoc tudscr
Anwenderleitfaden: CTAN-Mirror oder texdoc treatise
Schriftinstallation: Skripte zum Download

LyX-Layoutdateien und Befehlsvervollständigung für TeXstudio
Übersicht zu allen veröffentlichten Versionen


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: How to customize pagestyle of parts pages with tudscr?
BeitragVerfasst: Montag 27. Juni 2016, 21:54 
Offline

Registriert: Samstag 25. Juni 2016, 17:32
Beiträge: 3
Nice to hear and thanks again.

(Also, your subtle corrections of my rookie mistakes like space before footnote, position of begin-document, multiple layers per command, naming for custom.bg etc. are noted and much appreciated.)

Now back to actual writing...

FX


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 

Alle Zeiten sind UTC + 1 Stunde


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
cron