Latex page numer 24 goes blank - latex

I have some problems with numbering pages. Why page number 24 goes blank?
I just don't understand. If I set it on page number 25 it works fine but not with 24.
I've tried messing with fancyhdr but it just don't work
Sorry for my English. Is not my native language.
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{polski}
\usepackage{indentfirst}
\usepackage{fancyhdr}
\usepackage{amssymb}
\pagestyle{fancy}
\chead{}
\lhead{}
\rhead{}
\lfoot{\fancyplain{\thepage}{\thepage}}
\cfoot{}
\rfoot{}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancyplain}
\setcounter{page}{24}
\begin{document}
\chapter*{\begin{center}
{\small Rozdział 2}
\end{center}}
\title*{\begin{center}
{\huge \textbf{OPRACOWANIE I PREZENTACJA MATERIAŁU STATYSTYCZNEGO}}
\end{center}}
\section*{\begin{center}
2.1. Grupowanie materiału statystycznego
\end{center}}
Materiał liczbowy, otrzymany w wyniku przeprowadzonej obserwacji statystycznej (lub pomiaru), należy odpowiednio usystematyzować i pogrupować w postaci tzw. szeregów statystycznych.
Rozróżnia się zwykle dwa rodzaje grupowania:
- \textit{\textbf{typologiczne}} (np. według cech terytorialnych, rzeczowych, czasowych) mające na celu wyodrębnienia grup różnych jakościowo,
- \textbf{\textit{wariancyjne}}, mające na celu uporządkowanie badanej zbiorowości i poznanie jej struktury, które polega na łączeniu w klasy jednostek statystycznych o odpowiednich wartościach cech statystycznych.
\textbf{Szeregiem statystycznym} nazywamy ciąg wielkości statystycznych, uporządkowanych według określonych kryteriów.
Jak wynika ze schematu (rys. 2.1) przedstawiającego szeregi statystyczne, sposób grupowania cech zależy od rodzaju badania (przekrojowe, czasowe), rodzaju cechy statystycznej, sposobu pomiaru oraz liczby obserwacji (szczegółowe, rozdzielcze).
\textbf{Szeregiem szczegółowym} nazywamy uporządkowany ciąg wartości badanej cechy statystycznej.
Taki sposób porządkowania materiału jest stosowany wtedy, gdy przedmiotem badania jest niewielka liczba jednostek.
Zakładamy, że zmienna \textit{X} przyjmuje wartości: $ x_1 $, $ x_2 $, ..., $ x_n $. Wartości cechy porządkujemy niemalejąco:
$$ x_1 \leqslant x_2 \leqslant ... \leqslant x_n $$.
\end{document}

By default, the book class uses the twoside option. This means that new chapters are only allowed to start on odd pages. If you try to start a new chapter on page 24, an empty page gets inserted so the chapter starts on the odd page 25 instead of the even page 24.
If you don't want this, you can use the oneside option:
\documentclass[oneside]{book}

Related

VS code LaTex workshop book compile problem

