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
Related
I am trying to mock an antique writing style in LaTex (standard Overleaf with pdfLaTex) and I need to include the old "long s" letter (https://en.wikipedia.org/wiki/Long_s). Using the ſ symbol produces the LaTeX Error: Unicode character ſ (U+017F) error.
Here's a minimal example with my actual header, thank you for any suggestion:
\documentclass[a4paper,11pt,twoside,titlepage]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[labelfont=bf]{caption}
\usepackage{subcaption}
\usepackage[sorting=none]{biblatex}
\usepackage{booktabs}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{enumitem}
\usepackage{epigraph}
\usepackage{subfiles}
\begin{document}
Here is a ſimple example
\end{document}
The easiest way to use unicode characters in latex is to switch to an unicode aware engine such as lualatex or xelatex. In overleaf, you can switch to them in the sidebar of your project.
If you use one of these engines, you should remove the fontenc package.
% !TeX TS-program = lualatex
\documentclass[a4paper,11pt,twoside,titlepage]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[labelfont=bf]{caption}
\usepackage{subcaption}
\usepackage[sorting=none]{biblatex}
\usepackage{booktabs}
\usepackage[english]{babel}
\usepackage{csquotes}
%\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{enumitem}
\usepackage{epigraph}
\usepackage{subfiles}
\begin{document}
Here is a ſimple example
\end{document}
While working today, after hours of tweaking and fixing with the latex markup and making things prettier in the work, I all of the suddenly, after a refresh saw this:
All used packages:
\usepackage{caption}
\usepackage{blindtext}
\usepackage{pifont,mdframed}
\usepackage{enumitem}
\usepackage{amssymb}
\usepackage[titles]{tocloft}
\usepackage{hyperref} % Hyperlinks
\usepackage[nameinlink,noabbrev,capitalise]{cleveref} % Better in-doc refs
\usepackage[title,toc,titletoc,page]{appendix}
\usepackage{multirow}
\usepackage[margin=2cm]{geometry}
\usepackage{graphicx}
\usepackage{float} % Better figure and table placements
\usepackage{tabularx}
\usepackage{amsmath} % For using \text in equations
\usepackage{csquotes} % For blockquote
\usepackage[labelfont=it, labelsep=period]{caption}
\usepackage{subcaption}
\usepackage{color}
\usepackage{xcolor,colortbl}
\usepackage[final]{pdfpages} % used to include pdf to appendicies
\usepackage{lipsum}
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage{lettrine}
\usepackage{longtable}
\usepackage{ragged2e}
Declaration and usage:
\makeatletter
\newrobustcmd{\fixappendix}{%
\patchcmd{\l#subsection}{2.3em}{5.6em}{}{}%
}
\makeatother
\cleardoublepage
\newpage
\appendix
\addtocontents{toc}{\fixappendix}
\renewcommand{\thesubsection}{\appendixname~\arabic{subsection}}
Was caused by: \usepackage[titles]{tocloft}.
I'm using the following settings on Overleaf:
\documentclass[%
aip,
jmp,%
amsmath,amssymb,
%preprint,%
reprint,%
nofootinbib,
nobibnotes,
%author-year,%
%author-numerical,%
10pt
]{revtex4-2}
\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{tabularx}
\usepackage[a4paper, total={6.5in, 9in}]{geometry}
\usepackage{microtype}
\usepackage[english]{babel}
\usepackage[utf8]{inputenx}
\usepackage{bm}
\usepackage{amsbsy}
\usepackage{fixmath}
\usepackage{commath}
\usepackage{float}
\usepackage{siunitx} % notazione \num{e-}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}
%\usepackage{subcaption}
\usepackage{hyperref}
\usepackage{curve2e}
%\usepackage{caption}
\usepackage{subcaption}
%\usepackage{silence}
%\WarningFilter{caption}{Unsupported document class}
%\usepackage[center]{subfigure}
\usepackage{comment}
%\usepackage[mathlines]{lineno}% Enable numbering of text and display math
%\linenumbers\relax % Commence numbering lines
and I get the following warning:
Package caption Warning: Unknown document class (or package), standard defaults will be used. See the caption package documentation for explanation.
The thing is that I've commented the caption package (it shouldn't be active anymore), trying to replace it with subcaption.
Is there a way to solve the warning?
subcaption automatically loads the caption package. The warning is vanishes if you remove this package as well:
\documentclass[%
aip,
jmp,%
amsmath,amssymb,
%preprint,%
reprint,%
nofootinbib,
nobibnotes,
%author-year,%
%author-numerical,%
10pt
]{revtex4-2}
\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{tabularx}
\usepackage[a4paper, total={6.5in, 9in}]{geometry}
\usepackage{microtype}
\usepackage[english]{babel}
\usepackage[utf8]{inputenx}
\usepackage{bm}
\usepackage{amsbsy}
\usepackage{fixmath}
\usepackage{commath}
\usepackage{float}
\usepackage{siunitx} % notazione \num{e-}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}
%\usepackage{subcaption}
\usepackage{hyperref}
\usepackage{curve2e}
%\usepackage{caption}
%\usepackage{subcaption}
%\usepackage{silence}
%\WarningFilter{caption}{Unsupported document class}
%\usepackage[center]{subfigure}
\usepackage{comment}
%\usepackage[mathlines]{lineno}% Enable numbering of text and display math
%\linenumbers\relax % Commence numbering lines
\begin{document}
content...
\end{document}
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.
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}