Exploring TeXmacs Tables

Hello again,

Over the past couple of days, I’ve been playing with TeXmacs, and I must say, it’s an incredibly powerful tool and it is very user-friendly.

However, I’ve encountered a question that I couldn’t find a direct answer to in the documentation. Specifically, I’m curious about whether TeXmacs offers an analogous feature to TeX’s side tables. You know, those vertical tables that can be quite handy for certain layouts.

here is Side Table Illustration

If anyone has insights or tips on creating similar side tables in TeXmacs, I’d greatly appreciate your guidance.

Best

You can use <rotate|90|AAAA>

Where 90 is the rotation parameter in grades and AAAA is the typographical material (in your case the tabular).

I have tried to attach a minimal example (rotate-table.tm) but it seems it is not possible to upload a .tm files (sub-optimal for a forum about TeXmacs).
So I have included it below.

<TeXmacs|2.1.2>

<style|generic>

<\body>
  <\hide-preamble>
    \;

    <assign|mysnake|<macro|<math|<superpose|\||<shift|\<sim\>|.1em|>>>>>\ 

    <assign|rnake|<macro|<math|<resizebox|!|<heightof|<gate>>|<TurnWavy>>>>>

    <assign|snake1|<macro|<math|<syntax|<superpose|\||<shift|\<sim\>|.1em|>>|\<less\>>>>>

    <assign|snake2|<macro|<math|<move|<with|vmagnified-factor|0.76|hmagnified-factor|0.76|<hmagnified|<vmagnified|<syntax|<superpose|\||<shift|\<sim\>|.1em|>>|\<less\>>>>>||.18em>>>>

    <assign|snake3|<macro|<math|<syntax|<move|<with|vmagnified-factor|0.76|hmagnified-factor|0.76|<hmagnified|<vmagnified|<superpose|\||<shift|\<sim\>|.1em|>>>>>||.18em>|\<less\>>>>>

    <assign|snake4|<macro|<math|<math-relation|<move|<with|vmagnified-factor|0.76|hmagnified-factor|0.76|<hmagnified|<vmagnified|<superpose|\||<shift|\<sim\>|.1em|>>>>>||.18em>>>>>

    <assign|snake5|<macro|<math|<math-relation|<move|<with|vmagnified-factor|0.76|hmagnified-factor|0.76|<hmagnified|<vmagnified|<superpose|\||<shift|\<sim\>|.1em|>>>>>||.18em>>>>>

    <assign|snake6|<macro|<math|<math-relation|<move|<superpose|<clipped|\<vdash\>|||0.1em|>|<shift|\<sim\>|.04em|.1em>>||0em>>>>>

    <assign|snake7|<macro|<math|<math-relation|<move|<superpose|<clipped|\<vdash\>|||0.1em|>|<shift|<with|hmagnified-factor|0.8|<hmagnified|\<sim\>>>|.04em|.1em>>||0em>>>>>

    <assign|snake|<macro|<math|<math-relation|<superpose|<clipped|\<vdash\>|||0.1em|>|<shift|<with|hmagnified-factor|0.8|<hmagnified|\<sim\>>>|.04em|.1em>>>>>>
  </hide-preamble>

  <section*|Rotate table example>

  <tabular|<tformat|<cwith|1|1|1|-1|cell-tborder|0ln>|<cwith|1|1|1|-1|cell-bborder|1ln>|<cwith|2|2|1|-1|cell-tborder|1ln>|<cwith|1|1|1|1|cell-lborder|0ln>|<cwith|1|1|4|4|cell-rborder|0ln>|<table|<row|<cell|<strong|Column
  1>>|<cell|<strong|Column 2>>|<cell|<strong|Column 3>>|<cell|<strong|Column
  4>>>|<row|<cell|aaaa>|<cell|bbbb>|<cell|cccc>|<cell|dddd>>|<row|<cell|aaaa>|<cell|bbbb>|<cell|cccc>|<cell|dddd>>>>>

  \;

  <rotate|90|aaaa><space|24em><space|5em><rotate|90|<tabular|<tformat|<cwith|1|1|1|-1|cell-tborder|0ln>|<cwith|1|1|1|-1|cell-bborder|1ln>|<cwith|2|2|1|-1|cell-tborder|1ln>|<cwith|1|1|1|1|cell-lborder|0ln>|<cwith|1|1|4|4|cell-rborder|0ln>|<table|<row|<cell|<strong|Column
  1>>|<cell|<strong|Column 2>>|<cell|<strong|Column 3>>|<cell|<strong|Column
  4>>>|<row|<cell|aaaa>|<cell|bbbb>|<cell|cccc>|<cell|dddd>>|<row|<cell|aaaa>|<cell|bbbb>|<cell|cccc>|<cell|dddd>>>>>>

  \;

  <tformat|<table|<row|<cell|>|<cell|>|<cell|>>>>
</body>

<\initial>
  <\collection>
    <associate|info-flag|minimal>
    <associate|page-medium|paper>
    <associate|page-packet|1>
    <associate|par-mode|justify>
    <associate|preamble|false>
  </collection>
</initial>

<\references>
  <\collection>
    <associate|auto-1|<tuple|?|1|snake.tm>>
  </collection>
</references>

<\auxiliary>
  <\collection>
    <\associate|toc>
      <vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|Rotate
      table example> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
      <no-break><pageref|auto-1><vspace|0.5fn>
    </associate>
  </collection>
</auxiliary>
1 Like

Dear @Aigor,

I am immensely grateful for your assistance and the provided code. Please pardon me, but I have two additional questions:

  1. Can a table with a caption instead of a tabular environment be used?
  2. As I am relatively new to TeXmacs, I must understand how to utilize the provided code. Should I incorporate it into the style ts. file or insert it at the location where I want this vertical table?

Your help is greatly appreciated. After several years of using LaTeX, I find TeXmacs a fantastic tool.

To use the example you can cut and paste all the text in the above blockquote, save it to rotate-table.tm and then open that file with TeXmacs.
When you open it with TeXmacs it looks like this


If you are on Windows with meta-alt-S (meta is the windows key) you can switch to the source view that look like this.

The rotate command is available in the menu as Format | Transform | Rotate
If you want to use via the GUI you have to select the table and then select Format | Transform | Rotate from the menu.
As far as I know the rotate command can be used with any material.

Hi @Aigor,

Thank you for your feedback!
Indeed, it is possible to rotate a table. However, it seems to me that there’s a limitation: if I rotate the table by 90 degrees or more, the individual cells become uneditable. I can still select the entire table, but editing individual cells becomes tricky. To work around this, one must make sure to format the table before applying any rotation.

Thank you once again for helping out! :blush: