Coder Social home page Coder Social logo

Comments (4)

Lev135 avatar Lev135 commented on September 1, 2024

Это пока только набросок. Надо посмотреть, какие вообще взаимосвязи существуют на примерах в TeX'е

from finetex.

Lev135 avatar Lev135 commented on September 1, 2024

Есть такая проблема с математическими окружениями:

  > a + b &= c
  > d &= e + f

должно транслироваться (и транслируется сейчас) в

\begin{align*}
a + b &= c \\
d &= e + f
\end{align*}

В то же время для нумерованных формул

  | 1 > a + b &= c
  | 2 > d &= e + f

In equation $ref 1 we can see...
\begin{align}
\label{_gr_1} a + b &= c \\
\label{_gr_2} d &= e + f
\end{align}

In equation \ref{_gr_1} we can see...

Существуют различные способы группировки нумерации

  | 1 > a + b &= c
      > d &= e + f
  | 2 > q &= p - 2
\begin{align}
\label{_gr_1}
\begin{split}
a + b &= c \\
d &= e + f
\end{split}\\
\label{_gr_2}
g &= p - 2
\end{align}

Есть предположение, что всё-таки придётся такие вещи встраивать в язык. Слишком уж сложные тут связи

from finetex.

Lev135 avatar Lev135 commented on September 1, 2024

Можно выбрать такой синтаксис

  | 1 >> a + b &= c
  | 2 >> d &= e + f

In equation $ref 1 we can see...
  | 1 >> a + b &= c
       > d &= e + f
  | 2 >> q &= p - 2

И описать его как

> = @TexBeginEnd align* @Sep \\ @InnerMath
(lbl : Ident) > = @TexBeginEnd align @Pref \label{${"_gr_" ++ lbl}} @Sep \\ @InnerMath
> = @TexBeginEnd split @Sep \\ @InMath

Единственное противоречие с существующим синтаксисом -- то, что по текущим нормам после префикса должен идти пробел. Но так уж совсем не очень получается:

  | 1 > > a + b &= c
        > d &= e + f
  | 2 > > q &= p - 2

from finetex.

Lev135 avatar Lev135 commented on September 1, 2024

Более полный вариант предполагаемого синтаксиса:

> | @Unique = @Begin \[ @End \]            @InnerMath
  | @Group  = @TexBeginEnd align* @Sep \\  @InnerMath

(lbl : Ident) > | @Unique = @TexBeginEnd equation      @Pref \label{${"_gr_" ++ lbl}} @InnerMath
                | @Group  = @TexBeginEnd align @Sep \\ @Pref \label{${"_gr_" ++ lbl}} @InnerMath

> | @Unique @InMath = @Begin "" @End "" 
  | @Group  @InMath = @TexBeginEnd split @Sep \\ @InnerMath

Он позволит транслировать

1 >> a + b &= c
   > d &= e + f
2 >> e &= g
3 >> h &= k

в

\begin{align}
\label{_gr_1}
\begin{split}
a + b &= c \\
d &= e + f
\end{split}\\
\label{_gr_2}
e &= g \\
\label{_gr_3}
h &= k
\end{align}

избегая лишних split, которые сделают генерируемый код совсем уж перегруженным

from finetex.

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.