I can't reproduce the error with the code snipset:
\listfiles
\documentclass[12pt, a4paper, twoside]{book}
\usepackage[top=1.50in, bottom=1.50in, left=1.25in, right=1.25in]{geometry}
\usepackage[shortlabels]{enumitem}
\usepackage{pdfpages}
\usepackage{balance}
\usepackage{color}
\begin{document}
Hello World
\end{document}
The file runs without errors or warnings.
The version list:
*File List*
book.cls 2007/10/19 v1.4h Standard LaTeX document class
bk12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
geometry.sty 2010/09/12 v5.6 Page Geometry
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
ifvtex.sty 2010/03/01 v1.5 Detect VTeX and its facilities (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
geometry.cfg
enumitem.sty 2011/09/28 v3.5.2 Customized lists
pdfpages.sty 2012/04/03 v0.4s Insert pages of external PDF documents (AM)
ifthen.sty 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
calc.sty 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
eso-pic.sty 2010/10/06 v2.0c eso-pic (RN)
atbegshi.sty 2011/10/05 v1.16 At begin shipout hook (HO)
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
pppdftex.def 2012/04/03 v0.4s Pdfpages driver for pdfTeX (AM)
balance.sty 1999/02/23 4.3 (PWD)
supp-pdf.mkii
pdftexcmds.sty 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
epstopdf-base.sty 2010/02/09 v2.5 Base part for package epstopdf
grfext.sty 2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty 2011/04/07 v1.3 Define keys (HO)
kvoptions.sty 2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
***********
In the comments the OP assumes the following as culprit:
\usepackage{pgfplots}
\pgfmathdeclarefunction{gauss}{2}{%
\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-0.5*((x-#1)/#2)^2)}%
}
The function can be found in the French Wikipedia:
Then μ and σ are the first and second parameter of your new function gauss
. But there is a third paramter, the function argument x
itself.
\pgfmathdeclarefunction{gauss}{3}{%
\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-0.5*((#3-#1)/#2)^2)}%
}
Then the function is called with three arguments: μ, σ, and x.
\pgfmathparse{gauss(0,1,2)}
The function can also be optimized. For example, the calculations with constants can be moved outside:
\pgfmathparse{1/(sqrt(2*pi)}
\let\gaussAux\pgfmathresult
\pgfmathdeclarefunction{gauss}{3}{%
\pgfmathparse{\gaussAux/#2*exp(-0.5*((#3-#1)/#2)^2)}%
}
No, there is no general procedure. One has to look into the package code and some knowledge of the terminal can be helpful; but one can always open the package file with an editor.
Let's see for \WritingHand
that the Comprehensive List tells you it is from marvosym.sty
.
First of all, we need to identify how the font is known to LaTeX. In these cases, rather than opening the file in an editor, I use less
:
less $(kpsewhich marvosym.sty)
because kpsewhich
is the utility that's used internally by the TeX programs to find a file. The first lines in the file are
\ProvidesPackage{marvosym}
[2011/07/20 v2.2 Martin Vogel's Symbols font definitions]
\newcommand{\mvs}{\fontfamily{mvs}\fontencoding{U}%
\fontseries{m}\fontshape{n}\selectfont}
Good. We know how to load the font. The code is not the best possible, because
\newcommand{\mvs}{\usefont{U}{mvs}{m}{n}}
would be a cleaner call, although they're equivalent. The encoding U
is “unspecified“ or “unknown”, which means that LaTeX won't try any of its tricks to adapt commands to the current encoding. It is a standard encoding, so there's no need to declare it beforehand. Any time we need a glyph from the font, we can say
\usefont{U}{mvs}{m}{n}
in a group. Now we look for \WritingHand
and we find it on line 80:
\newcommand\WritingHand{\mvchr{98}} \let\Writinghand\WritingHand
the second part is just an alias. What's \mvchr
? It's on line 5
\newcommand{\mvchr}[1]{{\mvs\char#1}}
but it's again poor LaTeX programming, because \symbol{#1}
would be better.
So we have all the necessary bits in order to accomplish our task:
\newcommand{\WritingHand}{{\usefont{U}{mvs}{m}{n}\symbol{98}}}
will work without loading any package. If you plan to use \WritingHand
in moving arguments (sectional titles or captions, for instance), it may be better to use \DeclareRobustCommand
instead of \newcommand
, otherwise in the .aux
file you would find
{\fontencoding {#1}\fontfamily {#2}\fontseries {#3}\fontshape {#4}\selectfont \ignorespaces \char 98\relax }
instead of a simple \WritingHand
. Not much of a problem, but possibly annoying.
Suppose instead you want to use the glyph
that is available in the STIX font package. Looking at the documentation, we find it at position octal 204 (decimal 132) in the font stix-extra1
(font table on page 43).
As before, we look in stix.sty
, but we don't find extra
inside it. Turn back to the documentation: on page 2 we find indeed
There are also three fonts containing extra miscellaneous symbols, stix-extra1
, stix-extra2
and stix-extra3
, provided as TFM and PFB files without support from the macro package.
This seems a problem, but indeed it isn't. We can proceed almost as before, just adding the necessary infrastructure
\DeclareFontFamily{U}{stixextrai}{}
\DeclareFontShape{U}{stixextrai}{m}{n}
{ <-> stix-extra1 }{}
\newcommand{\WolframSym}{{\usefont{U}{stixextrai}{m}{n}\symbol{132}}}
The same caveat as before for \DeclareRobustCommand
applies. The family name stixextrai
is arbitrary. Example document:
\documentclass{article}
\DeclareFontFamily{U}{stixextrai}{}
\DeclareFontShape{U}{stixextrai}{m}{n}
{ <-> stix-extra1 }{}
\newcommand{\WolframSym}{{\usefont{U}{stixextrai}{m}{n}\symbol{132}}}
\begin{document}
\WolframSym
\end{document}
which is how I produced the image above.
Best Answer
As per which packages/classes define
\titlefont
, a non exhaustive search may includeWith line numbers (now that I read OP...)
The line 1225 refers to some other
\newcommand*\titlefont
.