1

How to change number format of section from number 0.1 to number 1, picture below.

\documentclass[10pt,a6paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[main=slovak,english]{babel}
\usepackage[cm]{fullpage}
\usepackage[a6paper, top=15mm, left=10mm, right=10mm, bottom=10mm,foot=5mm,marginparsep=0mm]{geometry}
%showframe
\usepackage{tipa}
\usepackage{tabularx,booktabs}  %\toprule
\usepackage{listings}
\usepackage{multirow}
\usepackage{longtable}
%\usepackage{lscape}
\usepackage{wasysym} % symbols
\usepackage{amssymb} % symbols
%\usepackage{pdflscape}
%\usepackage{lscape}
\usepackage{hyperref}
\usepackage{marvosym}
\usepackage{framed}
\usepackage{wasysym}
\usepackage{pdflscape}
\usepackage{graphicx}
%\usepackage{amsmath}
\usepackage{color}
\usepackage{tabularx,booktabs}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{adjustbox}

\usepackage{array,multirow,graphicx}


\newcommand*{\knihaB}{\fontfamily{bch}\selectfont}
\newcommand*{\knihaA}{\fontfamily{phv}\selectfont}
\newcommand*{\knihaC}{\fontfamily{ccr}\selectfont}
\newcommand*{\knihaM}{\fontfamily{cmr}\selectfont}

\newcommand*{\knihaEa}{\fontfamily{qag}\selectfont}
\newcommand*{\knihaEb}{\fontfamily{phv}\selectfont}

\newcommand*{\knihacc}{\fontfamily{pag}\selectfont}
\newcommand*{\knihaaa}{\fontfamily{ccr}\selectfont}
\newcommand*{\knihabb}{\fontfamily{ccr}\selectfont}

\begin{document}
\catcode`\-=12
\sloppy

\section{{\knihaEa text }} 

text    text    text    text    text    text    


\end{document}

enter image description here

Thanks for help.

  • 4
    Your image link does not work (for me), but you're using book and have no top chapter above \section, so what do you expect \thesection should produce? It is usually defined (effectively) as \thechapter.\arabic{section}. None of the packages you are using changes this. So use \renewcommand{\thesection}{\arabic{section}} if this is what you want to have. –  Feb 28 '17 at 14:22
  • 2
    And don't load hyperref in the middle of the bunch of packages, put it at the end of the preamble –  Feb 28 '17 at 14:23
  • 2
    Don't load packages multiple times. – samcarter_is_at_topanswers.xyz Feb 28 '17 at 14:25

1 Answers1

4

(I'm posting this answer mainly so that the query may be treated as having been answered officially.)

  • To change the appearance of the section number, modify the macro \thesection. Given your stated objective, you should run

    \renewcommand{\thesection}{\arabic{section}}
    
  • Do take some time to simplify and de-cruft the preamble of your document. At the moment, several packages are loaded more than once, while others needn't be loaded explicitly. E.g., the rotating package loads the graphicx package automatically -- no need to load graphicx separately. In the code below, I've also attempted to provide some structure and sequencing to the way the packages are loaded.

  • With very few exceptions, the hyperref package should be loaded last in the preamble. See the posting Which packages should be loaded after hyperref instead of before? for some of these exceptions.

enter image description here

\documentclass[10pt,a6paper]{book}

%% basic setup and layout
\usepackage[utf8]{inputenc}
\usepackage[main=slovak,english]{babel}
\usepackage[cm]{fullpage}
\usepackage[top=15mm, bottom=10mm, hmargin=10mm, 
        foot=5mm, marginparsep=0mm]{geometry}

%% various symbols
\usepackage{tipa}
\usepackage{wasysym} 
\usepackage{amssymb} 
\usepackage{marvosym}

%% advanced tabular layouts
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{booktabs}

%% other packages
\usepackage{listings}
\usepackage{multirow}
\usepackage{framed}
\usepackage{color}
\usepackage{rotating}
\usepackage{adjustbox}

%% various font-related macros
\newcommand*{\knihaB}{\fontfamily{bch}\selectfont}
\newcommand*{\knihaA}{\fontfamily{phv}\selectfont}
\newcommand*{\knihaC}{\fontfamily{ccr}\selectfont}
\newcommand*{\knihaM}{\fontfamily{cmr}\selectfont}

\newcommand*{\knihaEa}{\fontfamily{qag}\selectfont}
\newcommand*{\knihaEb}{\fontfamily{phv}\selectfont}

\newcommand*{\knihacc}{\fontfamily{pag}\selectfont}
\newcommand*{\knihaaa}{\fontfamily{ccr}\selectfont}
\newcommand*{\knihabb}{\fontfamily{ccr}\selectfont}

%% hyperlinking -- load this package *last*
\usepackage{hyperref}

%% change the "look" of printed section-level numbers
\renewcommand{\thesection}{\arabic{section}}

\begin{document}
\catcode`\-=12
\sloppy

\section{\knihaEa text }

text    text    text    text    text    text    
\end{document}
Mico
  • 506,678