The code is:
Code: Select all
\renewcommand{\figurename}{Fig.}
Code: Select all
\renewcommand{\figurename}{Fig.}
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
\figurename
, which are more specific for different types of documents, are defined in the classes. Others for a specific purpose are define in the macro packages.\refname
. The title for the bibliography chapter ("Bibliography")in the »book« (or »report«) class is stored in the macro \bibname
.Code: Select all
#!/bin/bash
# texgrep - searches for a text pattern contained in files
# located inside the texmf trees
# usage: texgrep pattern [extension]
# usage examples:
# texgrep phantomsection sty
# texgrep \\\\def\\\\phantomsection
# Stefan Kottwitz, 2008
if [ $# -eq 0 ]; then
echo 1>&2 Usage: texgrep pattern [extension]
exit 1
fi
for path in TEXMFMAIN TEXMFDIST TEXMFHOME
do
find `kpsewhich --var-value=$path` -name "*$2" |xargs grep $1
done
exit 0
Thanks for your reply.localghost wrote:Macros are defined at different places. Those which are essential for every document are defined in the LaTeX kernel (files with suffix *.ltx). Macros like\figurename
, which are more specific for different types of documents, are defined in the classes. Others for a specific purpose are define in the macro packages.
A good example is the macro for the bibliography or references heading. In the »article« class the references section title ("References") is stored in the macro\refname
. The title for the bibliography chapter ("Bibliography")in the »book« (or »report«) class is stored in the macro\bibname
.
Macros which are not part of vanilla LaTeX are of course defined by packages. A possible pitfall is that some packages define the same macro.
As you can see, it is not always obvious where a macro is defined. That's one reason why we mostly like to see a minimal example here added to a question in order to see where possible clashes are caused.
Thorsten
I have copied thse code to the latex software and complied. But it failed. Can you tell me the method to use these codes? For example, where should I place these codes and run?Stefan_K wrote:With some experience one can know where a macro may be defined or can easily locate it.
Sometime it's hard though, in such cases I use a shell script
I described it here in my blog: Speed up the work by shell scripts.Code: Select all
#!/bin/bash # texgrep - searches for a text pattern contained in files # located inside the texmf trees # usage: texgrep pattern [extension] # usage examples: # texgrep phantomsection sty # texgrep \\\\def\\\\phantomsection # Stefan Kottwitz, 2008 if [ $# -eq 0 ]; then echo 1>&2 Usage: texgrep pattern [extension] exit 1 fi for path in TEXMFMAIN TEXMFDIST TEXMFHOME do find `kpsewhich --var-value=$path` -name "*$2" |xargs grep $1 done exit 0
Stefan
That is cool! I could try installing the Linux on my PC!Stefan_K wrote:This software is not related to LaTeX. It's a shell script. The example above runs on the bash shell, but can be used on other shells as well. It's for use at the command prompt, i.e. in a terminal window. On a Linux (or Unix system) or Mac OS X ist should run without further installations - having a good shell is an important reason for me to work with Linux. If you use Windows, you would need additional software, such as Cygwin. The TeX tools such as kpsewhich and texdoc also work on windows, but in this shell script I used typical unix tools such as find, xargs and grep.
This was for basic information. Details depend on your operating system.
Stefan
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