TransWikia.com

How to get a fixed position textblock on first page of an article?

TeX - LaTeX Asked on December 23, 2020

I am attempting to create a design for an academic journal in LaTeX. In this, I have been having problems with creating a header that is specific for the first page of each article (etc), and was therefore led to try using a text block that adds relevant information such as title of journal, ISSN, Volume, issue number etc on the first page.

I have however been having problems getting the text block to allign with the header on the subsequent pages, and it seems to me like the text block moves vertically depending on size of title of an article, and whether or not there is an abstract present.

A MWE for a standard article would be:

documentclass[12pt,a4paper,twoside]{article}
usepackage[utf8]{inputenc}

usepackage[T1]{fontenc}

usepackage[overlay]{textpos}

usepackage{lipsum}

usepackage[footnotesep=0.5cm]{geometry}

raggedbottom

usepackage [english]{babel}
usepackage [autostyle, english = american]{csquotes}
MakeOuterQuote{"}

usepackage[backend=biber,authordate,sorting=nyt,cmsdate=both,maxcitenames=2,noibid]{biblatex-chicago}

usepackage{sectsty}
subsectionfont{centering normalfontscshape}
subsubsectionfont{centering normalfontscshape}
usepackage{etoolbox}
patchcmd{abstract}
  {bfseriesabstractname}
  {scshapeabstractname}
  {}{}

usepackage{fancyhdr}
setlength{headheight}{15.2pt}
pagestyle{fancy}
renewcommand{headrulewidth}{0pt}

title{textsc{Test Article}}
author{Name Author 
Affiliation
Email}
date{nodate}

begin{document}

setcounter{page}{81}

maketitle

begin{textblock}{10}(0,-4.3)
noindent footnotesize{emph{Journal: The Journal of...} (ISSN NNNN-NNNN)
Vol. 11, Nr. 1, (2020), 81--83
DOI:  XXXXXXX}
end{textblock}

pagestyle{fancy}

lhead[thepage]{textsc{Author}}
rhead[textsc{Author}]{thepage}
chead{emph{Journal: The Journal of...}}
fancyfoot[C]{}

begin{abstract}

noindent lipsum[1]
end{abstract}

renewcommand{abstractname}{Keywords}
begin{abstract}
{centering Keyword – Keyword – Keyword – Keyword – Keyword
par
}
end{abstract}

subsection*{Introduction}

lipsum

end{document}

Creating this for the first two pages:
enter image description here

enter image description here

For editorials and similar texts I then tried to make a slightly amended version of the same file:

documentclass[12pt,a4paper,twoside]{article}
usepackage[utf8]{inputenc}

usepackage[T1]{fontenc}

usepackage[overlay]{textpos}

usepackage{lipsum}

usepackage[footnotesep=0.5cm]{geometry}

raggedbottom

usepackage [english]{babel}
usepackage [autostyle, english = american]{csquotes}
MakeOuterQuote{"}

usepackage[backend=biber,authordate,sorting=nyt,cmsdate=both,maxcitenames=2,noibid]{biblatex-chicago}

usepackage{sectsty}
subsectionfont{centering normalfontscshape}
subsubsectionfont{centering normalfontscshape}
usepackage{etoolbox}
patchcmd{abstract}
  {bfseriesabstractname}
  {scshapeabstractname}
  {}{}

usepackage{fancyhdr}
setlength{headheight}{15.2pt}
pagestyle{fancy}
renewcommand{headrulewidth}{0pt}

title{textsc{Editorial}}
date{nodate}

begin{document}

setcounter{page}{1}

maketitle

begin{textblock}{10}(0,-4.3)
noindent footnotesize{emph{Journal: The Journal of...} (ISSN NNNN-NNNN)
Vol. 11, Nr. 1, (2020), 1
DOI:  XXXXXXX}
end{textblock}

pagestyle{fancy}

lhead[thepage]{}
rhead[]{thepage}
chead{emph{Journal: The Journal of...}}
fancyfoot[C]{}

subsection*{}

lipsum

bigskip
bigskip

begin{tabular*}{textwidth}{c @{extracolsep{fill}} ccc}
Editor & Editor & Editor
end{tabular*}

end{document}

This however puts the text block in a higher vertical position:

enter image description here

Is there any way I can get the text block to always be on the same vertical position in every file? Preferably to align with the headers for the subsequent pages.

One Answer

I'd stick with inserting the content in the header rather than trying to position content on the page using something like textpos. Below is an option where you define two different pages styles, one for the first page - firstpagestyle - and one for all subsequent pages - otherpagestyle.

enter image description here

documentclass[12pt,a4paper,twoside]{article}

%usepackage[utf8]{inputenc}
%usepackage[T1]{fontenc}

usepackage{lipsum}

usepackage[footnotesep=0.5cm]{geometry}

%usepackage [english]{babel}
%usepackage [autostyle, english = american]{csquotes}
%MakeOuterQuote{"}

usepackage{sectsty}
subsectionfont{centering normalfontscshape}
subsubsectionfont{centering normalfontscshape}
usepackage{etoolbox}
patchcmd{abstract}
  {bfseriesabstractname}
  {scshapeabstractname}
  {}{}

usepackage{fancyhdr}

fancypagestyle{firstpagestyle}{%
  fancyhf{}% Remove header/footer
  fancyhead[LO]{footnotesizesmash{begin{tabular}[t]{@{} l @{}}
    emph{Journal: The Journal of ldots} (ISSN NNNN-NNNN) 
    Vol.~11, Nr.~1, (2020), 81--83                     
    DOI: XXXXXXX
  end{tabular}}}
  fancyfoot[CO]{thepage}
  renewcommand{headrulewidth}{0pt}% Remove header rule
  renewcommand{footrulewidth}{0pt}% Remove footer rule
}
fancypagestyle{otherpagestyle}{%
  fancyhf{}% Remove header/footer
  fancyhead[LE,RO]{thepage}
  fancyhead[C]{emph{Journal: The Journal of ldots}}
  fancyhead[RE,LO]{textsc{Author}}
  renewcommand{headrulewidth}{0pt}% Remove header rule
  renewcommand{footrulewidth}{0pt}% Remove footer rule
}

pagestyle{otherpagestyle}

title{textsc{Test Article}}
author{Name Author 
  Affiliation
  Email}
date{1900-01-01}

apptocmd{maketitle}% <cmd>
  {thispagestyle{firstpagestyle}}% <appendix>
  {}{}% <success><failure>

raggedbottom

begin{document}

setcounter{page}{81}

maketitle

begin{abstract}
noindentlipsum[1]
end{abstract}

renewcommand{abstractname}{Keywords}
begin{abstract}
centering Keyword -- Keyword -- Keyword -- Keyword -- Keyword
end{abstract}

subsection*{Introduction}

lipsum

end{document}

firstpagestyle sets the header using a [t]op-aligned tabular that has no height (thanks to smash). Subsequent page headers (under otherpagestyle) are managed in the usual way.

Correct answer by Werner on December 23, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP