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

Add map of \mu to \psdmapshortnames #90

Closed
wants to merge 2 commits into from
Closed

Add map of \mu to \psdmapshortnames #90

wants to merge 2 commits into from

Conversation

muzimuzhi
Copy link
Contributor

@muzimuzhi muzimuzhi commented Apr 24, 2019

Currently, hyperref

  • provides text command \textmugreek, and then
  • relates it to math symbol \mugreek in psdextra option

But actually, there is not any command named \mugreek, neither in LaTeX2e kernel and amsmath bundle, nor in The Comprehensive LaTeX Symbol List. Therefore I suppose it is a typo.

This typo causes problems when you use

\documentclass{article}
\usepackage[unicode,psdextra]{hyperref}
\usepackage{unicode-math}

\begin{document}
\section{$\lambda$} % all right
\section{$\mu$}     % "Improper alphabetic constant" error
\end{document}

even you have set up hyperref according to this answer on tex.sx.


Hence this pull request is an attempt to fix this.

@u-fischer
Copy link
Member

There are two "mu" in unicode: the micro symbol in U+00B5 and the greek mu in U+03B6.

The naming and use in latex is a bit messy, but in general \mu/\textmu is used for the first, while \textmugreek is used in hyperref and also the textgreek package for the second.

So renaming the command or removing \textmugreek is imho not a good idea. To avoid your error it is enough to add a mapping \mu to \textmu in \psdmapshortnames:

\documentclass{article}
\usepackage{unicode-math}
\usepackage[unicode,psdextra]{hyperref}

\usepackage{etoolbox}
\apptocmd{\psdmapshortnames}{\let\mu\textmu}{}{\fail}

\begin{document}
\section{$\mu$}
\end{document}

@muzimuzhi
Copy link
Contributor Author

Sorry for my rudeness

So sorry. This pull request is lack of consideration and hence is somewhat rude.

The main object of this pr is, to let hyperref cover full greek alphabet frequently used in math mode. I thought it was a "typo" before, since it seems \textmu is the only missing one, and \textmugreek the paired redundant one.

My understanding of two "mu"

I understand why hyperref picks \textmugreek since

  • textcomp package uses \textmu to denote the first mu, "micro sign" (U+00B5)
  • textgreek packages uses \textmu to denote the second mu, "greek small letter mu" (U+03BC), if only textcomp is not loaded, and uses \textmugreek to denote the second mu all the time
  • hence, to reduce the ambiguity of which mu does \textmu represent, hyperref picks \textmugreek instead of the shorter \textmu

My object and question

But a variant of my original object is still there: is it reasonable for hyperref to support auto-mapping \mu in its \psdmapshortnames list?

Currently,
https://github.com/ho-tex/hyperref/blob/fcacdf4e712a6728a7567d65bea3867f05ce3d40/hyperref.dtx#L26579
seems the only mapping involving "mu". To complete my object (if it is reasonable), should this pr change that line to \let\mu\textmugreek, or just add a newline and leave the existed line un-touched? Since

  • \mu is the (most) frequently-used command when latex users want a second "mu" in math mode, and
  • \mugreek is seldom defined by packages, hence the current mapping is seldom used.

@u-fischer
Copy link
Member

I didn't found the request rude. Imho you are quite right, that there is a definition for \mu missing. \let\mu\textmu should be added to \psdmapshortnames. If you change the pull request to do only this I can merge it, or I can do it directly.

@muzimuzhi
Copy link
Contributor Author

muzimuzhi commented Apr 25, 2019

Pull request updated.

Note: Changelog.txt is not touched.

PS: Maybe opening an issue is more polite than a direct pull request, this is why I think it "rude".

@muzimuzhi muzimuzhi changed the title fix typo, rename \(text)mugreek to \(text)mu Add map of \mu to \psdmapshortnames Apr 25, 2019
u-fischer added a commit that referenced this pull request Apr 27, 2019
u-fischer added a commit that referenced this pull request Apr 27, 2019
@u-fischer
Copy link
Member

I added the line manually (along with some other changes), it will be in the next hyperref version.

@u-fischer u-fischer closed this Apr 27, 2019
@muzimuzhi
Copy link
Contributor Author

Thanks.

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

Successfully merging this pull request may close these issues.

None yet

2 participants