I want to use fancyhdr to modify my page numbering, and it works just fine. However, there is a number that appears right at the end of my text, which looks like a page number, but probably is something else. Does anyone know how to get rid of it (or am I just blind?)?
Here's the (granted very bloated) code:
\documentclass[12 pt, twoside]{article}
\usepackage{setspace}
\usepackage[a4paper, total={6.3in, 8.4in}]{geometry}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{fancyhdr}
\usepackage{multicol}
\usepackage{lastpage}
\setlength{\columnsep}{0.5cm}
\usepackage{amssymb}
\usepackage{sectsty}
\usepackage{parskip}
\usepackage{subfig}
\setstretch{1.1}
\usepackage[export]{adjustbox}
\usepackage{tikz}
\usepackage{wrapfig}
\setlength\intextsep{0pt}
\setlength{\arrayrulewidth}{0.3mm}
\setlength{\tabcolsep}{8pt}
\renewcommand{\arraystretch}{1}
\usepackage{longtable}
\usepackage{titlepic}
\usepackage{titlesec}
\titlespacing\section{0pt}{12pt plus 4pt minus 2pt}{1pt plus 2pt minus 2pt}
\titlespacing\subsection{0pt}{12pt plus 4pt minus 2pt}{1pt plus 2pt minus 2pt}
\titlespacing\subsubsection{0pt}{12pt plus 4pt minus 2pt}{1pt plus 2pt minus 2pt}
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RO,LE]{\sffamily\small{\textit{\color{codegray}[assignment name]}}}
\fancyhead[RE]{\sffamily\small{\textit{\color{codegray}[author name]}}}
\fancyfoot[RO,LE]{\sffamily\textbf{\thepage}}
\usepackage{fontspec}
\setmainfont{Georgia}
\setsansfont{Arial}
\definecolor{mygreen}{cmyk}{0.11, 0.0, 0.22, 0.3}
\definecolor{coolred}{cmyk}{0.0, 0.75, 0.75, 0.25}
\definecolor{codegray}{cmyk}{0.06,0.0,0.04,0.77}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\titleformat*{\section}{\large\color{codegray}\bfseries\sffamily}
\titleformat*{\subsection}{\normalsize\color{codegray}\bfseries\sffamily}
\sectionfont{\color{codegray}\bfseries\sffamily}
\renewcommand{\headrulewidth}{0.4pt}
\begin{document}
\begin{multicols}{2}
\section{Introduction}
And here's what I want to get rid of:
Thanks!
Related
I am using latex to write my thesis and it has the following numbering structure which is quite confusing when I make reference to previous chapters. For example, if am in chapter 3 and want to reference a subsection in chapter 2, I use section \ref{section 1} and it's not clear which section 1 I want (chapter 1 or 2).
So, how do I change the above like the image below
Below is the code in my header then inside the document I use \chapter, \section and \subsection to distinguish them.
\documentclass[a4paper,11pt]{report}
% Preamble
\usepackage[utf8x]{inputenc}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\usepackage{subfig}
\usepackage{fullpage}
\usepackage{tabularx}
\usepackage{comment}
\usepackage{color, colortbl}
\usepackage{graphicx}
\usepackage{url}
\usepackage{setspace}
\usepackage{float}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{varioref}
\usepackage{multirow}
\usepackage{hhline}
\renewcommand\thesection{\arabic{section}}
\usepackage{parskip}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{caption}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\renewcommand{\arraystretch}{1.3}
\usepackage{lscape}
\usepackage{multirow}
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
\usepackage{longtable}
\setlength{\parindent}{0pt}
[1]: https://i.stack.imgur.com/tsJLC.png
[2]: https://i.stack.imgur.com/xNruu.png
\renewcommand\bibname{References} % change title of references section
\newcommand{\myquote}[2]{\begin{center}\fbox{\begin{minipage}{.95\linewidth}#1\hfill #2\end{minipage}}\end{center}}
\newcommand{\source}[1]{\caption*{{#1}} }
\usepackage{natbib} \input{natbib-add}
\bibliographystyle{named}
\bibpunct{[}{]}{;}{a}{}{}
%\setlength{\skip\footins}{1.5cm}
\setlength{\intextsep}{10pt plus 2pt minus 2pt}
It's this line:
\renewcommand\thesection{\arabic{section}}
It changes the section numbering to start from 1, like the chapters already are. Just delete the line and the sections are numbered 1.1, 1.2, etc.
I got some big latex source that compiles to a booklet that justifies text in an alternating manner, left-right-left-right, so that it's nice for printing I guess. How can you remove that? I can't share the entire thing, but it starts with:
\documentclass[12pt, a4paper, twoside]{book}
\usepackage{helvet}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{textcomp}
\usepackage[
a4paper,
outer=2cm,
inner=4cm,
top=2cm,
bottom=2cm
]{geometry}
\usepackage{float}
\usepackage{tabularx}
\usepackage[disable]{todonotes}
%\usepackage{color, soul}
\usepackage{color}
\usepackage{amsmath}
\usepackage{algorithmicx}
\usepackage[noend]{algpseudocode}
\usepackage{algorithm}
\usepackage{framed}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{titlepic}
\usepackage{fancyhdr}
\usepackage[simplified]{pgf-umlcd}
\usepackage{tikz}
\definecolor{grey}{rgb}{0.9, 0.9, 0.9}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{dkred}{rgb}{0.6,0,0.0}
\lstdefinestyle{DOS}
{
backgroundcolor=\color{black},
basicstyle=\scriptsize\color{white}\ttfamily,
stringstyle=\color{white},
keywords={}
}
\lstdefinestyle{makefile}
{
numberblanklines=false,
language=make,
tabsize=4,
keywordstyle=\color{red},
identifierstyle= %plain identifiers for make
}
Found the answer, and it was because of some code that I didn't include above
\fancyhf{}
\fancyhead[LO, RE]{\small \rightmark}
\fancyfoot[LO, RE]{\small \thepage}```
It was the LO, RE that means Left side when odd page, right side on even pages. So, changed that to LO, LE and it's now consistent
Is it possible to create footers like above in xelatex? on the first page the number to be aligned on the right and on the second page on the left side. The top border would be a nice addition but it is not necessary. I don't need any text (section names) beside the numbers.
\documentclass[11pt,a4paper]{article}
\usepackage{fontspec}
\setmainfont{Charis SIL}
\usepackage{geometry}
\geometry{a4paper, left=1in, right=1in,
top=0.5in, bottom=0.65in}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}
\setcounter{secnumdepth}{0}
\usepackage{sectsty}
\sectionfont{\huge}
\subsectionfont{\Large}
\subsubsectionfont{\large}
\paragraphfont{\normalsize}
\usepackage{hyperref}
\subparagraphfont{\normalsize}
\renewcommand{\baselinestretch}{1.5}"
If you are using the twoside documentclass option, then you can use the fancyhdr package to add such a footline:
\documentclass[11pt,a4paper,twoside]{article}
\usepackage{fontspec}
\setmainfont{Charis SIL}
\usepackage{geometry}
\geometry{a4paper, left=1in, right=1in,
top=0.5in, bottom=0.65in}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}
\setcounter{secnumdepth}{0}
\usepackage{sectsty}
\sectionfont{\huge}
\subsectionfont{\Large}
\subsubsectionfont{\large}
\paragraphfont{\normalsize}
\usepackage{hyperref}
\subparagraphfont{\normalsize}
\renewcommand{\baselinestretch}{1.5}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{1pt}
\fancyhead{}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\usepackage{duckuments}
\begin{document}
\duckument
\end{document}
I want my email id on left, phone number in middle and site on right side, i.e. I want the line to be "justify" aligned (please look at the image).
CV.jpg
I used "\hspace{}" for adding space but I think it's not the right way.
Link for resume.cls: https://docs.google.com/document/d/12QO34MquVCenQ8Vu8fmuIzrSRqPIhvUZiRdVVCqSqbA/edit
I tried the following code:
\documentclass{resume}
\usepackage{tabularx}
\usepackage{hyperref}
\hypersetup{colorlinks=true,urlcolor=blue}
\hypersetup{linktocpage}
\usepackage{marvosym}
\usepackage[bitstream-charter]{mathdesign}
\usepackage[left=1cm,top=0.5cm,right=1cm,bottom=0.1cm]{geometry}
\name{\bf Saksham Sharma}
\address{
{\Large\Letter}{\href{mailto:abc#gmail.com}{abc#gmail.com}}
{\Large\Telefon} +1-xxx-xxx-xxxx
{\Large\Mundus} {\href{example.com}{example.com}}
}
\begin{document}
\end{document}
Use \hfill to push the content to the sides:
\documentclass{resume}
\usepackage{marvosym}
\usepackage[bitstream-charter]{mathdesign}
\usepackage{geometry}
\geometry{
hmargin=1cm,
top=5mm,
bottom=1mm
}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
urlcolor=blue,
linktocpage
}
\name{\bfseries Saksham Sharma}
\address{%
{\Large\Letter}{\href{mailto:abc#gmail.com}{abc#gmail.com}}\hfill
{\Large\Telefon} +1-xxx-xxx-xxxx\hfill
{\Large\Mundus} {\href{example.com}{example.com}}%
}
\begin{document}
\end{document}
However, I'd advise against using some restrictive resume class for setting your CV, unless it's something really fancy. Instead, just use article:
\documentclass{article}
\usepackage{marvosym}
\usepackage[bitstream-charter]{mathdesign}
\usepackage{geometry}
\geometry{
hmargin=1cm,
top=5mm,
bottom=1mm
}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
urlcolor=blue,
linktocpage
}
\setlength{\parindent}{0pt}
\begin{document}
{\centering
{\huge\bfseries \MakeUppercase{Saksham Sharma}\par}
\bigskip
{\Large\Letter}{\href{mailto:abc#gmail.com}{abc#gmail.com}}\hfill
{\Large\Telefon} +1-xxx-xxx-xxxx\hfill
{\Large\Mundus} {\href{example.com}{example.com}}
\par}
\smallskip
Your resume here
\end{document}
See this MWE:
% !TeX spellcheck = en_US
\documentclass[12pt]{article}
\usepackage[onehalfspacing]{setspace}
\usepackage[a4paper, margin=2.5cm]{geometry}
\usepackage{mathptmx}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[hang]{caption}
\usepackage{subcaption}
\usepackage[bottom]{footmisc}
\usepackage{dcolumn} %makes r output work
\usepackage{tabularx}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
\newcommand{\possessivecite}[1]{\citeauthor{#1}'s (\citeyear{#1})}
\usepackage{pdfpages}
\usepackage{hyperref}
\usepackage{pdflscape}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{landscape}
\setcapmargin[2cm]
\begin{figure}[]
\captionsetup{justification=centering}
\caption{Main Caption. }
\label{fig:val_efcts}
\begin{subfigure}{0.55\textwidth}
\caption{X}
\includegraphics[width=\textwidth] {example-image-a}
\end{subfigure}
\begin{subfigure}{0.55\textwidth}
\caption{Y}
\includegraphics[width=\textwidth] {example-image-b}
\end{subfigure}
\begin{subfigure}{0.55\textwidth}
\caption{Z}
\includegraphics[width=\textwidth] {example-image-c}
\end{subfigure}
\captionsetup{justification=raggedright} \subcaption*{This subcaption is supposed to be ragged right and intented by 4 cm. \\ This is in a new line.}
\end{figure}
\end{landscape}
\end{document}
It should be self-explanatory, mostly. I'd like the last subcaption below the picture to be ragged right, but indented 2 cm. I tried to use \setcapmargin, but that does not work, creating the "undefined control sequence" error (so it's an unknown command).
Since you're writing a caption without numbering, set it in a \parbox where you have some more control over the placement and alignment:
\documentclass{article}
\usepackage{graphicx}
\usepackage[hang]{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}[]
\captionsetup{justification=centering}
\caption{Main Caption. }
\label{fig:val_efcts}
\begin{subfigure}{0.3\textwidth}
\caption{X}
\includegraphics[width=\linewidth] {example-image-a}
\end{subfigure}\hfill
\begin{subfigure}{0.3\textwidth}
\caption{Y}
\includegraphics[width=\linewidth] {example-image-b}
\end{subfigure}\hfill
\begin{subfigure}{0.3\textwidth}
\caption{Z}
\includegraphics[width=\linewidth] {example-image-c}
\end{subfigure}
\hspace*{4cm}%
\parbox{\dimexpr\linewidth-8cm}{\raggedright
\strut This subcaption is supposed to be ragged right and indented by 4cm. \\
This is in a new line.\strut%
}
\end{figure}
\end{document}
Note the use of \struts to support correct baseline alignment when dealing with text inside \parboxes. For more on this, see How to keep a constant baseline skip when using minipages (or \parboxes)?