I'm coming to you because I have a problem when I am redefining commands.
In this case, I'm trying to change the numbering of the mathematical equations. The problem is that a space is added before the "Eq" and before the reference "a" (in bold) as shown below.
I looked on the internet for a solution to this problem. So I have put in "\ignorespaces" but the problem remains...
\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[leqno]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{lipsum}
\usepackage[french]{babel}
\usepackage[showframe]{geometry}
\makeatletter
\renewcommand\theequation{
\ignorespaces\@alph\c@equation
}
\renewcommand\tagform@[1]{
\maketag@@@{
\ignorespaces Eq.~\ignorespaces#1.\unskip\@@italiccorr
}
}
% reference
\renewcommand{\eqref}[1]{
\ignorespaces\ref{#1}
}
\makeatother
\begin{document}
\chapter{First chapter}
\section{Section 1}
\lipsum[1]
\begin{align}
f(x) = x^2 + \frac{1}{\sqrt[3]{x}}
\label{eq1}
\end{align}
\textbf{See equation \ref{eq1}.}
\lipsum[2]
\begin{align}
g(x) = x^3 + \frac{4}{\sqrt{x}}
\label{eq2}
\end{align}
\end{document}
Do you know how to fix it? I'm sure it's a silly solution, but right now it eludes me.