# How to make subsections not appear in the text? [duplicate]

I have the following preamble and I want the subsection not to be visible in the text. Instead of Chapter 1 "Blah Blah" I only want "Blah Blah to be visible. With this code I did it bu the subsections are still visible in the text. e.g. 2.5 "blah blah". How can I also remove 2.5 ??

\documentclass[a4paper,12pt]{book}
\usepackage{titlesec}

\titleformat{\chapter}[display]{\normalfont\huge\bfseries}{}{20pt}{\Huge}

\let\cleardoublepage\clearpage
\usepackage[english,greek]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{blindtext}
\usepackage[pdftex]{graphicx}
\usepackage[skip=2pt, font=small, labelformat = empty]{caption}

\newcommand{\gr}{\selectlanguage{greek}}
\newcommand{\en}{\selectlanguage{english}}
\usepackage{wrapfig}
\usepackage[paperwidth=17cm, paperheight=24cm]{geometry}

\usepackage[onehalfspacing]{setspace}
\usepackage{textcomp}
\useshorthands{;}
\defineshorthand{;}{?}
\usepackage{fancyhdr}
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\pagestyle{fancy}

\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\renewcommand{\sectionmark}[1]{ \markright{#1}{} }

• Put \renewcommand\thesubsection{} in your preamble. Feb 19 '14 at 22:08

No need to use titlesec for this. The easiest way to get all sectional units unnumbered is to set secnumdepth to -2 (or to -1 if parts should be numbered):

\documentclass{book}

\setcounter{secnumdepth}{-2}

\begin{document}

\chapter{Test chapter}
\section{Test section}
\subsection{Test subsection}
\subsubsection{Test subsubsection}

\end{document}


• Niiiice...!!! It worked perfectly..!! Thanks a lot..!! :-) Feb 19 '14 at 22:19
• @Stefanos You're welcome! Don't forget that you can accept answers that best solved your problems by clicking the checkmark to their left; in case of doubt, please see How do you accept an answer?. Feb 19 '14 at 22:23
• One more thing ...!! With the same preamble, each section is defined to start at almost the 2/3 of the page, meaning there is a small space and then goes the "Section 1: blah blah". Can I start each section at the beginning of the page like the other pages? Feb 19 '14 at 22:24
• @Stefanos As a general rule, one question per post. Please consider opening a new question with this new requirement. Feb 19 '14 at 22:25