Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing number, treated as zero. Illegal unit of measure (pt inserted) #1572

Closed
IskeenX opened this issue Dec 2, 2024 · 4 comments
Closed

Comments

@IskeenX
Copy link

IskeenX commented Dec 2, 2024

Brief outline of the bug

When i'm using \subsection{xxxx}, this error is appearing Missing number, treated as zero. Illegal unit of measure (pt inserted). And it seems like, it's only with subsections.

Minimal example showing the bug

\RequirePackage{latexbug}       % <--should be always the first line (see CONTRIBUTING)!

@ settings.sty

\ProvidesPackage{settings}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{
    a4paper,
    left=35mm,
    right=25mm,
    top=25mm,
    bottom=40mm
}
\usepackage{fix-cm}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}
\usepackage{mathptmx}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{minted}
\usepackage{pdfpages}
\usepackage{tocloft}
\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{ragged2e}
\usepackage{etoolbox}
\usepackage[style=ieee]{biblatex}
\usepackage[verbose]{placeins}
\setcounter{tocdepth}{1}
\usepackage{caption}
\usepackage[breaklinks]{hyperref}
\usepackage{csquotes}

\justifying
\addbibresource{citation.bib}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\addto\captionsenglish{\renewcommand{\listfigurename}{}}

\fancypagestyle{firstpage}{%
  \fancyhf{}
  \fancyhead[L]{\includegraphics[trim=3cm -3cm 0 0, width=4.2cm]{img/oe_logo.jpg}}
  \fancyhead[R]{\includegraphics[trim=0 0 0 -0.7cm]{img/neumannlogo.jpg}}
  %`trim=left bottom right top` 
}
\fancypagestyle{firstpage-w}{%
  \fancyhf{}
  \fancyhead[L]{\includegraphics[trim=3cm -3cm 0 0, width=4.2cm]{img/oe_logo.jpg}}
  %\fancyhead[R]{\includegraphics[trim=0 0 0 -0.7cm]{img/neumannlogo.jpg}}
  %`trim=left bottom right top` 
}
\pagestyle{fancy}
  \fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{\thepage}

\titleformat{\chapter}[hang]
    {\fontsize{14pt}{18pt}\normalfont\bfseries}
    {\thechapter.}{15pt}{\MakeUppercase}
\titleformat{\section}[hang]
    {\fontsize{12pt}{16pt}\normalfont\bfseries}
    {\thesection }{5pt}{} 
\titleformat{\subsection}[hang]
    {\fontsize{12pt}\normalfont\bfseries}
    {\thesubsection }{5pt}{}
\titlespacing{\chapter}{0pt}{0pt}{18pt}
\titlespacing{\section}{0pt}{18pt}{18pt}
\titlespacing{\subsection}{0pt}{18pt}{18pt}

\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<succes>}{<failure>}
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}% LoF
\patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{}% LoT
\makeatother

\tolerance=1000  
\hbadness=10000  
\emergencystretch=\maxdimen  
\hyphenpenalty=1000  
\hfuzz=0.1pt  



% main.tex

\begin{document}

\section{System Design}
At a high level, the AgroPlus platform is built on a modular architecture, where each component performs a distinct role while interacting with other components thro...

\subsection{Frontend Design}   % <--- Error is only here
The Frontend of the AgroPlus platform serves as the primary interface between the users and the system. It is respon...

\subsubsection{Website Interface}
The e-commerce website is the cornerstone of the AgroPlus platform. Designed to cater to both novice and experienced users...
  
\end{document}

Log file (required) and possibly PDF file

output.log

image

@u-fischer
Copy link
Member

Your example is incomplete, can not be compiles and uses lots of external packages. It also doesn't show a bug: your titleformat declaration for subsection is wrong.

Please read next time https://github.com/latex3/latex2e/blob/develop/CONTRIBUTING.md before opening an issue.

@IskeenX
Copy link
Author

IskeenX commented Dec 2, 2024

I didnt quiet get what should I provide to explain you my situation. I have just read your link and it seems like my question was too long. And the issue is 100% on the main Latex side. The packages I used, they are not interfering with this problem. I thought its better if i demonstrate the entire settings file.

What do i have to add?

@u-fischer
Copy link
Member

This here isn't a support site, it is an issue tracker. You claim that LaTeX has a bug and to demonstrate that you should use only kernel packages and not third-party packages. For this we provide the latexbug package and require that you use it (which you didn't do in your log). E.g.

\RequirePackage{latexbug}
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{minted}
\begin{document}
blub
\end{document}

will give an error in the log:

! Package latexbug Error: Third-party file(s)
(latexbug)                
(latexbug)                This test file uses third-party file(s)
(latexbug)                
(latexbug)                ==============
(latexbug)                minted.sty
(latexbug)                ==============
(latexbug)                
(latexbug)                So you should contact the authors
(latexbug)                of these files, not the LaTeX Team!
(latexbug)                (Or remove the packages that load
(latexbug)                them, if they are not necessary to
(latexbug)                exhibit the problem).
(latexbug)                
(latexbug)                If you think the bug is in core LaTeX
(latexbug)                (as maintained by the LaTeX Team) but
(latexbug)                these files are needed to demonstrate
(latexbug)                the problem, please continue and mention
(latexbug)                this explicitly in your bug report
(latexbug)                (with an explanation why you think so).

So do not use minted, etc.

@IskeenX
Copy link
Author

IskeenX commented Dec 2, 2024

I see. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants