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

Double-stroked lines #37

Open
s-henao-castellanos opened this issue Aug 7, 2023 · 3 comments
Open

Double-stroked lines #37

s-henao-castellanos opened this issue Aug 7, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@s-henao-castellanos
Copy link

(This is not a bug, so I don't know if this is the place for feature requests. My apologies if it isn't)

In LaTeX, when one writes together several\hlines, a multiple stroked line is created. On some journal style I was trying to reproduce on typst, a double stroke is used to denote the end of the header column of the tables. Here's a minimal example:

\begin{tabular}{c|cc}
    A & B & C \\\hline\hline 
    a & b & c \\ 
    1 & 2 & 3
\end{tabular}

I was wondering if that was possible to do with tablex, as it is not possible with typst's plain #table.

I tried (...),hlinex(),hlinex(),(...) to no avail. The creation of an empty row, such as hlinex(),[],[],[],hlinex() for a 3 column table, is the only workaround I've found, but the two lines are spaced according to the inset:

#tablex(
  columns: 3,
  row-gutter: (0pt,10pt,0pt),
  auto-lines: false,
  (),vlinex(),(),
  [A],[B],[C],
  hlinex(),
  [],[],[],
  hlinex(),
  [a],[b],[c],
  [1],[2],[3]
)

which is less than desirable.

So, is this possible to do with the current tablex implementation? Or is it planned as addition in a future release?

@PgBiel
Copy link
Owner

PgBiel commented Aug 7, 2023

Hi! This is indeed not possible yet, but is planned. (Can't say I can give you a time estimate, however, unfortunately.)

I'm not sure if that would work, but, regarding your workaround of adding an empty row, you could maybe try to change the inset of the cells inside it (though that doesn't always work very well).

@PgBiel PgBiel added the enhancement New feature or request label Aug 7, 2023
@PgBiel PgBiel added this to the v0.2.0 or later milestone Aug 12, 2023
@Andrew15-5
Copy link

Andrew15-5 commented Sep 18, 2023

I've tried using block for outer 2nd stroke, and it only works without repeating the headers (they disappear), which is fine for someone/some tables. I've tried nesting in table instead, and it works the same way, but the bottom stroke can be at a different inset. Nesting in tablex doesn't break long table. I want to try the empty row method.

Update:
No, I couldn't do it. I can't "unstroke" vertical strokes in an empty row (I think I can draw a background color stroke, but this would be even more ugly). I also couldn't add vertical strokes to all rows except 1st.

@tonyddg
Copy link

tonyddg commented Sep 11, 2024

I tried to create a multiple stroked line by an empty colspanx occupied a whole row with a given height. My attempt seemed to be worked:

#tablex(
	columns: 3, 
	rows: (auto, ) + (2pt, ) + (auto, ) * 2, 
	auto-lines: false,

	(), vlinex(), (),
	[A], [B], [C], 
	
        // a double stroked
	hlinex(),
	colspanx(3)[], 
	hlinex(),

	[a], [b], [c],
	[1], [2], [3]
)

Snipaste_2024-09-11_15-13-12

Here is another example:

#tablex(
	columns: 6, 
	rows: (2pt, ) + (auto, ) * 4 + (2pt, ), 
	auto-vlines: false, auto-hlines: false, 
	align: center + horizon,

	hlinex(),
	colspanx(6)[],
	hlinex(),

	colspanx(2)[Symbol], [Value], colspanx(2)[Symbol], [Value],	
	hlinex(), 
	rowspanx(3)[Damping\ $(N dot m"/"s)$], 
	[$c_(1,2)$], [35], 
	rowspanx(3)[Stiffness\ $(N dot m)$], 
	[$k_(1,2)$], [63.66], 
	(), [$c_(3,4)$], [15], (), [$k_(3,4)$], [79.57], 
	(), [$c_(5,6)$], [3], (), [$k_(5,6)$], [33.66], 

	hlinex(),
	colspanx(6)[],
	hlinex(),
)

Snipaste_2024-09-11_15-30-32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants