Git Product home page Git Product logo

texstudio-macro's Introduction

texstudio-macro

repository for txs macros

texstudio-macro's People

Contributors

abelokoj-github avatar dbitouze avatar junoslukan avatar meansquarederror avatar octaeder avatar sunderme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

texstudio-macro's Issues

Autolabel does not link words correctly

The script that is supposed to produce automatic labels does not work with multiple-word titles.

Expected result:

\section{Title with words}\label{sec:title-with-words}

Actual result:

\section{Title with words}\label{sec:title -ith -ords}

with macro "Auto-correct multiple capital letters" active multi cursors add text to first cursor only

Environment

  • TeXstudio: 4.5.1 and current dev git 4.5.1-92-g9c430267d
  • Qt: 6.4.2
  • OS: Win10
  • TeX distribution: miktex

Expected behavior

Text entered is inserted at all of the multi cursors

Actual behavior

Text is only entered at the first multi cursor

How to reproduce

Load Macro "Auto-correct multiple capital letters" from macro repository
Create an new document (quick start wiz), a simple two liner is sufficient

\begin{equation*}
    \frac{1+1+1+1+1+1+1+1+1+1}
    {\frac{1+1+1+1+1+1+1+1+1}
    {\frac{1+1+1+1+1+1+1+1}
    {\frac{+1+1+1+1+1+1}
    {\frac{1+1+1+1+1+1}
    {\frac{1+1+1+1+1}
    {\frac{1+1+1+1}
    {\frac{1+1+1}
    {\frac{1+1}
    {1}}}}}}}}}
\end{equation*}

As an example add multi cursors before each but the first frac to change frac to dfrac. Enter d (use strg+alt+cursorDownArrow):

multicursors

autoLabel.txsMacro doens't work anymore

The issue is linked to texstudio-org/texstudio#2728.
The new perl regex compatible engine (QRegularExpression) thinks that the trigger regex expression is faulty: "lookbehind assertion is not fixed length".

Furthermore, line 19

 "title = title.toLowerCase().match(/\w+/g).join(\"-\");",

should be

 "title = title.toLowerCase().match(/\\w+/g).join(\"-\");",

ie with \\w, not \w.

Macro "Transpose Cursor and Anchor Positions" fails sometimes

Assume cursor is positioned right before aaa in the following example. Then cursor is moved down one line. So we see that the text from aaa to eee is selected (including):

Example:
Some text aaa more text
eee

But macro "Transpose Cursor and Anchor Positions" fails. The reason is that the macro wants to move the cursor to the right in the second line. But the line is not long enough.

Toggle between {...} and [...] doesn't account for nested brackets.

I was using the Toggle between macro, and I realised that, if you use brackets more than one time: e.g. forallin[v]{A_{2}} -> forallin[v][A_{2]}, it doesn't account for them. Maybe it could be helped with an loop here:

rightEnd = line.indexOf( rightChar, leftEnd);

rightEnd = leftEnd
leftPivot = leftEnd
do {
leftPivot = line.indexOf(leftChar, leftPivot+1);
rightEnd = line.indexOf(rightChar, rightEnd+1);
} while (leftPivot > -1 && leftPivot < rightEnd)

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.