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

5.7 still bugs about formatting error #725

Closed
michaelaye opened this Issue Jul 30, 2018 · 12 comments

Comments

Projects
None yet
7 participants
@michaelaye
Copy link

michaelaye commented Jul 30, 2018

Description

The simplest of all Latex Documents creates the perl-based formatting error still.
I was under the impression that the Perl indentation requirement was removed recently?

This is my Latex document:

\documentclass{article}
\begin{document}
hello world
\end{document}

Log messages

LaTeX Workshop Output [15:32:16] Initializing LaTeX Workshop. [15:32:16] Creating LaTeX Workshop http and websocket server. [15:32:16] LaTeX Workshop initialized. [15:32:16] Found root file from active editor: /Users/klay6683/Dropbox/Documents/latex_docs/testing.tex [15:32:16] Root file changed from: undefined. Find all dependencies. [15:32:16] Instatiating new file watcher for /Users/klay6683/Dropbox/Documents/latex_docs/testing.tex [15:32:16] Parsing /Users/klay6683/Dropbox/Documents/latex_docs/testing.tex [15:32:16] Server created on 127.0.0.1:50070 [15:32:16] LaTeX Workshop version: 5.7.0 [15:32:16] Default data loaded. [15:32:17] Formatting with arguments -c,/Users/klay6683/Dropbox/Documents/latex_docs/,/Users/klay6683/Dropbox/Documents/latex_docs/__latexindent_temp.tex,-y="defaultIndent: ' '" [15:32:18] Formatting failed with exit code 2 [15:32:18] stderr: Can't locate Log/Log4perl.pm in @inc (you may need to install the Log::Log4perl module) (@inc contains: /usr/local/texlive/2018/texmf-dist/scripts/latexindent /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /usr/local/texlive/2018/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 22. BEGIN failed--compilation aborted at /usr/local/texlive/2018/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 22. Compilation failed in require at /usr/local/texlive/2018/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 25. BEGIN failed--compilation aborted at /usr/local/texlive/2018/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 25. Compilation failed in require at /Library/TeX/texbin/latexindent line 27. BEGIN failed--compilation aborted at /Library/TeX/texbin/latexindent line 27.

[15:32:18] File watcher: responding to change in /Users/klay6683/Dropbox/Documents/latex_docs/testing.tex
[15:32:18] Parsing /Users/klay6683/Dropbox/Documents/latex_docs/testing.tex

Developer Tools Console INFO no standard startup: not the explorer viewlet /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4103 Overwriting grammar scope name to file mapping for scope source.python. Old grammar file: file:///Users/klay6683/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/python/syntaxes/MagicPython.tmLanguage.json. New grammar file: file:///Users/klay6683/.vscode/extensions/magicstack.magicpython-1.0.12/grammars/MagicPython.tmLanguage e.register @ /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4103 /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1375 INFO No grammar found for scope text.html.javadoc /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] �[34m[2018-07-30 15:32:16.351] [TRACE] extension - �[39minitialize /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] �[34m[2018-07-30 15:32:16.353] [TRACE] extension - �[39mgetConfiguration /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] �[36m[2018-07-30 15:32:16.353] [DEBUG] extension - �[39mgetConfiguration { onStartup: false, dontShowPortAlreadyInUseError: false, port: 52698, host: '127.0.0.1' } /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] vscode-icons is active! /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] vscode-latex-utilities have been activated /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2364 Formatting failed. Please refer to LaTeX Workshop Output for details. e.onDidNotificationChange @ /Users/klay6683/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2364

How to reproduce

  1. Create minimal example as given above
  2. Compile with Latex Workshop
  3. Formatting error message pops up

Expected behavior

No error should pop up

Actual behavior

Error pops up

@James-Yu

This comment has been minimized.

Copy link
Owner

James-Yu commented Jul 31, 2018

[15:32:18] stderr: Can't locate Log/Log4perl.pm in @inc (you may need to install the Log::Log4perl module)

@James-Yu James-Yu closed this Jul 31, 2018

@michaelaye

This comment has been minimized.

Copy link
Author

michaelaye commented Aug 3, 2018

I don't understand this feedback. What is Log::Log4perl module?
How would I install it? If it's a requirement of this VSCode plugin, why didn't it install it?

@James-Yu

This comment has been minimized.

Copy link
Owner

James-Yu commented Aug 3, 2018

It's not a requirement of this plugin. It's one for latexindent.

@michaelaye

This comment has been minimized.

Copy link
Author

michaelaye commented Aug 3, 2018

Isn't latexindent being called by this plugin? I didn't call it for sure. I also didn't activate anything like that in any settings.

@jinyangustc

This comment has been minimized.

Copy link

jinyangustc commented Aug 8, 2018

@michaelaye If you use MacTex, latexindent should be installed already. My MacTex is installed with brew, and

$ which latexindent
/Library/TeX/texbin/latexindent

But there are several missing Perl modules, so I got several stderr: Can't locate XXX.pm errors (including the one you reported).

The fix is to open a terminal and cpan XXX to install the module. After that try again format the document. Repeat the process until latexindent works.

Here are the modules I installed (based on my memory and bash history, so may be an incomplete list)

cpan Log::Log4perl
cpan Log::Dispatch::File
cpan YAML::Tiny
cpan File::HomeDir
cpan Unicode::GCString

Edit: I looked into my .bashrc. It seems that cpan will append some environment variables to it. I don't remember whether it is automatic or by hand:

PATH="/Users/jy/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/Users/jy/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/Users/jy/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/Users/jy/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/Users/jy/perl5"; export PERL_MM_OPT;

@jinyangustc jinyangustc referenced this issue Aug 8, 2018

Closed

Log4Perl #102

@michaelaye

This comment has been minimized.

Copy link
Author

michaelaye commented Aug 8, 2018

Thanks for your detailed explanation, but I find that way too much overhead. As your README states, latexindent is optional, how do I deactivate the call to it, so that the error goes away?

@RELNO

This comment has been minimized.

Copy link

RELNO commented Aug 16, 2018

@michaelaye had faced the same issue, solved it through the following [@James-Yu, maybe worth adding to README or wiki]

screen shot 2018-08-15 at 22 29 59

  • Than, go to VScode preferences and search for the LaTex-workshop extension settings.
  • Under which look for the latex-workshop.latexindent.args[I'm using the new settings mod, might be still raw JSON for you]
  • paste the EXE path

screen shot 2018-08-15 at 22 32 57

That's it, no more error messages!

@michaelaye

This comment has been minimized.

Copy link
Author

michaelaye commented Aug 16, 2018

I'm quite puzzled that nobody seems to answer me the simplest question: how to NOT indent?? I don't want to indent, I don't want to install extra stuff, I just want to work with Latex in peace. :( It says it's optional in the README but so far I only received advice how to install more stuff. :(

@RELNO

This comment has been minimized.

Copy link

RELNO commented Aug 16, 2018

@michaelaye it is not a solution but a workaround until a permanent solution would become available.
Also, no installation is needed, just put one .exe file somewhere without installing anything. Lastly, this file has no indentation effect on my .tex, only removing the error msg.

@Gruntfuggly

This comment has been minimized.

Copy link

Gruntfuggly commented Sep 18, 2018

I'd like to disable indent too - adding an exe doesn't work for me because it doesn't seem to handle files with spaces in the path... 😞

@AllanWang

This comment has been minimized.

Copy link

AllanWang commented Oct 13, 2018

On Mojave, it looks like there is a problem with Mac::SystemDirectory, which fails the installation of cpan File::HomeDir. Has anyone tried this on Mojave?

@xkef

This comment has been minimized.

Copy link

xkef commented Nov 1, 2018

Removal of Command Line Tools of Mojave and reinstalling High Sierra ones fixed things as outlined in bug report here:
https://rt.cpan.org/Public/Bug/Display.html?id=127028

For me the fix was installing the beta 2 cmd tools and then sudo softwareupdate -i -a forced my system back to High Sierra ones (run pkgs in /Library/Developer/CommandLineTools and sudo xcode-select --switch /Library/Developer/CommandLineTools)

then run cpanm command in here:
https://github.com/cmhughes/latexindent.pl/blob/master/helper-scripts/latexindent-module-installer.pl

maybe using --reinstall flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.