Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tableAttributes not working correctly #525

Closed
machitgarha opened this issue Nov 10, 2024 · 5 comments · Fixed by #528
Closed

tableAttributes not working correctly #525

machitgarha opened this issue Nov 10, 2024 · 5 comments · Fixed by #528
Assignees
Labels
defaults Related to default option values and renderer prototypes latex Related to the LaTeX interface and implementation
Milestone

Comments

@machitgarha
Copy link

First, thanks for this awesome package.

The following file's table label doesn't get rendered correctly using any of PdfLaTeX, XeLaTeX or LuaLaTeX: https://github.com/Witiko/markdown/blob/80a1a29e8eea660609d994711ce729b30e427310/tests/testfiles/unit/lunamark-markdown/table-attributes.test

@Witiko
Copy link
Owner

Witiko commented Nov 11, 2024

@machitgarha Hi and thanks for using the Markdown package for TeX.

Could you be more specific, please? What are your full example documents, what do you expect to be the output and what is the actual output? Screenshots welcome.

Here my example document example.tex:

\documentclass{article}
\usepackage{markdown}
\markdownSetup {
  pipeTables = true,
  tableCaptions = true,
  tableAttributes = true,
}
\begin{document}
\begin{markdown}
This test ensures that the Lua `tableCaptions` and `tableAttributes` options correctly
propagate through the plain TeX interface.

| Right | *Left* |   Default   | Center |
|------:|:-------|-------------|:------:|
|   12  |   12   |      12     |    12  |
|  123  |   123  |   **123**   |   123  |
|    1  |     1  |       1     |     1  |

  : Demonstration of *pipe table* syntax with the caption spreading over
    multiple lines. {#identifier .class-name key=value}

| Right | *Left* |   Default   | Center |
|------:|:-------|-------------|:------:|
|   12  |   12   |      12     |    12  |
|  123  |   123  |   **123**   |   123  |
|    1  |     1  |       1     |     1  |

  Table: Demonstration of *pipe table* syntax with the caption spreading over
         multiple lines.

A caption may not span multiple paragraphs.
\end{markdown}
\end{document}

Here is the resulting document example.pdf after using the command lualatex example:
image

I don't see anything wrong with it.

If you see a different output in example.pdf, you may be using an outdated version of the Markdown package. Around line 73 in the file example.log, I see the following text:

Package: markdown 2024-11-06 v3.8.1-11-g80a1a29e markdown renderer

What text do you see?

@machitgarha
Copy link
Author

Hi! Sorry, the issue is too vague and missing context.

The problem is, when I want to reference the table, I can't. I.e., when I write "Table <#identifier>", it produces "Table ", not "Table 1". I'm using LuaLaTeX.

@Witiko
Copy link
Owner

Witiko commented Nov 16, 2024

I understand now. We don't really support that at the moment, i.e. the table identifiers produce corresponding TeX macros that TeXnicians can redefine but there is no predefined behavior at the moment. However, we can provide defaults for table identifiers for sure! I will add it to my tasks for this month's release.

In the meantime, if you fancy yourself a TeXnician, you may want to look at the sections Table Attribute Context Renderers and Attribute Renderers of our user manual to see how you might do this for yourself.

@Witiko Witiko self-assigned this Nov 16, 2024
@Witiko Witiko added the defaults Related to default option values and renderer prototypes label Nov 16, 2024
@Witiko Witiko modified the milestones: 3.8.1, 3.9.0 Nov 16, 2024
@Witiko Witiko added the latex Related to the LaTeX interface and implementation label Nov 18, 2024
@Witiko
Copy link
Owner

Witiko commented Nov 18, 2024

@machitgarha: After PR #528, table attributes should work correctly in LaTeX:

\documentclass{article}
\usepackage[
  pipe_tables,
  table_attributes,
  table_captions,
  relative_references,
]{markdown}
\begin{document}
\begin{markdown}

| Right | *Left* |   Default   | Center |
|------:|:-------|-------------|:------:|
|   12  |   12   |      12     |    12  |
|  123  |   123  |   **123**   |   123  |
|    1  |     1  |       1     |     1  |
  : Demonstration of *pipe table* syntax with the caption spreading over
    multiple lines. {#identifier .class-name key=value}

Demonstration of a *relative reference*: See Table <#identifier>.

\end{markdown}
\end{document}

image

PR #528 will be released at the end of November in version 3.9.0 of the Markdown package for TeX.

@machitgarha
Copy link
Author

@Witiko, big thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defaults Related to default option values and renderer prototypes latex Related to the LaTeX interface and implementation
Projects
None yet
2 participants