LaTeX forum ⇒ Page LayoutHeader in a document with two column

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
caarloxy
Posts: 1
Joined: Thu Oct 15, 2020 1:50 pm

Header in a document with two column

Postby caarloxy » Thu Oct 15, 2020 2:01 pm

Hello everyone,
my problem, I try to import some header with different packages.
I tried {fancyhdr}, \myheaders, and scrlayer-scrpage. However I did not manage to set my headers!
I would like to have a header with the name of the section and a line to divide the header to the text.

As you can see below I used the command \beginn{twocolumn} to have my report in two column, however the table of content has to stay as single column. I think this command causes some struggels with the header.
The footer with the page number was no problem, I used on the first pages Roman numbering, and later on arabic. that is fine how it is and shouldn't be changed.

Happy to get some feedback or improvements.

Peace
caarloXY

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[10pt, a4paper,twoside]{scrartcl} %option für seitenränder DIV11 mit Bindekorrektur BCOR5mm
  2. %twocolumn
  3.  
  4. \usepackage[T1]{fontenc}
  5. \usepackage[utf8]{inputenc}
  6. \usepackage[english]{babel}
  7. \usepackage{lmodern}
  8. \usepackage{hyperref}
  9. \hypersetup{
  10. colorlinks=true,
  11. linkcolor=black,
  12. filecolor=black,
  13. urlcolor=black,
  14. citecolor=black
  15. }
  16.  
  17. %\usepackage[numbers]{natbib}
  18.  
  19. \setcounter{secnumdepth}{3} %zeigt wietief eine gliederungsebene nummeriert werden soll
  20. \usepackage[parfill]{parskip} %noindent fuer das ganze Doku%
  21. \usepackage{geometry}
  22. \geometry{a4paper,left=20mm,right=15mm, top=20mm, bottom=25mm} %mit includehead includefoot seite anpassen
  23. \setlength{\columnsep}{0.6cm}
  24.  
  25.  
  26. \usepackage{scrlayer-scrpage}
  27. \addto\captionsenglish{\renewcommand{\contentsname}{Table of content}}
  28.  
  29.  
  30. %\title{TEXT}
  31. %\author{Name}
  32. %\date{\today}
  33.  
  34. \begin{document}
  35.  
  36. %\clearpage\maketitle
  37. %\thispagestyle{empty} %keine seitenzahl
  38.  
  39. %\maketitle
  40.  
  41. \input{titlepage.tex}
  42. \newpage
  43.  
  44. \pagenumbering{Roman} %Römische Zahlen
  45.  
  46.  
  47. \begin{twocolumn}
  48.  
  49. \section*{Abstract}
  50. \input{abstract.tex}
  51. \newpage
  52.  
  53. \end{twocolumn}
  54.  
  55.  
  56.  
  57. \begin{onecolumn}
  58. \tableofcontents
  59. \end{onecolumn}
  60.  
  61.  
  62. \begin{twocolumn} %beginn und end twocolumn für zwei spaltiger text
  63. %\pagestyle{}
  64.  
  65. \newpage
  66. \pagenumbering{arabic}
  67.  
  68. \section{Introduction}
  69. \input{Introduction.tex} %to insert a tex file
  70. \label{sec:intro}
  71. \newpage %to go on the next page
  72.  
  73. \section{Basics}
  74. \input{Basics.tex}
  75. \newpage
  76.  
  77.  
  78. \end{twocolumn}
  79. \end{document}

User avatar
Ijon Tichy
Posts: 333
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Thu Oct 15, 2020 2:23 pm

The shown code is not neither minimal nor working (because of missing files). So it is not a Infominimal working example and we cannot test it really.

However \onecolumn and \twocolumn are commands not environments. You should not misuse them as environments. See a good introduction to LaTeX how to use them correctly.

Package parskip is a workaround for classes, that do not support paragraph distance instead of paragraph indention. With KOMA-Script classes you should use option parskip or command \setparsizes instead of that package. See the manual for more information.

Sorry for not being more helpful, but with broken code that does not show the problem, it is very hard to help.


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 6 guests