minad / org-modern

:unicorn: Modern Org Style
GNU General Public License v3.0
1.54k stars 48 forks source link

Alignment Issue with Single-Digit Footnotes in Org Tables using Org Modern Mode #170

Closed YorkZ closed 9 months ago

YorkZ commented 9 months ago

Description:

Hello org-modern-mode team,

I’ve encountered an alignment issue in Org tables when using single-digit footnotes within org-modern-mode. While double-digit footnotes (e.g., [fn:10]) align correctly in the table, single-digit footnotes (e.g., [fn:1]) do not align properly, causing a visual inconsistency in the table layout.

Steps to Reproduce:

  1. Create an Org file with an Org table.
  2. Insert a single-digit footnote reference (e.g., [fn:1]) in one of the table cells.
  3. Insert a double-digit footnote reference (e.g., [fn:10]) in another cell of the same table.
  4. Enable org-modern-mode.
  5. Observe the alignment of the footnote references within the table.

Expected Behavior: Both single-digit and double-digit footnotes should align consistently in the Org table, maintaining a uniform table appearance.

Actual Behavior: Single-digit footnotes do not align the same way as double-digit footnotes, leading to a misaligned appearance in the Org table.

Environment:

Thank you for looking into this issue. I appreciate your efforts in maintaining and improving org-modern-mode.

minad commented 9 months ago

Expected Behavior: Both single-digit and double-digit footnotes should align consistently in the Org table, maintaining a uniform table appearance.

This is a duplicate of #5.

If footnotes in tables create problems for you, the footnote styling can be disabled by setting org-modern-footnote to nil.

YorkZ commented 9 months ago

Hello @minad ,

Thank you for directing me to the existing issue #5. I have reviewed the discussion and appreciate the insights shared there. However, I’d like to clarify a key aspect of my issue to ensure we’re on the same page.

In my case, I am using a fixed-pitch font for Org tables, not a variable-pitch font as discussed in the thread. Despite using a fixed-pitch font, I am experiencing alignment issues with single-digit footnotes in Org tables, where they do not align properly compared to double-digit footnotes. This misalignment occurs even though the fixed-pitch font should theoretically ensure consistent character widths and alignment.

Given this context, I am curious if there might be a different solution or workaround applicable to my scenario, where the focus is on alignment issues in Org tables with fixed-pitch fonts under org-modern-mode.

I appreciate any further insights or suggestions you might have regarding this specific setup. Thank you for your time and for your continued work on maintaining and enhancing org-modern-mode.

Best regards,

York

minad commented 9 months ago

Most of the org-modern styling does not preserve alignment. This is also not a goal since it will greatly limit the styling possibilities. As a result, if one uses certain styled syntax elements inside a table, the table will be misaligned.

There these possible solutions:

  1. Disable styling of problematic elements in your configuration, e.g., set org-modern-footnote=nil.
  2. Add support for not styling certain elements inside tables to org-modern.
  3. Add support for pixel precise table alignment to org-modern.
  4. Ensure that org-modern styling preserves alignment.