Skip to content

Releases: cmhughes/latexindent.pl

V3.9

14 Mar 15:26
6fa7181
Compare
Choose a tag to compare

V3.9, March 14, 2021

  • #229, Log4Perl module removed, logging is now perhaps too simple, but hopefully eases installation and use for all. See Latexindent/Logger.pm for implementation.

Small enhancements:

  • #242, update to -l switch so that instead of only looking for localSettings.yaml, it will also look for (in order): latexindent.yaml, .localSettings.yaml and .latexindent.yaml. Note that you don't need to have all 4, and that for most uses, just 1 of these files should be enough. As previously, using -l=myfile.yaml will only load myfile.yaml and now using -l=myfile.yaml+ will assume that you want to load as many of the following that exist: myfile.yaml, localSettings.yaml, latexindent.yaml, .localSettings.yaml, .latexindent.yaml
  • #239, update to commandCodeBlocks

bug fixes:

  • #243, bug with -y switch, also documented in fineTuning section
  • #249, bug with item indentation resolved
  • #250, bug with ifElseFi resolved so that the main regex for the ifElseFi routine obeys the settings in fineTuning

V3.8.3

06 Nov 15:37
e4d1dff
Compare
Choose a tag to compare

This is a minor release that implements fixes for the following issues:

  • #209, EndFinishesWithLineBreak + lookForAlignDelims adds extra blank line
  • #217, Spaces Are Converted to Tabs in the Middle of Line
  • #223, Formatting TikZ stuff?

The documentation has been updated with appropriate examples, including details of how to produce alignment such as the following:

\begin{tikzpicture}
	\path (A) edge              node {0,1,L}(B)
	          edge              node {1,1,R} (C)
	      (B) edge [loop above] node {1,1,L}(B)
	          edge              node {0,1,L}(C)
	      (C) edge              node {0,1,L}(D)
	          edge [bend left]  node {1,0,R}(E)
	      (D) edge [loop below] node {1,1,R}(D)
	          edge              node {0,1,R}(A)
	      (E) edge [bend left]  node {1,0,R} (A);
\end{tikzpicture}

and a patch to the textWrap routine, so that spaces are preserved (or not) according to the new field tabstop

x       y

Settings

modifyLineBreaks:
    textWrapOptions:
        columns: 80
        tabstop: 9

Pull request, for reference: #227

V3.8.2

10 Jun 19:05
64b2bee
Compare
Choose a tag to compare

Bug fix addressing the issue at #207

V3.8.1: Version 3.8.1:

09 May 08:14
9c989be
Compare
Choose a tag to compare

A minor release to fix the AlignAtAmpersand.pm bug reported at #201

V3.8: Version 3.8

09 May 09:34
fc35190
Compare
Choose a tag to compare

new features:

  • alignFinalDoubleBackSlash for align-at-ampersand routine, #179
  • dontMeasure for align-at-ampersand routine, #182
  • delimiterRegEx for align-at-ampersand-routine, #187

documentation updates:

  • update to the -c switch, #180
  • update to STDIN, #189

bug fixes:

  • multicolumn alignment, #143
  • sentence text wrapping, #188

V3.7.1

09 May 09:35
470f27d
Compare
Choose a tag to compare

This implements a small upgrade to the text wrap routine to allow an option not to break words when text wrapping. Full details are given at #173

V3.7: This version implements the following:

09 May 09:36
Compare
Choose a tag to compare

This pull request implements the following:

  1. new feature new double-back-slash and comma poly-switches: #106
  2. new feature fine tuning: #113
  3. new feature new poly-switch value for blank lines: #146
  4. update better file extension handling: #154
  5. new feature replacement mode switches: #155

This also resolves #148, #160, #166 and a bug reported at #167.

New features

  1. summary of new poly-switches

From #106, we have new the following new poly-switches

DBSStartsOnOwnLine:
DBSFinishesWithLineBreak
CommaStartsOnOwnLine
CommaFinishesWithLineBreak

I was particularly happy to be able to employ the Else object for each of these, because of which the overhead was manageable.

double back slash poly-switch

For example, starting with

