I have been using something like
\renewcommand\vec[1] {\boldsymbol{\MakeLowercase{#1}}}
\newcommand\mat[1] {\boldsymbol{\MakeUppercase{#1}}}
for some time now to typeset vectors and matrices.
However, every time this comes up when I ask a question, people tell me it is a bad idea to use \Makeuppercase in math mode.
Furthermore, \Makeuppercase is pretty much broken for me at this point, so I might need an alternative.
For this alternative, I was thinking it would suffice if I could issue a warning when a lowercase symbol is used for matrices (or an uppercase symbol for vectors).
I know how to issue a warning using \@warning or \GenericWarning, but I can't figure out how to test if something is lower- or upper case.
Also, would this actually be a better way to enforce consistent typesetting of vectors and matrices as described above or should I consider something completely different?
Addendum
Because everyone keeps on commenting how bad of an idea it is to enforce case in math mode I feel that I have to emphasise that I am aware of these concerns and this is my attempt to find a workaround. My main concern is that the commands I had, helped me to keep my notation consistent and the semantics of my LaTeX code clear and I would prefer to keep this consistency somehow.
To give an example, a typical set of equations that I work with looks as follows:
\begin{align*}
\vec{f} &= \sigma(\mat{W}_\mathrm{fx} \vec{x} + \mat{W}_\mathrm{fh} \vec{h} + \vec{b}_\mathrm{f}) \\
\vec{i} &= \sigma(\mat{W}_\mathrm{ix} \vec{x} + \mat{W}_\mathrm{ih} \vec{h} + \vec{b}_\mathrm{i}) \\
\vec{s} &= \sigma(\mat{W}_\mathrm{sx} \vec{x} + \mat{W}_\mathrm{sh} \vec{h} + \vec{b}_\mathrm{s}) \\
\vec{c} &\gets \vec{f} \odot \vec{c} + \vec{i} \odot \phi(\vec{s})
\end{align*}
Now, depending on context, it might be useful/necessary to write this as follows:
\begin{align*}
\mat{F} &= \sigma(\mat{X} \mat{W}_\mathrm{fx}^\mathsf{T} + \mat{H} \mat{W}_\mathrm{fh} + \vec{b}_\mathrm{f} \mat{1}) \\
\mat{I} &= \sigma(\mat{X} \mat{W}_\mathrm{ix}^\mathsf{T} + \mat{H} \mat{W}_\mathrm{ih} + \vec{b}_\mathrm{i} \mat{1}) \\
\mat{S} &= \sigma(\mat{X} \mat{W}_\mathrm{sx}^\mathsf{T} + \mat{H} \mat{W}_\mathrm{sh} + \vec{b}_\mathrm{s} \mat{1}) \\
\mat{C} &\gets \mat{F} \odot \mat{C} + \mat{I} \odot \phi(\mat{S})
\end{align*}
In these transformations it often happens that I overlook the capitalisation of one or more variables.
Because these equations align quite nicely, it would be easy to spot in the output, but it also happens that it is not immediately visible.
I find that the \vec and \mat commands make the LaTeX core more readable and when checking the formulas I find it easier to focus on those commands than on the actual case of each variable.
I just like to believe that there is nothing wrong with using technology to compensate for my shortcomings.
This being said, I agree that enforcing case is not the best thing to do. Therefore, I am now looking for a solution that notifies me when the case does not match what I expect for a vector/matrix so that I don't have to do the checking manually.



\vecand\mat, resp. and it regularly happens that I (have to) rewrite the math so that\vecbecomes a regular scalar and\matbecomes a\vecor vice versa. – Mr Tsjolder from codidact Jan 15 '24 at 14:12