Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
cmhughes committed May 12, 2024
2 parents 587f372 + d460102 commit 7e280fc
Show file tree
Hide file tree
Showing 30 changed files with 198 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM perl:5.38.2-slim-threaded-buster
#

ARG LATEXINDENT_VERSION
ENV LATEXINDENT_VERSION ${LATEXINDENT_VERSION:-V3.24}
ENV LATEXINDENT_VERSION ${LATEXINDENT_VERSION:-V3.24.1}

RUN apt-get update \
&& apt-get install \
Expand Down
4 changes: 2 additions & 2 deletions LatexIndent/Sentence.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ sub one_sentence_per_line {
{
if ($yesNo) {
if ( $sentencesFollowEachPart eq "par" ) {
$sentencesFollowEachPart = qr/\R?\\par/s;
$sentencesFollowEachPart = qr/\R?\\par(?![a-zA-Z])/s;
}
elsif ( $sentencesFollowEachPart eq "blankLine" ) {
$sentencesFollowEachPart = qr/
Expand Down Expand Up @@ -207,7 +207,7 @@ sub one_sentence_per_line {

# similarly for \par
if ( ${ ${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentencesFollow} }{par} ) {
$notWithinSentence .= "|" . qr/(?:\R?\\par)/s;
$notWithinSentence .= "|" . qr/(?:\R?\\par(?![a-zA-Z]))/s;
}

my $sentenceRegEx = qr/
Expand Down
4 changes: 2 additions & 2 deletions LatexIndent/Version.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ use warnings;
use Exporter qw/import/;
our @EXPORT_OK = qw/$versionNumber $versionDate/;

our $versionNumber = '3.24';
our $versionDate = '2024-04-28';
our $versionNumber = '3.24.1';
our $versionDate = '2024-05-12';
1
2 changes: 1 addition & 1 deletion defaultSettings.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# latexindent.pl, version 3.24, 2024-04-28
# latexindent.pl, version 3.24.1, 2024-05-12
#
# defaultSettings.yaml, the default settings for latexindent.pl
#
Expand Down
5 changes: 4 additions & 1 deletion documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!-- announcement: paths feature update, log file bug fix-->
<!-- announcement: oneSentencePerLine par issue bug fix-->

# changelog.md
## V3.24.1, May 12, 2024
oneSentencePerLine par issue bug fix, see [issue 527](https://github.com/cmhughes/latexindent.pl/issues/527)

## V3.24, April 28, 2024
* `paths` feature update, see [issue 516](https://github.com/cmhughes/latexindent.pl/issues/516)
* `lookForAlignDelims` updated to include `spreadtab`, see [issue 535](https://github.com/cmhughes/latexindent.pl/issues/535)
Expand Down
4 changes: 2 additions & 2 deletions documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
# built documents.
#
# The short X.Y version.
version = u'3.24'
version = u'3.24.1'
# The full version, including alpha/beta/rc tags.
release = u'3.24'
release = u'3.24.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion documentation/demonstrations/pre-commit-config-conda.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.24
rev: V3.24.1
hooks:
- id: latexindent-conda
args: [-s]
2 changes: 1 addition & 1 deletion documentation/demonstrations/pre-commit-config-cpan.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.24
rev: V3.24.1
hooks:
- id: latexindent
args: [-s]
2 changes: 1 addition & 1 deletion documentation/demonstrations/pre-commit-config-demo.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.24
rev: V3.24.1
hooks:
- id: latexindent
args: [-l, -m, -s, -w]
2 changes: 1 addition & 1 deletion documentation/demonstrations/pre-commit-config-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.24
rev: V3.24.1
hooks:
- id: latexindent-docker
args: [-s]
2 changes: 1 addition & 1 deletion documentation/latexindent-yaml-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "latexindent-yaml-schema.json",
"title": "latexindent.pl YAML schema",
"description": "latexindent.pl YAML schema helper, V3.24 2024-04-28",
"description": "latexindent.pl YAML schema helper, V3.24.1 2024-05-12",
"type": "object",
"properties": {
"fileExtensionPreference": {
Expand Down
2 changes: 1 addition & 1 deletion documentation/readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
latexindent.pl, version 3.24, 2024-04-28
latexindent.pl, version 3.24.1, 2024-05-12

PERL script to indent code within environments, and align delimited
environments in .tex files.
Expand Down
4 changes: 2 additions & 2 deletions documentation/title.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
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.24
\centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.24.1
\end{tcolorbox}
}
\author{Chris Hughes \thanks{and contributors!
See \vref{sec:contributors}.
For
all communication, please visit \cite{latexindent-home}.}}
\date{2024-04-28}
\date{2024-05-12}
\maketitle
\begin{adjustwidth}{1cm}{1cm}
\small
Expand Down
10 changes: 5 additions & 5 deletions helper-scripts/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
# - <upload latexindent.zip to ctan>

minorVersion=0
oldVersion='3.23.9'
newVersion='3.24'
oldDate='2024-04-06'
newDate='2024-04-28'
oldVersion='3.24'
newVersion='3.24.1'
oldDate='2024-04-28'
newDate='2024-05-12'
updateVersion=0
gitMode=0

Expand Down Expand Up @@ -174,7 +174,7 @@ if [ $gitMode -eq 1 ]; then
###result=$? && [[ result -gt 0 ]] && echo -e "${RED}-g switch failure: git diff --cached has differences you'll need to commit them${COLOR_OFF}" && paplay /usr/share/sounds/freedesktop/stereo/bell.oga && exit

allmode=0
for mycommand in 'git pull' 'git push' 'git checkout main' 'git merge --no-ff develop' 'git pull' "git tag V${newVersion}" 'git push' 'git push --tags'
for mycommand in 'git pull' 'git push' 'git checkout main' 'git merge --no-ff develop' 'git pull' "git tag V${newVersion}" 'git push' 'git push --tags' 'git checkout develop' 'git merge main'
do
while true; do
[[ allmode -eq 1 ]] && helper_section_print "$mycommand" && $mycommand && break
Expand Down
2 changes: 1 addition & 1 deletion latexindent.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
# latexindent.pl, version 3.24, 2024-04-28
# latexindent.pl, version 3.24.1, 2024-05-12
#
# 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
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ and [pre-commit](https://latexindentpl.readthedocs.io/en/latest/sec-appendices.h

## version

latexindent.pl, version 3.24, 2024-04-28
latexindent.pl, version 3.24.1, 2024-05-12

## author
Chris Hughes (cmhughes)
Expand Down Expand Up @@ -157,7 +157,7 @@ framework](https://pre-commit.com) by adding this to your

```yaml
- repo: https://github.com/cmhughes/latexindent.pl.git
rev: V3.24
rev: V3.24.1
hooks:
- id: latexindent
```
Expand Down
4 changes: 4 additions & 0 deletions test-cases/alignment/alignment-test-cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ latexindent.pl -s issue-526.tex -o=+-mod1

latexindent.pl -s issue-535.tex -o=+-mod1

latexindent.pl -s issue-543.tex -o=+-mod1

latexindent.pl -s issue-541.tex -l issue-541.yaml -o=+-mod1

[[ $silentMode == 0 ]] && set -x
[[ $gitStatus == 1 ]] && git status
[[ $noisyMode == 1 ]] && makenoise
19 changes: 19 additions & 0 deletions test-cases/alignment/issue-541-mod1.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
\documentclass{ctexrep}%Chinese report
\usepackage{tabularray}%tabular

\begin{document}
\begin{tblr}[long,
label= {market_fuyanshan}
]{
cells = {c,m},
hline{1-2,5}= {-}{1pt},
hline{3-4} = {-}{},
vlines,
row{1} = {cmd=\bfseries},
}
XXX & YYY & ZZZ \\
AAA & DDD & GGG \\
BBB & EEE & HHH \\
CCC & FFF & III
\end{tblr}
\end{document}
19 changes: 19 additions & 0 deletions test-cases/alignment/issue-541.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
\documentclass{ctexrep}%Chinese report
\usepackage{tabularray}%tabular

\begin{document}
\begin{tblr}[long,
label= {market_fuyanshan}
]{
cells = {c,m},
hline{1-2,5}= {-}{1pt},
hline{3-4} = {-}{},
vlines,
row{1} = {cmd=\bfseries},
}
XXX & YYY & ZZZ \\
AAA & DDD & GGG \\
BBB & EEE & HHH \\
CCC & FFF & III
\end{tblr}
\end{document}
11 changes: 11 additions & 0 deletions test-cases/alignment/issue-541.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fineTuning:
keyEqualsValuesBracesBrackets:
name: |-
(?x)
[a-zA-Z@\*0-9_\/.:\#-]+
(?:
[a-zA-Z@\*0-9_\/.\h:\#-]
\{
[a-zA-Z@\*0-9_\/.\h:\#-,]+?
\}
)*?
15 changes: 15 additions & 0 deletions test-cases/alignment/issue-543-mod1.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
\documentclass{ctexrep}%Chinese report
\usepackage{tabularray}%tabular

\begin{document}
\begin{tblr}{
cells={c,m},
hlines,
vlines,
}
AAAAAAA & BBBBBBB \\
c & {f \\g} \\ %multirows
d & h \\
e & {i \\j} %multirows
\end{tblr}
\end{document}
15 changes: 15 additions & 0 deletions test-cases/alignment/issue-543.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
\documentclass{ctexrep}%Chinese report
\usepackage{tabularray}%tabular

\begin{document}
\begin{tblr}{
cells={c,m},
hlines,
vlines,
}
AAAAAAA & BBBBBBB \\
c & {f \\g} \\ %multirows
d & h \\
e & {i \\j} %multirows
\end{tblr}
\end{document}
7 changes: 7 additions & 0 deletions test-cases/oneSentencePerLine/issue-527-mod1.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
\paragraph{latexindent.pl}
latexindent.pl is a Perl script that indents .tex (and other) files according to an indentation scheme that the user can modify to suit their taste.
Environments, including those with alignment delimiters (such as tabular), and commands, including those that can split braces and brackets across lines, are usually handled correctly by the script.
Options for verbatim-like environments and commands, together with indentation after headings (such as chapter, section, etc) are also available.
The script also has the ability to modify line breaks, and to add comment symbols and blank lines;
furthermore, it permits string or regex-based substitutions.
All user options are customisable via the switches and the YAML interface.
9 changes: 9 additions & 0 deletions test-cases/oneSentencePerLine/issue-527.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\paragraph{latexindent.pl}
latexindent.pl is a Perl script that indents .tex (and other) files according to an indentation
scheme that the user can modify to suit their taste. Environments, including those with alignment
delimiters (such as tabular), and commands, including those that can split braces and
brackets across lines, are usually handled correctly by the script. Options for verbatim-like environments
and commands, together with indentation after headings (such as chapter, section,
etc) are also available. The script also has the ability to modify line breaks, and to add comment
symbols and blank lines; furthermore, it permits string or regex-based substitutions. All user
options are customisable via the switches and the YAML interface.
25 changes: 25 additions & 0 deletions test-cases/oneSentencePerLine/issue-527.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
modifyLineBreaks:
oneSentencePerLine:
manipulateSentences: 1
removeSentenceLineBreaks: 1
textWrapSentences: 1
sentencesFollow:
par: 1
blankLine: 1
fullStop: 1
exclamationMark: 1
questionMark: 1
rightBrace: 1
commentOnPreviousLine: 1
other: ;
sentencesBeginWith:
A-Z: 1
a-z: 1
sentencesDoNOTcontain:
other: \} # regex
sentencesEndWith:
basicFullStop: 0
betterFullStop: 1
exclamationMark: 1
questionMark: 1
other: ;
2 changes: 2 additions & 0 deletions test-cases/oneSentencePerLine/one-sentence-per-line.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ latexindent.pl -s issue-463 -m -o=+-mod2 -l=issue-419b.yaml

latexindent.pl -s issue-514 -m -o=+-mod1 -l=issue-514.yaml

latexindent.pl -s issue-527 -m -o=+-mod1 -l=issue-527.yaml

[[ $noisyMode == 1 ]] && makenoise
[[ $gitStatus == 1 ]] && git status

Expand Down
15 changes: 15 additions & 0 deletions test-cases/texexchange/83663-mod1.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
I've a LaTeX source.
I'm ready
to strip its comments.

So I hope there are
100\% auto
ways to get this done.



\begin{verbatim}
next two lines should not be lost
% don't lose this line
% this line should stay too
\end{verbatim}
18 changes: 18 additions & 0 deletions test-cases/texexchange/83663.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
I've a LaTeX source.
I'm ready %for submission
%But first I would like
to strip its comments.

So I hope there are
100\% auto
ways to get this done.

\begin{comment}
Because there are subtle ways to mess it up.
\end{comment}

\begin{verbatim}
next two lines should not be lost
% don't lose this line
% this line should stay too
\end{verbatim}
10 changes: 10 additions & 0 deletions test-cases/texexchange/83663.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
replacements:
-
substitution: |-
s/^\h*(?<!\\)%.*\R//mg
-
substitution: |-
s/(?<!\\)%.*$//mg
-
substitution: |-
s/\\begin\{comment\}.*?\\end\{comment\}//sg
1 change: 1 addition & 0 deletions test-cases/texexchange/texexchange-test-cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,6 @@ latexindent.pl -m -s 667013.tex -l 667013 -o=+-mod1
latexindent.pl -s -l 709049.yaml -m 709049.tex -o=+-mod1
latexindent.pl -s -l 709049a.yaml -m 709049.tex -o=+-mod2

latexindent.pl -s -rv -l 83663.yaml 83663.tex -o=+-mod1
[[ $noisyMode == 1 ]] && makenoise
[[ $gitStatus == 1 ]] && git status

0 comments on commit 7e280fc

Please sign in to comment.