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

Add "" around file/directory names for formatting in default settings #485

Closed
huw opened this issue Mar 25, 2018 · 6 comments
Closed

Add "" around file/directory names for formatting in default settings #485

huw opened this issue Mar 25, 2018 · 6 comments

Comments

@huw
Copy link

huw commented Mar 25, 2018

Description

When migrating to 5.0.0, formatting for configurations where users work in directories that have paths with spaces in them will break due to underlying changes with the toolchain. This can also be confusing for new or non-technical users installing the package for the first time, because by default the package no longer escapes these spaces.

How to reproduce

  1. Create a directory or .tex file with a space in the name
  2. Attempt to format the file using LaTeX-Workshop

Expected behavior

The file is formatted correctly

Actual behavior

The following notifications appear:

![Error][https://i.imgur.com/q2HHP1P.png]

Upon inspecting the logs, these messages appear:

[13:42:25] Linter for active file successfully finished in 0s 154ms
[13:42:25] Linter log parsed with 0 messages.
[13:42:25] Formatting failed with exit code 2
[13:42:25] stderr: Could not find directory /Users/huw/Documents/Class/PHIL2650/Exercises/Week
Exiting, no indentation done. at /usr/local/texlive/2017/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 95.

The full path of the file should be /Users/huw/Documents/Class/PHIL2650/Exercises/Week III/

Additional Information

This is solvable on the default system by adding the following settings to your config file:

    "latex-workshop.latexindent.args": [
        "-c",
        "\"%DIR%/\"",
        "\"%TMPFILE%\"",
        "-y=\"defaultIndent: '%INDENT%'\""
    ],

I've escaped the strings around %TMPFILE% and %DIR%. Otherwise, these are the default settings.

@James-Yu
Copy link
Owner

Sorry but I cannot reproduce the problem. All my latex projects are located in a folder with space (Google Drive to be specific), and they work well.

@James-Yu
Copy link
Owner

In addition, please note that --shell-escape is not default

@huw huw changed the title Add "" around file/directory names in default settings Add "" around file/directory names for formatting in default settings Mar 25, 2018
@huw
Copy link
Author

huw commented Mar 25, 2018

Updated. Looks like this is just affecting formatting — not sure why I thought it was affecting the whole system. I also get no Week IIIindent.log in my root directory either.

@James-Yu
Copy link
Owner

That's more than surprising, since no formatting code is touched. I'll look into it.

@James-Yu
Copy link
Owner

@Project-PP Can you please have a look into this issue? I'm quite messed up with the formatter code. Thx!

@huw
Copy link
Author

huw commented Mar 25, 2018

Awesome! Love the speedy development on this project very much!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
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

2 participants