Text FormattingPage numbering location and headers

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
etp94
Posts: 16
Joined: Sat Sep 03, 2016 11:55 pm

Page numbering location and headers

Post by etp94 »

Hi!

How could I use headers and page numbering in the fashion that is shown at the picture attached?

I'm using \documentclass[12pt,openany]{report}

And I've found some solutions that use \documentclass{memoir}

Do I've to change document class in order to have headers and change page numbering position?

Thanks for reading! :)
Attachments
Page numbering and header at apa style
Page numbering and header at apa style
pagenumberingandheaders.png (46.98 KiB) Viewed 10312 times
Last edited by cgnieder on Tue Sep 20, 2016 11:20 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Page numbering location and headers

Post by Johannes_B »

How about using class apa6. It should take care of all your specifications.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
etp94
Posts: 16
Joined: Sat Sep 03, 2016 11:55 pm

Page numbering location and headers

Post by etp94 »

Johannes_B wrote:How about using class apa6. It should take care of all your specifications.
Thanks for answering!

I've been reading the package documentation of the package you recommended, to start using apa6 package,

should I start writting the next code?

\documentclass[12pt,doc]{apa6}
\usepackage{apa6}


Instead of

Code: Select all

\documentclass[12pt,openany]{report}
%left justified text
  \usepackage[document]{ragged2e} 
%half inch paragraph indent
  \setlength\RaggedRightParindent{0.5in}
%1 inch margin for each side
  \addtolength{\oddsidemargin}{-.875in}
  \addtolength{\evensidemargin}{-.875in}
  \addtolength{\textwidth}{1.75in}
  \addtolength{\topmargin}{-.875in}
  \addtolength{\textheight}{1.75in} 
Is apa6 package compatible with \bibliographystyle{apacite}, \cite and \appendix commands??

Regards! :)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Page numbering location and headers

Post by Johannes_B »

In short: yes.

You should be able to get what you want by doing all that. Remember to make a backup, just in case.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
etp94
Posts: 16
Joined: Sat Sep 03, 2016 11:55 pm

Page numbering location and headers

Post by etp94 »

By just using:

\documentclass[12pt,doc]{apa6}
\usepackage{apa6}


It says apa6.sty not found, I search for an answer and found that there is not such a file, the code must be run without \usepackage{apa6}.

By running just \documentclass[12pt,doc]{apa6}, the compiler return errors of undefined control sequence from commands like \chapter \section \subsection \clearpage \begin{figure} and \end{figure}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Page numbering location and headers

Post by Johannes_B »

Please show a minimal working example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
etp94
Posts: 16
Joined: Sat Sep 03, 2016 11:55 pm

Page numbering location and headers

Post by etp94 »

Johannes_B wrote:Please show a minimal working example.
Thanks for replying! :)

This is my main LaTex file:

Code: Select all

\documentclass[12pt,doc]{apa6}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[spanish,activeacute,es-lcroman,es-tabla]{babel}
\usepackage{mathtools}
\usepackage[latin1]{inputenc}
\usepackage{dcolumn}
\usepackage{float}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epstopdf}
\usepackage{subfig}
\usepackage{color}
\usepackage{pifont}
\usepackage{apacite}
\usepackage{authblk}
\usepackage{rotating}
\usepackage{verbatim}
\usepackage{moreverb}

\spanishdecimal{.}

\title{}
\author{}
\date{}

\bibliographystyle{apacite}

\begin{document}

\input{Titulo.tex}
\pagenumbering{roman}
		\clearpage\null\newpage
\input{Blanco.tex}
		\clearpage\null\newpage<
\input{Agradecimientos.tex}
		\clearpage\null\newpage
\input{Resumen.tex}
		\clearpage\null\newpage
%Index input
\tableofcontents
		\clearpage\null\newpage
%List of figures input
\listoffigures
		\clearpage\null\newpage
%List of tables input
\listoftables
		\clearpage\null\newpage

%Text files
\input{Introduccion.tex}
\input{Justificacion.tex}
		\clearpage\null\newpage<
