1

My code produce two different results when I compile it depending on which PC I use. One of the PC has Ubuntu 16.04 the other Arch Linux.

This is the result in Ubuntu PC:

enter image description here

This is the result in Arch Linux PC:

enter image description here

I want to get the same result in both PC (with the numbers of sections like in Arch). In both PC the table of content has the number of sections and subsections. So I wonder if the problem is caused by a missing package.

The tex is a book document. The preamble include this specifications: (sorry for the messy code)

\documentclass[10pt,a4paper,twoside]{book}
\usepackage[english]{babel} 
\usepackage[latin1]{inputenc}
\usepackage{lmodern}
\usepackage{textcomp, gensymb}
\usepackage{graphicx,ctable,url,amsmath, wrapfig}
\usepackage{amssymb}
\usepackage[version=3]{mhchem}
\usepackage{paralist}
\usepackage{xfrac}
\usepackage[list-units = single,range-units = single]{siunitx}
\usepackage{lineno}
\usepackage{afterpage}
\usepackage{float}
\usepackage[authoryear]{natbib}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{array}
\usepackage[nooneline,bf]{caption} %does not center caption
\usepackage{titlesec}
\usepackage{eurosym}
\usepackage{rotating}
\usepackage{slantsc}
\usepackage{bibspacing}
\usepackage[text={13cm,19cm},centering]{geometry}
\usepackage{natbib,natbibspacing} %natbibspacing uses natbibspacing.sty file to remove white space between references in reference list
\usepackage{ragged2e}
% colours
\usepackage{Sweave}
\usepackage{xcolor}
\definecolor{mycolor}{HTML}{8B0000}

\graphicspath{{/home/marcos/Dropbox/PhD_Marcos/Thesis/Figures/}}
\DeclareGraphicsExtensions{.jpg, .png, .pdf}

\newcommand*{\justifyheading}{\raggedleft}
\titleformat{\chapter}[display] {\normalfont\huge\bfseries\justifyheading}{\chaptertitlename\ \thechapter}{10pt}{\Large}
%commands rightly align chapter header and title. spacing between header and chapter title is 10 pt. The chapter title has fontsize Large

%Figures
\usepackage[caption=false]{subfig}
\renewcommand{\captionfont}{\it \small}      %figure and table captions italic



\setcounter{tocdepth}{2}                %only chapters in ToC

\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}

\renewcommand{\rmdefault}{ppl} %change font to Palatino
\renewcommand{\sfdefault}{phv}
\renewcommand{\ttdefault}{pcr}

\renewcommand{\baselinestretch}{1.05}
\renewcommand{\textfraction}{0.05}
\renewcommand{\topfraction}{0.95}
\renewcommand{\bottomfraction}{0.95}
\renewcommand{\floatpagefraction}{0.35}
\setcounter{totalnumber}{5}

\pagestyle{fancy}                   %page style for chapters, the following commands adjust fancy default
\fancyhf{}                          %clear header and footer
\renewcommand{\sectionmark}[1]{\markright{\slshape \thesection.\ #1}{}}  %adjust rightmark default (section)
\fancyhead[RO]{\footnotesize \slshape {\rightmark}}                      %odd page header
\fancyhead[LE]{\footnotesize \slshape Chapter \thechapter}               %even page header
\fancyfoot[LE,RO]{\thepage}         %put page number in footer, even pages left, odd pages right
\renewcommand{\headrulewidth}{0.4pt}

\fancypagestyle{plain}{%redefine empty page style, used for chapter pages
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}

\setlength{\parindent}{0pt}                             %no indentation at start paragraph
%\setlength{\parskip}{1.5ex plus 0.5ex minus 0.2ex}      %white space between paragraphs
\setlength{\parskip}{1.5ex plus 0.1ex minus 0.1ex} 

\flushbottom                                            %makes all pages the same hight
% caption position
\captionsetup{justification=centering,margin=0.5cm}
%\renewcommand*{\UrlFont}{\normalsize}
\urlstyle{same}
\usepackage[scaled=.5]{beramono}

%\usepackage{xr-hyper} 
\usepackage{hyperref} 
\hypersetup{
    colorlinks=true,
    linkcolor=mycolor,
    filecolor=magenta,      
    urlcolor=cyan,
    citecolor=blue,
    bookmarks=true,
    %pdfpagemode=FullScreen,
%    citebordercolor    ={0.3 0.3 0.3},
%    linkbordercolor    ={0.3 0.3 0.3},
%    pdfborder={1 1 1},
%    pdfborderstyle={/S/U/W 1}
}
%\makeatletter
%\Hy@AtBeginDocument{%
%  \def\@pdfborder{0 0 0}% Overrides border definition set with colorlinks=true
%  \def\@pdfborderstyle{/S/U/W 1}% Overrides border style set with colorlinks=true
%                                % Hyperlink border style will be underline of width 1pt
%}
%\makeatother

\usepackage{booktabs, stackengine}
\usepackage{threeparttable}
\usepackage{multirow}
\usepackage{lscape}
\usepackage{pdfpages}

\begin{document}
Sebastiano
  • 54,118
Marcos
  • 33
  • Seems the same as https://tex.stackexchange.com/questions/299969/titlesec-loss-of-section-numbering-with-the-new-update-2016-03-15 ; the last command in https://tex.stackexchange.com/a/353756/38080 solves it for every Ubuntu I know. – Rmano Nov 03 '17 at 08:18

0 Answers0