# why there is no number in my section [duplicate]

I can see it in my lyx editor there is number in my section

but when I render the pdf there is no number in my section

anyone can help me? I think there is a problem with my preamble but I don't know which one because when I delete all my preamble the number is shown

It's seems the problem is with \usepackage{titlesec} what make me confuse is

it only happen in my computer,

when I try to render the same file in my friend's computer the number is shown

my latex preamble

%% \renewcommand{\chapter}[1]{\chapter[#1]{\centering #1}}
\usepackage{titlesec}
\usepackage{graphicx}
\usepackage{pdflscape}
\usepackage{colortbl}
\usepackage{amsmath}
\usepackage{color}
\usepackage{tocbibind}
\usepackage{url}
\usepackage[titletoc]{appendix}
\definecolor{lineno}{rgb}{0.5,0.5,0.5}
\definecolor{bcolor}{rgb}{0.98,0.98,0.98}
\definecolor{code}{rgb}{0,0.1,0.6}
\definecolor{codesty}{rgb}{0.7,0.1,0.1}
\definecolor{commandsty}{rgb}{0.1,0.5,0.0}
\definecolor{keywordsty}{rgb}{0.4,0.0,0.4}
\definecolor{stringsty}{rgb}{1.0,0.5,0.0}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\centering}{\chaptertitlename\thechapter}{20pt}{\Huge}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{Chapter  \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}{}}

\fancyhf{}

\fancypagestyle{plain}{ %
\fancyhf{} % remove everything
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}}
\usepackage[margin=10pt,font=small,labelfont=bf,labelsep=endash]{caption}

• I think the problem is related with this one, tex.stackexchange.com/questions/299969/…. – buncis Sep 29 '16 at 9:46
• If that is the case, you don't load titlesec package, unless you need to modify you sections. Which is your document class? Did you try to change it? – Yorgos Sep 29 '16 at 9:50
• @Yorgos my class is book standard class? is that wrong? – buncis Sep 29 '16 at 9:55
• no i don't think so... but try article or koma-script book to see if there is a difference – Yorgos Sep 29 '16 at 10:08
• You may have the version of titlesec with that bug (which explains why it works at your friends computer). Try updating the package -- see tex.stackexchange.com/questions/55437/… for instructions on updating. – Torbjørn T. Sep 29 '16 at 11:20

this is a bug from the titlesec/tex-live itself

this is happen because I upgrade my ubuntu distributions to 16.04,

one of the workaround is adding this in preamble

\usepackage{etoolbox}

\makeatletter
\patchcmd{\ttlh@hang}{\parindent\z@}{\parindent\z@\leavevmode}{}{}
\patchcmd{\ttlh@hang}{\noindent}{}{}{}
\makeatother


another workaround is upgrade your whole texlive version to 2016 version, default ubuntu repository only have 2015 version, so you need to add this PPA https://launchpad.net/~jonathonf/+archive/ubuntu/texlive-2016

or do manual install https://www.tug.org/texlive/quickinstall.html

• The LyX version has nothing whatsoever to do with this bug, it is titlesec that is the problem. – Torbjørn T. Sep 29 '16 at 11:31