Comments (7)
Thanks for this, no trouble at all :)
Have you tried using the m switch, as in
latexindent.pl -m tmp/tmp.tex
See also https://latexindentpl.readthedocs.io/en/latest/sec-the-m-switch.html#lst-tw-bf-myenv1
from latexindent.pl.
Thanks for the quick answer!
I confirm that it works with the -m flag on the minimal example I gave. For some reason it doesn't work when I do the same on a longer, more complicated file. There are special cases.
This is a good example from the thesis I'm writing:
\textit{AP1}'s expression pattern follows \textit{LFY}, but with a slightly
delayed timing~\cite{AlejandraMandel1992}. The loss of function mutant \textit{ap1} forms
a high number of ectopic flowers resulting in an increased inflorescence branching.
Sepals are rarely seen in \textit{ap1} mutants and petals are homeotically
transformed into sepal-like organs, from which, at the axels, new \textit{ap1}
flowers develop displaying the same phenotype~\cite{Mandel1995}. Constitutive expression of
\textit{AP1} under the \textit{CaMV 35S} promoter causes early flowering
shoots, a phenotype that resembles a \textit{tfl1} mutant~\cite{Mandel1995}.
AP1 and LFY act in concert to
promote the floral transition
but interestingly, LFY
promotes TFL1 expression when
AP1 is not present, revealing
another layer of complexity
that is still largely
unfathomed~\cite{Goslin2017}.
In this case I used the command latexindent -m -y="modifyLineBreaks:textWrapOptions:columns:30" nanopore_rnaseq.tex
to get rid of any prblems that may arise from the settings in the yaml config.
The problem seems to be something else, maybe \textit{} is messing up with latexindent? It might recognize the whole block (between the blank lines) as a function and skip indentation?
Should I change something like blocksBeginWith
?
from latexindent.pl.
from latexindent.pl.
Yes I was thinking about that option, just wanted to make sure there wasn't anything easier I was missing. It works well now thanks, it's surprisingly helpful to work with well formatted text (I am a latex newbie).
Thanks for the help!
from latexindent.pl.
from latexindent.pl.
Sure, I was just worried that this would be a very inelegant regex (it has not been "tested"):
modifyLineBreaks:
textWrapOptions:
columns: 79
blocksBeginWith:
other: '\\text[a-z]*\{.*\}'
I wanted to handle all the \text* like \textbf for example, however the * could be substituted with something more specific. There is still the problem that \textit{aaa ... aaa} gets a hard indent (tab) no matter what when the break is inside the {}. I can live with that anyway, it's just nitpicking at that point.
Thanks again, hopefully this can help others in the future.
from latexindent.pl.
from latexindent.pl.
Related Issues (20)
- `CommaFinishesWithLineBreaks` in nested environments HOT 4
- Erroneous Indentation at Paragraph Start and Failure to Wrap First Sentence after `\item` HOT 3
- Add linebreak after `\par` HOT 2
- Could latexindent.pl provide appropriate spaces and text wraps before or after math operators? (sounds like many formatters doing for Python or C language) HOT 3
- Indentation in tabular* HOT 3
- Contextual `sentencesBeginWith`, semicolons, lowercase and `\paragraph` HOT 2
- Unknown error "���" HOT 21
- [Feature] More friendly support for CJK words (characters) HOT 18
- [latexindent.exe] -GCString switch cannot run normally HOT 2
- Exclude `table` and `tabular` from indentation HOT 3
- Feature Request: Support spreadtab block HOT 4
- can't run it, neither after `tlmgr` nor as a Perl script HOT 4
- Error "Can't open file" when using `-g` key with nontrivial path HOT 3
- [windows] conda installation fail due to perl version HOT 6
- Format tabular for fullwidth fonts HOT 2
- [Bug] Incorrect indentation amount when have a long config with tabualrray package HOT 4
- Can't find string terminator '"' error - bug? HOT 7
- the future of multirows in _tabularray_ package would let latexindent format the code incorrectly HOT 8
- Indenting of tikz arrow specification HOT 4
- Incorrect encoding (possiblely due to #505) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from latexindent.pl.