How change the size of font of ticks-label on x axis only

How change the size of font of ticks-label on x axis only.

Example in documentation changes bought of axis (#show lq.selector(lq.tick-label): set text(0.8em)). Adding the .where(kind: "x") resolve in error.

Thank you for responding

Duplicate of How to hide ticks on one axis while preserving labels in Lilaq? - #3 by Andrew, as you can’t currently select one-axis ticks. Both, or none (or create manual ticks). It will be possible eventually.

Duplicate of https://forum.typst.app/t/how-to-hide-ticks-on-one-axis-while-preserving-labels-in-lilaq/4140

Thanks for pointing it out @Andrew!

Hi @MAX2, this is actually possible to achieve and not exactly a duplicate of How to hide ticks on one axis while preserving labels in Lilaq? because it deals with the tick labels and not the ticks themselves.

Due to a necessary optimization, Lilaq does not actually create instances of lq.tick in the general case which is why show rules do not work. This restriction will be lifted in the future and is due to the lack of built-in custom types in Typst.

However, Lilaq does create instances of lq.tick-label for each tick label and the tick label has a kind parameter that can be selected for:

#import "@preview/lilaq:0.5.0" as lq

#show: lq.show_(
  lq.tick-label.with(kind: "x"), 
  it => { set text(2em); it }
)
#lq.diagram()

This special selective show rule is part of the design of elembic and it is just twice mentioned in the Lilaq docs: Working with ticks − Lilaq and Time series − Lilaq . I admit, it’s not quite intuitive and needs to be learned but the alternative would be that it’s just not possible at all.

On the background: Lilaq is designed around the concept of types (or element functions as they are currently still called) that can be subjected to set and show rules. Unfortunately, the available types like heading, figure etc. are all baked directly into the Typst compiler and package developers cannot write their own − yet. The package Elembic makes it possible now to explore the power of custom types through a very clever way (and Lilaq uses it) − the drawback is that set and show rules have a different syntax. Eventually, Typst will natively ship with this feature and we will be able to use standard syntax like show lq.tick-label.where(kind: "x"): set text(2em).

4 Likes

Soo, labels have different kind because there are not many of them with default locator?

Yes. With subticks there are easily 4-5 times as many ticks as labels. With mirrors, we get another factor of 2. Also, show rules can be very useful for tick labels, more than for ticks.

It’s a compromise…

But a temporary one!

1 Like