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

Inline string replacement syntax as used in the demo template doesn't work. #400

Open
Guscccc opened this issue Apr 30, 2024 · 0 comments
Open

Comments

@Guscccc
Copy link

Guscccc commented Apr 30, 2024

Bug Report

Disable all the other extensions except for LaTeX Workshop and LaTeX Utilities, and check that you still see this issue.

You still see this issue?: Yes

Describe the bug

Inline string replacement syntax as used in the demo template doesn't work.
In the wiki there is an example showing the demo setting for formattedPaste:

"latex-utilities.formattedPaste.image.template": [
    "\\begin{figure}[!htb]",
    "\t\\centering",
    "\t\\includegraphics[$1]{${imageFilePath}}",
    "\t\\caption{${imageFileNameWithoutExt/[-]/ /}}",
    "\t\\label{fig:${imageFileNameWithoutExt}}",
    "\\end{figure}",
    ""
]

But the \caption{${imageFileNameWithoutExt/[-]/ /}} part doen't really work as expected, as the caption is left blank when format paste is triggered. It seems the inline replacement part /[-]/ / doesn't work, because removing it restores the function (except for the replacement of - to space.

To Reproduce

Steps to reproduce the behaviour:

  1. set the "latex-utilities.formattedPaste.image.template" in the setting as above.
  2. format paste and see that the caption is left blank.
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

1 participant