2

Well I'm working with a document in KOMA Script and I tried to use the \thanklessauthor command that I found in the code of the Sample book of Tufte-book class. First I thought it was a plain TeX macro, but it is not.

Searching a little in the web, I found this page and between the lines 531 and 543 there is the part of the code that defines what I need. But it's strange for me don't see the whole definition of the \newcommand in each case. I never before programmed a class or something like, so I don't understand how is working that.

Until now, my MWE would be:

\documentclass[headsepline=true,paper=letter,headings=big,bibliography=totoc,DIV=10]{scrbook}
\usepackage{typearea}
\usepackage[spanish,mexico]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[copyright]{ccicons}
\usepackage{bera}

%%%%%%% Page Style
\usepackage[nouppercase]{scrpage2}
\pagestyle{scrheadings}

% Prints the month name (e.g., January) and the year (e.g., 2008)
\newcommand{\monthyear}{%
\ifcase\month\or January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or
  December\fi\space\number\year
}

\usepackage{setspace}
%\singlespacing
\onehalfspacing
%\doublespacing

%\usepackage[stable,bottom]{footmisc}
\raggedbottom
\clubpenalty=3000
\widowpenalty=3000
\setlength{\parskip}{3pt plus 2pt minus 2pt}

\begin{document}
\frontmatter
\extratitle{\vspace*{4\baselineskip}\centering on the quiet}
    \titlehead{Opera Prima Collection}
    \title{Tales on the quiet}
    %\subtitle{}
    \author{Me}
    \date{}
    \publishers{\emph{Listopad}}
    \uppertitleback{
    Copyleft \ccShareAlike\ \the\year\ \thanklessauthor 

\textsc{Edited by \thanklesspublisher}   
}
    \lowertitleback{    
Design and typesetting: \emph{Listopad} \\    
\textit{First edition, \monthyear}.
}
    \dedication{To my thumb.}
    \maketitle    
\end{document}

So how could I add those commands to my document?


Update

After the suggestions and the answer of Johannes B I try to adapt his suggestions to my code, this is the result of my MWE updated:

\documentclass[headsepline=true,paper=letter,headings=big,bibliography=totoc,DIV=10]{scrbook}
\usepackage{typearea}
\usepackage[english]{babel} % Actually in the document is in Spanish
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[copyright]{ccicons}
\usepackage{bera}

%%%%%%% Style chapter adjustments

%\makeatletter
%\renewcommand\@chapapp{}
%\renewcommand \thechapter{}
%\makeatother

%%%%%%% Page Style
\usepackage{scrlayer-scrpage} %  If I add this line I've got two figures of rulers in the head and the foot, now not.
%\usepackage[nouppercase]{scrpage2}
%\pagestyle{scrheadings}

% Prints the month name (e.g., January) and the year (e.g., 2008)
\newcommand{\monthyear}{%
\ifcase\month\or January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or
  December\fi\space\number\year
}

\usepackage{setspace}
%\singlespacing
\onehalfspacing
%\doublespacing

%\usepackage[stable,bottom]{footmisc} I want to know how to use the KOMA solution instead.
\raggedbottom
\clubpenalty=10000
\widowpenalty=10000

\KOMAoption{parskip}{half}

%%%%%%%% Automation

