texlive[44695] trunk: latexindent (25jun17)

commits+karl at tug.org commits+karl at tug.org
Sun Jun 25 23:50:48 CEST 2017


Revision: 44695
          http://tug.org/svn/texlive?view=revision&revision=44695
Author:   karl
Date:     2017-06-25 23:50:47 +0200 (Sun, 25 Jun 2017)
Log Message:
-----------
latexindent (25jun17)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
    trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl
    trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl
    trunk/Master/bin/win32/latexindent.exe
    trunk/Master/texmf-dist/doc/support/latexindent/README
    trunk/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
    trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-introduction.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm
    trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
    trunk/Master/texmf-dist/scripts/latexindent/latexindent.pl

Added Paths:
-----------
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm

Modified: trunk/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
===================================================================
(Binary files differ)

Modified: trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl	2017-06-25 21:50:47 UTC (rev 44695)
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 # kanji-config-updmap: setup Japanese font embedding
-# Version 20170505.0
+# Version 20170624.0
 #
 # formerly known as updmap-setup-kanji
 #
@@ -22,7 +22,7 @@
 use strict;
 
 my $prg = "kanji-config-updmap";
-my $version = '20170505.0';
+my $version = '20170624.0';
 
 my $updmap_real = "updmap";
 my $updmap = $updmap_real;
@@ -128,6 +128,7 @@
     #"sinotype"      => "STSong.ttf", # removed
     "adobe"         => "AdobeSongStd-Light.otf",
     "fandol"        => "FandolSong-Regular.otf",
+    "founder"       => "FZSSK.TTF",
     "arphic"        => "gbsn00lp.ttf",
     "cjkunifonts"   => "uming.ttc",
     "cjkunifonts-ttf" => "uming.ttf",

Modified: trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl	2017-06-25 21:50:47 UTC (rev 44695)
@@ -2,7 +2,7 @@
 #
 # kanji-fontmap-creator
 # (c) 2012-2014 Norbert Preining
-# Version: 20170505.0
+# Version: 20170624.0
 # Licenced under the GPLv2 or any higher version
 #
 # gui to create map files for updmap(-setup-kanji)
@@ -41,7 +41,7 @@
 my $opt_version = 0;
 
 my $prg = "kanji-fontmap-creator";
-my $version = "20170505.0";
+my $version = "20170624.0";
 
 #
 # global vars configuring operation

Modified: trunk/Master/bin/win32/latexindent.exe
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexindent/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/README	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/doc/support/latexindent/README	2017-06-25 21:50:47 UTC (rev 44695)
@@ -1,5 +1,5 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    latexindent.pl, version 3.2, 2017-06-19
+    latexindent.pl, version 3.2.1, 2017-06-25
 
     PERL script to indent code within environments, and align delimited 
     environments in .tex files.

Modified: trunk/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex	2017-06-25 21:50:47 UTC (rev 44695)
@@ -16,7 +16,7 @@
 %
 %   See <http://www.gnu.org/licenses/>.
 \usepackage[left=4.5cm,right=2.5cm,showframe=false,
-	top=2cm,bottom=1.5cm]{geometry}                      % page setup
+	top=2cm,bottom=1.5cm,marginparsep=2cm]{geometry}                      % page setup
 \usepackage{lmodern}
 \usepackage{parskip}                                 % paragraph skips
 \usepackage{booktabs}                                % beautiful tables
@@ -31,6 +31,7 @@
 \usepackage[sc,format=hang,font=small]{caption}      % captions
 \usepackage[backend=bibtex]{biblatex}                % bibliography
 \usepackage{tcolorbox}                                % framed environments
+\usepackage{tikz}
 \usepackage{xparse}
 \usepackage[charter]{mathdesign}                     % changes font
 \usepackage[expansion=false,kerning=true]{microtype} % better kerning
@@ -39,16 +40,12 @@
 \usepackage{array}
 % setup gitinfo2, as in the manual, details just above begin{document}
 \usepackage[mark,grumpy]{gitinfo2}
