i have chapter and this chapter don't have section: ex: infomation chapter, Acknowledgment chapter.
My latex:
Link in overleaf: https://www.overleaf.com/13998715dxwtfgqcqcby
Code: Select all
\
\documentclass[a4paper,11pt]{book}
\usepackage{import}
\usepackage{example}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{vietnam}
%\usepackage[utf8]{english}
\usepackage[none]{hyphenat}
%\usepackage{hyphenat}
%\usepackage[english]{babel}
\usepackage{xcolor}
\usepackage{lipsum}
%\usepackage{tabularx}
\usepackage{longtable}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{ragged2e}
\usepackage{hyperref}
%\hypersetup{linktocpage}
%\renewcommand{\theHsection}{\thepart.section.\thesection}
%\usepackage{placeins}
\usepackage[section]{placeins}
\usepackage{float}
%\hypersetup{
% colorlinks=true, %set true if you want colored links
% linktoc=all, %set to all if you want both sections and subsections linked
% linkcolor=blue, %choose some color if you want links to stand out
%}
\usepackage{booktabs}
\usepackage{array}
\usepackage{microtype}
%\DeclareCaptionTextFormat{new}{\nohyphens{#1}}
\geometry{a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,}
%Đổi tên chapter, section
\usepackage{titlesec}
%\usepackage{fixltx2e}
\usepackage{eurosym}
\usepackage{makeidx}
\makeindex
\pagestyle{fancy}
\fancyhf{}
\rfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\renewcommand{\headrule}{}
%\titleformat
%{\chapter} % command
%[display] % shape
%{\bfseries\Large\itshape} % format
%{CHAPTER No. \ \thechapter} % label
%{0.5ex} % sep
{
% \rule{\textwidth}{1pt}
% \vspace{1ex}
% \centering
} % before-code
%[
%\vspace{-0.5ex}%
%\rule{\textwidth}{0.3pt}
%] % after-code
%=====================
%\chapter{The Fourth Industrial Revolution \\
%Cách mạng công nghệ lần thứ Tư}
\usepackage{chngcntr}
%\counterwithout{section}{chapter}
\newcommand{\periodafter}[1]{#1.}
\titleformat{\chapter}[frame]
{\normalfont}
{\filright\small\enspace\MakeUppercase{\chaptertitlename}~\thechapter\enspace}
{20pt}
{\Large\filcenter}
\titleformat{\section}[runin]
{\normalfont\large\bfseries}{\thesection}{1em}{\periodafter}
\titlespacing*{\section}
{0pt}{3.5ex plus 1ex minus .2ex}{0.5em}
%Nguồn sách
\fancyfoot[LO]{Source: Industry 4.0 - Klaus Schwab and others}
%Chỉ dành cho nội bộ
\fancyfoot[LE]{For internal circulation only}
%Tiêu đề chương trên header
\fancyhead[LO]{\rightmark}
%Song ngữ-DataMining
\fancyhead[LE]{Data Mining }
%Giới thiệu công ty
\fancyhead[RE,RO]{BenhVienOTo}
%\renewcommand{\contentsname}{Whatever}
\usepackage[english]{babel}
\addto\captionsenglish{% Replace "english" with the language you use
\renewcommand{\contentsname}%
{Table of contents }%
}
\begin{document}
{\pagestyle{plain}
\tableofcontents
\cleardoublepage}
%\clearpage
%\frontmatter
%\pagenumbering{num_style}
\pagenumbering{arabic}
\import{Intro/}{Introduction.tex}
%/Chapter A1
\import{Chapter_A1/}{a1.tex}
\section{Historical Context - Bối cảnh lịch sử}
\import{Chapter_A1/}{sectiona1-1.tex}
%
\section{Profound and Systemic Change}
\import{Chapter_A1/}{sectiona1-2.tex}
\end{document}
....
case 1. If chapter have section, display section: \fancyhead[LO]{\rightmark}
case 2. if don't have section, display chapter in Left odd (LO): ??? in page pdf 3 (please compile in overleaf.
and how can remove blank page (page 4 pdf)
please see more in pdf attacht.
Thanks
how can i get it?
Please help
thanks