\usepackage{xifthen}
\makeatletter
%JB Taken from tufte-common.def
\newcommand{\plainauthor}{}%
\newcommand{\thanklessauthor}{}%
\renewcommand*{\author}[2][]{%
    \gdef\@author{#2}%
    \begingroup%
    % TODO store contents of \thanks command%
    \renewcommand{\thanks}[1]{}%
    \protected@xdef\thanklessauthor{#2}%
\endgroup%
\ifthenelse{\isempty{#1}}%
{\renewcommand{\plainauthor}{\thanklessauthor}}%
{\renewcommand{\plainauthor}{#1}}%
\@ifpackageloaded{hyperref}{\hypersetup{pdfauthor={\plainauthor}}}{}%
}%

\usepackage{xparse}

%Redefining the publishers
\RenewDocumentCommand{\publishers}{ o m o}{ % I didn't understood this line
    \def\publishernothanks{}
    \def\shortpublishers{}
    \IfValueTF{#3}{
        \gdef\@publishers{#2\thanks{#3}}
        \gdef\publishernothanks{#2}
        \gdef\publisherthanksnote{#3}
    }
    {
        \gdef\@publishers{#2}
        \let\publishernothanks\publishers
    }
    \IfNoValueTF{#1}{
        \let\shortpublishers\publishernothanks
    }{
        \gdef\shortpublishers{#1}
    }
}

\makeatother

%\addtokomafont{author}{\itshape}
%\addtokomafont{publishers}{\itshape}

\usepackage{blindtext}

\begin{document}
\frontmatter
\extratitle{\vspace*{4\baselineskip}\centering on the quiet}
\titlehead{State Fund for Culture and the Arts of Tabasco. \\
Cultural Institute of Tabasco}
\subject{Tales}
\title{ on the quiet}
%\subtitle{}
\author{Me}
\date{}
\publishers{\emph{Listopad}}
\uppertitleback{
    Copyleft \ccShareAlike\ \the\year\ \thanklessauthor 
\textsc{Edited by \thanklesspublisher}   
}
\lowertitleback{    
Design and typesetting: \thanklesspublisher \\    
\textit{First edition, \monthyear}.
}
\dedication{To my thumb.}
\maketitle    

\blinddocument
\chapter{Let's test the result}
\begin{labeling}{the thanklessauthor}
\item[The author] \makeatletter \@author \makeatother
\item[the thanklessauthor] \thanklessauthor
\item[the plainauthor] \plainauthor
\item[the publisher] \makeatletter\@publishers\makeatother
\item[the shortpublisher]\shortpublishers
\item[publishernothanks]\publishernothanks
\item[publishthanksnote]\publisherthanksnote
\end{labeling}
\end{document}

This MNWE (Minimal not working example) has errors, one of them is that I can't use \thankslesspublisher inside a \uppertitleback and \lowertitleback

  • 4
    Look at line 562 ff. You could simply copy the definition to your preamble, make sure not to forget the \makeatletter ... \maketatother-combi. But to be honest, right now i don't know why you need this. – Johannes_B Oct 13 '14 at 8:52
  • It's late here. Going to take a look at this in the morning. Please be patient, we'll find asolution ;-) – Johannes_B Oct 15 '14 at 20:27
  • I understand, and don't worry this work isn't urgent. Thanks for the helping and the new tricks ;) – Aradnix Oct 15 '14 at 22:39
4

The Tufte classes define an author command in a way, that a thanks is gobbled and just the name is stored (thankslessauthor). If an optional argument to \author was given, this is stored as the plainauthor, if none was given, thanklessauthor and plainauthor are the same.

As you can see on the last page of the example, if the thanks is not gobbled, the footnotemark is output as well.

Depending on what you are trying to achieve, there might be a more KOMA-like solution in stock.

For the publishers i used a different approach using package xparse. You can use \publishers the regular way, but if you want to include a thanks you can put it in the optional argument at the end. If you want to give an optional shortpublisher, you can use the optional argument at the beginning. If none is given, the shortpublisher will be the publisher.

Package xparse enables us to define commands with an advanced syntax. Defining \RenewDocumentCommand{\publishers}{ o m o }{ <definition> } we can use \publishers[<optional short publisher>]{<publishers>}[<optional thanks>] in the document. The { o m o } part defines, what arguments the command can take. In this case an optional argument (the short publisher), a mandatory argument (the publisher) and another optional argument (a possible thanks).

The thanks is saved in the variable \publisherthanks if you wish to later use it again.

You can change the appearance of the elements by adding (addtokomafont, appends to the list) or setting (setkomafont, resets the list and starts over) font and size switches.

Package scrlayer-scrpage is the successor of scrpage2. The global option headsepline=true is passed to the package leading to a separation line between the head and the text body.

Concerning the footnotes, instead of using option stable KOMA and also the standard classes provide the optional argument. The KOMA-interface is more advanced here, you can choose different titles for the head, the toc and the actual chapter title. The bottom option is not provided by KOMA, since the package doesn't interfere with KOMA, it's fine to use.

\documentclass[headsepline=true,paper=letter,headings=big,bibliography=totoc,DIV=10]{scrbook}
\usepackage[english]{babel} % Actually in the document is in Spanish
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[copyright]{ccicons}


%\makeatletter
%\renewcommand\@chapapp{}
%\renewcommand \thechapter{}
%\makeatother

\usepackage{scrlayer-scrpage} 

% Prints the month name (e.g., January) and the year (e.g., 2008)
\newcommand{\monthyear}{%
\ifcase\month\or January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or
  December\fi\space\number\year
}


%\usepackage[bottom]{footmisc} 


\usepackage{xifthen}
\makeatletter
%JB Taken from tufte-common.def
\newcommand{\plainauthor}{}%
\newcommand{\thanklessauthor}{}%
\renewcommand*{\author}[2][]{%
    \gdef\@author{#2}%
    \begingroup%
    % TODO store contents of \thanks command%
    \renewcommand{\thanks}[1]{}%
    \protected@xdef\thanklessauthor{#2}%
\endgroup%
\ifthenelse{\isempty{#1}}%
{\renewcommand{\plainauthor}{\thanklessauthor}}%
{\renewcommand{\plainauthor}{#1}}%
\@ifpackageloaded{hyperref}{\hypersetup{pdfauthor={\plainauthor}}}{}%
}%

\usepackage{xparse}

%Redefining the publishers

\RenewDocumentCommand{\publishers}{ o m o }{
    \def\publishernothanks{}
    \def\shortpublishers{}
    \def\publisherthanksnote{}
    \IfNoValueTF{#3}{
        \gdef\@publishers{#2}
        \let\publishernothanks\@publishers
    }
    {
        \gdef\@publishers{#2\thanks{#3}}
        \gdef\publishernothanks{#2}
        \gdef\publisherthanksnote{#3}
    }
    \IfNoValueTF{#1}{
        \let\shortpublishers\publishernothanks
    }{
        \gdef\shortpublishers{#1}
    }
}
\makeatother
\publishers{Listopad}

%\addtokomafont{author}{\itshape}
%\addtokomafont{publishers}{\itshape}

\usepackage{blindtext}

\extratitle{\vspace*{4\baselineskip}\centering on the quiet}
\titlehead{State Fund for Culture and the Arts of Tabasco. \\
Cultural Institute of Tabasco}
\subject{Tales}
\title{ on the quiet}
%\subtitle{}
\author{Me}
\date{}
\uppertitleback{
    Copyleft \ccShareAlike\ \the\year\ \publishernothanks \\
    \textsc{Edited by \publishernothanks}
}
\lowertitleback{%
Design and typesetting:  \publishernothanks \newline
\textit{First edition, \monthyear}.
}
\dedication{To my thumb.}
\begin{document}
\frontmatter
\maketitle    

\blinddocument
\chapter{Let's test the result}
\begin{labeling}{the thanklessauthor}
\item[The author] \makeatletter \@author \makeatother
\item[the thanklessauthor] \thanklessauthor
\item[the plainauthor] \plainauthor
\item[the publisher] \makeatletter\@publishers\makeatother{}
\item[the shortpublisher]\shortpublishers
\item[publishernothanks]\publishernothanks
\item[publishthanksnote]\publisherthanksnote
\end{labeling}
\end{document}

enter image description here

  • Very interesting solution, in fact I also wanted to use the \thankslesspublisher command, so I review your solution and I added the code missing form that section of the code, but doesn't work, still doesn't appear on my document. Should I modify my MWE or edit my question for show that? – Aradnix Oct 13 '14 at 21:26
  • I added the functionality using a different approach. Please see the updated answer. – Johannes_B Oct 14 '14 at 12:51
  • Thanks for the helping, the MWE runs fine. My problem is when I want to build a legal page using \uppertitleback and \lowertitleback, at least \thankslesspublisher can't run inside those macros. Maybe is because the definition of both them, I'm not sure but isn't serious. – Aradnix Oct 15 '14 at 17:20
  • @Aradnix I edited the answer. There was only one character missing, leading to a real big blow up. Took me a while to see the cause. – Johannes_B Oct 16 '14 at 8:20
  • Thanks a lot, but now it's late for me (3:22 am) and unfortunately I have a lot of work with my thesis right now, I think until the weekend I could check properly your answer. Thanks again. – Aradnix Oct 16 '14 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.