I am not allowed to use the caption package as the journal asks not to do so. I am using the elsarticle class and I would like to replace the colon in the figure captions with the dot so that "Figure 3:" becomes "Fig. 3.".
Using the \renewcommand{\fnum@figure}{Fig.~\thefigure}, I change "Figure" to "Fig.". but I still cannot get rid of the colon. Any tips on that? I appreciate it.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
The elsarticle class relies on the standard »article« class, where you can find the formatting for the float captions. Try the following lines in the preamble of your document (untested).
Thanks a lot.
Actually I just started with Lyx and am planning to switch later to latex, so, I am almost on board .
I pasted the code in the preamble of the lye doc, but it gives errors: "You can't use `\spacefactor' in vertical mode" and "LaTeX Error: Missing \begin{document}." and ...
and I don't have a clue on how to fix it. Perhaps it wouldn't work with lyx...???
Regards,
Mahsa.
Mahsa wrote:[…] Actually I just started with Lyx and am planning to switch later to latex, so, I am almost on board.[…]
That's an important information that you should have given right at the beginning. I wouldn't have answered then because I don't use LyX. I can only recommend not to wait and to use LaTeX from now on. But that's my personal thinking.
Mahsa wrote:[…] Perhaps it wouldn't work with lyx...? […]
I exported the doc from Lyx to Latex, and pasted the code in the preamble, it does not work in Latex, it gives an error of undefined control sequence, Illegal unit of measure, etc...Any other hints??? Thanks in advance.
Great, Thanks a lot! It works on your doc indeed and now also on my document.
For some reason on my doc it was giving an error and I have no idea why...I had to make the slightest change of "\renewcommand{\figurename}{Fig.} " to "\renewcommand{\fnum@figure}{Fig.~\thefigure}" together with the rest of the code you provided, the problem is solved and the colon is removed. Thanks again. I really appreciate it
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p