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

syntax conceal for spacing commands #2594

Closed
pburger24 opened this issue Dec 4, 2022 · 9 comments
Closed

syntax conceal for spacing commands #2594

pburger24 opened this issue Dec 4, 2022 · 9 comments

Comments

@pburger24
Copy link

request to apply the syntax conceal feature to LaTeX spacing commands such as \quad, \qquad, \,, \thinspace, \:, medspace, ;, \thickspace, \!, \bigskip, \vskip, \vspace, \hspace, \vfill, \hfill

@lervag
Copy link
Owner

lervag commented Dec 4, 2022

This is more or less already supported. There are probably some exceptions, but at least \quad and \, and similar should already work. The following are not implemented now:

  • \thinspace
  • \medspace
  • \thickspace
  • \bigskip
  • \vskip
  • \vspace
  • \hspace
  • \vfill
  • \hfill

I could add these, but before I properly consider it, please help me by categorizing the commands:

  1. Do they work in math or normal mode?
  2. Are they part of the "core", or do they come from a specific package?

@pburger24
Copy link
Author

u mean like do they come from a latex package?
\\: , \\medspace, \\;, \\thickspace, \! all come from amsmath

@pburger24
Copy link
Author

the reset r not from a package

@pburger24
Copy link
Author

i haven't noticed , working or \quad, and i just fetched

@lervag
Copy link
Owner

lervag commented Dec 6, 2022

I'm sorry, but could you please write in full sentences? I do not understand what you write in the last comment.

Proof that the conceals work as expected for some of these:

image

Here you see that \quad and many of the other symbols are concealed (on the right-hand side). The left-hand side has set conceallevel=0. However, \medspace, \thickspace and similar are not concealed yet.

In any case, I've investigated and reached the following conclusion:

  1. I will not add conceals for the vertical variants. These are more important in a context and should not be concealed (IMHO).
  2. I will implement support for the other variants. It is true that amsmath does provide some of these, but only in the sense that it improves them. The following minimal example compiles and works as expected without loading amsmath:
\documentclass{minimal}
\begin{document}

Hello
\thinspace
\medspace
\thickspace
\bigskip
\hspace{1em}
\hfill
\vspace{1em}
\vfill
Moon

1 \, \: \; \! \quad \qquad 2

$ 1 \, \: \; \! \quad \qquad 2 $

$
Hello
\thinspace
\medspace
\thickspace
\bigskip
\hspace{1em}
\hfill
\vspace{1em}
Moon
$

\end{document}

Some of this, as mentioned before, already works. But I'll implement the missing parts as well.

lervag added a commit that referenced this issue Dec 6, 2022
@lervag
Copy link
Owner

lervag commented Dec 6, 2022

Done. It should work as expected now, I believe.

@pburger24
Copy link
Author

after fetching, it still didn't conceal , or \quad , it just highlighted them.

@lervag
Copy link
Owner

lervag commented Dec 7, 2022

Then that's because you have some issue with your configuration.

@lervag
Copy link
Owner

lervag commented Dec 7, 2022

To be clear: Please provide details on your system. There's a template for posting issues and it's there for a reason :)

@lervag lervag closed this as completed Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants