njpipeorgan / wolfram-language-notebook

Notebook support for Wolfram Language in VS Code
Apache License 2.0
159 stars 11 forks source link

Adjustable column spacing #43

Open userrand opened 1 year ago

userrand commented 1 year ago

Is your feature request related to a problem?

The third option for Column does not seem to work. I suppose this is because TeXForm does not take that option into account. I use Column to read long or dense lists.

Describe the solution you'd like This code roughly mimics the third spacing option and modifies the TeXForm as well by mapping elements to column with "" entries :

(
column[a_,b_:Automatic,c_:0]/; IntegerQ[c] && c>=0 :=
 If[c==0,
    Column[a,b,c],
    Column[a//Map[Column@Prepend[ConstantArray["",c],#]&]
          ,
           b
          ]
 ]
)

The issue is that the third option of Column can also handle non integer values for the third argument. I suppose one might first omit the third option then modify the TexForm output using string manipulations to adjust the spacing. I can look into that if needed.

Question :

Is it possible to add something similar to the output renderer ?