7

I'm taking study notes in latex and I want to read it in my kindle. So far I was able to get very good results using:

\documentclass[ebook,oneside,openany,17pt]{memoir}
\usepackage[margin=0.3in]{geometry}
\usepackage[hidelinks]{hyperref}

But for an e-reader is really helpful the TOC with links, and as I found useless the page numbering in an e-reader, I just want to remove it (also it looks very bad with 0.3in margin) from the the pages in the final pdf and from the TOC at the right end.

In order to remove the page numbers I've used:

\thispagestyle{empty}

But now I have several issues:

  1. With the command \thispagestyle{empty} the TOC is empty.
  2. If I remove \thispagestyle{empty}, still the TOC is empty (I think is because I use the * form for chapters, sections, etc.)
  3. When I remove \thispagestyle{empty} and use the numbered sectioning then the TOC have page numbers at the right side.

What I want is:

  • No page numbering at all, not in pages nor in TOC.
  • If it is possible no numbered sectioning.
  • Hyperlinks (this part is working just fine right now).

I hope here I could find a complete solution.


Note: I've tried with this Remove dots & Page numbers from TOC with no luck, I think one big problem in my approach could be the use of \thispagestyle{empty}.
MWE:

\documentclass[ebook,oneside,openany,17pt]{memoir}
\usepackage[margin=0.3in]{geometry}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}

\usepackage[backref,hidelinks]{hyperref}

\begin{document}

\title{Notes about something}
\author{Me}

\maketitle

\tableofcontents
\thispagestyle{empty}

\chapter*{First thought}
\thispagestyle{empty}

\section*{Complications}

\subsection*{OK}

\end{document}
3
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    May 7, 2015 at 12:04
  • @ChristianHupfer I will do it i a minute, sorry for the delay. May 7, 2015 at 12:59
  • Just added the MWE. May 7, 2015 at 13:06

1 Answer 1

4

This should serve as a starting point.

\documentclass[ebook,oneside,openany,17pt]{memoir}
\usepackage[margin=0.3in]{geometry}
\usepackage[hidelinks]{hyperref}
\usepackage{blindtext}   %% for demo
\setsecnumformat{}
\pagestyle{empty}
\makeatletter
\let\ps@plain\ps@empty
\makeatother

\providecommand\chapfont{}
\makechapterstyle{mychap}{
  \renewcommand\printchaptername{}
  \renewcommand\printchapternum{}
  \renewcommand\afterchapternum{}
  \renewcommand\chapfont{\Huge\sffamily\bfseries}
  \renewcommand\printchaptertitle[1]{%
    \chapfont ##1
  }
  \setlength{\beforechapskip}{-\baselineskip}
}
\chapterstyle{mychap}
\setsecheadstyle{\raggedright\large\sffamily\bfseries}
\begin{document}
\renewcommand{\chapternumberline}[1]{}
\renewcommand{\numberline}[1]{}
\addtocontents{toc}{\cftpagenumbersoff{chapter}}
\addtocontents{toc}{\cftpagenumbersoff{section}}
\tableofcontents*

\Blinddocument
\end{document}
10
  • Not working for me :( The TOC is still empty! I will post a image if you need it. Maybe is a problem with my latex configuration? May 7, 2015 at 13:50
  • @xndrme Did you compile my code as such? Did it not compile?
    – user11232
    May 7, 2015 at 13:52
  • Also when I click on the Contents link in the TOC it gets me to Heading on level 2(subsection) May 7, 2015 at 13:52
  • Wait! Maybe I have a problem with my editor!? When I rerun the compilation it worked just fine! May 7, 2015 at 13:54
  • @xndrme For table of contents, you have to compile atleast 2 times. Not a problem with editor.
    – user11232
    May 7, 2015 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.