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

Incorrect Unexpected "}" when using \includegraphics #568

Closed
MarcelRobitaille opened this issue Feb 26, 2022 · 8 comments
Closed

Incorrect Unexpected "}" when using \includegraphics #568

MarcelRobitaille opened this issue Feb 26, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@MarcelRobitaille
Copy link

I am experiencing what I think is a bug where every time I use \includegraphics with a filename including =, I get Unexpected "}" for the closing brace after the file name.

This is fine:

\includegraphics[width=\linewidth]{./figures/a_filename-with_strange-symbols.pdf}

This gives the error, even though LaTeX itself has no problem displaying the figure:

\includegraphics[width=\linewidth]{./figures/a_filename-with_strange-symbols=.pdf}

I am using texlab 3.3.1. LSP client is Neovim 0.6.1.

@MarcelRobitaille
Copy link
Author

I don't think so. I made a video of a working state, then I add the = and the error appears, I undo and the error goes away, I redo and the error reappears, I add a new line and the error is still there (after I go back to normal mode).

Peek.2022-02-26.16-40.mp4

3.3.1 is the latest version in my distribution's repositories, but I can try installing from source.

@clason
Copy link
Contributor

clason commented Feb 26, 2022

Yeah, I thought it went away, but it reappeared. (I took it to be a standard "stale diagnostic issue", but it seems this is something different.)

pfoerster added a commit that referenced this issue Feb 27, 2022
@pfoerster pfoerster added the bug Something isn't working label Feb 27, 2022
@pfoerster
Copy link
Member

Thanks for the report!

but it seems this is something different.

Yeah, this is not an issue with the diagnostics layer. Instead, it is a problem of the parser, which should be fixed with 867d5c1.

@MarcelRobitaille
Copy link
Author

Thank you so much @pfoerster! I have installed from master and can confirm that this is fixing my issue.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue May 29, 2022
## [4.0.0] - 25.05.2022

### Added

- Add `--version` command line flag
- Provide pre-built binaries for `aarch64-apple-darwin` architecture ([#591](latex-lsp/texlab#591))
- Autocomplete files based on `\graphicspath` ([#590](latex-lsp/texlab#590))
- Release `texlab` on `crates.io` ([#399](latex-lsp/texlab#399))

### Changed

- _BREAKING_: Use client-side file watching instead of server-side notifications (`workspace/didChangeWatchedFiles`)
- _BREAKING_: Bump minimum supported Rust version to 1.58.1
- _BREAKING_: Do not use `citeproc-rs` to render citations. Instead, use a custom approach that tries to resemble the `BibLaTeX` output ([#629](latex-lsp/texlab#629))

### Fixed

- Parse `\subinputfrom` command correctly ([#610](latex-lsp/texlab#610))
- Parse verbatim environments correctly ([#490](latex-lsp/texlab#490))
- Stop capturing stdout when build exits ([#588](latex-lsp/texlab#588))
- Fix parsing of key-value pairs ([#573](latex-lsp/texlab#573))
- Normalize `texlab.rootDirectory` when resolving includes ([#571](latex-lsp/texlab#571))
- Allow optional arguments in environment definitions ([#570](latex-lsp/texlab#570))
- Allow `=` in include paths ([#568](latex-lsp/texlab#568))
@HawkinsT
Copy link

HawkinsT commented Oct 13, 2022

I'm still getting this issue on 4.3.0, testing in neovim 0.8.0 on arch linux, even when compiling master from source. I thought maybe I had an old version of texlab knocking about that was being used instead but checked and this is the only version on my system. This bug occurs even in a .tex file where the only contents is \graphicspath{test} (it doesn't occur if there is no content or only spaces in the curly brackets).

Adding square brackets (as per the original example), e.g. \graphicspath[]{test} fixes the issue.

Edit: I misread this as this issue relates to \includegraphics, not \graphicspath. I'll open a new issue.

@dpo
Copy link

dpo commented Oct 19, 2022

I'm getting a similar error with labels that contain the = symbol, e.g., \label{fig:x=2}.

@brunotvs
Copy link

brunotvs commented Jul 3, 2023

Same error when using | to call shell commands
Example:
\input{|ipython scripts/test.ipynb}

@pfoerster pfoerster reopened this Jul 7, 2023
pfoerster added a commit that referenced this issue Jul 7, 2023
pfoerster added a commit that referenced this issue Jul 7, 2023
pfoerster added a commit that referenced this issue Jul 7, 2023
@pfoerster
Copy link
Member

I'm getting a similar error with labels that contain the = symbol, e.g., \label{fig:x=2}.

Same error when using | to call shell commands

Both of these errors should be fixed now :)

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Nov 15, 2023
## [5.11.0] - 2023-11-05

### Added

- Add `texlab.inlayHints.labelDefinitions` and `texlab.inlayHints.labelReferences` options ([#753](latex-lsp/texlab#753))
- Display inlay hints for label references by default ([#753](latex-lsp/texlab#753))

### Fixed

- Moving the build logs to the recycle bin will now clear the diagnostics ([texlab-vscode/#825](latex-lsp/texlab-vscode#825))
- Fix false positive when reporting syntax errors for BibTeX accents ([#945](latex-lsp/texlab#945))

## [5.10.1] - 2023-10-10

### Fixed

- Fix regression when renaming commands ([#936](latex-lsp/texlab#936))

## [5.10.0] - 2023-09-30

### Added

- Allow passing additional arguments to `ChkTeX` using `texlab.chktex.additionalArgs` ([#927](latex-lsp/texlab#927))

### Fixed

- Fix loading bibliographies from `kpathsea` search path ([#923](latex-lsp/texlab#923))
- Don't report duplicate results when using goto definition on includes ([#924](latex-lsp/texlab#924))
- Fix project detection when there exist files with the same name ([#923](latex-lsp/texlab#923))
- Do not report parse errors with `$` in paths ([#931](latex-lsp/texlab#931))

## [5.9.2] - 2023-08-14

### Fixed

- Don't crash when using comments inside `\include`-like commands ([#919](latex-lsp/texlab#919))
- Folding ranges include only the contents instead of the entire range of the structure.
  For example, the folding range of an environment will start after the `\begin` and stop before the `\end`
  ([#915](latex-lsp/texlab#915))

## [5.9.1] - 2023-08-11

### Fixed

- Improve performance when completing BibTeX entries ([#493](latex-lsp/texlab#493))
- Don't report unused entries for very large bibliographies
- Avoid redundant reparses after saving documents

## [5.9.0] - 2023-08-06

### Added

- Use bibliographies found in `BIBINPUTS` environment variable ([#493](latex-lsp/texlab#493))
- Add `texlab.build.pdfDirectory` setting ([#911](latex-lsp/texlab#911))

### Fixed

- Fix search path for aux files when using `\include` instead of `\input` ([#906](latex-lsp/texlab#906))

## [5.8.0] - 2023-07-30

### Added

- Report diagnostics for unused and undefined labels
- Report diagnostics for unused BibTeX entries and undefined citations
- Report diagnostics for duplicate BibTeX entries
- Report diagnostics for duplicate labels
- Add `texlab.build.auxDirectory` and `texlab.build.logDirectory` settings ([#906](latex-lsp/texlab#906))

### Deprecated

- Deprecate `texlab.auxDirectory` in favor of `texlab.build.auxDirectory`

### Fixed

- Fix parsing paths with `|` ([#568](latex-lsp/texlab#568))
- Fix parsing LaTeX identifiers with `=` ([#568](latex-lsp/texlab#568))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants