Skip to content

False positives when using titlesec in latex #316

@lennartack

Description

@lennartack

Describe the bug
If I put this in my preamble:

\usepackage{titlesec}
\titleformat{\section}{\large\bfseries}{\thesection.}{0.4em}{}

I get a lot of false positives. For example: \textit{This} is a test. gives an UPPERCASE_SENTENCE_START for is.

The culprit seems to be {\section}. I suspect ltex thinks an actual section title is coming and keeps scanning for the opening brace.

Sample document

\documentclass[a5paper]{article}
\usepackage{titlesec}

\titleformat{\section}{\large\bfseries}{\thesection.}{0.4em}{}

\title{Test}
\author{Test}
\date{\today}

\begin{document}

\maketitle


\section{Introduction}

\textit{This} is a test.

\end{document}

Version information
List here the version information of the relevant software.

  • Operating system: Debian 12.7
  • ltex-ls: 16.0.0
  • Java: openjdk version "17.0.12" 2024-07-16
  • neovim v0.10.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    1-bug 🐛Issue type: Bug report (something isn't working as expected)2-unconfirmedIssue status: Bug that needs to be reproduced (all new bugs have this label)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions