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 formatting tool #23

Closed
tdegeus opened this issue Mar 2, 2022 · 1 comment
Closed

Add formatting tool #23

tdegeus opened this issue Mar 2, 2022 · 1 comment

Comments

@tdegeus
Copy link
Owner

tdegeus commented Mar 2, 2022

It would be good to have a formatting tool that can:

Ensure label formatting (DONE!)

I.e. enforce labels starting with eq:, fig:, tab:. For example:

\begin{equation}
\label{4}
...
\end{equation}
See \cref{4}

should be changed to

\begin{equation}
\label{eq:4}
...
\end{equation}
See \cref{eq:4}

Ensure label numbering

In the case that labels are simply the float number, the formatting can ensure that the right number is used. For example

\begin{equation}
\label{eq:4}
...
\end{equation}
...
\begin{equation}
\label{eq:2}
...
\end{equation}
See \cref{eq:4}

should be changed to

\begin{equation}
\label{eq:1}
...
\end{equation}
...
\begin{equation}
\label{eq:2}
...
\end{equation}
See \cref{eq:1}

Ensure cleveref (DONE!)

Rename:

  • Fig.~\ref{mylabel}
  • Fig. \ref{mylabel}
  • Figure \ref{mylabel}
  • Figure~\ref{mylabel}
  • Tab.~\ref{mylabel}
  • Tab. \ref{mylabel}
  • Table \ref{mylabel}
  • Table~\ref{mylabel}
  • Eq.~\ref{mylabel}
  • Eq. \ref{mylabel}
  • Equation \ref{mylabel}
  • Equation~\ref{mylabel}

to

\cref{mylabel}

Something clever should be considered for

  • Eqs.~\eqref{a}, \eqref{b}, and \eqref{c}: can be formatted
  • Eq.~(\ref{a}--\ref{c}): can be formatted, or should throw a warning

(Languages should be considered)

@tdegeus
Copy link
Owner Author

tdegeus commented Mar 11, 2022

Mostly done, still remaining: #32 and #31

@tdegeus tdegeus closed this as completed Mar 11, 2022
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

No branches or pull requests

1 participant