1

I'm still working on a Latex-template for my institution. So far everything runs fine and the former questions i asked here helped me a lot.

Now, i want to adjust the different parts of the journals footer to meet the expected layout. I have a working solution using \parbox inside my \lofoot, \cofoot etc. commands that makes the footer contents show up as wanted. The authors should appear on the left side with a linebreak if there are several, the title should appear always right of the author section, also flushedright to the right margin of the textbody, also with a linebreak if needed (see MWE below). But i figured the fitting widths out only using trial and error. That's not how it should be (I'm kind of a perfectionist ;) )

Thus, i wanted to find out which macros inside the scrlayer-scrpage package define those commands and to adjust/renew them that they fit my needs. But, so far, i wasn't able to receive these informations.

When i run latexdef -p scrlayer-scrpage lefoot inside the terminal or use \meaning\lefoot inside my document, for example, i get the phrase macro:->\sls@renewelement {even}{left}{foot}. So far, so good, but i couldn't figure out how to find the definition of the element foot (Running latexdef on foot produced only that it's undefined since foot is no command, running it on sls@renewelement didn't help either). I also searched inside the .sty file directly without a result. If i run {\tracingall\lefoot} inside the document the compilation process never ends and i can't find any informations in the log.

Therefore, my question is not only about the mentioned adjustment of the footer, but also a general one on working deeper in Latex/Tex backend: How to get these kind of informations if I need to do it again – and this will be the case for sure since I'm only getting started with the template.

Here is my MWE (I intentionnaly use the article class and no KOMA-class). I added my workaround solution only to the odd pages, so everyone can see the layout differences:

\documentclass[a4paper,12pt,
twoside,%
]{article}
\usepackage[T1]{fontenc}


\usepackage{blindtext}

\usepackage{geometry}
\geometry{%
    inner=20mm,
    outer=60mm,
    top=15mm,
    bottom=20mm,
    marginparwidth=45mm,
    showframe % to show the margins
}

\usepackage[footwidth=textwithmarginpar,footsepline=0.4pt:text,ilines]{scrlayer-scrpage}
\clearpairofpagestyles

\ModifyLayer[addvoffset=2.5ex]{scrheadings.foot.odd}
\ModifyLayer[addvoffset=2.5ex]{scrheadings.foot.even}
\ModifyLayer[addvoffset=2.5ex]{scrheadings.foot.oneside}
\ModifyLayer[addvoffset=2.5ex]{plain.scrheadings.foot.odd}
\ModifyLayer[addvoffset=2.5ex]{plain.scrheadings.foot.even}
\ModifyLayer[addvoffset=2.5ex]{plain.scrheadings.foot.oneside}

\setkomafont{pagefoot}{\sffamily\tiny\normalshape}

\ohead*{\pagemark}

\lefoot*{Journal 2000, § 1--4}
\cefoot*{A List of different authors who have written the current article}
\refoot*{\bfseries The title of the current article which was written by the different authors mentioned on the left}

\lofoot*{\parbox[t]{.35\textwidth}{A List of different authors who have written the current article}}
\cofoot*{\hspace*{.13\textwidth}\parbox[t]{.5\textwidth}{\raggedleft\bfseries The title of the current article which was written by the different authors mentioned on the left}}
\rofoot*{Journal 2000, § 1--4}


\begin{document}

\section{Section Heading}
 \blindtext[5]

\end{document}

I'm sure the solution can be interpreted from reading The TeXbook or TeX by Topic or something similar, but it would save me an enormous amount of time if someone has a faster answer. The KOMA-script documentation wasn't as helpful so far.

Thanks in advance for your helpful replies!

EDIT

The links provided in the comments are very helpful and I found a lot which I nedd and want to read to understand Latex even better.

But the particular question remains unsolved and i couldn't find a solution. I still adjust the footer layout by using parbox and hspace* commands inside the lefoot... commands provided by the scrlayer-scrpage package. Inside the package the \lefoot command i.e. is defined as macro:->\sls@renewelement {even}{left}{foot}.

Has anyone the concrete answer where to find the definition of these three elements, so i can redefine them to fitting my needs? Or is it generally a bad idea to change something as deep inside the package-tree/backend?