\begin{pmatrix}
1 & 2 \\[2pt] 3 & 4 \\ [ 3 ex] 5&6\\[
\end{pmatrix}

and the YAML:

modifyLineBreaks:
environments:
DBSFinishesWithLineBreak: 1

and running

latexindent.pl -m pmatrix3.tex -l DBS3.yaml

gives

\begin{pmatrix}
1 & 2 \\[2pt]
3 & 4 \\ [ 3 ex]
5 & 6 \\[
4 pt
7 & 8
\end{pmatrix}

The example above is part of the documentation.

comma poly-switch

Starting with

\mycommand{ 1, 2, 3, 4, 5}[6, 7, 8, 9]

and running

latexindent.pl -m mycommand.tex -y="modifyLineBreaks:optionalArguments:CommaFinishesWithLineBreak:1,modifyLineBreaks:mandatoryArguments:CommaFinishesWithLineBreak:1"

gives

\mycommand{ 1,
	2,
	3,
	4,
	5}[6,
	7,
	8,
	9]
  1. fine tuning

From #113 we have:

# fineTuning allows you to tweak the internal pattern matching that 
# is central to latexindent.pl
fineTuning:
    environments:
      name: '[a-zA-Z@\*0-9_\\]+' 
    ifElseFi:
      name: '@?if[a-zA-Z@]*?' 
    commands:
      name: '[+a-zA-Z@\*0-9_\:]+?'
    keyEqualsValuesBracesBrackets:
      name: '[a-zA-Z@\*0-9_\/.\h\{\}:\#-]+?'
      follow: '(?:(?<!\\)\{)|,|(?:(?<!\\)\[)'
    NamedGroupingBracesBrackets:
      name: '[0-9\.a-zA-Z@\*><]+?'
      follow: '\h|\R|\{|\[|\$|\)|\('
    UnNamedGroupingBracesBrackets: 
      follow: '\{|\[|,|&|\)|\(|\$'
    arguments:
      before: '(?:#\d\h*;?,?\/?)+|\<.*?\>'
      between: '_|\^|\*'
    modifyLineBreaks:
      betterFullStop: '(?:\.\)(?!\h*[a-z]))|(?:(?<!(?:(?:e\.g)|(?:i\.e)|(?:etc))))\.(?!(?:[a-z]|[A-Z]|\-|~|\,|[0-9]))'
      doubleBackSlash: '\\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])?'
      comma: ','
  1. blank-line poly-switch

If you start with

section1.tex

\section{Introduction}
A sentence

and the YAML:

tmp.yaml

modifyLineBreaks:
    mandatoryArguments:
        RCuBFinishesWithLineBreak: 4

and run

latexindent.pl -m  section1.tex -l=tmp.yaml

then you receive

\section{Introduction}

A sentence

From #146 we have a new poly-swtich value

  1. file extension

latexindent.pl can now be called on any file, regardless of if the extesion is within fileExtensionPrefrerences. If no extension is given, then fileExtensionPreferences must still be consulted.

  1. replacement switches

Starting with the .tex file:

JHenneberg.tex

\begin{equation}
  \ell
  _{j}(x):= \prod
  _{0 \leq m \leq k; \quad m \neq j}\frac{x - x_m}{x_j - x_m}= \frac
  {x - x_0}{x_j - x_0}\cdots \frac
  {x -
    x_{j - 1}}{x_j -
    x_{j - 1}}\frac
  {x -
    x_{j + 1}}{x_j -
    x_{j + 1}}\cdots \frac
  {x - x_k}{x_j - x_k}
\end{equation}

\begin{equation}
  W =
  \begin{bmatrix}
    1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & z_i   & 0 & 1 & 0 & 0         \\ -z_i    & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1
  \end{bmatrix}
\end{equation}

\begin{itemize*}
  \item dünne Platten, kleine Verformungen \item dünne Platten, große Verformungen \item dicke Platten
\end{itemize*}

and the following YAML

JH.yaml

indentAfterItems:
    itemize*: 1

modifyLineBreaks:
    environments:
        DBSFinishesWithLineBreak: 1
    items:
        ItemStartsOnOwnLine: 1
    removeParagraphLineBreaks:
        environments: 
            equation: 1

replacements:
  -
    substitution: s/\h*\R\h*_/_/sg
    when: after
  -
    substitution: s/\h*_/_/sg
    when: after
  -
    substitution: s/([a-zA-Z:\}])\h*(=|-)\h*/$1 $2 /sg
    when: after

and running

latexindent.pl -m  -r JHenneberg.tex -l=JH.yaml

gives the following

output

\begin{equation}
	\ell_{j}(x): = \prod_{0 \leq m \leq k; \quad m \neq j}\frac{x - x_m}{x_j - x_m} = \frac {x - x_0}{x_j - x_0}\cdots \frac {x - x_{j - 1}}{x_j - x_{j - 1}}\frac {x - x_{j + 1}}{x_j - x_{j + 1}}\cdots \frac {x - x_k}{x_j - x_k}
\end{equation}

\begin{equation}
	W = 
	\begin{bmatrix}
		1    & 0   & 0 & 0 & 0 & 0 \\
		0    & 1   & 0 & 0 & 0 & 0 \\
		0    & 0   & 1 & 0 & 0 & 0 \\
		0    & z_i & 0 & 1 & 0 & 0 \\
		-z_i & 0   & 0 & 0 & 1 & 0 \\
		0    & 0   & 0 & 0 & 0 & 1
	\end{bmatrix}
\end{equation}

\begin{itemize*}
	\item dünne Platten, kleine Verformungen
	\item dünne Platten, große Verformungen
	\item dicke Platten
\end{itemize*}

Pull request reference: #169

V3.6: This implements

09 May 09:36
67b47f6
Compare
Choose a tag to compare
- verbatim poly-switches: https://github.com/cmhughes/latexindent.pl/issues/139
- better full stop upgrade: https://github.com/cmhughes/latexindent.pl/issues/153

V3.5.3: Minor release addressing the indentconfig.yaml bug reported at

09 May 09:37
162e869
Compare
Choose a tag to compare
- https://github.com/cmhughes/latexindent.pl/issues/141

V3.5.2: Minor release implementing the bug fix for verbatim environments

09 May 09:38
a94a2c9
Compare
Choose a tag to compare
with * in the name, https://github.com/cmhughes/latexindent.pl/issues/138