cmhughes / latexindent.pl

Perl script to add indentation (leading horizontal space) to LaTeX files. It can modify line breaks before, during and after code blocks; it can perform text wrapping and paragraph line break removal. It can also perform string-based and regex-based substitutions/replacements. The script is customisable through its YAML interface.
GNU General Public License v3.0
864 stars 84 forks source link

[latexindent.exe] -GCString switch cannot run normally #531

Closed saxyx closed 4 months ago

saxyx commented 5 months ago

Please provide the following when posting an issue:

GCString.tex code

\begin{table}[H] \centering \begin{tblr}{ hlines, vlines, cells = {c,m}} 5:30 & 起床 & 12:30~14:00 & 午休 \ 6:00~7:00 & 早操 & 14:00~17:30 & 集训 \ 7:00~7:50 & 早餐 & 17:30~18:30 & 晚餐 \ 7:50~11:00 & 集训 & 19:00~21:00 & 晚自习 \ 11:00~12:30 & 午餐 & 23:00 & 熄灯 \ \end{tblr} \end{table}


If I run latexindent.exe "GCString.tex" -y="defaultIndent: ' '" -GCString -o=++ in cmd, the error message is

Can't locate object method "new" via package "Unicode::GCString" at E:\Personal\Temp\par-6c656e6f766f\cache-915a8c0064c09de5b911dab5529ae5b236f00de7\inc\lib/LatexIndent/AlignmentAtAmpersand.pm line 1789.

You can see https://github.com/rschupp/PAR-Packer/issues/87 for more details.

Solution:

When using pp to package the program in cmd, use set PAR_VERBATIM=1, that is

set PAR_VERBATIM=1 && pp -M Win32::Unicode --addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml" --cachedeps=scancache --output latexindent.exe latexindent.pl
cmhughes commented 5 months ago

Great, thanks. Can you submit a pull request?

cmhughes commented 4 months ago

resolved at https://github.com/cmhughes/latexindent.pl/releases/tag/V3.23.8

thanks to @saxyx for fixing!