Closed lsfinn closed 4 years ago
Thanks for this, I'll do my best to try to explain what's going on.
The oneSentencePerLine
https://latexindentpl.readthedocs.io/en/latest/sec-the-m-switch.html#features-of-the-onesentenceperline-routine
The sentence manipulation routine takes place after verbatim environments, preamble and trailing comments have been accounted for; this means that any characters within these types of code blocks will not be part of the sentence manipulation routine.
Importantly, and perhaps the documentation should say this if it doesn't already, the oneSentencePerLine
does not operate on a per-code-block basis. The oneSentencePerLine
does not know about any other code blocks.
In relation to your example, Sed sed& \end{align} laoreet magna.
is considered a sentence, and so Sed sed ...
will start on its own line. Again, the oneSentencePerLine
does not know about any other code blocks.
Perhaps this could/should change and perhaps it should be able to operate on a per-code-block basis...?
The text wrap routine can operate on a per-code-block basis. If we use the following YAML file:
modifyLineBreaks:
textWrapOptions:
columns: 75
perCodeBlockBasis: 1
all:
except:
- quotation
- align
then we receive the following ouput:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus
viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
\begin{itemize}
\item tempus iaculis mauris.
\item Nulla facilisi.
\end{itemize}
Integer ut ornare ex.
Pellentesque tempor porttitor
\begin{align}
nunc vitae lacinia. & Cras dapibus risus \\
congue nibh ultricies & , sit amet ultricies \\
sem tempor. Sed sed &
\end{align}
laoreet magna. Phasellus iaculis ante scelerisque urna scelerisque
lobortis.
\begin{quotation}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
\end{quotation}
I hope this helps. Let me know.
Hi Chris -
Thanks much for such a rapid response.
Please check my new understanding here: textWrapOptions and oneSentencePerLine are entirely independent functions under the broader rubric of modifyLineBreaks. This was something I didn’t fully appreciate.
I seem, however, to have another problem. When I use the YAML file in your example with the input file provided I’m getting a different result than you are:
Lorem ipsum dolor
sit amet,
consectetur adipiscing
elit. Integer tempus
viverra est sed tempor. Suspendisse
sapien tellus, suscipit ut enim eu,
\begin{itemize}
\item tempus iaculis mauris.
\item Nulla facilisi.
\end{itemize}
Integer ut ornare ex.
Pellentesque tempor porttitor
\begin{align}
nunc vitae lacinia. & Cras dapibus risus \\
congue nibh ultricies & , sit amet ultricies \\
sem tempor. Sed sed &
\end{align}
laoreet magna. Phasellus iaculis ante scelerisque urna scelerisque
lobortis.
\begin{quotation}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
\end{quotation}
In your results the text before the \begin{align}
is wrapped; in my result, it is not.
I’ve checked that the YAML file you provided are the only modifications to the defaults.
Have you any thoughts on what might be going on here?
Thanks much,
Sam
Hi Sam, Thanks for the follow-up.
Please check my new understanding here: textWrapOptions and oneSentencePerLine are entirely independent functions under the broader rubric of modifyLineBreaks. This was something I didn’t fully appreciate.
Yes, that's correct. Perhaps I need to make the documentation clearer on this.
I confirm that the output I posted is still the same output that I receive. Explicitly, starting with:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
\begin{itemize}
\item tempus iaculis mauris.
\item Nulla facilisi.
\end{itemize}
Integer ut ornare ex.
Pellentesque tempor porttitor
\begin{align}
nunc vitae lacinia.& Cras dapibus risus\\
congue nibh ultricies&, sit amet ultricies\\
sem tempor. Sed sed&
\end{align}
laoreet magna. Phasellus iaculis ante scelerisque urna scelerisque lobortis.
\begin{quotation}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
\end{quotation}
and
modifyLineBreaks:
textWrapOptions:
columns: 75
perCodeBlockBasis: 1
all:
except:
- quotation
- align
and running the command
latexindent.pl -m lorem.tex -l cmh.yaml -o lorem-out
then I receive the output
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus
viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
\begin{itemize}
\item tempus iaculis mauris.
\item Nulla facilisi.
\end{itemize}
Integer ut ornare ex.
Pellentesque tempor porttitor
\begin{align}
nunc vitae lacinia. & Cras dapibus risus \\
congue nibh ultricies & , sit amet ultricies \\
sem tempor. Sed sed &
\end{align}
laoreet magna. Phasellus iaculis ante scelerisque urna scelerisque
lobortis.
\begin{quotation}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
\end{quotation}
If your output is not as above, then do be sure to check your log file, indent.log
.
Has this helped? Best Chris
Hmmm . . .
Still not reproducing your results:
cmh.yaml: modifyLineBreaks: textWrapOptions: columns: 75 perCodeBlockBasis: 1 all: except:
Running the command
latexindent.pl -m lorem.tex -l cmh.yaml -o lorem-out I receive the output
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu, \begin{itemize} \item tempus iaculis mauris. \item Nulla facilisi. \end{itemize} Integer ut ornare ex.
Pellentesque tempor porttitor \begin{align} nunc vitae lacinia. & Cras dapibus risus \ congue nibh ultricies & , sit amet ultricies \ sem tempor. Sed sed & \end{align} laoreet magna. Phasellus iaculis ante scelerisque urna scelerisque lobortis.
\begin{quotation} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu, \end{quotation}
The indent.log file does not show anything amiss:
modifyLineBreaks:
textWrapOptions:
all:
except:
- quotation
- align
columns: '75'
perCodeBlockBasis: '1'
INFO: Please direct all communication/issues to: https://github.com/cmhughes/latexindent.pl
I do recover the same results you quote if I add
modifyLineBreaks: removeParagraphLineBreaks: all: 1
Is there perhaps a difference in other default files?
Thanks,
Sam
— Sam Finn lsfinn@gmail.com
On Jul 26, 2020, at 1:29 PM, Chris Hughes notifications@github.com wrote:
Hi Sam, Thanks for the follow-up.
Please check my new understanding here: textWrapOptions and oneSentencePerLine are entirely independent functions under the broader rubric of modifyLineBreaks. This was something I didn’t fully appreciate.
Yes, that's correct. Perhaps I need to make the documentation clearer on this.
I confirm that the output I posted is still the same output that I receive. Explicitly, starting with:
lorem.tex
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu, \begin{itemize} \item tempus iaculis mauris. \item Nulla facilisi. \end{itemize} Integer ut ornare ex.
Pellentesque tempor porttitor \begin{align} nunc vitae lacinia.& Cras dapibus risus\ congue nibh ultricies&, sit amet ultricies\ sem tempor. Sed sed& \end{align} laoreet magna. Phasellus iaculis ante scelerisque urna scelerisque lobortis.
\begin{quotation} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu, \end{quotation} and
cmh.yaml
modifyLineBreaks: textWrapOptions: columns: 75 perCodeBlockBasis: 1 all: except:
- quotation
- align and running the command
latexindent.pl -m lorem.tex -l cmh.yaml -o lorem-out then I receive the output
lorem-out.tex
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu, \begin{itemize} \item tempus iaculis mauris. \item Nulla facilisi. \end{itemize} Integer ut ornare ex.
Pellentesque tempor porttitor \begin{align} nunc vitae lacinia. & Cras dapibus risus \ congue nibh ultricies & , sit amet ultricies \ sem tempor. Sed sed & \end{align} laoreet magna. Phasellus iaculis ante scelerisque urna scelerisque lobortis.
\begin{quotation} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu, \end{quotation} If your output is not as above, then do be sure to check your log file, indent.log.
Has this helped? Best Chris
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/211#issuecomment-664030315, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHAVLL4A5VHT66GLSRKBRLR5R73BANCNFSM4PHIJBYA.
Can you add showAmalgamatedSettings: 1 as shown in the following
https://latexindentpl.readthedocs.io/en/latest/sec-default-user-local.html#lst-logfilepreferences
And then repost your log file?
Following your instructions here’s the new log file:
logFilePreferences:
showAmalgamatedSettings: '1'
modifyLineBreaks:
textWrapOptions:
all:
except:
- quotation
- align
columns: '75'
perCodeBlockBasis: '1'
Amalgamated/overall settings to be used:
---
backupExtension: .bak
commandCodeBlocks:
commandNameSpecial:
-
amalgamate: '1'
- '@ifnextchar\['
roundParenthesesAllowed: '1'
stringsAllowedBetweenArguments:
-
amalgamate: '1'
- node
- at
- to
- decoration
- \+\+
- \-\-
cycleThroughBackUps: '0'
defaultIndent: "\t"
fileContentsEnvironments:
filecontents: '1'
filecontents*: '1'
fileExtensionPreference:
.bib: '4'
.cls: '3'
.sty: '2'
.tex: '1'
fineTuning:
NamedGroupingBracesBrackets:
follow: \h|\R|\{|\[|\$|\)|\(
name: '[0-9\.a-zA-Z@\*><]+?'
UnNamedGroupingBracesBrackets:
follow: \{|\[|,|&|\)|\(|\$
arguments:
before: (?:#\d\h*;?,?\/?)+|\<.*?\>
between: _|\^|\*
commands:
name: '[+a-zA-Z@\*0-9_\:]+?'
environments:
name: '[a-zA-Z@\*0-9_\\]+'
ifElseFi:
name: '@?if[a-zA-Z@]*?'
keyEqualsValuesBracesBrackets:
follow: (?:(?<!\\)\{)|,|(?:(?<!\\)\[)
name: '[a-zA-Z@\*0-9_\/.\h\{\}:\#-]+?'
modifyLineBreaks:
betterFullStop: (?:\.\)(?!\h*[a-z]))|(?:(?<!(?:(?:e\.g)|(?:i\.e)|(?:etc))))\.(?!(?:[a-z]|[A-Z]|\-|~|\,|[0-9]))
comma: ','
doubleBackSlash: \\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])?
indentAfterHeadings:
chapter:
indentAfterThisHeading: '0'
level: '2'
paragraph:
indentAfterThisHeading: '0'
level: '6'
part:
indentAfterThisHeading: '0'
level: '1'
section:
indentAfterThisHeading: '0'
level: '3'
subparagraph:
indentAfterThisHeading: '0'
level: '7'
subsection:
indentAfterThisHeading: '0'
level: '4'
subsection*:
indentAfterThisHeading: '0'
level: '4'
subsubsection:
indentAfterThisHeading: '0'
level: '5'
indentAfterItems:
description: '1'
enumerate: '1'
itemize: '1'
list: '1'
indentPreamble: '0'
indentRules:
anotherenvironment: "\t\t\t\t"
chapter: ' '
item: ' '
myenvironment: "\t\t"
myitem: ' '
section: ' '
indentRulesGlobal:
UnNamedGroupingBracesBrackets: '0'
afterHeading: '0'
commands: '0'
environments: '0'
filecontents: '0'
ifElseFi: '0'
items: '0'
keyEqualsValuesBracesBrackets: '0'
mandatoryArguments: '0'
namedGroupingBracesBrackets: '0'
optionalArguments: '0'
specialBeginEnd: '0'
itemNames:
item: '1'
myitem: '1'
logFilePreferences:
PatternLayout:
default: '%A%n'
trace: '%A%n'
ttrace: '%A%n'
endLogFileWith: '--------------'
showAmalgamatedSettings: '1'
showDecorationFinishCodeBlockTrace: '0'
showDecorationStartCodeBlockTrace: '0'
showEveryYamlRead: '1'
showGitHubInfoFooter: '1'
lookForAlignDelims:
Bmatrix: '1'
Vmatrix: '1'
align: '1'
align*: '1'
alignat: '1'
alignat*: '1'
aligned: '1'
array: '1'
bmatrix: '1'
cases: '1'
dcases: '1'
listabla: '1'
longtable: '1'
matrix: '1'
pmatrix: '1'
tabu: '1'
tabular:
alignDoubleBackSlash: '1'
alignFinalDoubleBackSlash: '0'
alignRowsWithoutMaxDelims: '1'
delimiterJustification: left
delimiterRegEx: (?<!\\)(&)
delims: '1'
dontMeasure: '0'
justification: left
multiColumnGrouping: '0'
spacesAfterAmpersand: '1'
spacesBeforeAmpersand: '1'
spacesBeforeDoubleBackSlash: '1'
tabularx:
delims: '1'
vmatrix: '1'
lookForPreamble:
.bib: '0'
.cls: '0'
.sty: '0'
.tex: '1'
maxNumberOfBackUps: '0'
maximumIndentation: '-1'
modifyLineBreaks:
commands:
CommandNameFinishesWithLineBreak: '0'
CommandStartsOnOwnLine: '0'
condenseMultipleBlankLinesInto: '1'
environments:
BeginStartsOnOwnLine: '0'
BodyStartsOnOwnLine: '0'
EndFinishesWithLineBreak: '0'
EndStartsOnOwnLine: '0'
equation*:
BeginStartsOnOwnLine: '0'
BodyStartsOnOwnLine: '0'
EndFinishesWithLineBreak: '0'
EndStartsOnOwnLine: '0'
ifElseFi:
BodyStartsOnOwnLine: '0'
ElseFinishesWithLineBreak: '0'
ElseStartsOnOwnLine: '0'
FiFinishesWithLineBreak: '0'
FiStartsOnOwnLine: '0'
IfStartsOnOwnLine: '0'
OrFinishesWithLineBreak: '0'
OrStartsOnOwnLine: '0'
ifnum:
BodyStartsOnOwnLine: '0'
ElseFinishesWithLineBreak: '0'
ElseStartsOnOwnLine: '0'
FiFinishesWithLineBreak: '0'
FiStartsOnOwnLine: '0'
IfStartsOnOwnLine: '0'
OrFinishesWithLineBreak: '0'
OrStartsOnOwnLine: '0'
items:
ItemFinishesWithLineBreak: '0'
ItemStartsOnOwnLine: '0'
keyEqualsValuesBracesBrackets:
EqualsFinishesWithLineBreak: '0'
EqualsStartsOnOwnLine: '0'
KeyStartsOnOwnLine: '0'
mandatoryArguments:
LCuBStartsOnOwnLine: '0'
MandArgBodyStartsOnOwnLine: '0'
RCuBFinishesWithLineBreak: '0'
RCuBStartsOnOwnLine: '0'
namedGroupingBracesBrackets:
NameFinishesWithLineBreak: '0'
NameStartsOnOwnLine: '0'
oneSentencePerLine:
manipulateSentences: '0'
removeSentenceLineBreaks: '1'
sentenceIndent: ''
sentencesBeginWith:
A-Z: '1'
a-z: '0'
other: '0'
sentencesEndWith:
basicFullStop: '0'
betterFullStop: '1'
exclamationMark: '1'
other: '0'
questionMark: '1'
sentencesFollow:
blankLine: '1'
commentOnPreviousLine: '1'
exclamationMark: '1'
fullStop: '1'
other: '0'
par: '1'
questionMark: '1'
rightBrace: '1'
textWrapSentences: '0'
optionalArguments:
LSqBStartsOnOwnLine: '0'
OptArgBodyStartsOnOwnLine: '0'
RSqBFinishesWithLineBreak: '0'
RSqBStartsOnOwnLine: '0'
preserveBlankLines: '1'
removeParagraphLineBreaks:
afterHeading: '0'
alignAtAmpersandTakesPriority: '1'
all: '0'
beforeTextWrap: '0'
environments:
— Sam Finn lsfinn@gmail.com
Thanks for that, Sam. I don't see any differences between yours and mine.
Let's continue to strip this down. Starting with
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
and
modifyLineBreaks:
textWrapOptions:
columns: 75
perCodeBlockBasis: 1
all:
except:
- quotation
- align
logFilePreferences:
showEveryYamlRead: 1
showAmalgamatedSettings: 1
and running
latexindent.pl -m lorem.tex -l sam.yaml -o lorem-out
then I receive
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus
viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
Would you like to try the above and report back?
Hi Chris -
On this we agree:
Lorem-out.tex: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
and indent.log:
logFilePreferences:
showAmalgamatedSettings: '1'
showEveryYamlRead: '1'
modifyLineBreaks:
textWrapOptions:
all:
except:
- quotation
- align
columns: '75'
perCodeBlockBasis: '1'
Amalgamated/overall settings to be used:
---
backupExtension: .bak
commandCodeBlocks:
commandNameSpecial:
-
amalgamate: '1'
- '@ifnextchar\['
roundParenthesesAllowed: '1'
stringsAllowedBetweenArguments:
-
amalgamate: '1'
- node
- at
- to
- decoration
- \+\+
- \-\-
cycleThroughBackUps: '0'
defaultIndent: "\t"
fileContentsEnvironments:
filecontents: '1'
filecontents*: '1'
fileExtensionPreference:
.bib: '4'
.cls: '3'
.sty: '2'
.tex: '1'
fineTuning:
NamedGroupingBracesBrackets:
follow: \h|\R|\{|\[|\$|\)|\(
name: '[0-9\.a-zA-Z@\*><]+?'
UnNamedGroupingBracesBrackets:
follow: \{|\[|,|&|\)|\(|\$
arguments:
before: (?:#\d\h*;?,?\/?)+|\<.*?\>
between: _|\^|\*
commands:
name: '[+a-zA-Z@\*0-9_\:]+?'
environments:
name: '[a-zA-Z@\*0-9_\\]+'
ifElseFi:
name: '@?if[a-zA-Z@]*?'
keyEqualsValuesBracesBrackets:
follow: (?:(?<!\\)\{)|,|(?:(?<!\\)\[)
name: '[a-zA-Z@\*0-9_\/.\h\{\}:\#-]+?'
modifyLineBreaks:
betterFullStop: (?:\.\)(?!\h*[a-z]))|(?:(?<!(?:(?:e\.g)|(?:i\.e)|(?:etc))))\.(?!(?:[a-z]|[A-Z]|\-|~|\,|[0-9]))
comma: ','
doubleBackSlash: \\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])?
indentAfterHeadings:
chapter:
indentAfterThisHeading: '0'
level: '2'
paragraph:
indentAfterThisHeading: '0'
level: '6'
part:
indentAfterThisHeading: '0'
level: '1'
section:
indentAfterThisHeading: '0'
level: '3'
subparagraph:
indentAfterThisHeading: '0'
level: '7'
subsection:
indentAfterThisHeading: '0'
level: '4'
subsection*:
indentAfterThisHeading: '0'
level: '4'
subsubsection:
indentAfterThisHeading: '0'
level: '5'
indentAfterItems:
description: '1'
enumerate: '1'
itemize: '1'
list: '1'
indentPreamble: '0'
indentRules:
anotherenvironment: "\t\t\t\t"
chapter: ' '
item: ' '
myenvironment: "\t\t"
myitem: ' '
section: ' '
indentRulesGlobal:
UnNamedGroupingBracesBrackets: '0'
afterHeading: '0'
commands: '0'
environments: '0'
filecontents: '0'
ifElseFi: '0'
items: '0'
keyEqualsValuesBracesBrackets: '0'
mandatoryArguments: '0'
namedGroupingBracesBrackets: '0'
optionalArguments: '0'
specialBeginEnd: '0'
itemNames:
item: '1'
myitem: '1'
logFilePreferences:
PatternLayout:
default: '%A%n'
trace: '%A%n'
ttrace: '%A%n'
endLogFileWith: '--------------'
showAmalgamatedSettings: '1'
showDecorationFinishCodeBlockTrace: '0'
showDecorationStartCodeBlockTrace: '0'
showEveryYamlRead: '1'
showGitHubInfoFooter: '1'
lookForAlignDelims:
Bmatrix: '1'
Vmatrix: '1'
align: '1'
align*: '1'
alignat: '1'
alignat*: '1'
aligned: '1'
array: '1'
bmatrix: '1'
cases: '1'
dcases: '1'
listabla: '1'
longtable: '1'
matrix: '1'
pmatrix: '1'
tabu: '1'
tabular:
alignDoubleBackSlash: '1'
alignFinalDoubleBackSlash: '0'
alignRowsWithoutMaxDelims: '1'
delimiterJustification: left
delimiterRegEx: (?<!\\)(&)
delims: '1'
dontMeasure: '0'
justification: left
multiColumnGrouping: '0'
spacesAfterAmpersand: '1'
spacesBeforeAmpersand: '1'
spacesBeforeDoubleBackSlash: '1'
tabularx:
delims: '1'
vmatrix: '1'
lookForPreamble:
.bib: '0'
.cls: '0'
.sty: '0'
.tex: '1'
maxNumberOfBackUps: '0'
maximumIndentation: '-1'
modifyLineBreaks:
commands:
CommandNameFinishesWithLineBreak: '0'
CommandStartsOnOwnLine: '0'
condenseMultipleBlankLinesInto: '1'
environments:
BeginStartsOnOwnLine: '0'
BodyStartsOnOwnLine: '0'
EndFinishesWithLineBreak: '0'
EndStartsOnOwnLine: '0'
equation*:
BeginStartsOnOwnLine: '0'
BodyStartsOnOwnLine: '0'
EndFinishesWithLineBreak: '0'
EndStartsOnOwnLine: '0'
ifElseFi:
BodyStartsOnOwnLine: '0'
ElseFinishesWithLineBreak: '0'
ElseStartsOnOwnLine: '0'
FiFinishesWithLineBreak: '0'
FiStartsOnOwnLine: '0'
IfStartsOnOwnLine: '0'
OrFinishesWithLineBreak: '0'
OrStartsOnOwnLine: '0'
ifnum:
BodyStartsOnOwnLine: '0'
ElseFinishesWithLineBreak: '0'
ElseStartsOnOwnLine: '0'
FiFinishesWithLineBreak: '0'
FiStartsOnOwnLine: '0'
IfStartsOnOwnLine: '0'
OrFinishesWithLineBreak: '0'
OrStartsOnOwnLine: '0'
items:
ItemFinishesWithLineBreak: '0'
ItemStartsOnOwnLine: '0'
keyEqualsValuesBracesBrackets:
EqualsFinishesWithLineBreak: '0'
EqualsStartsOnOwnLine: '0'
KeyStartsOnOwnLine: '0'
mandatoryArguments:
LCuBStartsOnOwnLine: '0'
MandArgBodyStartsOnOwnLine: '0'
RCuBFinishesWithLineBreak: '0'
RCuBStartsOnOwnLine: '0'
namedGroupingBracesBrackets:
NameFinishesWithLineBreak: '0'
NameStartsOnOwnLine: '0'
oneSentencePerLine:
manipulateSentences: '0'
removeSentenceLineBreaks: '1'
sentenceIndent: ''
sentencesBeginWith:
A-Z: '1'
a-z: '0'
other: '0'
sentencesEndWith:
basicFullStop: '0'
betterFullStop: '1'
exclamationMark: '1'
other: '0'
questionMark: '1'
sentencesFollow:
blankLine: '1'
commentOnPreviousLine: '1'
exclamationMark: '1'
fullStop: '1'
other: '0'
par: '1'
questionMark: '1'
rightBrace: '1'
textWrapSentences: '0'
optionalArguments:
LSqBStartsOnOwnLine: '0'
OptArgBodyStartsOnOwnLine: '0'
RSqBFinishesWithLineBreak: '0'
RSqBStartsOnOwnLine: '0'
preserveBlankLines: '1'
removeParagraphLineBreaks:
afterHeading: '0'
alignAtAmpersandTakesPriority: '1'
all: '0'
beforeTextWrap: '0'
environments:
quotation: '0'
filecontents: '0'
ifElseFi: '0'
items: '0'
mandatoryArguments: '0'
masterDocument: '0'
optionalArguments: '0'
paragraphsStopAt:
commands: '0'
comments: '0'
environments: '1'
filecontents: '0'
heading: '0'
ifElseFi: '0'
items: '0'
specialBeginEnd: '0'
verbatim: '1'
preamble: '0'
specialBeginEnd: '0'
specialBeginEnd:
SpecialBeginStartsOnOwnLine: '0'
SpecialBodyStartsOnOwnLine: '0'
SpecialEndFinishesWithLineBreak: '0'
SpecialEndStartsOnOwnLine: '0'
textWrapOptions:
afterHeading: '0'
alignAtAmpersandTakesPriority: '1'
all:
except:
- quotation
- align
columns: '75'
environments:
quotation: '0'
filecontents: '0'
ifElseFi: '0'
items: '0'
mandatoryArguments: '0'
masterDocument: '0'
optionalArguments: '0'
perCodeBlockBasis: '1'
preamble: '0'
separator: ''
specialBeginEnd: '0'
verbatim:
VerbatimBeginStartsOnOwnLine: '0'
VerbatimEndFinishesWithLineBreak: '0'
noAdditionalIndent:
comment: '1'
document: '1'
exercises: '1'
foreach: '0'
frame: '0'
mydefinition: '1'
myexample: '1'
mysolution: '1'
problem: '1'
widepage: '1'
noAdditionalIndentGlobal:
UnNamedGroupingBracesBrackets: '0'
afterHeading: '0'
commands: '1'
environments: '0'
filecontents: '0'
ifElseFi: '0'
items: '0'
keyEqualsValuesBracesBrackets: '0'
mandatoryArguments: '0'
namedGroupingBracesBrackets: '0'
optionalArguments: '0'
specialBeginEnd: '0'
noIndentBlock:
cmhtest: '1'
noindent: '1'
onlyOneBackUp: '0'
preambleCommandsBeforeEnvironments: '0'
removeTrailingWhitespace:
afterProcessing: '1'
beforeProcessing: '0'
replacements:
-
amalgamate: '1'
-
lookForThis: '1'
that: pl.latexindent
this: latexindent.pl
when: before
specialBeginEnd:
displayMath:
begin: \\\[
end: \\\]
lookForThis: '1'
displayMathTeX:
begin: \$\$
end: \$\$
lookForThis: '1'
inlineMath:
begin: (?<!\$)(?<!\\)\$(?!\$)
end: (?<!\\)\$(?!\$)
lookForThis: '1'
specialBeforeCommand: '0'
verbatimCommands:
lstinline: '1'
verb: '1'
verbatimEnvironments:
lstlisting: '1'
minted: '1'
verbatim: '1'
INFO: Please direct all communication/issues to: https://github.com/cmhughes/latexindent.pl — Sam Finn lsfinn@gmail.com
On Aug 1, 2020, at 12:54 AM, Chris Hughes notifications@github.com wrote:
Thanks for that, Sam. I don't see any differences between yours and mine.
Let's continue to strip this down. Starting with
lorem-mwe.tex
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu,
and
sam.yaml
modifyLineBreaks: textWrapOptions: columns: 75 perCodeBlockBasis: 1 all: except:
- quotation
- align
logFilePreferences: showEveryYamlRead: 1 showAmalgamatedSettings: 1 and running
latexindent.pl -m lorem.tex -l sam.yaml -o lorem-out then I receive
lorem-out.tex
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus viverra est sed tempor. Suspendisse sapien tellus, suscipit ut enim eu, Would you like to try the above and report back?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/211#issuecomment-667484425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHAVLJ3IRVW2PMJU6EMNLLR6O33JANCNFSM4PHIJBYA.
Hi Sam, Ok, that's good news.
Can you add little bits at a time, building up to your original example to see at which point your output diverges from mine?
Best Chris
Hi Chris,
My original example had the first para broken into a series of short lines, which I expected to be wrapped to the designated column length. Your revision removed the line breaks to form a single long line, which was wrapped. That is the distinction.
Based on this it seems I was wrong in my presumption that text wrapping worked both ways: i.e., always moving line breaks so that successive lines as close to, but less than, columns as possible.
If my new understanding - that text wrapping only addresses lines longer than columns - is correct, then I think we can close this out. If, however, text wrapping should address lines that are both longer and shorter than columns, then we’ll need to continue to track this down.
Let me know - and, thanks!
Sam
— Sam Finn lsfinn@gmail.com
On Aug 1, 2020, at 3:31 PM, Chris Hughes notifications@github.com wrote:
Hi Sam, Ok, that's good news.
Can you add little bits at a time, building up to your original example to see at which point your output diverges from mine?
Best Chris
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/211#issuecomment-667589581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHAVLPKSI6T6EKJNOIJSE3R6SCRVANCNFSM4PHIJBYA.
Hi Sam, Many thanks for this, it's helpful. I'm sorry it has taken so long to get to the bottom of it.
Yes, I think your description is accurate, and is part of the reason why the remove paragraph line break feature exists.
I think a relevant part of the documentation is:
See what you think, and let me know,
All the best Chris
On Mon, 3 Aug 2020, 18:29 Sam Finn, notifications@github.com wrote:
Hi Chris,
My original example had the first para broken into a series of short lines, which I expected to be wrapped to the designated column length. Your revision removed the line breaks to form a single long line, which was wrapped. That is the distinction.
Based on this it seems I was wrong in my presumption that text wrapping worked both ways: i.e., always moving line breaks so that successive lines as close to, but less than, columns as possible.
If my new understanding - that text wrapping only addresses lines longer than columns - is correct, then I think we can close this out. If, however, text wrapping should address lines that are both longer and shorter than columns, then we’ll need to continue to track this down.
Let me know - and, thanks!
Sam
— Sam Finn lsfinn@gmail.com
On Aug 1, 2020, at 3:31 PM, Chris Hughes notifications@github.com wrote:
Hi Sam, Ok, that's good news.
Can you add little bits at a time, building up to your original example to see at which point your output diverges from mine?
Best Chris
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/cmhughes/latexindent.pl/issues/211#issuecomment-667589581>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAHAVLPKSI6T6EKJNOIJSE3R6SCRVANCNFSM4PHIJBYA .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/211#issuecomment-668146285, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYBNBZSXFUAHSVFTK6DR63XXDANCNFSM4PHIJBYA .
latexindent v3.8.2
My goal is to wrap text (one sentence per line), but not the body of environments. My understanding of the docs is that I accomplish this by enabling text wrapping while setting the appropriate environment options to 0, as in
(store instructions in file my.yaml)
Applied to the file lorem.tex,
via
I find that text is continues to wrap in both the quotation and the align environments:
Perhaps mistakenly I expect that the body of the quotation and align environments to be passed unmodified by the wrapping routines.