Giter Site home page Giter Site logo

Comments (7)

cmhughes avatar cmhughes commented on June 20, 2024

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.

andy941 avatar andy941 commented on June 20, 2024

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.

cmhughes avatar cmhughes commented on June 20, 2024

from latexindent.pl.

andy941 avatar andy941 commented on June 20, 2024

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.

cmhughes avatar cmhughes commented on June 20, 2024

from latexindent.pl.

andy941 avatar andy941 commented on June 20, 2024

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.

cmhughes avatar cmhughes commented on June 20, 2024

from latexindent.pl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.