Hi I'm new to LaTex and doing some translating at school in LaTex. Since I'm translating a book, I received a bulky file and when I tried to build it. It didn't work.. By the way I'm using TexLive and Visual Studio Code for editing.
The error consists of a lot of undefined sequences..
The code mainly operates with 3 files. modern_robotics.tex, mr1.tex and mr2.tex.
Due to copyright reasons and also the big file, I won't be able to upload all the codes. But I think I can upload the three files mentioned above. I think most of the problem is in mr2.. but I'm not sure.
Any help would be appreciated. Thanks.
modern_robotics.tex
\input{mr1}
% to center the book horizontally:
\setlength{\oddsidemargin}{63pt}
\setlength{\evensidemargin}{63pt}
% instead of centering horizontally, make it so pages can be enlarged in 2per printing without large gutter:
%\setlength{\oddsidemargin}{80pt}
%\setlength{\evensidemargin}{46pt}
\input{mr2}
mr1.tex
\documentclass[10pt]{book}
%======================================================================%
% PACKAGES %
%======================================================================%
\usepackage[centertags]{amsmath}
\usepackage{amsthm,amsfonts,amssymb,enumerate} % Amstex
%\usepackage{Jtocinc}% Jtocinc.sty Include Table of Contents as first entry
%\usepackage{fancybox}
\usepackage{makeidx}
\makeindex
\usepackage[shortlabels]{enumitem}
\usepackage{color}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{xspace}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{ifthen,version}
\usepackage{cancel}
\usepackage{arydshln}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{xcolor}
\usepackage{framed}
\definecolor{shadecolor}{rgb}{0.9,0.9,0.9}
% For translation!!!!!!!!
\usepackage{kotex}
\usepackage{titlesec}
\titleformat{\chapter}% reformat chapter headings
[hang]% like section, with number on same line
{\Huge\bfseries}% formatting applied to whole
{\thechapter~장.}% Chapter number
{0.5em}% space between # and title
{}% formatting applied just to title
\titlespacing*{\chapter}{0pt}{-5mm}{20mm}
\titlespacing*{\section}{0pt}{15mm}{15mm}
\titlespacing*{\subsection}{0pt}{15mm}{15mm}
\titlespacing*{\subsubsection}{0pt}{15mm}{15mm}
\renewcommand{\figurename}{그림}
\usepackage{geometry}
\geometry{
a4paper,
left=20mm,
right=31mm,
top=40mm,
bottom=40mm
}
\usepackage[font={footnotesize,stretch=1.6}]{caption}
\setlength{\belowcaptionskip}{15mm}
\usepackage{setspace}
\setstretch{1.6}
\setlength\parindent{0pt}
% For translation!!!!!!!!
%%%%%%%%%%% for long sub-figures (160824) %%%%%%%%
\usepackage{caption}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{csquotes}
\usepackage[linktoc=all,colorlinks=true,urlcolor=blue]{hyperref}
\hypersetup{
colorlinks,
linkcolor=blue
}
\newboolean{include-notes}
% Comment out the following line to exclude the notes.
\setboolean{include-notes}{false}
%notes
\newcommand{\fpnote}[1]{\ifthenelse{\boolean{include-notes}}%
{\textbf{FP says: #1}}{}}
\newcommand{\klnote}[1]{\ifthenelse{\boolean{include-notes}}%
{\textbf{KL says: #1}}{}}
\newcommand{\kldraft}[1]{\ifthenelse{\boolean{include-notes}}%
{#1}{}}
\newenvironment{function}[2]
{
\vspace*{0.1in}
\noindent
\verb~#1~
\\
\noindent
#2
}{}
\usepackage{draftcopy}
\usepackage{fancyhdr}
\usepackage{datetime}
\begin{comment}
\usepackage[linktoc=all]{hyperref}
\hypersetup{
colorlinks,
linkcolor=blue
}
\end{comment}
% Visual ornaments
% \usepackage[avantgarde]{quotchap}
% select Sanserif font for title and quote
% \renewcommand\sectfont{\sffamily\bfseries\Huge}
% San serif section headers
\usepackage{sfsect}
% hyperref package should be the last one in \usepackage list
% \usepackage[colorlinks,backref]{hyperref}
%********** Fine Tune for this TeX
\hfuzz2pt % Don't bother to report over-full boxes if over-edge is < 2pt
\hyphenation{di-men-sion-al}
%\renewcommand{\theenumi}{\roman{enumi}}
%\renewcommand{\labelenumi}{{\normalfont(\theenumi)}}
\renewcommand{\theenumi}{\alph{enumi}}
\renewcommand{\labelenumi}{{\normalfont(\theenumi)}}
%======================================================================%
% COMMANDS %
%======================================================================%
%\renewcommand{\baselinestretch}{1.5}
%\renewcommand{\baselinestretch}{1.0}
% new commands for unit axes vectors
\newcommand{\xhat}{\ensuremath{\hat{\text{x}}}}
\newcommand{\yhat}{\ensuremath{\hat{\text{y}}}}
\newcommand{\zhat}{\ensuremath{\hat{\text{z}}}}
\newcommand{\Xhat}{\ensuremath{\hat{\text{X}}}}
\newcommand{\Yhat}{\ensuremath{\hat{\text{Y}}}}
\newcommand{\Zhat}{\ensuremath{\hat{\text{Z}}}}
\newcommand{\xhats}{\ensuremath{\hat{\text{x}}_{\text{s}}}}
\newcommand{\yhats}{\ensuremath{\hat{\text{y}}_{\text{s}}}}
\newcommand{\zhats}{\ensuremath{\hat{\text{z}}_{\text{s}}}}
\newcommand{\xhatb}{\ensuremath{\hat{\text{x}}_{\text{b}}}}
\newcommand{\yhatb}{\ensuremath{\hat{\text{y}}_{\text{b}}}}
\newcommand{\zhatb}{\ensuremath{\hat{\text{z}}_{\text{b}}}}
\newcommand{\xhatc}{\ensuremath{\hat{\text{x}}_{\text{c}}}}
\newcommand{\yhatc}{\ensuremath{\hat{\text{y}}_{\text{c}}}}
\newcommand{\zhatc}{\ensuremath{\hat{\text{z}}_{\text{c}}}}
% new commands for abstract (unrepresented) vectors
\newcommand{\vecp}{\ensuremath{\text{p}}}
\newcommand{\vecq}{\ensuremath{\text{q}}}
\newcommand{\vecr}{\ensuremath{\text{r}}}
\newcommand{\vecs}{\ensuremath{\text{s}}}
\newcommand{\vect}{\ensuremath{\text{t}}}
\newcommand{\vecu}{\ensuremath{\text{u}}}
\newcommand{\vecv}{\ensuremath{\text{v}}}
\newcommand{\vecw}{\ensuremath{\text{w}}}
\newcommand{\vecx}{\ensuremath{\text{x}}}
\newcommand{\vecy}{\ensuremath{\text{y}}}
\newcommand{\vecz}{\ensuremath{\text{z}}}
% new commands for orthogonal group
\newcommand{\SOthree}{\ensuremath{SO(3)}\xspace}
\newcommand{\SOtwo}{\ensuremath{SO(2)}\xspace}
\newcommand{\SOn}{\ensuremath{SO(n)}\xspace}
\newcommand{\sothree}{\ensuremath{so(3)}\xspace}
\newcommand{\sotwo}{\ensuremath{so(2)}\xspace}
\newcommand{\son}{\ensuremath{so(n)}\xspace}
\newcommand{\SE}{\ensuremath{SE(3)}\xspace}
\newcommand{\se}{\ensuremath{se(3)}\xspace}
% new commands for bold face greeks
\newcommand{\bomega}{\ensuremath{\mathbf{\omega}}}
\newcommand{\blambda}{\ensuremath{\mathbf{\lambda}}}
% new commands for mathematical equations
\newcommand{\defeq}{\ensuremath{\triangleq}}
\newcommand{\trans}{\ensuremath{^{\mbox{\scriptsize $\top$}}}}
\newcommand{\invtrans}{\ensuremath{^{\mbox{\scriptsize $-\top$}}}}
\newcommand{\inverse}{\ensuremath{^{\mbox{\scriptsize -1}}}}
\newcommand{\smallTH}{\ensuremath{^{\mbox{\scriptsize th}}}}
\newcommand{\trace}{\ensuremath{\mathrm{tr}}}
\newcommand{\RE}{\ensuremath{\mathbb{R}}}
\newcommand{\strad}{\bar{}\!\!\!\!\:d}
\newcommand{\bstrad}{\,\,\,\bar{}\!\!\!\!\:d}
\newcommand{\xinit}{\ensuremath{x^{\circ}}}
\newcommand{\optimal}{\ensuremath{^{\mbox{\scriptsize \textsf {OPT}}}}}
% new commands for abbreviations and others
\newcommand{\etal}{\textit{et al.}\#\xspace}
\newcommand{\eg}{\textit{e.g.,}\xspace}
\newcommand{\ie}{\textit{i.e.,}\xspace}
\newcommand{\etc}{\textit{etc}\#\xspace}
%\newcommand{\mass}{\mathfrak{m}}
%\newcommand{\gravity}{\mathfrak{g}}
% Zero height rule of width of one quad
\newcommand{\IR}[1]{\rule{1em}{0pt}%
\makebox[0cm][c]{\rotatebox{45}{\ #1}}}
%********** Definitions for proof
\def\QED{\mbox{\rule[0pt]{1.5ex}{1.5ex}}}
\def\endofrmk{\hspace*{\fill}~$\Diamond$\par\endtrivlist\unskip}
%********** Environments
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{명제}
%
\theoremstyle{definition}
\newtheorem{definition}{정의}[chapter]
\newtheorem{assumption}{Assumption}[chapter]
\newtheorem{condition}{Condition}[chapter]
\newtheorem{example}{예제}[chapter]
%
%
\numberwithin{equation}{chapter}
%\renewcommand{\theequation}{\thesection.\arabic{equation}}
%********** Tools
\newcommand{\mnote}[1]%
{\mbox{}\marginpar{\raggedright\hspace{0pt}\small#1}}
% {\footnote{#1}}
%\reversemarginpar
\newcommand {\nemo} {\hfill $\Box$ }
\newlength{\blenfbox}
\newsavebox{\boxff}
\newenvironment{FramedPar}%
{\setlength{\fboxsep}{15pt}%
\setlength{\blenfbox}{\fboxsep}%
\addtolength{\blenfbox}{\fboxrule}%
\begin{lrbox}{\boxff}
\minipage{\textwidth}}%
{\endminipage\end{lrbox}
\bigskip\noindent\hspace*{-\blenfbox}%
\fbox{\usebox{\boxff}}\bigskip\bigskip}
\newlength{\mylength}
\newenvironment{FramedNM}%
{\setlength{\fboxsep}{5pt}%
\setlength{\mylength}{\fboxsep}%
\addtolength{\mylength}{\fboxrule}%
\Sbox
\minipage{\textwidth}%
\setlength{\abovedisplayskip}{0pt}}%
{\endminipage\endSbox\par
\addvspace{\smallskipamount}\noindent\hspace*{-\mylength}%
\fbox{\TheSbox}\smallskip}
\newenvironment{FramedEqn}%
{\setlength{\fboxsep}{15pt}
\setlength{\mylength}{\linewidth}%
\addtolength{\mylength}{-2\fboxsep}%
\addtolength{\mylength}{-2\fboxrule}%
\Sbox
\minipage{\mylength}%
\setlength{\abovedisplayskip}{0pt}%
\setlength{\belowdisplayskip}{0pt}%
\equation}%
{\endequation\endminipage\endSbox
\[\fbox{\TheSbox}\]}
\newcounter{xmplctr}
\newcounter{rmrkctr}
\newenvironment{remark}{
\addtocounter{rmrkctr}{1}
\begin{trivlist}
\item[] {\bf Remark \thermrkctr}
}{\end{trivlist}}
%\setlength{\textheight}{7.5in} % fit to b5
%\setlength{\textwidth}{5.5in} % fit to b5
%\setlength{\oddsidemargin}{0.5in}
%\setlength{\evensidemargin}{0.5in}
%\setlength{\footskip}{20mm} % fit to b5
\raggedbottom
%======================================================================%
% COMMANDS FROM KEVIN %
%======================================================================%
% to make the book: pdflatex; bibtex; pdflatex; pdflatex; makeindex; pdflatex
\usepackage{verbatim}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Indexing. See http://en.wikibooks.org/wiki/LaTeX/Indexing
%
% usual method when defining a term is {\bf term}\index{indexed form of term}
% if we want it to appear in the index as
%
% joint
% revolute, 13
%
% then use {\bf revolute joint}\index{joint|revolute}
%
% can also use \indbf{term} for bold indexed term or \ind{term} for indexed term as short hand if printed
% form is same way it should show up in index
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\topfraction}{0.99}
\renewcommand{\textfraction}{0.01}
\renewcommand{\floatpagefraction}{0.95}
\renewcommand{\textfloatsep}{6mm}
\providecommand{\ind}[1]{#1\index{#1}}
\providecommand{\indbf}[1]{{\bf #1}\index{#1}}
\DeclareGraphicsExtensions{.jpg,.pdf,.mps,.png,.eps} %For pdftex
\newcommand{\real}{\mathbb{R}}
\renewcommand{\Re}{\mathbb{R}} % redefine script R
%\newenvironment{flushenum}{
%\begin{enumerate}
% \setlength{\leftmargin}{0pt}
%}{\end{enumerate}}
\setcounter{secnumdepth}{3}
\newcounter{exercise}[chapter]
\newcommand{\exercise}{\refstepcounter{exercise} \vspace*{5mm} \noindent {\bf \theexercise. }}
\newcommand{\colwidth}{4.8in}
\newcommand{\zeroopen}{[0}
\newcommand{\fzclose}{f_z]^T}
\newcommand{\angvel}{\boldsymbol{\omega}}
\newcommand{\jointtorques}{\boldsymbol{\tau}}
\newcommand{\linvel}{{\bf v}}
%\newcommand{\torque}{{\bf n}}
\newcommand{\torque}{{\bf m}}
%\newcommand{\torquescalar}{n}
\newcommand{\torquescalar}{m}
\newcommand{\force}{{\bf f}}
%\newcommand{\twist}{{\bf t}}
%\newcommand{\wrench}{{\bf w}}
\newcommand{\pos}{{\bf p}}
\newcommand{\rot}{{\bf R}}
\newcommand{\partframe}{P}
\newcommand{\worldframe}{O}
\newcommand{\contactloc}{{\bf x}}
\newcommand{\contactnorm}{\hat{{\bf u}}}
%\newcommand{\config}{{\bf q}}
\newcommand{\config}{q}
\newcommand{\constraints}{{\bf f}}
\newcommand{\crossp}[1]{[#1]}
%\newcommand{\fmode}{{\tt r}}
%\newcommand{\rollmode}{\fmode}
%\newcommand{\smode}{{\tt s}}
%\newcommand{\bmode}{{\tt b}}
%\newcommand{\lmode}{{\tt s}$_\ell$}
%\newcommand{\rmode}{{\tt s}$_r$}
\newcommand{\fmode}{{\tt R}}
\newcommand{\rollmode}{\fmode}
\newcommand{\smode}{{\tt S}}
\newcommand{\bmode}{{\tt B}}
\newcommand{\lmode}{{\tt Sl}}
\newcommand{\rmode}{{\tt Sr}}
\newcommand{\wrench}{\mathcal{F}}
\newcommand{\twist}{\mathcal{V}}
\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
%\newcommand{\mass}{{\textrm m}}
%\newcommand{\gravity}{{\textrm g}}
\newcommand{\mass}{\mathfrak{m}}
\newcommand{\gravity}{\mathfrak{g}}
\newcommand{\exerenumbegin}{\begin{enumerate}[itemsep=0pt,parsep=0pt,partopsep=0pt,topsep=0pt]}
\newcommand{\exerenumend}{\end{enumerate}}
%======================================================================%
% END COMMANDS FROM KEVIN %
%======================================================================%
%\input{formatting}
\usdate
\begin{comment}
\pagestyle{fancy}
\fancyhead{} % turn off default
\rfoot{\currenttime ~ \today}
\lfoot{Lynch and Park}
\lhead{\slshape \leftmark}
\end{comment}
% size so the same build works for all these cases, with character size at least the same as 10pt printed:
% 8.5x11 or A4 (8.27 x 11.69), one book page per page
% same as above, but two pages per page
% 9.7 in diagonal view tablet, which is 5.82 in x 7.76 in (3/4 ratio)
% so 4.75 in width, 7.2 in height assures 0.5'' vertical margins printed 2per on A4 paper, and 0.5'' side margins and gutter printed 2 per on 8.5x11
% 7.2 in includes text and header. if default head height is 12pt and headsep is 25pt (total 37 pt about 0.5''), that means textheight is 6.7''.
% need 1.9'' at
% but for some reason 0.6in seems to work better for centering the header+text (ignoring foo.
% maybe book class changes some spacings from defaults.
%
% VERSIONS TO MAKE:
% - tablet version (margins stripped), working hyperlinks
% - printable large font version (A4 and 8.5x11), working hyperlinks
% - printable 2 per page version (A4 and 8.5x11), hyperlinks probably don't work
% to center vertically:
\setlength{\textheight}{6.7in}
\setlength{\voffset}{0.6in}
mr2.tex
%======================================================================%
% USE TO ONLY MAKE PART OF THE BOOK %
%======================================================================%
%
%\includeonly{chapters/ch03-rbm/ch03-text}
%======================================================================%
% Title Page %
%======================================================================%
\begin{document}
\frontmatter
\begin{titlepage}
\selectfont
\begin{center}
%\renewcommand{\baselinestretch}{1.5}
\pagestyle{empty}
\LARGE{\bfseries MODERN ROBOTICS\\ \vspace*{0.2in}
\Large{MECHANICS, PLANNING, AND CONTROL}
}
\vspace{50mm}
\Large{\scshape Kevin M. Lynch and Frank C. Park} \\
\normalsize
\vspace*{0.2in}
\today
\vspace*{0.7in}
This document is the unedited preprint version of \vspace*{0.1in} \\
\large{\emph{Modern Robotics}} \\
\normalsize
\emph{Mechanics, Planning, and Control} \\
%Kevin M. Lynch and Frank C. Park \vspace*{0.1in} \\
\copyright ~Kevin M. Lynch and Frank C. Park \vspace*{0.1in} \\
\end{center}
\noindent
This preprint is being made available for personal use only and not for further distribution. The book will be published by Cambridge University Press in May 2017,
ISBN 9781107156302. Citations of the book should cite Cambridge University Press as the publisher, with a publication date of 2017. Original figures from this book may be reused provided proper citation is given. More information on the book, including software, videos, and a feedback form can be found at \url{http://modernrobotics.org}. Comments are welcome!
\end{titlepage}
\thispagestyle{empty}
\cleardoublepage
%======================================================================%
% Foreword and Preface %
%======================================================================%
%\renewcommand{\chaptermark}[1]{%
% \markboth{}{}}
%\renewcommand{\sectionmark}[1]{%
% \markright{}}
%\cleardoublepage
%\chaptermark{}
%\sectionmark{}
%\sectionmark{\href{http://lynchandpark.org}{Modern Robotics, Lynch and Park}}
%\sectionmark{some stuff}
%\pagenumbering{arabic}
\begin{comment}
\pagestyle{myheadings}
\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{%
\markright{\thesection.\ #1}}
\end{comment}
%\begin{comment}
%\newcommand{\helv}{\fontfamily{phv}\fontseries{b}\fontsize{9}{11}\selectfont}
%\newcommand{\helv}{\fontfamily{phv}\fontsize{9}{11}\selectfont}
\pagestyle{fancy}
\fancyhf{}
%\renewcommand{\headrulewidth}{0pt}
\fancyhead[LE,RO]{\small\thepage}
\fancyhead[RE]{\small\nouppercase{\rightmark}}
\fancyhead[LO]{\small\nouppercase{\leftmark}}
\fancyfoot[CO,CE]{\footnotesize \href{http://modernrobotics.org}{\copyright Lynch and Park. Nov.\ 2016 preprint of \emph{Modern Robotics}, Cambridge U.\ Press, 2017.}}
%\fancyhead[RE]{\small\scshape\nouppercase{\rightmark}}
%\fancyhead[LO]{\small\scshape\nouppercase{\leftmark}}
%\fancyhead[LE,RO]{\helv \thepage}
%\fancyhead[RE]{\helv \rightmark}
%\fancyhead[LO]{\helv \leftmark}
%\end{comment}
\setcounter{page}{1}
\tableofcontents
\cleardoublepage
\fancyhead[RE,LO]{\small Foreword}
\include{chapters/foreword/foreword}
\cleardoublepage
\fancyhead[RE,LO]{\small Preface}
\include{chapters/preface/preface-text}
\cleardoublepage
\renewcommand{\chaptermark}[1]{\markboth{\arabic{chapter}~장.\ #1}{}}
\fancyhead[RE]{\small\nouppercase{\rightmark}}
\fancyhead[LO]{\small\nouppercase{\leftmark}}
%\pagestyle{plain}
%\pagenumbering{roman}
%\setcounter{page}{2}
%\kldraft{\include{chapters/notation}}
%======================================================================%
% Table of Contents %
%======================================================================%
%\tableofcontents
%\cleardoublepage
%\addcontentsline{toc}{chapter}{List of Tables}
%\listoftables
%\cleardoublepage
%\addcontentsline{toc}{chapter}{List of Figures}
%\listoffigures
%\cleardoublepage
%\include{chapters/chapter0/ch0}
%\cleardoublepage
%======================================================================%
% Chapters %
%======================================================================%
\mainmatter
\include{chapters/ch01-preview/ch01-text}
\cleardoublepage
\include{chapters/ch02-cspace/ch02-text}
\cleardoublepage
\include{chapters/ch03-rbm/ch03-text}
\cleardoublepage
\include{chapters/ch04-kinematics/ch04-text}
\cleardoublepage
\include{chapters/ch05-velkinematics/ch05-text}
\cleardoublepage
\include{chapters/ch06-invkinematics/ch06-text}
\cleardoublepage
\include{chapters/ch07-closed/ch07-text}
\cleardoublepage
\include{chapters/ch08-dynamics/ch08-text}
\cleardoublepage
\include{chapters/ch09-trajectory/ch09-text}
\cleardoublepage
\include{chapters/ch10-planning/ch10-text}
\cleardoublepage
\include{chapters/ch11-control/ch11-text}
\cleardoublepage
\include{chapters/ch12-contact/ch12-text}
\cleardoublepage
\include{chapters/ch13-mobile/ch13-text}
\cleardoublepage
%======================================================================%
% APPENDIX %
%======================================================================%
\appendix
\cleardoublepage
\include{chapters/app1-formulas/app1-text}
\cleardoublepage
\include{chapters/app2-rotationreps/app2-text}
\cleardoublepage
\include{chapters/app3-dh/app3-text}
\cleardoublepage
\include{chapters/app4-optimization/app4-text}
\cleardoublepage\phantomsection % the \phantomsection seems to be needed to correctly hyperref
%\appendix
%\include{chapters/appendix}
%\cleardoublepage
%======================================================================%
% BIBLIOGRAPHY %
%======================================================================%
%\pagestyle{headings}
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{plain}
\bibliography{robotics-frank,robotics-kevin}
\cleardoublepage\phantomsection % the \phantomsection seems to be needed to correctly hyperref
%======================================================================%
% INDEX %
%======================================================================%
%\begin{comment}
\addcontentsline{toc}{chapter}{\indexname}
\printindex
\cleardoublepage
%\end{comment}
\end{document}
It seems that I can't post images due to 10 reputations rule. Some of the errors are as below. (for mr2.tex)
The font size command \normalsize is not defined(Ln 10, Col 1)
checked for documentclass but no problem.
Environment titlepage undefined(Ln 14, Col 1)
Undefined control sequence. - many times.
error_screencapture

Latex: fail to show line breaks in formula with ```\\```

I'm using rmarkdown to knit to pdf. However, line break \\ doesn't take effect. I suspect something is wrong with my package amsmath, because running the tex file also shows the same problem. But I don't know how to fix it.
(I installed R and Rstudio with tinytex, then installed tex live 2021. I don't know whether this can be the cause.)
The code is shown below:
---
title: "test"
date: '2022-04-07'
output:
word_document: default
pdf_document:
keep_tex: yes
---
$$
a = b \\
c = d
$$
Also, when I try knit to word, there are warning messages
[WARNING] Could not convert TeX math
a = b \
c = d
, rendering as TeX:
a = b \
^
unexpected control sequence \
expecting "%", "\label", "\tag", "\nonumber" or whitespace
Building the tex file, I still cannot see the expected linebreak in the output pdf. The tex file is shown below.
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\#ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
pdftitle={test},
hidelinks,
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin#nat#width>\linewidth\linewidth\else\Gin#nat#width\fi}
\def\maxheight{\ifdim\Gin#nat#height>\textheight\textheight\else\Gin#nat#height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps#figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\title{test}
\author{}
\date{\vspace{-2.5em}2022-04-07}
\begin{document}
\maketitle
\[
a = b \\
c = d
\]
\end{document}
I think this should perfectly answer your question:
https://tex.stackexchange.com/questions/46189/how-do-i-add-a-line-break-in-display-math-mode
In short: \[ \] is made for one equation/one line of math. To add a line-break, you should use an environment like gather or align. The code for align would look like this in your tex-code:
\begin{align}
a &= b \\
c &= d
\end{align}
If you don't need numbering of your equations, you would use the starred version of the respective environment (gather*, align*. Like this:
\begin{align*}
a &= b \\
c &= d
\end{align*}
If the link I provided does not fit your problem, please explain why. I am happy to correct this answer.

How it is possible to convert LaTeX document to Word (docx file) with all cross-references and labels for images and equations, tables by Pandoc?

I have a tex-file obtained originally from RStudio with bookdown. The original set of Rmd-files were deleted by accident.
So I need to convert below minimized correct tex-file to Word (docx file extension):
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\#ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
pdftitle={Simple document},
hidelinks,
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage[margin=1in]{geometry}
\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if#noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin#nat#width>\linewidth\linewidth\else\Gin#nat#width\fi}
\def\maxheight{\ifdim\Gin#nat#height>\textheight\textheight\else\Gin#nat#height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps#figure{htbp}
\makeatother
\usepackage[normalem]{ulem}
% Avoid problems with \sout in headers with hyperref
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{5}
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\usepackage[]{biblatex}
\addbibresource{bibliography.bib}
\title{Simple document}
\author{}
\date{\vspace{-2.5em}}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{conjecture}{Conjecture}[section]
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\theoremstyle{definition}
\newtheorem{example}{Example}[section]
\theoremstyle{definition}
\newtheorem{exercise}{Exercise}[section]
\theoremstyle{remark}
\newtheorem*{remark}{Remark}
\newtheorem*{solution}{Solution}
\begin{document}
\maketitle
{
\setcounter{tocdepth}{2}
\tableofcontents
}
\hypertarget{format}{%
\section{Format}\label{format}}
Read \ref{format} for details.
Or read \protect\hyperlink{format}{format}.
Formatting:
\begin{itemize}
\tightlist
\item
sup-script or power - x\textsuperscript{2} ;
\item
sub-script - y\textsubscript{3} ;
\item
strike through - \sout{strike through} ;
\item
term -- definition ;
\item
long term --- long definition .
\end{itemize}
Here comes \textbf{footnote} \footnote{Footnote text} with its contents.
Image with caption, see \ref{fig:image}.
\begin{figure}
\centering
\includegraphics{image.png}
\caption{\label{fig:image} Image}
\end{figure}
Labeled table is below, see table \ref{tab:table}.
\begin{longtable}[]{#{}ll#{}}
\caption{\label{tab:table}\\
My table}\tabularnewline
\toprule
\textbf{Col 1 header} & \textbf{Col 2 header} \\
\midrule
\endfirsthead
\endhead
r1c1 & r1c2 \\
r2c1 & r2c2 \\
\bottomrule
\end{longtable}
Inline: \(a^2 + b^2 = c^2\).
Block:
\[ E = \frac{mc^2}{\sqrt{1-\frac{v^2}{c^2}}} \]
Labeled, see \eqref{eq:eq}:
\begin{equation}
f\left(k\right) =\binom{n}{k} p^k\left(1-p\right)^{n k}
\label{eq:eq}
\end{equation}
See LaTeX \autocite{latex} site for details.
Code is below, see \ref{exm:code}:
\begin{example}
\protect\hypertarget{exm:code}{}{\label{exm:code} }Hello world
\end{example}
\begin{verbatim}
int main(){
return 0;
}
\end{verbatim}
\hypertarget{references}{%
\section*{References}\label{references}}
\addcontentsline{toc}{section}{References}
\printbibliography
\end{document}
When I try to convert it to docx using pandoc (2.16.1 version) command below:
pandoc simple.tex --to docx+native_numbering --output simple.docx --table-of-contents --toc-depth 5 --number-sections --citeproc --verbose --csl ieee.csl
(In the above command ieee.csl was downloaded from Zotero).
I get
and I see many strange things:
[fig:image] along with Figure with number;
[tab:table] along with Table with number;
[eq:eq] instead of equation number;
[exm:code] instead of example number.
Is it possible to replace (or suppress them for Figure and Table) above strange […] fields by correct numbers and links using Pandoc to get correct docx output?
This is currently not supported by plain pandoc, but you can use filters to get the numbering back. E.g., the resolve-references.lua filter in the OpenJournals "Inara" project does something comparable. You may have to adjust and extend it to fully suit your requirements.

LaTeX align environment missing $ inserted

I'm using an Align environment inside of a proof, and I'm getting the error "Missing $ inserted." I've commenting out all but the first line of the align makes the error go away, but I still can't figure out what the problem is. No solution I could find works. Am I missing something?
\documentclass[12pt,letterpaper]{article}
\usepackage{ifpdf, enumerate}
\usepackage{mla}
\usepackage{gb4e}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{stmaryrd}
\newcommand{\tuple}[1]{\ensuremath{\left \langle #1 \right \rangle }}
\newcommand{\evaluation}[2][]{\ensuremath{\llbracket #2\rrbracket^{#1}}}
\begin{document}
\begin{proof}
\begin{align*}
\evaluation[\mathbb{M}]{(Mx)(D (x) \& V (x))} = 1 \iff \\
\evaluation[\mathbb{M}]{\lbrack \alpha / x \rbrack (D (x) \& V (x))} = 1 \text{for most constants \alpha} \\
\evaluation[\mathbb{M}]{(D (\alpha) \& V (\alpha))} = 1 \text{for most constants \alpha } \\
\evaluation[\mathbb{M}]{D (\alpha)} = 1 \text{and} \evaluation[\mathbb{M}]{V (\alpha)} = 1 \text{for most constants \alpha } \\
F(\alpha) \in F(D) \text{and} F(\alpha) \in F(V) \text{for most constants \alpha } \\
\intertext{Examining the definitions of the model, we see that there are only four entities that are both in $F(D)$ and $F(V)$: Alice, Bob, Colin, and David. Because this is not more than half of the total twelve entities in the universe, our naive definition of ``most'' is not satisfied. Therefore the statement is false, which implies that the truth value of the origenal proposition is not 1.}
\end{align*}
\end{proof}
\end{document}
Here is what the error message looks like.
./test.tex:24: Missing $ inserted.
<inserted text>
$
l.24 \end{align*}
?
You've missed only one tricky fact: \alpha only works in math mode, so if you replace all occurrences of
\text{for most constants \alpha} \\
(lines 18, 19, 20, 21) with
\text{for most constants }\alpha \\
then your tex will compile sweetly. Also:
\text{for most constants}\ \alpha \\
or:
\text{for most constants $\alpha$} \\
as you already did in line 22 of your code (...$F(D)$ and $F(V)$...).
This answer is not applicable to this exact case, but the given error can also pop up if the "amsmath" package is not being used. It becomes tricky because the whole code looks alright except I had forgotten to add the \usepackage{amsmath} line in the beginning of the document.

latex error Missing $ inserted

I'm trying to use LaTeX to write my math notes. But I have some problems.
The error is written:
LaTeX error Missing $ inserted
And it doesn't compile correctly:
\documentclass[french,12pt,a4paper]{article}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{fullpage}
\author{
Alexandre Monterroso\\
Université de Fribourg\\
}
\newtheorem{de}{Définition}[subsection]
\newtheorem{theo}{Théorème}[section]
\newtheorem{prop}[theo]{Proposition}
\begin{document}
\section{Combinatoris}
\subsection{Ordered choices}
\begin{itemize}
\item With repetition
\end{itemize}
\begin{theo}
The number of lists (a_{1}, ..., a_{k}) of k not necessarly distincts objects elements (ie. with repetition) from a set n elements is a^{k} (n, k \epsilon N).
\end{theo}
\end{document}
You need to specify math-related content in math mode. So, use
The number of lists ($a_1, \dots, a_k$) of~$k$ not necessarily dist ...
$...$ initiated and closes in-line math mode, while \[...\] initiates and closes display math mode.

Resources