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

Unexpected detection of Duplicate label in \NewDocumentCommand #4227

Closed
4 tasks done
NemoYuan2008 opened this issue Apr 12, 2024 · 0 comments
Closed
4 tasks done

Unexpected detection of Duplicate label in \NewDocumentCommand #4227

NemoYuan2008 opened this issue Apr 12, 2024 · 0 comments

Comments

@NemoYuan2008
Copy link

NemoYuan2008 commented Apr 12, 2024

Pre-checks*

  • The issue has not been reported in this repository.
  • The issue remains after disabling all other extensions and restarting Visual Studio Code.
  • The FAQ cannot address the issue.
  • The issue is not related to compiling a document, or the document can be successfully compiled in the OS terminal but not in Visual Studio Code with this extension.

Environment*

  • Operating System: Ubuntu 22.04.4 LTS
  • Visual Studio Code Version: 1.88.1
  • LaTeX Workshop Version: 9.19.2
  • TeX Distribution Version: TeX Live 2024

The Issue*

A warning Duplicate label #2 is reported in the following example for \NewDocumentCommand, which is unexpected.
In contrast, \newcommand works well.

Similarily, \NewDocumentEnvironment has the same issue.

\documentclass{article}

\newcommand{\cmda}[2]{\section{#1}\label{#2}}   % Good
\newcommand{\cmdb}[2]{\section{#1}\label{#2}}   % Good

\NewDocumentCommand{\cmdc}{mm}{\section{#1}\label{#2}}  % Duplicate label #2
\NewDocumentCommand{\cmdd}{mm}{\section{#1}\label{#2}}  % Duplicate label #2

\begin{document}
\cmda{1}{1}
\cmdb{2}{2}
\cmdc{3}{3}
\cmdd{4}{4}
\end{document}

Logs

LaTeX Workshop Output*

[15:21:09.369][Logger] New log placeholder %WS1% registered for /home/yuan/test .
[15:21:09.369][Extension] Initializing LaTeX Workshop.
[15:21:09.457][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[15:21:09.481][Server] Creating LaTeX Workshop http and websocket server.
[15:21:09.531][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[15:21:09.563][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":43047} .
[15:21:09.575][Extension] Extension root: /home/yuan/.vscode/extensions/james-yu.latex-workshop-9.19.2
[15:21:09.575][Extension] $PATH: /home/yuan/Apps/anaconda3/condabin:/home/yuan/Apps/texlive/2024/bin/x86_64-linux:/home/yuan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/yuan/.local/share/JetBrains/Toolbox/scripts
[15:21:09.576][Extension] $SHELL: /usr/bin/zsh
[15:21:09.576][Extension] $LANG: en_US.UTF-8
[15:21:09.576][Extension] $LC_ALL: undefined
[15:21:09.576][Extension] process.platform: linux
[15:21:09.577][Extension] process.arch: x64
[15:21:09.577][Extension] vscode.env.appName: Visual Studio Code
[15:21:09.577][Extension] vscode.env.remoteName: undefined
[15:21:09.578][Extension] vscode.env.uiKind: 1
[15:21:09.580][Config] latex-workshop.latex.recipe.default: "lastUsed" .
[15:21:09.654][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"]
[15:21:09.656][Root] Current workspace folders: ["file://%WS1%"]
[15:21:09.656][Extension] LaTeX Workshop initialized.
[15:21:09.657][Root] Found root file from active editor: %WS1%/test.tex
[15:21:09.657][Root] Root file changed: from %WS1%/test.tex to %WS1%/test.tex, langID latex . Refresh dependencies
[15:21:09.657][Event] ROOT_FILE_CHANGED: "%WS1%/test.tex"
[15:21:09.658][Cacher][Watcher] Reset.
[15:21:09.658][Cacher][Watcher] Reset.
[15:21:09.660][Cacher] Adding %WS1%/test.tex .
[15:21:09.661][Cacher][Watcher] Watched %WS1%/test.tex with a new .* watcher on %WS1% .
[15:21:09.661][Event] FILE_WATCHED: "%WS1%/test.tex"
[15:21:09.663][Cacher] Caching %WS1%/test.tex .
[15:21:09.664][Cacher] Updated inputs of %WS1%/test.tex .
[15:21:09.664][Cacher] Parse LaTeX AST: %WS1%/test.tex .
[15:21:09.664][Event] ROOT_FILE_SEARCHED
[15:21:09.676][Server] valdOrigin is http://127.0.0.1:43047
[15:21:09.690][Cacher] Parsed LaTeX AST: %WS1%/test.tex .
[15:21:09.691][File] Calling kpsewhich to resolve article.cls .
[15:21:09.843][File] kpsewhich returned with '/home/yuan/Apps/texlive/2024/texmf-dist/tex/latex/base/article.cls'.
[15:21:09.845][Cacher] Updated elements in 153.99 ms: %WS1%/test.tex .
[15:21:09.846][Event] FILE_PARSED: "%WS1%/test.tex"
[15:21:09.847][Structure] Structure force updated with 0 root sections for %WS1%/test.tex .
[15:21:09.847][Event] STRUCTURE_UPDATED
[15:21:11.983][Commander] BUILD command invoked.
[15:21:11.984][Build] The document of the active editor: file://%WS1%/test.tex
[15:21:11.985][Build] The languageId of the document: latex
[15:21:11.985][Root] Current workspace folders: ["file://%WS1%"]
[15:21:11.986][Root] Found root file from active editor: %WS1%/test.tex
[15:21:11.986][Root] Keep using the same root file: %WS1%/test.tex
[15:21:11.987][Event] ROOT_FILE_SEARCHED
[15:21:11.987][Event] STRUCTURE_UPDATED
[15:21:11.987][Build] Building root file: %WS1%/test.tex
[15:21:11.988][Build][Recipe] Build root file %WS1%/test.tex
[15:21:11.990][Build][Recipe] Preparing to run recipe: latexmk.
[15:21:11.990][Build][Recipe] Prepared 1 tools.
[15:21:11.998][Build][Recipe] outDir: %WS1% .
[15:21:12.000][Build] Recipe step 1 The command is latexmk:["-synctex=1","-interaction=nonstopmode","-file-line-error","-pdf","-outdir=%WS1%","%WS1%/test"].
[15:21:12.000][Build] env: {}
[15:21:12.000][Build] root: %WS1%/test.tex
[15:21:12.000][Build] cwd: %WS1%
[15:21:12.005][Build] LaTeX build process spawned with PID 17205.
[15:21:12.808][Parser][TexLog] Logged 0 messages.
[15:21:12.809][Build] Finished a step in recipe with PID 17205.
[15:21:12.809][Build] Successfully built %WS1%/test.tex .
[15:21:12.809][Event] BUILD_DONE
[15:21:12.810][Viewer] Call refreshExistingViewer: "%WS1%/test.pdf" .
[15:21:12.810][Viewer] Not found PDF viewers to refresh: %WS1%/test.pdf
[15:21:12.810][Cacher] Parsing .fls %WS1%/test.fls .
[15:21:12.812][Cacher] Found .aux %WS1%/test.tex from .fls %WS1%/test.fls , parsing.
[15:21:12.812][Cacher] Parsed .aux %WS1%/test.tex .
[15:21:12.812][Cacher] Parsed .fls %WS1%/test.fls .
[15:21:20.877][Event] STRUCTURE_UPDATED

@NemoYuan2008 NemoYuan2008 changed the title Unexpected detection of Duplicate label in NewDocumentCommand Unexpected detection of Duplicate label in \NewDocumentCommand Apr 12, 2024
James-Yu added a commit that referenced this issue Apr 16, 2024
commit eca259d
Author: James Yu <yujianqiaojames@gmail.com>
Date:   Mon Apr 15 17:52:06 2024 +0100

    Fix #4233 Cache outdir/auxdir per root file

commit 729fe8a
Author: James Yu <yujianqiaojames@gmail.com>
Date:   Mon Apr 15 13:41:04 2024 +0100

    Fix #4215 Add `tkz-euclide` suggestions, update some others

commit 8abc746
Author: James Yu <yujianqiaojames@gmail.com>
Date:   Mon Apr 15 12:53:34 2024 +0100

    Fix a typing issue

commit a7aa1fb
Author: James Yu <yujianqiaojames@gmail.com>
Date:   Mon Apr 15 12:48:22 2024 +0100

    Version 9.20.0

commit 5e15cab
Author: James Yu <yujianqiaojames@gmail.com>
Date:   Mon Apr 15 12:43:53 2024 +0100

    Prioritize SyncTeX binary over synctex.js

commit 2163ae2
Author: Ken Peng <37787058+pyk1998@users.noreply.github.com>
Date:   Mon Apr 15 18:44:32 2024 +0800

    Fix forward SyncTex accuracy in internal browser by providing a range location indication alternative (#4194)

    * Add forward SyncTex with range location indication.

    * Remain default behavior of using red circle for forward SyncTex.

    * Remove unused column parameter in callSyncTeXToPDFRange.

    * Merged configuration `latex-workshop.synctex.indicator.type` to `latex-workshop.synctex.indicator.enabled`.

    Added fallback logic in `toPDF` for boolean type of `latex-workshop.synctex.indicator.enabled`.

    Extend type `SyncTeXRecordToPDFAll` from base type `SyncTeXRecordToPDF`.

    Merged `locateRange` to `locate`.

    Remove `SyncTeXRecordToPDFAllList`.

    Merged `callSyncTeXToPDFRange` to `callSyncTeXToPDF`.

    In `ServerResponse`, added and extended type `SynctexData` from base type `SynctexRangeData`.

    * Merged `forwardSynctexRange` with `forwardSynctex` in viewer.

    * Indent fixing.

    * Change the enum name.

    Simplify if-else clauses.

    Change rectangle default color.

    Add comments.

    * Code style tweaks

    ---------

    Co-authored-by: James Yu <yujianqiaojames@gmail.com>

commit 68c5e74
Author: James Yu <yujianqiaojames@gmail.com>
Date:   Mon Apr 15 10:55:58 2024 +0100

    Fix #4215 Use `kpsewhich.class.enabled` and `kpsewhich.bibtex.enabled` to control `kpsewhich`

commit afe93c7
Author: James Yu <yujianqiaojames@gmail.com>
Date:   Fri Apr 12 11:03:53 2024 +0100

    Fix #4227 Ignore label defs in `xparse` macros

commit 16b504e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Apr 11 14:50:40 2024 +0100

    Bump tar from 6.2.0 to 6.2.1 (#4226)

    Bumps [tar](https://github.com/isaacs/node-tar) from 6.2.0 to 6.2.1.
    - [Release notes](https://github.com/isaacs/node-tar/releases)
    - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
    - [Commits](isaacs/node-tar@v6.2.0...v6.2.1)

    ---
    updated-dependencies:
    - dependency-name: tar
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e2a5b60
Author: Jerome Lelong <jerome.lelong@gmail.com>
Date:   Thu Apr 11 08:10:26 2024 +0200

    Update grammar files to jlelong/vscode-latex-basics@0393049

commit 7773d50
Author: Jerome Lelong <jerome.lelong@gmail.com>
Date:   Tue Apr 9 07:18:58 2024 +0200

    Update grammar files to jlelong/vscode-latex-basics@6a16810

commit 0738417
Author: James Yu <yujianqiaojames@gmail.com>
Date:   Thu Apr 4 13:09:40 2024 +0100

    Version 9.19.2

commit 0483b31
Author: James Yu <yujianqiaojames@gmail.com>
Date:   Thu Apr 4 13:08:14 2024 +0100

    Prevent `.aux` and `.out` file changes from triggering auto-build

commit 88c83b2
Author: wasalm <info@andries-salm.com>
Date:   Wed Apr 3 15:21:55 2024 +0200

    Bugfix: Synctex does not work while using vscode in browser (#4220)

    * Bugfix syntex for code-server

    Make synctex work in the code server environment

    * Update latexworkshop.ts

    typo

    * Update latexworkshop.ts

    ---------

    Co-authored-by: James Yu <yujianqiaojames@gmail.com>

commit 14fef41
Author: Jerome Lelong <jerome.lelong@gmail.com>
Date:   Tue Mar 26 21:47:07 2024 +0100

    Update grammar files to jlelong/vscode-latex-basics@70d2764
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant