Table in Header with latex? - latex

I need to create some work instructions in latex. Is there anyway to get a table in the header of a latex page?

Use the fancyhdr package.
For example:
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L]{\begin{tabular}{l}Line 1\\Line 2\end{tabular}}

Related

Changing fontsize of word "References" in Latex

I'm a beginner to latex, I was writing an article. At the end when adding references. I did:
\begin{thebibliography}{100}
Some bibitems here
\end{thebibliography}
After compiling, the word "Reference" appears in pdf, and it is too big in size. I want its font size to be 12pt. How can I do that?
Using the titlesec package, you can temporarily change the size of section headings:
\documentclass[12pt]{article}
\usepackage{titlesec}
\begin{document}
test
\begingroup
\titleformat*{\section}{\fontsize{12pt}{14pt}\bfseries\selectfont}
\begin{thebibliography}{100}
Some bibitems here
\end{thebibliography}
\endgroup
\end{document}

How to change page numbering on chapter bages using scrbook and scrlayer-scrpage

I am currently writing my thesis using scrbook and changed the footer layout. However, I also want to change the footer on Part and Chapter pages as well. What do I need to change for this? Currently, it basically looks like this right now. I want to have the page number in the center of the Chapter/Part page as well.
Example code:
\documentclass[english, 12pt]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[automark,ilines]{scrlayer-scrpage}
\usepackage{blindtext}
\pagestyle{scrheadings}
\ohead{}
\ihead{\headmark}
\chead{}
\cfoot{-~\pagemark~-}
\ofoot{}
\ifoot{}
\begin{document}
\chapter{Introduction}
\blindtext[5]
\end{document}
Thanks in advance for your help!
You can use an optional argument to set the styles for the plain pages:
\documentclass[english, 12pt]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[automark,ilines]{scrlayer-scrpage}
\usepackage{blindtext}
\pagestyle{scrheadings}
\ohead[]{}
\ihead[whatever]{\headmark}
\chead[]{}
\cfoot[something]{-~\pagemark~-}
\ofoot[]{}
\ifoot[]{}
\begin{document}
\chapter{Introduction}
\blindtext[5]
\end{document}

Remove Chapter title from header on all pages, latex book class

Edited to include a reproducible example.
So, I've found a number of people asking about how to add the chapter title from the header of subsequent pages but I need the opposite. I'm using fancy header but need everything except the page number removed from the header (the page needs to be at the top right of every page). The code I'm using removes the header from the first page of each chapter, but every subsequent page has the chapter name in the header on the left. I'm using \documentclass[12pt,oneside]{book}.
Below is the header code:
\documentclass[12pt,oneside]{book}
\usepackage{fancyhdr} % Permits header customization. See header section below.
\fancypagestyle{plain}{
\lhead{}
\fancyhead[R]{\thepage}
\fancyhead[L]{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot{}
}
\begin{document}
\chapter{Starting Here}
Some stuff
\newpage
New stuff
\end{document}
I have to submit this document with specific formatting requirements and want to continue using the fancyhdr package. Any help is much appreciated.
While your MWE loads the fancyhdr package, you don't actually use it for normal pages as there is no \pagestyle{fancy} or similar. This means your code only customises plain pages like they are used for the first page of a chapter.
If you want to customise normal pages as well:
\documentclass[12pt,oneside]{book}
\usepackage{fancyhdr} % Permits header customization. See header section below.
\fancypagestyle{plain}{
\lhead{}
\fancyhead[R]{\thepage}
\fancyhead[L]{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot{}
}
\pagestyle{fancy}
\fancyhead[R]{\thepage}
\fancyhead[L]{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot{}
\begin{document}
\chapter{Starting Here}
Some stuff
\newpage
New stuff
\end{document}
from the .cls file, I commented \pagestyle and added following code before /begin{document}.
\usepackage{fancyhdr} % Permits header customization. See header section below.
\fancypagestyle{plain}{
\lhead{}
\fancyhead[R]{\thepage}
\fancyhead[L]{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot{}
}
\pagestyle{fancy}
\fancyhead[R]{\thepage}
\fancyhead[L]{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot{}

How to disable numbering in latex?

I am new to latex and I wrote the below tex code on Texmaker editor.
What I want to do is to add the "University" section without any numbering preceeding it and to be centered horizontally, because when I run the code I find that the word "University" is displayed but it is preceeded by a number and I do not want to display any number preceeding that word.
code:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{kpfonts}
\author{Anan}
\pagestyle{plain}
\begin{document}
\section{University}
\end{document}
\section*{\centering University}
% * removes numbering for _this_ \section instance,
% \centering within environment centres the title.
Note however, that this is a local solution, and that it's better practice (and easier for you to make later document-global changes) to re-define the \section, \subsection, ... environments using the titlesec package, as is described well in Alan Munn:s answer in the following tex.stackexchange thread:
https://tex.stackexchange.com/questions/8546/section-heading-centering-problem
All you have to do is to edit your line 9:
\section{University}
this way:
\section*{\centering University}
since the command \section* produces unnumbered sections.
Further, if you want to to include an unnumbered section to your table of contents, you can add
\addcontentsline{toc}{section}{University}
(this time without \centering) just after. The resulting code:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{kpfonts}
\author{Anan}
\pagestyle{plain}
\begin{document}
\tableofcontents
\section*{\centering University}
\addcontentsline{toc}{section}{University}
Text.
\end{document}

Margin Figures in Latex

I would like to put some figures in margin in my latex documents. I want them to be non-float. Is there any package for it.
thanks
Use the caption package:
\usepackage{caption}
and e.g.
\marginpar{%
\includegraphics[width=\marginparwidth]{myfile}
\captionof{figure}{The caption}
}

Resources