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

varioref: Get rid of the trailing space if \reftextfaceafter (and friends) is made empty #1622

Open
dbitouze opened this issue Jan 13, 2025 · 2 comments
Assignees
Labels
bug (improve documentation) nothing really wrong but documentation could be better category tools fixed in dev Fixed in development branch, not in stable release works as designed

Comments

@dbitouze
Copy link
Contributor

dbitouze commented Jan 13, 2025

Brief outline of the enhancement

It would be nice for varioref to get rid of the trailing space if \reftextfaceafter (and friends) is made empty.

Minimal example showing the current behaviour

\RequirePackage{latexbug}
\documentclass[twoside]{article}
\usepackage{varioref}
\usepackage{lipsum}

\begin{document}
\lipsum[1-6]

\textbf{See figure~\vref{myfigure}.}

\def\reftextfaceafter {}

\textbf{See figure~\vref{myfigure}.}

\lipsum[1-6]

\begin{figure}[ht]
  \centering
  \caption{This is a figure}
  \label{myfigure}
\end{figure}
\end{document}

image

@FrankMittelbach
Copy link
Member

I think it is a bit pointless to use varioref and then set the varying part to empty, why would you want to do that?
Besides, if you want to support that for \reftextafter you would need to do that for each and every other \reftext... variable which means a lot of testing on each occation without much benefit.

What I'm prepared to do is, I guess, to document that instead of empty you need to get rid of that space by doing

\def\reftextfaceafter {\unskip}

@FrankMittelbach FrankMittelbach added works as designed bug (improve documentation) nothing really wrong but documentation could be better category tools labels Jan 13, 2025
@FrankMittelbach FrankMittelbach self-assigned this Jan 13, 2025
FrankMittelbach added a commit that referenced this issue Jan 13, 2025
@github-project-automation github-project-automation bot moved this to Pool (unscheduled issues) in upcoming LaTeX2e releases Jan 13, 2025
@FrankMittelbach FrankMittelbach added this to the Release 2025 Spring milestone Jan 13, 2025
@FrankMittelbach FrankMittelbach moved this from Pool (unscheduled issues) to Done in dev in upcoming LaTeX2e releases Jan 13, 2025
@dbitouze
Copy link
Contributor Author

I think it is a bit pointless to use varioref and then set the varying part to empty, why would you want to do that?

Sorry, I should have explained the context: I want to do that because an editor requires the class I'm creating for him to not display the reference text for the references that are visible on the current double page. So I need to make empty \reftextfaceafter, \reftextfacebefore, \reftextcurrent (and only them).

\def\reftextfaceafter {\unskip}

does the trick: thanks!

FrankMittelbach added a commit that referenced this issue Jan 14, 2025
* fix for #1622

* updates after review
@FrankMittelbach FrankMittelbach added the fixed in dev Fixed in development branch, not in stable release label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (improve documentation) nothing really wrong but documentation could be better category tools fixed in dev Fixed in development branch, not in stable release works as designed
Projects
Status: Done in dev
Development

No branches or pull requests

2 participants