LaTeX forum ⇒ Text Formattingremove page numbers from header Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
chmst1999
Posts: 4
Joined: Sun Feb 24, 2019 7:54 am

remove page numbers from header  Topic is solved

Postby chmst1999 » Mon Feb 25, 2019 1:26 am

I am trying to write a letter with consistent letterhead on every page. I believe I have a working document now (thanks to help from a prior post). However, now the header has the page numbers in the top-left corner. I don't want page numbers. Is there a way to have everything work the way it is but omit the page numbers in the header?

UPDATE: I fixed it with the line below included after the start of the document (in %%%%%)
\pagenumbering{gobble} % stops page numbering throughout document

Now the document and header work as I want without the page numbering!

  1. \documentclass[12pt,headsepline]{letter} % Uses 10pt
  2. \usepackage[document]{ragged2e}
  3. \usepackage{makecell}
  4. \usepackage{graphicx}
  5. \usepackage{tabularx}
  6. \usepackage{geometry}
  7.  
  8. \geometry{
  9. letterpaper,% <------- corrected
  10. includehead, includefoot,
  11. total={170mm,257mm},
  12. headheight=5mm,
  13. left=20mm,
  14. head=58.99994pt,%<------ added
  15. }
  16. \usepackage{hyperref}
  17. \hypersetup{
  18. colorlinks=true,
  19. linkcolor=blue,
  20. filecolor=magenta,
  21. urlcolor=blue}
  22.  
  23. %Header
  24. \usepackage{blindtext}
  25. \usepackage{marvosym}
  26. \usepackage{scrlayer-scrpage}
  27. \newcommand*{\email}[1]{\href{mailto:#1}{\nolinkurl{#1}}}
  28. %\ihead*{}
  29. \chead{
  30. \begin{tabularx}{\textwidth}{ccc}
  31. &\textsc{\large\bf First A. Last}& \\
  32. &\textsc{P.O. BOX 999, Square, ZZ 11223}& \\
  33. \textsc{\Mobilefone \hspace{1mm} (555) 555-5555} & \textsc{\Letter \hspace{1mm} \email{anyone@anywhere.k12.mt.us}} & \ComputerMouse \hspace{1mm} \href{http://goo.gl/AAAA}{http://goo.gl/AAAA}
  34. %\hline
  35. \end{tabularx}%
  36. }
  37.  
  38. \begin{document}
  39.  
  40. \signature{First And Last} % name for signature
  41. \longindentation=0pt % needed to get closing flush left
  42. \let\raggedleft\raggedright % needed to get date flush left
  43.  
  44. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  45. \pagenumbering{gobble} % stops page numbering throughout document
  46. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  47.  
  48. \begin{letter}{Mr. Whom Ever\\Superintendent\\P.O. Box 8888\\Smallville, YY 76543}
  49. \opening{Dear Mr. Ever:}\thispagestyle{scrheadings}
  50.  
  51. \blindtext[10]
  52.  
  53. \vspace{\baselineskip}%\linebreak Doesn't make any sense
  54. \closing{Sincerely,}
  55. \encl{enclosure 1, enclosure 2} % Enclosures
  56. \end{letter}
  57. \end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9367
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Feb 27, 2019 11:47 am

Nice that you found it!

Switching off the numbering style (to none) is one way. Another way would be modifying the header entries, with the scrlayer-scrpage tools. For example, \ohead{} woud do it.

I prefer scrlttr2 over the letter class, btw.

Stefan
Site admin


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 2 guests