-% tcolorbox libraries
-\tcbuselibrary{breakable,skins,listings,minted,xparse}
-%\usepackage{varioref}                                % clever referencing
-%\tcbuselibrary{documentation,breakable,skins,minted}
-% tikz libraries
+% tikz, tcolorbox libraries
 \usetikzlibrary{positioning}
 \usetikzlibrary{decorations.pathmorphing}
 \usetikzlibrary{decorations,shapes}
-\usepackage{varioref}                                % clever referencing
-\usepackage{hyperref}
+\usepackage{varioref}                                % the documentation library from tcolorbox loads hyperref
+\tcbuselibrary{breakable,minted,xparse,documentation}
 \hypersetup{
 	pdfauthor={Chris Hughes},
 	pdftitle={latexindent.pl package},
@@ -62,6 +59,21 @@
 }
 \usepackage{cleveref}
 
+% customise the \tcbdocnew command
+\tcbset{doclang/new={{\bfseries\color{green!50!black}N\normalfont\color{black}}}}
+\tcbset{doc marginnote={width=1.6cm}}
+%\newcommand{\announce}[1]{\tcbdocmarginnote{\tcbdocnew{#1}}}
+\NewDocumentCommand{\announce}{ s m }{%
+	\IfBooleanTF{#1}
+	{% \announce*
+		\tcbdocmarginnote[overlay={\node[anchor=north east,text=cmhgold] at ([yshift=3mm,xshift=4mm]frame.north east) {$\bigstar$}; }]{\tcbdocnew{#2}}
+	}
+	{% \announce
+		\tcbdocmarginnote{\tcbdocnew{#2}}
+	}}
+
+\reversemarginpar
+% bibliographies
 \addbibresource{latex-indent}
 \addbibresource{contributors}
 
@@ -404,7 +416,7 @@
 \newcommand{\flagbox}[1]{%
 	\par
 	\makebox[30pt][l]{%
-		\hspace{-2cm}%
+		\hspace{-1cm}%
 		\ttfamily\fontseries{b}\selectfont #1
 	}%
 }
@@ -539,7 +551,7 @@
 			sharp corners,
 			enhanced,
 			overlay={\node[anchor=north east,outer sep=2pt] at ([xshift=3cm,yshift=4mm]frame.north east) {\includegraphics[width=3cm]{logo}}; }]
-		\centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.2
+		\centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.2.1
 	\end{tcolorbox}
 }
 \author{Chris Hughes \thanks{and contributors! See \vref{sec:contributors}. For
@@ -583,3 +595,48 @@
 \input{references}
 \input{appendices}
 \end{document}
+
+version history:
+
+1.0: first release
+https://www.ctan.org/ctan-ann/id/mailman.278.1369470527.5851.ctan-ann@dante.de
+
+1.1R
+Changed Bin to RealBin so that I hope the script can get bun­dled into TeXLive 2013. Some other up­dates, too, detailed in the documentation.
+https://www.ctan.org/ctan-ann/id/mailman.3048.1384345731.2385.ctan-ann@dante.de
+
+1.11R
+This release updates the script to use $FindBin::RealBin which should help in the TeXLive implementation.
+
+Version 2.0R
+Ver­sion 2.0R of la­texin­dent.pl adds a num­ber of new fea­tures, in­clud­ing: - in­den­ta­tion af­ter \item com­mands - align­ment of de­lim­itered en­vi­ron­ments in com­mands, such as \ma­trix - in­den­ta­tion of \if...\else...\fi state­ments - max­i­mum num­ber of back­ups can cy­cle through back­ups - bet­ter sup­port for .cls and .sty files - and a few other bug fixes
+https://www.ctan.org/ctan-ann/id/mailman.3090.1417864461.4370.ctan-ann@dante.de
+
+Version 2.1R
+in­dent­con­fig.yaml can now be a 'hid­den' file, .in­dent­con­fig.yaml The Win­dows ex­e­cutable file, la­texin­dent.exe, should now work much bet­ter with Win­dows TeXLive.
+https://www.ctan.org/ctan-ann/id/mailman.343.1429509943.4405.ctan-ann@dante.de
+
+Version 2.2
+v2.2 addresses a reg­exp issue, and adds a few enhancements; full details are here: https://github.com/cmhughes/latexindent.pl/pull/49
+https://www.ctan.org/ctan-ann/id/mailman.198.1477655196.4574.ctan-ann@ctan.org
+
+Version 3.0
+latexindent.pl version 3.0: this represents a complete re-build of the script; full details are given here: 
+https://github.com/cmhughes/la­texin­dent.pl/pull/56
+
+V3.0.1 
+pro­vides sup­port for the align­ment at am­per­sands rou­tine for code that con­tains uni­code char­ac­ters; see 
+https://github.com/cmhughes/la­texin­dent.pl/pull/61
+
+V3.0.2
+A mi­nor re­lease to fix a small bug re­lated to in­den­tPream­ble; de­tails given here: 
+https://github.com/cmhughes/la­texin­dent.pl/pull/62
+
+Ver­sion 3.1 of la­texin­dent.pl, 
+in­clud­ing op­tions for text wrap­ping and para­graph line break re­moval. Full de­tails here: 
+https://github.com/cmhughes/la­texin­dent.pl/pull/64
+
+Ver­sion 3.2 
+im­ple­ments a new fea­ture called 'mul­ti­Colum­nGroup­ing' which gives a new op­tion for the align­ment-at-am­per­sands rou­tine. 
+More de­tails are given at 
+https://github.com/cmhughes/la­texin­dent.pl/pull/67

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex	2017-06-25 21:50:47 UTC (rev 44695)
@@ -32,7 +32,7 @@
 
 	Calling \texttt{latexindent.pl myfile} with the (default) settings specified in \cref{lst:fileExtensionPreference}
 	means that the script will first look for \texttt{myfile.tex}, then \texttt{myfile.sty}, \texttt{myfile.cls},
-	and finally \texttt{myfile.bib} in order\footnote{Throughout this manual, listings with line numbers represent code
+	and finally \texttt{myfile.bib} in order\footnote{Throughout this manual, listings shown with line numbers represent code
 		taken directly from \texttt{defaultSettings.yaml}.}.
 
 \yamltitle{backupExtension}*{extension name}
@@ -219,14 +219,14 @@
 
 	If you find that \texttt{latexindent.pl} does not perform satisfactorily on such
 	environments then you can set the relevant key to \texttt{0}, for example \texttt{tabular: 0}; alternatively, if you just want to ignore \emph{specific}
-	instances of the environment, you could wrap them in something from \texttt{noIndentBlock} (see \cref{lst:noIndentBlock}).
+	instances of the environment, you could wrap them in something from \texttt{noIndentBlock} (see \vref{lst:noIndentBlock}).
 
 	\begin{minipage}{.45\textwidth}
-		\cmhlistingsfromfile[columns=fixed]{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:basic}
+		\cmhlistingsfromfile*[showspaces=false,showtabs=false]{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:basic}
 	\end{minipage}%
 	\hfill
 	\begin{minipage}{.45\textwidth}
-		\cmhlistingsfromfile[columns=fixed]{demonstrations/tabular1-default.tex}{\texttt{tabular1.tex} default output}{lst:tabularafter:basic}
+		\cmhlistingsfromfile*[showspaces=false,showtabs=false]{demonstrations/tabular1-default.tex}{\texttt{tabular1.tex} default output}{lst:tabularafter:basic}
 	\end{minipage}%
 
 	If you wish to remove the alignment of the \lstinline!\\! within a delimiter-aligned block, then the
@@ -244,9 +244,9 @@
 		\item \texttt{spacesBeforeDoubleBackSlash}: optionally, specifies the number of spaces to be inserted
 		      before (non-aligned) \lstinline!\\!. In order to use this field, \texttt{alignDoubleBackSlash} needs
 		      to be set to 0 (default: 0).
-		\item \texttt{multiColumnGrouping}: details if \texttt{latexindent.pl} should group columns
+		\item \announce{2017-06-19} \texttt{multiColumnGrouping}: details if \texttt{latexindent.pl} should group columns
 		      underneath a \lstinline!\multicolumn! command (default: 0);
-		\item \texttt{alignRowsWithoutMaxDelims}: details if rows that do not contain the
+		\item \announce{2017-06-19} \texttt{alignRowsWithoutMaxDelims}: details if rows that do not contain the
 		      maximum number of delimeters should be formatted so as to have the ampersands aligned (default: 1).
 	\end{itemize}
 
@@ -260,11 +260,11 @@
 	the \lstinline!\\! have not (compare the alignment of \lstinline!\\! in \cref{lst:tabularafter:basic,lst:tabularafter:advanced}).
 
 	\begin{minipage}{.45\textwidth}
-		\cmhlistingsfromfile[columns=fixed]{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:advanced}
+		\cmhlistingsfromfile*[showspaces=false,showtabs=false]{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:advanced}
 	\end{minipage}%
 	\hfill
 	\begin{minipage}{.45\textwidth}
-		\cmhlistingsfromfile[columns=fixed]{demonstrations/tabular1-advanced.tex}{\texttt{tabular1.tex} using \cref{lst:aligndelims:advanced}}{lst:tabularafter:advanced}
+		\cmhlistingsfromfile*[showspaces=false,showtabs=false]{demonstrations/tabular1-advanced.tex}{\texttt{tabular1.tex} using \cref{lst:aligndelims:advanced}}{lst:tabularafter:advanced}
 	\end{minipage}%
 
 	Saving \cref{lst:aligndelims:advanced} into \texttt{tabular1.yaml} as in \cref{lst:tabular1YAML}, and running the command
@@ -274,7 +274,7 @@
 	gives \cref{lst:tabularafter:spacing}; note the spacing before the \lstinline!\\!.
 
 	\begin{minipage}{.45\textwidth}
-		\cmhlistingsfromfile[columns=fixed]{demonstrations/tabular1-advanced-3spaces.tex}{\texttt{tabular1.tex} using \cref{lst:tabular1YAML}}{lst:tabularafter:spacing}
+		\cmhlistingsfromfile*[showspaces=false,showtabs=false]{demonstrations/tabular1-advanced-3spaces.tex}{\texttt{tabular1.tex} using \cref{lst:tabular1YAML}}{lst:tabularafter:spacing}
 	\end{minipage}%
 	\hfill
 	\begin{minipage}{.54\textwidth}

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex	2017-06-25 21:50:47 UTC (rev 44695)
@@ -21,6 +21,12 @@
  If you plan to use \texttt{latexindent.pl} (i.e, the original Perl script) then you will
  need a few standard Perl modules -- see \vref{sec:requiredmodules} for details.
 
+ As you read through this documentation, you'll occasionally see dates shown in the margin
+ (for example, next to this paragraph!)
+ \announce*{2017-06-25} which detail the date of the version in which the feature was implemented;
+ the `N' stands for `new as of the date shown'. If you see a $\color{cmhgold}\bigstar$, it
+ means that the feature is new as of the release of the current version.
+
 \subsection{From the command line}\label{sec:commandline}
 	\texttt{latexindent.pl} has a number of different switches/flags/options, which
 	can be combined in any way that you like, either in short or long form as detailed below.
@@ -38,6 +44,13 @@
 	This will output a welcome message to the terminal, including the version number
 	and available options.
 
+\flagbox{-v, --version}
+	\announce*{2017-06-25}
+	\begin{commandshell}
+latexindent.pl -v
+      \end{commandshell}
+	This will output only the version number to the terminal.
+
 \flagbox{-h, --help}
 
 	\begin{commandshell}
@@ -84,10 +97,60 @@
 	be ignored and \texttt{-o} will take priority (this seems safer than the
 	other way round).
 
-	Note that using \texttt{-o} is equivalent to using
+	Note that using \texttt{-o} as above is equivalent to using
 	\begin{commandshell}
 latexindent.pl myfile.tex > output.tex
 \end{commandshell}
+
+	You can call the \texttt{-o} switch with the name of the output file \emph{without} an extension; in
+	\announce*{2017-06-25}
+	this case, \texttt{latexindent.pl} will use the extension from the original file. For example,
+	the following two calls to \texttt{latexindent.pl} are equivalent:
+	\begin{commandshell}
+latexindent.pl myfile.tex -o=output
+latexindent.pl myfile.tex -o=output.tex
+\end{commandshell}
+
+	You can call the \texttt{-o} switch using a \texttt{+} symbol at the beginning; this will
+	\announce*{2017-06-25}
+	concatenate the name of the input file and the text given to the \texttt{-o} switch.
+	For example, the following two calls to \texttt{latexindent.pl} are equivalent:
+	\begin{commandshell}
+latexindent.pl myfile.tex -o=+new
+latexindent.pl myfile.tex -o=myfilenew.tex
+\end{commandshell}
+
+	You can call the \texttt{-o} switch using a \texttt{++} symbol at the end of the name
+	\announce*{2017-06-25}
+	of your output file; this tells \texttt{latexindent.pl} to search successively for
+	the name of your output file concatenated with $0, 1, \ldots$ while the name of the
+	output file exists.  For example,
+	\begin{commandshell}
+latexindent.pl myfile.tex -o=output++
+\end{commandshell}
+	tells \texttt{latexindent.pl} to output to \texttt{output0.tex}, but if it exists then
+	output to \texttt{output1.tex}, and so on.
+
+	Calling \texttt{latexindent.pl} with simply
+	\begin{commandshell}
+latexindent.pl myfile.tex -o=++
+\end{commandshell}
+	tells it to output to \texttt{myfile0.tex}, but if it exists then output to \texttt{myfile1.tex}
+	and so on.
+
+	The \texttt{+} and \texttt{++} feature of the \texttt{-o} switch can be combined; for example, calling
+	\begin{commandshell}
+latexindent.pl myfile.tex -o=+out++
+\end{commandshell}
+	tells \texttt{latexindent.pl} to output to \texttt{myfileout0.tex}, but if it exists, then
+	try \texttt{myfileout1.tex}, and so on.
+
+	There is no need to specify a file extension when using the \texttt{++} feature, but if you wish to,
+	then you should include it \emph{after} the \texttt{++} symbols, for example
+	\begin{commandshell}
+latexindent.pl myfile.tex -o=+out++.tex
+\end{commandshell}
+
 	See \vref{app:differences} for details of how the interface has changed
 	from Version 2.2 to Version 3.0 for this flag.
 \flagbox{-s, --silent}
@@ -146,6 +209,34 @@
 	absolute paths -- for absolute paths, see \vref{sec:indentconfig}.
 	Explicit demonstrations of how to use the \texttt{-l} switch are given throughout this documentation.
 
+	You can call the \texttt{-l} switch with a `+' symbol either before or after
+	\announce*{2017-06-25}
+	another YAML file; for example:
+	\begin{commandshell}
+latexindent.pl -l=+myyaml.yaml  myfile.tex
+latexindent.pl -l "+ myyaml.yaml" myfile.tex
+latexindent.pl -l=myyaml.yaml+  myfile.tex
+    \end{commandshell}
+	which translate, respectively, to
+	\begin{commandshell}
+latexindent.pl -l=localSettings.yaml,myyaml.yaml myfile.tex
+latexindent.pl -l=localSettings.yaml,myyaml.yaml myfile.tex
+latexindent.pl -l=myyaml.yaml,localSettings.yaml myfile.tex
+    \end{commandshell}
+	Note that the following is \emph{not} allowed:
+	\begin{commandshell}
+latexindent.pl -l+myyaml.yaml myfile.tex
+    \end{commandshell}
+	and
+	\begin{commandshell}
+latexindent.pl -l + myyaml.yaml myfile.tex
+    \end{commandshell}
+	will \emph{only} load \texttt{localSettings.yaml}, and \texttt{myyaml.yaml} will be ignored.
+
+	You may also choose to omit the \texttt{yaml} extension, such as
+	\begin{commandshell}
+latexindent.pl -l=localSettings,myyaml myfile.tex
+    \end{commandshell}
 \flagbox{-d, --onlydefault}
 	\begin{commandshell}
 latexindent.pl -d myfile.tex

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-introduction.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-introduction.tex	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-introduction.tex	2017-06-25 21:50:47 UTC (rev 44695)
@@ -19,7 +19,9 @@
 	at \cite{latexindent-home}.
 
 \subsection{License}
-	\texttt{latexindent.pl} is free and open source, and it always will be.
+	\texttt{latexindent.pl} is free and open source, and it always will be; it
+	is released under the GNU General Public License v3.0.
+
 	Before you start using it on any important files, bear in mind that \texttt{latexindent.pl} has the option to overwrite your \texttt{.tex} files.
 	It will always make at least one backup (you can choose how many it makes, see \cpageref{page:onlyonebackup})
 	but you should still be careful when using it. The script has been tested on many

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex	2017-06-25 21:50:47 UTC (rev 44695)
@@ -58,6 +58,7 @@
 
 \yamltitle{textWrapOptions}*{fields}
 	When the \texttt{-m} switch is active \texttt{latexindent.pl} has the ability to wrap text using the options
+	\announce{2017-05-27}
 	specified in the \texttt{textWrapOptions} field, see \cref{lst:textWrapOptions}. The value of
 	\texttt{columns} specifies the column at which the text should be wrapped.
 	By default, the value of \texttt{columns} is \texttt{0}, so \texttt{latexindent.pl}
@@ -148,6 +149,7 @@
 
 \yamltitle{removeParagraphLineBreaks}*{fields}
 	When the \texttt{-m} switch is active \texttt{latexindent.pl} has the ability to remove line breaks
+	\announce{2017-05-27}
 	from within paragraphs; the behaviour is controlled by the \texttt{removeParagraphLineBreaks} field, detailed in
 	\cref{lst:removeParagraphLineBreaks}. Thank you to \cite{jowens} for shaping and assisting with the testing of this feature.
 
@@ -277,6 +279,7 @@
 
 \yamltitle{paragraphsStopAt}*{fields}
 	The paragraph line break routine considers blank lines and the \lstinline|\par| command to be the end of a paragraph;
+	\announce{2017-05-27}
 	you can fine tune the behaviour of the routine further by using the \texttt{paragraphsStopAt} fields, shown in \cref{lst:paragraphsStopAt}.
 
 	\cmhlistingsfromfile[style=paragraphsStopAt]{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{paragraphsStopAt}}{lst:paragraphsStopAt}

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm	2017-06-25 21:50:47 UTC (rev 44695)
@@ -22,6 +22,7 @@
 use File::Basename; # to get the filename and directory path
 use Exporter qw/import/;
 use LatexIndent::GetYamlSettings qw/%masterSettings/;
+use LatexIndent::Switches qw/%switches/;
 our @EXPORT_OK = qw/file_extension_check/;
 
 sub file_extension_check{
@@ -37,7 +38,8 @@
     my @fileExtensions = sort { $fileExtensionPreference{$a} <=> $fileExtensionPreference{$b} } keys(%fileExtensionPreference);
     
     # get the base file name, allowing for different extensions (possibly no extension)
-    my ($dir, $name, $ext) = fileparse($fileName, @fileExtensions);
+    my ($name, $dir, $ext) = fileparse($fileName, @fileExtensions);
+    ${$self}{baseName} = $name;
 
     # check to make sure given file type is supported
     if( -e $fileName  and !$ext ){
@@ -90,6 +92,51 @@
     # store the file extension
     ${$self}{fileExtension} = $ext;
 
+    # check to see if -o switch is active
+    if($switches{outputToFile}){
+        
+        $self->logger("Output file check",'heading');
+
+        # the -o file name might begin with a + symbol
+        if($switches{outputToFile} =~ m/^\+(.*)/ and $1 ne "+"){
+            $self->logger("-o switch called with + symbol at the beginning: $switches{outputToFile}");
+            $switches{outputToFile} = ${$self}{baseName}.$1;
+            $self->logger("output file is now: $switches{outputToFile}");
+        }
+
+        my $strippedFileExtension = ${$self}{fileExtension};
+        $strippedFileExtension =~ s/\.//; 
+
+        # grab the name, directory, and extension of the output file
+        my ($name, $dir, $ext) = fileparse($switches{outputToFile}, $strippedFileExtension);
+
+        # if there is no extension, then add the extension from the file to be operated upon
+        if(!$ext){
+            $self->logger("-o switch called with file name without extension: $switches{outputToFile}");
+            $switches{outputToFile} = $name.($name=~m/\.\z/ ? q() : ".").$strippedFileExtension;
+            $self->logger("Updated to $switches{outputToFile} as the file extension of the input file is $strippedFileExtension");
+        }
+
+        # the -o file name might end with ++ in which case we wish to search for existence, 
+        # and then increment accordingly
+        $name =~ s/\.$//;
+        if($name =~ m/\+\+$/){
+            $self->logger("-o switch called with file name ending with ++: $switches{outputToFile}");
+            $name =~ s/\+\+$//;
+            $name = ${$self}{baseName} if ($name eq "");
+            my $outputFileCounter = 0;
+            my $fileName = $name.$outputFileCounter.".".$strippedFileExtension; 
+            $self->logger("will search for exisitence and increment counter, starting with $fileName");
+            while( -e $fileName ){
+                $self->logger("$fileName exists, incrementing counter");
+                $outputFileCounter++;
+                $fileName = $name.$outputFileCounter.".".$strippedFileExtension; 
+            }
+            $self->logger("$fileName does not exist, and will be the output file");
+            $switches{outputToFile} = $fileName;
+        }
+    }
+
     # read the file into the Document body
     my @lines;
     open(MAINFILE, $fileName) or die "Could not open input file, $fileName";

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm	2017-06-25 21:50:47 UTC (rev 44695)
@@ -35,7 +35,6 @@
 sub readSettings{
   my $self = shift;
   
-  $defaultSettings = YAML::Tiny->new;
   $defaultSettings = YAML::Tiny->read( "$FindBin::RealBin/defaultSettings.yaml" );
   $self->logger("YAML settings read",'heading');
   $self->logger("Reading defaultSettings.yaml from $FindBin::RealBin/defaultSettings.yaml");
@@ -104,11 +103,34 @@
   # get information about LOCAL settings, assuming that $readLocalSettings exists
   my $directoryName = dirname (${$self}{fileName});
   
+  my @localSettings;
+
+  # local settings can be called with a + symbol, for example
+  #     -l=+myfile.yaml
+  #     -l "+ myfile.yaml"
+  #     -l=myfile.yaml+
+  # which translates to, respectively
+  #     -l=localSettings.yaml,myfile.yaml
+  #     -l=myfile.yaml,localSettings.yaml
+  # Note: the following is *not allowed*:
+  #     -l+myfile.yaml
+  # and
+  #     -l + myfile.yaml
+  # will *only* load localSettings.yaml, and myfile.yaml will be ignored
+  if($switches{readLocalSettings} =~ m/\+/){
+        $self->logger("+ found in call for -l switch: will add localSettings.yaml");
+
+        # + can be either at the beginning or the end, which determines if where the comma should go
+        my $commaAtBeginning = ($switches{readLocalSettings} =~ m/^\h*\+/ ? q() : ",");
+        my $commaAtEnd = ($switches{readLocalSettings} =~ m/^\h*\+/ ? "," : q());
+        $switches{readLocalSettings} =~ s/\h*\+\h*/$commaAtBeginning."localSettings.yaml".$commaAtEnd/e; 
+        $self->logger("New value of -l switch: $switches{readLocalSettings}");
+  }
+
   # local settings can be separated by ,
   # e.g  
   #     -l = myyaml1.yaml,myyaml2.yaml
   # and in which case, we need to read them all
-  my @localSettings;
   if($switches{readLocalSettings} =~ m/,/){
         $self->logger("Multiple localSettings found, separated by commas:",'heading');
         @localSettings = split(/,/,$switches{readLocalSettings});
@@ -118,6 +140,13 @@
 
   # add local settings to the paths, if appropriate
   foreach (@localSettings) {
+    # check for an extension (.yaml)
+    my ($dir, $name, $ext) = fileparse($_, "yaml");
+
+    # if no extension is found, append the current localSetting with .yaml
+    $_ = $_.($_=~m/\.\z/ ? q() : ".")."yaml" if(!$ext);
+
+    # check for existence and non-emptiness
     if ( (-e "$directoryName/$_") and !(-z "$directoryName/$_")) {
         $self->logger("Adding $directoryName/$_ to YAML read paths");
         push(@absPaths,"$directoryName/$_");

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm	2017-06-25 21:50:47 UTC (rev 44695)
@@ -18,6 +18,7 @@
 use warnings;
 use LatexIndent::GetYamlSettings qw/%masterSettings/;
 use LatexIndent::Switches qw/%switches/;
+use LatexIndent::Version qw/$versionNumber $versionDate/;
 use FindBin; 
 use File::Basename; # to get the filename and directory path
 use Exporter qw/import/;
@@ -41,7 +42,7 @@
     my $self = shift;
 
     # details of the script to log file
-    $self->logger("$FindBin::Script version 3.2, a script to indent .tex files",'heading');
+    $self->logger("$FindBin::Script version $versionNumber, $versionDate, a script to indent .tex files",'heading');
     $self->logger("$FindBin::Script lives here: $FindBin::RealBin/");
 
     # time the script is used
@@ -48,10 +49,18 @@
     my $time = localtime();
     $self->logger("$time");
 
+    # -v switch is just to show the version number
+    if($switches{version}) {
+        print $versionNumber,", ",$versionDate,"\n";
+        exit(2);
+    }
+
     if(scalar(@ARGV) < 1 or $switches{showhelp}) {
     print <<ENDQUOTE
-latexindent.pl version 3.2
+latexindent.pl version $versionNumber, $versionDate
 usage: latexindent.pl [options] [file][.tex|.sty|.cls|.bib|...]
+      -v, --version
+          displays the version number and date of release
       -h, --help
           help (see the documentation for detailed instructions and examples)
       -o, --outputfile
@@ -72,7 +81,7 @@
                 latexindent.pl -l=some.yaml,another.yaml myfile.tex 
       -d, --onlydefault
           ONLY use defaultSettings.yaml, ignore ALL (yaml) user files
-      -g, --logfile
+      -g, --logfile=<name of log file>
           used to specify the name of logfile (default is indent.log)
       -c, --cruft=<cruft directory> 
           used to specify the location of backup files and indent.log

Added: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	                        (rev 0)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2017-06-25 21:50:47 UTC (rev 44695)
@@ -0,0 +1,24 @@
+package LatexIndent::Version;
+#	This program is free software: you can redistribute it and/or modify
+#	it under the terms of the GNU General Public License as published by
+#	the Free Software Foundation, either version 3 of the License, or
+#	(at your option) any later version.
+#
+#	This program is distributed in the hope that it will be useful,
+#	but WITHOUT ANY WARRANTY; without even the implied warranty of
+#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#	GNU General Public License for more details.
+#
+#	See http://www.gnu.org/licenses/.
+#
+#	Chris Hughes, 2017
+#
+#	For all communication, please visit: https://github.com/cmhughes/latexindent.pl
+use strict;
+use warnings;
+use Exporter qw/import/;
+our @EXPORT_OK = qw/$versionNumber $versionDate/;
+
+our $versionNumber = '3.2.1';
+our $versionDate = '2017-06-25';
+1


Property changes on: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2017-06-25 21:50:30 UTC (rev 44694)
+++ trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2017-06-25 21:50:47 UTC (rev 44695)
@@ -1,4 +1,4 @@
-# defaultSettings.yaml for latexindent.pl, version 3.2, 2017-06-19
+# defaultSettings.yaml for latexindent.pl, version 3.2.1, 2017-06-25
 #                      a script that aims to
 #                      beautify .tex, .sty, .cls files
 #

Modified: trunk/Master/texmf-dist/scripts/latexindent/latexindent.pl
===================================================================
(Binary files differ)



More information about the tex-live-commits mailing list