1

I'm typesetting my paper (linguistics) and it ran fine in XeLaTeX until I used the ling-macros package, which should have been working fine, given it's not a new package and I've found no similar questions about the error I encountered. This is what I got:

    > ! LaTeX Error: Command \f already defined.
    >                Or name \end... illegal, see p.192 of the manual.
    > 
    > See the LaTeX manual or LaTeX Companion for explanation. Type  H
    > <return>  for immediate help.  ...                                    
    > 
    >                                                    l.235 \newcommand{\f}[1]{\ensuremath{#1}}
    >                                           ^^I^^I^^I^^I^^I^^I% Formal express...
    > 
    > ?

I'm sure it's somehow to do with ling-macros (or with its conflict with some other packages I used?) since that's a very specific message I got; when I %'ed that line the file ran fine again (see last line below).

The following is my preamble:

\documentclass[12pt]{article}
\usepackage[hmargin=2.5cm, vmargin=2.5cm]{geometry}
\setlength\parindent{4ex}
\setlength\parskip{0pt}
\usepackage{setspace}
\doublespace
\usepackage{fontspec}
\setmainfont{Times New Roman}
\defaultfontfeatures{Scale=MatchLowercase}
\usepackage{polyglossia}

\usepackage[rm, bf]{titlesec} % formatting taken out for brevity

\usepackage{longtable}

\usepackage{natbib}

\usepackage{fancyhdr} % actual header taken out
\pagestyle{fancy}

\usepackage{titling} % actual title with author info taken out

\usepackage{linguex}
\usepackage{tikz-qtree}
\usepackage{ling-macros}

1 Answer 1

1

The linguex package defines \f as an alias for \b. Also \b is given a different meaning than in standard LaTeX (which is the “underbar” accent).

In the context of linguex, inside \ex. one inputs \a. and \b. for introducing items. The package also provides \c. \d. \e. \f. for more items.

You can work around the issue in two ways. One is quite drastic, namely to remove the possibility of using \f. for items inside \ex.: just add \let\f\relax before \usepackage{ling-macros}.

If you want to use \f. for items inside \ex., you need a more elaborate trick, shown below.

\documentclass[12pt]{article}

%% packages

\usepackage[hmargin=2.5cm, vmargin=2.5cm]{geometry}
\usepackage{setspace}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage[rm, bf]{titlesec} % formatting taken out for brevity
\usepackage{longtable}
\usepackage{natbib}
\usepackage{fancyhdr} % actual header taken out
\usepackage{titling} % actual title with author info taken out

\usepackage{linguex}
\usepackage{tikz-qtree}

%% fix the issues with \f
\let\f\relax % remove the definition done by linguex
\usepackage{ling-macros} % load the package
\makeatletter
\let\lingmacros@f\f
\DeclareRobustCommand{\f}{\@ifnextchar.\b\lingmacros@f}
\makeatother

%% settings

\setmainfont{Times New Roman}
\defaultfontfeatures{Scale=MatchLowercase}

\pagestyle{fancy}
\doublespacing % not \doublespace
% you don't know what ex is, until at begin document
\AtBeginDocument{\setlength\parindent{4ex}}
% leave a little flexibility to \parskip
%\setlength\parskip{0pt}

I separated the package loading part from the settings part. Note that \doublespace is not the right declaration, which should be \doublespacing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .