Skip to content

Show rules specifically for math symbols #254

Open

Description

@ModProg

I was wondering if I could somehow alias * to dot.c.

First, I tried doing it through #show "*": [#sym.dot.c], but that doesn't affect math mode AFAICT.

My second attempt used #let dd = symbol("·") which does work, but only allows me to use dd as an alias for dot.c, but symbol doesn't currently allow setting a custom shorthand.

While both changes would fix this for me, I think they individually provide enough advantages to warrant implementing both of them.

I.e. some way to create a math scoped #show (e.g. #show.math or something like that) and allowing to add a custom shorthand to symbol, not sure how that syntax would work, maybe just as a named parameter.

Activity

  1. owiecc commented on Mar 24, 2023

    @owiecc
    SponsorContributor

    Why not put the · directly in the equation instead of dot.c?

  2. ModProg commented on Mar 24, 2023

    @ModProg
    ContributorAuthor

    Why not put the · directly in the equation instead of dot.c?

    well because I want something that I can type on a standard keyboard.

  3. added
    feature request
    math
    syntax
    styling
    on Apr 1, 2023
  4. user202729 commented on Jul 19, 2023

    @user202729
    Contributor
    #show math.ast: math.dot.c
    $a * b$
    

    (addressed in #1051)

    Consider this solved then. You just need to figure out what's the "full name" of the symbol.

  5. lukasjuhrich commented on May 21, 2024

    @lukasjuhrich

    Consider this solved then. You just need to figure out what's the "full name" of the symbol.

    This issue is not solved, at least not in the way #4137 intended it – show rules intened for math mode also apply to normal mode.

    edit: I now understand that putting such a symbol replacement show rule only inside a second show math.equation:… show rule provides a workaround; so technically typst can do this already. I think communicating this pattern in the docs might be a good idea.

  6. changed the title [-]Show in math mode and symbol with custom shorthand[/-] [+]Show rules specifically for math symbols[/+] on Jul 15, 2024
  7. wmstack commented on Nov 2, 2024

    @wmstack

    Is there a way to create a show rule for a series of math symbols? For example, I wanted to convert three * (or ast) into a single dots.c in a math equation. It doesn't seem to be working and I haven't found a way to make it work.

    This is not a big deal, but I thought there was a straightforward way to do it.

  8. wrzian commented on Nov 2, 2024

    @wrzian
    Contributor
  9. added a commit that references this issue on Dec 23, 2024
    d333467
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestmathstylingsyntax

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions