# latexindent: it does the work, but emits these messages

Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*\\begin{ <-- HERE document}/ at /opt/texbin/latexindent line 677.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*%\*\s*\\begin{ <-- HERE (.*?)}/ at /opt/texbin/latexindent line 1047.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*%\*\s*\\end{ <-- HERE (.*?)}/ at /opt/texbin/latexindent line 1073.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^%\s*\\end{ <-- HERE (.*?)}/ at /opt/texbin/latexindent line 1199.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^%\s*\\begin{ <-- HERE (.*?)}/ at /opt/texbin/latexindent line 1220.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*(\$)?\\begin{ <-- HERE \\?(.*?)}/ at /opt/texbin/latexindent line 1621. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*\\end{ <-- HERE \\?(.*?)}/ at /opt/texbin/latexindent line 1682. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\end{ <-- HERE table}/ at /opt/texbin/latexindent line 1621, <MAINFILE> line 1. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\end{ <-- HERE tabular}/ at /opt/texbin/latexindent line 1621, <MAINFILE> line 6.  It must be something silly I do. But what is it? ## update Here is my localSettings.yaml file: # Default value of indentation defaultIndent: " " # remove trailing whitespace from all lines removeTrailingWhitespace: 1 # verbatim environments- environments specified # in this hash table will not be changed at all! # vim: +2,/^\s*$/-1!column -t | sort -u | awk '{print "\t" $0}' verbatimEnvironments: ADA: 1 algorithmic: 1 AWKPROG: 1 CEEPL: 1 code: 1 Code: 1 CPLUSPLUS: 1 EIFFEL: 1 EMEL: 1 EMELRESPONSE: 1 JAVA: 1 lcode: 1 lCode: 1 lola: 1 LOLA: 1 LolaCodeTcbListing: 1 LolaCodeTcbListing*: 1 lstlisting: 1 OCCAM: 1 PASCAL: 1 PYTHON: 1 sample: 1 Sample: 1 session: 1 verbatim: 1 # no indent blocks (not necessarily verbatim environments) which are marked as # %\begin{noindent} or anything else that the user puts in this hash table noIndentBlock: noindent: 1 cmhtest: 1 # if you don't want to have additional indentation in an environment put it in # this hash table; note that environments in this hash table will inherit the # *current* level of indentation they just won't get any *additional*. # vim: +2,/^\s*$/-1!column -t | sort -u | awk '{print "\t" $0}' noAdditionalIndent: frame: 1 indentAfterHeading: part : indent : 0 level : 1 chapter : indent : 0 level : 2 section : indent : 0 level : 3 # vim: +2,/^\s*$/-1!column -t | sort -u | awk '{print "\t" $0}' indentAfterItems: description: 1 enumerate: 1 itemize: 1 # vim: +2,/^\s*$/-1!column -t | sort -u | awk '{print "\t" $0}' constructIfElseFi: if@fast: 1 ifnum: 1 ifodd: 1 @ifundefined: 1 # vim: +2,/^\s*$/-1!column -t | sort -u | awk '{print "\t" 0}' lookForAlignDelims: align: 1 align*: 1 alignat: 1 alignat*: 1 aligned: 1 array: 1 bmatrix: 1 cases: 1 dcases: 1 eqnarray: 1 eqnarray*: 1 listabla: 1 longtable: 1 matrix: 1 pmatrix: 1 tabular: 1 tabularx: 1  Input is, say, a file named input.tex: \begin{itemize} \item a \end{itemize}  While the output upon running latexindent -l input.tex is: Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*\\begin{ <-- HERE document}/ at /opt/texbin/latexindent line 677. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*%\*\s*\\begin{ <-- HERE (.*?)}/ at /opt/texbin/latexindent line 1047. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*%\*\s*\\end{ <-- HERE (.*?)}/ at /opt/texbin/latexindent line 1073. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^%\s*\\end{ <-- HERE (.*?)}/ at /opt/texbin/latexindent line 1199. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^%\s*\\begin{ <-- HERE (.*?)}/ at /opt/texbin/latexindent line 1220. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*(\)?\\begin{ <-- HERE \\?(.*?)}/ at /opt/texbin/latexindent line 1621.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*\\end{ <-- HERE \\?(.*?)}/ at /opt/texbin/latexindent line 1682.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\end{ <-- HERE itemize}/ at /opt/texbin/latexindent line 1621, <MAINFILE> line 1.
\begin{itemize}
\item a
\end{itemize}


UPDATE I manually edited the source, and it solves this problem. But others pop out:

Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*\\begin{ <-- HERE document}/ at /home/yogi/bin/latexindent line 677.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*%\*\s*\\begin{ <-- HERE (.*?)}/ at /home/yogi/bin/latexindent line 1047.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*%\*\s*\\end{ <-- HERE (.*?)}/ at /home/yogi/bin/latexindent line 1073.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^%\s*\\end{ <-- HERE (.*?)}/ at /home/yogi/bin/latexindent line 1199.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^%\s*\\begin{ <-- HERE (.*?)}/ at /home/yogi/bin/latexindent line 1220.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*(\\$)?\\begin{ <-- HERE \\?(.*?)}/ at /home/yogi/bin/latexindent line 1621.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\s*\\end{ <-- HERE \\?(.*?)}/ at /home/yogi/bin/latexindent line 1682.


This happens for /home/yogi/bin/latexindent being the one downloaded from the git repository.

• do you have an MWE for this? Aug 6 '16 at 14:50
• How is this a complete MWE? Aug 6 '16 at 14:50
• Can you please give us some more context? Without a crystal ball it is really difficult to help you. Aug 6 '16 at 15:02
• This might be a perl bug see stackoverflow.com/questions/31753737/… they added a warning but it was too aggressive and warned in good cases too, it got fixed but it depends which perl version you have. Aug 6 '16 at 16:18
• Apologies for this, was fixed a while ago in develop, hoping for a major release later in 2016 Aug 6 '16 at 17:15

To replicate the warnings, just type latexindent in a terminal.

It's a warning given by the fact that the { character in the regex expressions used in the perl script latexindent.pl should be escaped as per this perl deprecation.

To correct the issues, just escape the opening brackets in the lines stated in the warnings. For example the line 677:

if(m/^\s*\\begin{document}/)


should be modified to:

if(m/^\s*\\begin\{document}/)


and so on.

The warnings can be ignored but they will become syntax errors starting perl v5.26.

• Just to confirm that this was fixed a while ago in the develop branch; hoping for a major release in late 2016 Aug 6 '16 at 17:14
• This was fixed in March 29th, 2016, and has been released as version 2.2. Oct 27 '16 at 9:57