\input{Bases_teoricas.tex}
		\clearpage\null\newpage
\input{Metodologia.tex}
		\clearpage\null\newpage

\bibliography{Bibliografia}
\end{document}
Got a lot of errors! But the output file has correctly printed all my floats, functions and equations, and also it has the page numbering in the top right corner (as desired), but it does not use half inch indentation and paragraph left justification unless \usepackage[document]{ragged2e} and \setlength\RaggedRightParindent{0.5in} are used.

When I click on one of the 61 undefined control sequence errors, it opens one of the files where \section, \chapter, \chapter*, \subsection commands are used.

As it's shown in the attached files, the sections, subsection and chapters labels are not used as it's desired, it does not print chapter, section and subsection number (i.e 2. chaptertwo 2.1 firstsectionofchaptertwo 2.1.1 firstsubsectionofchaptertwo), it just print symbols like * and <, and chapters titles have normal sizes!.

Thanks for reading! :)... and sorry if I'm being annoying :(
Attachments
Also at the index chapter and section are not numbered (only the page numbering is printed)
Also at the index chapter and section are not numbered (only the page numbering is printed)
output2.png (41.08 KiB) Viewed 10224 times
Chapters and sections are not numbered
Chapters and sections are not numbered
output1.png (41.54 KiB) Viewed 10224 times
Last edited by cgnieder on Fri Sep 23, 2016 10:40 am, edited 1 time in total.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Page numbering location and headers

Post by Johannes_B »

Your code gives me the error message that shorttitle is not defined, which is needed for the header. Ignoring all the files i don't have, i don't get another error. You did not provide a compilable example.

That chapter is not defined is not surprising, as APA does not use chapters. The american psychological association uses section, and they don't start on a new page so all your page clearing is against APA.

Code: Select all

\documentclass[12pt,doc]{apa6}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[spanish,activeacute,es-lcroman,es-tabla]{babel}
\usepackage{mathtools}
\usepackage[latin1]{inputenc}
\usepackage{dcolumn}
\usepackage{float}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epstopdf}
\usepackage{subfig}
\usepackage{color}
\usepackage{pifont}
\usepackage{apacite}
\usepackage{authblk}
\usepackage{rotating}
\usepackage{verbatim}
\usepackage{moreverb}
\usepackage[document]{ragged2e}
\setlength\RaggedRightParindent{0.5in}

\spanishdecimal{.}

\title{Wombats are cute}
\shorttitle{Wombats}
\author{}
\date{}

\bibliographystyle{apacite}

\usepackage{blindtext}
\begin{document}
This is some test text without a meaniing and laura has really great tits and i cannot stop looking at them which feels kind of a betrayal. Oh, i want to see Katrins breasts even more.  

\pagenumbering{roman}
\blinddocument\blindtext
\blinddocument
\blinddocument
\end{document}
\input{Titulo.tex}
\clearpage\null\newpage
\input{Blanco.tex}
\clearpage\null\newpage<
\input{Agradecimientos.tex}
\clearpage\null\newpage
\input{Resumen.tex}
\clearpage\null\newpage
%Index input
\tableofcontents
\clearpage\null\newpage
%List of figures input
\listoffigures
\clearpage\null\newpage
%List of tables input
\listoftables
\clearpage\null\newpage

%Text files
\input{Introduccion.tex}
\input{Justificacion.tex}
\clearpage\null\newpage<
\input{Bases_teoricas.tex}
\clearpage\null\newpage
\input{Metodologia.tex}
\clearpage\null\newpage

\bibliography{Bibliografia}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
etp94
Posts: 16
Joined: Sat Sep 03, 2016 11:55 pm

Re: Page numbering location and headers

Post by etp94 »

Oh! :(

Is there another way to change page numbering location from footer to the top right corner without using apa6 package?

Thanks Johannes! :)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Page numbering location and headers

Post by Johannes_B »

I'm not sure i understand. You want to get apa appearance without using the apa6 class, that takes care of it? Or do you see the page numbers not at the top right corner?


PS: APA really is something completely insane. Not the institution, but the APA-style.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply