[Tex/LaTex] After install package (lm), the math symbol can’t be seen!

fontspec

I want to use XeLaTeX to compile a file like

\documentclass{article}
\usepackage{fontspec}
\begin{document}
$a_1+a_2+\cdots+a_n\geq n\sqrt[n]{a_1a_2\dots a_n}$
\end{document}

but there is some error:

/texmf-dist/tex/xelatex/euenc/eu1lmr.fd)kpathsea: Invalid fontname `[lmroman10-regular]', contains '['

! Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt not loadable: Metric (TFM) file or installed font not found.

relax
l.100 \fontencoding\encodingdefault\selectfont
?

After searching I knew I had to install package lm to display latin modern font. so I download the package and copy the files to right dictionary, then I run texhash. but the symbol like \geq and \cdots dispeared. The log file said:

LaTeX Font Warning: Encoding OT1' has changed toEU1' for symbol font
(Font) operators' in the math versionnormal' on input line 4.

LaTeX Font Info: Overwriting symbol font operators' in versionnormal'
(Font) OT1/cmr/m/n –> EU1/lmr/m/n on input line 4.

LaTeX Font Warning: Encoding OT1' has changed toEU1' for symbol font
(Font) operators' in the math versionbold' on input line 4.

What shall I do?

The .log file

This is XeTeX, Version 3.1415926-2.2-0.9997.4 (Web2C 2010) (format=xelatex 2011.4.20)  20 APR 2011 16:06
entering extended mode
 \write18 enabled.
 Source specials enabled.
**\input add.tex
(./add.tex (/texmf-dist/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/texmf-dist/base/size10.clo
File: size10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) (/texmf-dist/fontspec/fontspec.sty
Package: fontspec 2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX


(/texmf-dist/expl3/expl3.sty (/texmf-dist/expl3/l3names.sty
Package: l3names 2011/01/08 v2122 L3 Experimental Naming Scheme for TeX Primiti
ves
)
Package: expl3 2011/02/17 v2156 L3 Experimental code bundle wrapper

(/texmf-dist/etex-pkg/etex.sty
Package: etex 1998/03/26 v2.0 eTeX basic definition package (PEB)
\et@xins=\count88
) (/texmf-dist/expl3/l3basics.sty
Package: l3basics 2011/02/26 v2158 L3 Experimental basic definitions
)
(/texmf-dist/expl3/l3expan.sty
Package: l3expan 2010/09/20 v2037 L3 Experimental Argument Expansion module
) (/texmf-dist/expl3/l3tl.sty
Package: l3tl 2011/03/07 v2184 L3 Experimental Token Lists
)
(/texmf-dist/expl3/l3int.sty
Package: l3int 2011/03/06 v2178 L3 Experimental Integer module
\l_tmpa_int=\count89
\l_tmpb_int=\count90
\l_tmpc_int=\count91
\g_tmpa_int=\count92
\g_tmpb_int=\count93
\c_max_int=\count94
\g_tl_inline_level_int=\count95
\g_prg_inline_level_int=\count96
) (/texmf-dist/expl3/l3quark.sty
Package: l3quark 2011/03/03 v2172 L3 Experimental Quark Commands
)
(/texmf-dist/expl3/l3seq.sty
Package: l3seq 2010/03/29 v1879 L3 Experimental sequences and stacks
) (/texmf-dist/expl3/l3toks.sty
Package: l3toks 2010/09/20 v2037 L3 Experimental Token Registers
\l_tmpb_toks=\toks14
\l_tmpc_toks=\toks15
\g_tmpa_toks=\toks16
\g_tmpb_toks=\toks17
\g_tmpc_toks=\toks18
\c_empty_toks=\toks19
\l_tl_replace_toks=\toks20
)
(/texmf-dist/expl3/l3prg.sty
Package: l3prg 2011/03/06 v2178 L3 Experimental control structures
) (/texmf-dist/expl3/l3clist.sty
Package: l3clist 2011/03/06 v2178 L3 Experimental comma separated lists
\g_clist_map_inline_int=\count97
)
(/texmf-dist/expl3/l3token.sty
Package: l3token 2011/02/16 v2151 L3 Experimental token investigation and manip
ulation
) (/texmf-dist/expl3/l3prop.sty
Package: l3prop 2010/11/23 v2087 L3 Experimental Property Lists
\g_prop_inline_level_int=\count98
)
(/texmf-dist/expl3/l3msg.sty
Package: l3msg 2010/10/02 v2052 L3 Experimental LaTeX Messages module
\l_msg_redirect_classes_prop=\toks21
\l_msg_redirect_names_prop=\toks22
\l_msg_redirect_fatal_prop=\toks23
\l_msg_redirect_error_prop=\toks24
\l_msg_redirect_warning_prop=\toks25
\l_msg_redirect_info_prop=\toks26
\l_msg_redirect_log_prop=\toks27
\l_msg_redirect_trace_prop=\toks28
\l_msg_redirect_none_prop=\toks29
) (/texmf-dist/expl3/l3io.sty
Package: l3io 2010/10/03 v2063 L3 Experimental i/o module
\g_iow_streams_prop=\toks30
\g_ior_streams_prop=\toks31
\l_iow_stream_int=\count99
)
(/texmf-dist/expl3/l3skip.sty
Package: l3skip 2011/02/15 v2149 L3 Experimental skip registers
\l_tmpa_skip=\skip43
\l_tmpb_skip=\skip44
\l_tmpc_skip=\skip45
\g_tmpa_skip=\skip46
\g_tmpb_skip=\skip47
\l_tmpa_dim=\dimen103
\l_tmpb_dim=\dimen104
\l_tmpc_dim=\dimen105
\l_tmpd_dim=\dimen106
\g_tmpa_dim=\dimen107
\g_tmpb_dim=\dimen108
) (/texmf-dist/expl3/l3box.sty
Package: l3box 2011/03/06 v2178 L3 Experimental Box module
\l_tmpb_box=\box26
)
(/texmf-dist/expl3/l3keyval.sty
Package: l3keyval 2010/04/11 v1890 L3 Experimental keyval processing
\l_KV_level_int=\count100
) (/texmf-dist/expl3/l3keys.sty
Package: l3keys 2010/11/11 v2082 L3 Experimental key-value support
\l_keys_choice_int=\count101
)
(/texmf-dist/expl3/l3precom.sty
Package: l3precom 2010/02/09 v1793 L3 Experimental precompilation module
\g_gen_sym_int=\count102
\g_ggen_sym_int=\count103
) (/texmf-dist/expl3/l3xref.sty
Package: l3xref 2011/02/16 v2151 L3 Experimental cross referencing
\g_xref_all_curr_immediate_fields_prop=\toks32
\g_xref_all_curr_deferred_fields_prop=\toks33
)
(/texmf-dist/expl3/l3file.sty
Package: l3file 2010/03/21 v1853 L3 Experimental file loading
) (/texmf-dist/expl3/l3fp.sty
Package: l3fp 2011/03/06 v2178 L3 Experimental floating-point operations
\c_one_million=\count104
\c_one_hundred_million=\count105
\c_five_hundred_million=\count106
\c_one_thousand_million=\count107
\c_fp_pi_by_four_decimal_int=\count108
\c_fp_pi_by_four_extended_int=\count109
\c_fp_pi_decimal_int=\count110
\c_fp_pi_extended_int=\count111
\c_fp_two_pi_decimal_int=\count112
\c_fp_two_pi_extended_int=\count113
\l_fp_count_int=\count114
\l_fp_div_offset_int=\count115
\l_fp_exp_integer_int=\count116
\l_fp_exp_decimal_int=\count117
\l_fp_exp_extended_int=\count118
\l_fp_exp_exponent_int=\count119
\l_fp_input_a_sign_int=\count120
\l_fp_input_a_integer_int=\count121
\l_fp_input_a_decimal_int=\count122
\l_fp_input_a_exponent_int=\count123
\l_fp_input_b_sign_int=\count124
\l_fp_input_b_integer_int=\count125
\l_fp_input_b_decimal_int=\count126
\l_fp_input_b_exponent_int=\count127
\l_fp_input_a_extended_int=\count128
\l_fp_input_b_extended_int=\count129
\l_fp_mul_a_i_int=\count130
\l_fp_mul_a_ii_int=\count131
\l_fp_mul_a_iii_int=\count132
\l_fp_mul_a_iv_int=\count133
\l_fp_mul_a_v_int=\count134
\l_fp_mul_a_vi_int=\count135
\l_fp_mul_b_i_int=\count136
\l_fp_mul_b_ii_int=\count137
\l_fp_mul_b_iii_int=\count138
\l_fp_mul_b_iv_int=\count139
\l_fp_mul_b_v_int=\count140
\l_fp_mul_b_vi_int=\count141
\l_fp_mul_output_int=\count142
\l_fp_output_sign_int=\count143
\l_fp_output_integer_int=\count144
\l_fp_output_decimal_int=\count145
\l_fp_output_exponent_int=\count146
\l_fp_output_extended_int=\count147
\l_fp_round_position_int=\count148
\l_fp_round_target_int=\count149
\l_fp_split_sign_int=\count150
\l_fp_tmp_int=\count151
\l_fp_trig_octant_int=\count152
\l_fp_trig_sign_int=\count153
\l_fp_trig_decimal_int=\count154
\l_fp_trig_extended_int=\count155
\l_fp_tmp_dim=\dimen109
\l_fp_tmp_skip=\skip48
)
(/texmf-dist/expl3/l3luatex.sty
Package: l3luatex 2010/07/18 v1985 L3 Experimental LuaTeX functions
\g_cctab_allocate_int=\count156
\g_cctab_stack_int=\count157
) (/texmf-dist/expl3/l3font.sty
Package: l3font 2011/03/03 v2175 L3 Experimental Font Loading
)
(/texmf-dist/tools/calc.sty
Package: calc 2005/08/06 v4.2 Infix arithmetic (KKT,FJ)
\calc@Acount=\count158
\calc@Bcount=\count159
\calc@Adimen=\dimen110
\calc@Bdimen=\dimen111
\calc@Askip=\skip49
\calc@Bskip=\skip50
LaTeX Info: Redefining \setlength on input line 33.
LaTeX Info: Redefining \addtolength on input line 34.
\calc@Ccount=\count160
\calc@Cskip=\skip51
)) (/texmf-dist/xpackages/xparse.sty
Package: xparse 2011/01/09 v2125 Generic document command parser
\c_xparse_shorthands_prop=\toks34
\l_xparse_m_args_int=\count161
\l_xparse_mandatory_args_int=\count162
\l_xparse_processor_int=\count163
\l_xparse_total_args_int=\count164
)
(/texmf-dist/kastrup/binhex.tex)
\l_fontspec_script_int=\count165
\l_fontspec_language_int=\count166
\l_fontspec_strnum_int=\count167
Variant \tl_gset:cV already defined; not changing it on line 68
 (/texmf-dist/xkeyval/xkeyval.sty
Package: xkeyval 2008/08/13 v2.6a package option processing (HA)

(/texmf-dist/xkeyval/xkeyval.tex
\XKV@toks=\toks35
\XKV@tempa@toks=\toks36
\XKV@depth=\count168
File: xkeyval.tex 2008/08/13 v2.6a key=value parser (HA)
 (/texmf-dist/xkeyval/keyval.tex)))
(/texmf-dist/fontspec/fontspec-patches.sty
Package: fontspec-patches 2011/02/26 v2.1f Advanced font selection for XeLaTeX/
LuaLaTeX

(/texmf-dist/base/fixltx2e.sty
Package: fixltx2e 2006/03/24 v1.1n fixes to LaTeX
LaTeX Info: Redefining \em on input line 367.
)
LaTeX Info: Redefining \em on input line 7.
LaTeX Info: Redefining \emph on input line 14.
LaTeX Info: Redefining \- on input line 17.
) (/texmf-dist/base/fontenc.sty
Package: fontenc 2005/09/27 v1.99g Standard LaTeX package

(/texmf-dist/euenc/eu1enc.def
File: eu1enc.def 2010/05/27 v0.1h Experimental Unicode font encodings
)
LaTeX Font Info:    Try loading font information for EU1+lmr on input line 61.
 (/texmf-dist/xetex/euenc/eu1lmr.fd
File: eu1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
))
(/texmf-dist/xetex/xunicode/xunicode.sty
File: xunicode.sty 2008/02/08 v0.91 provides access to latin accents and many o
ther characters in Unicode lower plane
)
 LaTeX info: Defining document command \fontspec
(LaTeX)  with arg. spec. 'O{}m' on line 320.

 LaTeX info: Defining document command \setmainfont
(LaTeX)  with arg. spec. 'O{}m' on line 324.

 LaTeX info: Defining document command \setsansfont
(LaTeX)  with arg. spec. 'O{}m' on line 328.

 LaTeX info: Defining document command \setmonofont
(LaTeX)  with arg. spec. 'O{}m' on line 332.

 LaTeX info: Defining document command \setmathrm
(LaTeX)  with arg. spec. 'O{}m' on line 336.

 LaTeX info: Defining document command \setboldmathrm
(LaTeX)  with arg. spec. 'O{}m' on line 339.

 LaTeX info: Defining document command \setmathsf
(LaTeX)  with arg. spec. 'O{}m' on line 342.

 LaTeX info: Defining document command \setmathtt
(LaTeX)  with arg. spec. 'O{}m' on line 345.

 LaTeX info: Defining document command \newfontfamily
(LaTeX)  with arg. spec. 'mO{}m' on line 362.

 LaTeX info: Defining document command \newfontface
(LaTeX)  with arg. spec. 'mO{}m' on line 365.

 LaTeX info: Defining document command \defaultfontfeatures
(LaTeX)  with arg. spec. 'm' on line 368.

 LaTeX info: Defining document command \addfontfeatures
(LaTeX)  with arg. spec. 'm' on line 385.

 LaTeX info: Defining document command \newfontfeature
(LaTeX)  with arg. spec. 'mm' on line 392.

 LaTeX info: Defining document command \newAATfeature
(LaTeX)  with arg. spec. 'mmmm' on line 401.

 LaTeX info: Defining document command \newICUfeature
(LaTeX)  with arg. spec. 'mmm' on line 410.

 LaTeX info: Defining document command \aliasfontfeature
(LaTeX)  with arg. spec. 'mm' on line 412.

 LaTeX info: Defining document command \aliasfontfeatureoption
(LaTeX)  with arg. spec. 'mmm' on line 415.

 LaTeX info: Defining document command \newfontscript
(LaTeX)  with arg. spec. 'mm' on line 420.

 LaTeX info: Defining document command \newfontlanguage
(LaTeX)  with arg. spec. 'mm' on line 442.

 LaTeX info: Defining document command \DeclareFontsExtensions
(LaTeX)  with arg. spec. 'm' on line 459.

\c@fontspec_tmp_int=\count169
LaTeX Info: Redefining \itshape on input line 2089.
LaTeX Info: Redefining \slshape on input line 2093.
LaTeX Info: Redefining \scshape on input line 2097.
LaTeX Info: Redefining \upshape on input line 2101.

(/texmf-dist/fontspec/fontspec.cfg))
No file add.aux.
\openout1 = `add.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 2.
LaTeX Font Info:    ... okay on input line 2.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 2.
LaTeX Font Info:    ... okay on input line 2.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 2.
LaTeX Font Info:    ... okay on input line 2.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 2.
LaTeX Font Info:    ... okay on input line 2.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 2.
LaTeX Font Info:    ... okay on input line 2.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 2.
LaTeX Font Info:    ... okay on input line 2.
LaTeX Font Info:    Checking defaults for EU1/lmr/m/n on input line 2.
LaTeX Font Info:    ... okay on input line 2.
 fontspec info: Adjusting the maths setup (use [no-math] to avoid this).

\symlegacymaths=\mathgroup5
LaTeX Font Info:    Overwriting symbol font `legacymaths' in version `bold'
(Font)                  OT1/cmr/m/n --> OT1/cmr/bx/n on input line 2.
LaTeX Font Info:    Redeclaring math accent \acute on input line 2.
LaTeX Font Info:    Redeclaring math accent \grave on input line 2.
LaTeX Font Info:    Redeclaring math accent \ddot on input line 2.
LaTeX Font Info:    Redeclaring math accent \tilde on input line 2.
LaTeX Font Info:    Redeclaring math accent \bar on input line 2.
LaTeX Font Info:    Redeclaring math accent \breve on input line 2.
LaTeX Font Info:    Redeclaring math accent \check on input line 2.
LaTeX Font Info:    Redeclaring math accent \hat on input line 2.
LaTeX Font Info:    Redeclaring math accent \dot on input line 2.
LaTeX Font Info:    Redeclaring math accent \mathring on input line 2.
LaTeX Font Info:    Redeclaring math symbol \colon on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Gamma on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Delta on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Theta on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Lambda on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Xi on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Pi on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Sigma on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Upsilon on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Phi on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Psi on input line 2.
LaTeX Font Info:    Redeclaring math symbol \Omega on input line 2.
LaTeX Font Info:    Redeclaring math symbol \mathdollar on input line 2.
LaTeX Font Info:    Redeclaring symbol font `operators' on input line 2.

LaTeX Font Warning: Encoding `OT1' has changed to `EU1' for symbol font
(Font)              `operators' in the math version `normal' on input line 2.

LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  OT1/cmr/m/n --> EU1/lmr/m/n on input line 2.

LaTeX Font Warning: Encoding `OT1' has changed to `EU1' for symbol font
(Font)              `operators' in the math version `bold' on input line 2.

LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  OT1/cmr/bx/n --> EU1/lmr/m/n on input line 2.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  EU1/lmr/m/n --> EU1/lmr/m/n on input line 2.
LaTeX Font Info:    Overwriting math alphabet `\mathrm' in version `normal'
(Font)                  EU1/lmr/m/n --> EU1/lmr/m/n on input line 2.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
(Font)                  OT1/cmr/m/it --> EU1/lmr/m/it on input line 2.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
(Font)                  OT1/cmr/bx/n --> EU1/lmr/bx/n on input line 2.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `normal'
(Font)                  OT1/cmss/m/n --> EU1/lmss/m/n on input line 2.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `normal'
(Font)                  OT1/cmtt/m/n --> EU1/lmtt/m/n on input line 2.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  EU1/lmr/m/n --> EU1/lmr/bx/n on input line 2.
LaTeX Font Info:    Overwriting math alphabet `\mathrm' in version `bold'
(Font)                  EU1/lmr/m/n --> EU1/lmr/bx/n on input line 2.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
(Font)                  OT1/cmr/bx/it --> EU1/lmr/bx/it on input line 2.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold'
(Font)                  OT1/cmss/bx/n --> EU1/lmss/bx/n on input line 2.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold'
(Font)                  OT1/cmtt/m/n --> EU1/lmtt/bx/n on input line 2.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <7> on input line 2.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <5> on input line 2.
LaTeX Font Info:    Try loading font information for U+lasy on input line 2.
(/texmf-dist/base/ulasy.fd
File: ulasy.fd 1998/08/17 v2.2e LaTeX symbol font definitions
) [1

] (./add.aux) ) 
Here is how much of TeX's memory you used:
 9835 strings out of 495690
 172429 string characters out of 1189631
 1246752 words of memory out of 4200616
 12942 multiletter control sequences out of 15000+50000
 3990 words of font info for 20 fonts, out of 3000000 for 5000
 14 hyphenation exceptions out of 8191
 38i,6n,35p,608b,109s stack positions out of 5000i,500n,10000p,200000b,50000s

Output written on add.pdf (1 page).

I upload the two pdfs (including lmodern package or not) at http://ifile.it/q0pdnra/test.zip.

Best Answer

Your example works fine for me. Also I get no error if I load lmodern (if you load it you should load it before fontspec, as it will break the font selection system of fontspec if loaded later). Check your package versions. I'm using:

  fontspec.sty    2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX
  eu1enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
  eu1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern