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

Formatting introduces incorrect newlines with a \section in a \hypertarget #3839

Closed
sehHeiden opened this issue Jan 2, 2025 · 3 comments
Closed
Labels
bug Deficiencies in TeXiFy behaviour. wontfix Issue will be discarded by the development team.

Comments

@sehHeiden
Copy link

sehHeiden commented Jan 2, 2025

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

PyCharm

Operating System

Ubuntu 22.04 derivative TuxedoOS

TeXiFy IDEA version

0.9.9

What I did (steps to reproduce)

press str + sift + alt + l

Minimal example to reproduce the problem

\documentclass{article}
\usepackage{hyperref}
\begin{document}
        \hypertarget{introduction}{
        \section{Introduction}\label{introduction}
     }
\end{document}

Expected behavior

Do nothing

Actual behavior

Sometimes an empty line is added before the section. Than the latex code does not build anymore.

\begin{document}
\hypertarget{introduction}{

    \section{Introduction}\label{introduction}
 }

\end{document}

@sehHeiden sehHeiden added bug Deficiencies in TeXiFy behaviour. untriaged Issue type still needs to be triaged or verified. labels Jan 2, 2025
@PHPirates
Copy link
Collaborator

Could you provide a more realistic example? The problem occurs because you have a \section in a \hypertarget, but I don't understand why you would want that, since you can just refer to the section label and don't need the hypertarget

@PHPirates PHPirates added more-info-needed More information is needed from the person filing the issue. and removed untriaged Issue type still needs to be triaged or verified. labels Jan 10, 2025
@PHPirates PHPirates changed the title Autoformat makes code not build anymore Formatting introduces incorrect newlines with a \section in a \hypertarget Jan 10, 2025
@sehHeiden
Copy link
Author

Do not fully remember where this comes from, likely either an autocomplete (via chatgpt) or chatgpt chat advised me to use these as skeleton.

@PHPirates
Copy link
Collaborator

Makes sense, chatgpt can still produce nonsense from time to time. I will close this issue then

@PHPirates PHPirates closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2025
@PHPirates PHPirates added wontfix Issue will be discarded by the development team. and removed more-info-needed More information is needed from the person filing the issue. labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Deficiencies in TeXiFy behaviour. wontfix Issue will be discarded by the development team.
Projects
None yet
Development

No branches or pull requests

2 participants