4
  • There's macros - Where do I find out how a command/environment is defined? - TeX - LaTeX Stack Exchange. But anyway I believe for a general solution that you ask for knowledge of TeX programming is required. There's also tikz pgf - How to find the documentation for a package? - TeX - LaTeX Stack Exchange but generally speaking reading the source code is better than \show/latexdef.
    – user202729
    Jun 4 at 2:50
  • Hi, thanks for the links. The informations in there should be really helpful! I read through them more accurate when i got some time off. In the case of foot, as mentioned, i already searched the .sty package file, but, for me, it seems that the element is defined somewhere else. An so far i couldn't Figuren out where, because it dont seems to be a command... I'm aware that this Problem might be the cause of my little knowledge about Tex, but, nevertheless, need a solution.
    – lukeflo
    Jun 4 at 6:08
  • 2
    You are fundamentally running into an XY problem; your interpretation of what the KOMA package is doing is wrong, and so you are basically barking up the wrong tree. "finding out the definition of \lefoot" is not going to help solve your problem. (Putting the \parbox into the \lofoot is pretty much already the correct "solution" to your layout needs; you should explain why you think that is unsatisfactory and what would be a satisfactory solution.) Jun 7 at 13:56
  • What is unsatisfactory is that I had to use trial and error to push the parbox in \cofoot of my MWE manually so it is flushedright with the right margin of the textbody. As you can see, I use \hspace*{.13\textwidth}\parbox... to push it to the wanted position. I just thought there has to be a more consistent way to align the respectively inner and centered foot contents to the left or right margin of the textbody. This is necessary since the hole footer spans through \textwidth+\marginparwidth and the outer foot box (\rofoot above) always shows the journal number. Was that clear? ;)
    – lukeflo
    Jun 7 at 14:08

2 Answers 2

1

You could use eg.

\lefoot*{Journal 2000, § 1--4}
\refoot*{%
  \parbox[t][\ht\strutbox]{.5\textwidth}{\bfseries The title of the current article which was written by the different authors mentioned on the left}%
  \hspace*{.15\textwidth}%
  \parbox[t][\ht\strutbox]{.35\textwidth}{\raggedleft A List of different authors who have written the current article}%
}

\lofoot*{%
  \parbox[t][\ht\strutbox]{.35\textwidth}{A List of different authors who have written the current article}%
  \hspace*{.15\textwidth}%
  \parbox[t][\ht\strutbox]{.5\textwidth}{\raggedleft\bfseries The title of the current article which was written by the different authors mentioned on the left}%
}
\rofoot*{Journal 2000, § 1--4}

or

\refoot*{%
  \parbox{\textwidth}{%
    \parbox[t][\ht\strutbox]{.5\linewidth}{\bfseries The title of the current article which was written by the different authors mentioned on the left}%
    \hfill%
    \parbox[t][\ht\strutbox]{.35\linewidth}{\raggedleft A List of different authors who have written the current article}%
}}

\lofoot*{%
  \parbox{\textwidth}{%
    \parbox[t][\ht\strutbox]{.35\linewidth}{A List of different authors who have written the current article}%
    \hfill%
    \parbox[t][\ht\strutbox]{.5\linewidth}{\raggedleft\bfseries The title of the current article which was written by the different authors mentioned on the left}%
}}

Example:

\documentclass[a4paper,12pt,
twoside,%
]{article}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\usepackage{geometry}
\geometry{%
  inner=20mm,
  outer=60mm,
  top=15mm,
  bottom=20mm,
  marginparwidth=45mm,
  showframe % to show the margins
}

\usepackage[footwidth=textwithmarginpar,footsepline=0.4pt:text,ilines]{scrlayer-scrpage}
\clearpairofpagestyles

\ModifyLayer[addvoffset=2.5ex]{scrheadings.foot.odd}
\ModifyLayer[addvoffset=2.5ex]{scrheadings.foot.even}
\ModifyLayer[addvoffset=2.5ex]{scrheadings.foot.oneside}
\ModifyLayer[addvoffset=2.5ex]{plain.scrheadings.foot.odd}
\ModifyLayer[addvoffset=2.5ex]{plain.scrheadings.foot.even}
\ModifyLayer[addvoffset=2.5ex]{plain.scrheadings.foot.oneside}

\setkomafont{pagefoot}{\sffamily\tiny\normalshape}

\ohead*{\pagemark}
\ofoot*{Journal 2000, § 1--4}

\refoot*{%
  \parbox[t][\ht\strutbox]{.5\textwidth}{\bfseries The title of the current article which was written by the different authors mentioned on the left}%
  \hspace*{.15\textwidth}%
  \parbox[t][\ht\strutbox]{.35\textwidth}{\raggedleft A List of different authors who have written the current article}%
}

\lofoot*{%
  \parbox[t][\ht\strutbox]{.35\textwidth}{A List of different authors who have written the current article}%
  \hspace*{.15\textwidth}%
  \parbox[t][\ht\strutbox]{.5\textwidth}{\raggedleft\bfseries The title of the current article which was written by the different authors mentioned on the left}%
}

\begin{document}
\section{Section Heading}
\blindtext[5]
\end{document}

You could also use the default footwidth=text and declare additional layers for the marginpar in footer. Then it would be possible to use \ifoot* and \ofoot* for the entries aligned with the text.

1
  • Hey @esdd. Thank you, works fine. It's a better workaround than my version. It just didn't come to my mind to skip the center-part of the footer and stretch the inner part up to the margin of the text-body.
    – lukeflo
    Jun 11 at 19:24
0

for the sake of completion I post here my current solution. I used @esdd's answer for the last week. But ultimately, I needed to settle with another solution, because the required document layout changes geometry inside the document and that killed the adjustment of the footer.

I tried many different ways, but finally decided not to use the standard options provided by the scrlayer-scrpage package like \lofoot{} etc. Instead i declared some new layers which use the relation of \linewidth and \textwidth of the standard geometry. Thus, the footer doesn't changes it layout after \newgeometry is called.

Now I use the following code, and it works quite fine; no matter how the geometry is adjusted:

\documentclass[%
twoside,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{noto}

\usepackage{geometry}
\geometry{%
    inner=20mm,
    outer=60mm,
    top=15mm,
    bottom=20mm,
    marginparwidth=40.5mm,
    marginparsep=4.5mm,
    showframe % to show the margins
}

\usepackage{multicol}

\usepackage[]{scrlayer-scrpage}
\clearpairofpagestyles
\usepackage{xcolor}
%% Footer content %%
\DeclareNewLayer[
background,
twoside,
oddpage,
foot,
width=\textwidth+\marginparsep+\marginparwidth,
voffset=1in+\topmargin+\headsep+\textheight+\footskip+.6\footnotesep,
contents={\sffamily\tiny\normalshape%
    \parbox[b]{.743\linewidth}{%
    \parbox[b]{.35\linewidth}{\color{red}A\rule{\linewidth}{2pt}}%
    \hfill%
    \parbox[b]{.5\linewidth}{\color{green}\rule{\linewidth}{2pt}\raggedleft}%
    }%
    \hfill%
    \parbox[b]{.2\linewidth}{\color{blue}Journaltitle 1--12\raggedleft}%
    }
]{oddfootercontent}
\DeclareNewLayer[
clone=oddfootercontent,
evenpage,
hoffset=\evensidemargin+1in-\marginparsep-\marginparwidth,
contents={\sffamily\tiny\normalshape%
    \parbox[b]{\linewidth}{%
    \parbox[b]{.2\linewidth}{\color{blue}Journaltitle 1--12}%
    \hfill
    \parbox[b]{.743\linewidth}{%
        \parbox[b]{.35\linewidth}{\color{red}\rule{\linewidth}{2pt}}%
        \hfill%
        \parbox[b]{.5\linewidth}{\color{green}\rule{\linewidth}{2pt}\raggedleft}%
    }
    }
    }
]{evenfootercontent}
%% pagenumber at bottom of outsidemargin %%
\DeclareNewLayer[
background,
oneside,
outermargin,
height=\textheight,
voffset=1in+\voffset+\topmargin+\headheight+\headsep+.8\footnotesep,
contents={%
    \parbox[b][\layerheight][b]{\layerwidth}
    {\raggedleft\hfill\pagemark\hspace*{15mm}}%
}
]{outermargin.pagenumber.oneside}
\DeclareNewLayer[
clone=outermargin.pagenumber.oneside,
twoside,
oddpage
]{outermargin.pagenumber.odd}
\DeclareNewLayer[
clone=outermargin.pagenumber.odd,
evenpage,
contents={%
    \parbox[b][\layerheight][b]{\layerwidth}
    {\hspace*{15mm}\pagemark\hfill}%
}
]{outermargin.pagenumber.even}
\AddLayersToPageStyle{scrheadings}{%
    oddfootercontent,%
    evenfootercontent,%
    outermargin.pagenumber.oneside,%
    outermargin.pagenumber.odd,%
    outermargin.pagenumber.even%
}
\AddLayersToPageStyle{plain.scrheadings}{%
    oddfootercontent,%
    evenfootercontent,%
    outermargin.pagenumber.oneside,%
    outermargin.pagenumber.odd,%
    outermargin.pagenumber.even%
}
\setkomafont{pagenumber}{\sffamily\bfseries}
\usepackage[%
hang,%
bottom%
]{footmisc}
\setlength{\footnotemargin}{0.5cm}
\setlength{\skip\footins}{0,5cm}
\makeatletter
\renewcommand\footnoterule{\kern-3\p@
        \hrule \@width \textwidth \kern 2.6\p@}
\makeatother

\usepackage{blindtext}

\begin{document}
    \section{Autoren}
    \blindtext\footnote{text}
    
    \blindtext[6]\footnote{text}
    
    \blindtext[2]

    \newgeometry{
    inner=20mm,
    outer=37.5mm,
    top=15mm,
    bottom=20mm,
    marginparwidth=18mm,
    marginparsep=4.5mm
    }
    \begin{multicols}{2}
        \section{newgeometry}       
        \blindtext[3]\footnote{text}
        
        \blindtext[6]
    \end{multicols}
\end{document}

Nevertheless, @esdd's answer provided me the first solution, as well as the concept my own solution relies on. Therefore, it still is the answer which solved the question.

Thanks

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .