我想简单地在文本中写一个四分音符。然而我知道有\textmusicalnode
可用的。但这并没有给我四分音符。
例如,使用harmony
orwasysym
包会给我\Vier
or\quarternote
作为四分音符,但与amssymb
包结合使用会产生错误。我应该怎么做才能解决这个问题?
编辑
这就是我在序言中作为包裹包含的内容。
\RequirePackage{fix-cm}
\documentclass[a4paper,12pt,bibtotoc,liststotoc,BCOR=16mm,headinclude,numbers=noendperiod]{scrreprt}
\usepackage[ngerman,english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{fontspec}
\usepackage{verbatim}
\usepackage[onehalfspacing]{setspace}
\usepackage{chngcntr}
\usepackage{enumerate}
\usepackage[style=alphabetic-verb,bibstyle=alphabetic,hyperref=true]{biblatex}
\usepackage[hang,small]{caption} % small and hanging captions
\usepackage{lmodern} %% Type1 font for non english language
\usepackage{graphicx} %% graphics
\usepackage{subfig} %% to place graphics beside each other
\usepackage{listings} %% to include code listings
\usepackage{xcolor} %% syntax highlight in code listings
\usepackage{amsfonts} %% number-symbols in formulas
\usepackage{mathrsfs}
\usepackage{xfrac} %% slanted fractions with font fixtures
\usepackage[plainpages=false]{hyperref}
\usepackage{fancyhdr} %% fancy headings and footers
\usepackage{harmony} %% musical symbols
harmony
但是,如果我使用该包,我会收到以下错误:
Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:231
LaTeX Error: Command `\Finv' already defined.
Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:232
LaTeX Error: Command `\Game' already defined.
Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:237
LaTeX Error: Command `\beth' already defined.
Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:238
LaTeX Error: Command `\gimel' already defined.
Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:239
LaTeX Error: Command `\daleth' already defined.
答案1
wasysym
无需加载包即可使用包中的四分音符符号:
\documentclass{article}
\providecommand*{\quarternote}{%
\begingroup
\fontencoding{U}%
\fontfamily{wasy}%
\selectfont
\symbol{12}%
\endgroup
}
\begin{document}
\tiny \quarternote
\scriptsize \quarternote
\small \quarternote
\normalsize \quarternote
\large \quarternote
\Large \quarternote
\LARGE \quarternote
\huge \quarternote
\Huge \quarternote
\end{document}
我不推荐\Vier
包harmony
,因为它是一个固定字体大小的构造符号。
以下文件比较了和的四分音符符号wasy
,arev
并从符号中删除替换警告(wasy
如果\bfseries
使用)(只有小于 10pt 的尺寸不能用作粗体)。
\documentclass{article}
% wasy
\newcommand*{\quarternotewasy}{%
\begingroup
\fontencoding{U}%
\fontfamily{wasy}%
\fontshape{n}%
\ssubSeriesBXtoB
\selectfont
\symbol{12}%
\endgroup
}
\makeatletter
\newcommand*{\ssubSeriesBXtoB}{%
\if b\expandafter\@car\f@series{}\@nil
\fontseries{b}%
\fi
}
\makeatother
% arev
\newcommand*{\quarternotearev}{%
\begingroup
\usefont{U}{zavm}{m}{n}%
\symbol{90}%
\endgroup
}
\newcommand*{\test}[2]{%
#2%
\tiny #1%
\scriptsize #1%
\small #1%
\normalsize #1%
\large #1%
\Large #1%
\LARGE #1%
\huge #1%
\Huge #1%
}
\begin{document}
\begin{tabular}{ll}
wasy: & \test{\quarternotewasy}{} \\
wasy-bold: & \test{\quarternotewasy}{\bfseries} \\
arev: & \test{\quarternotearev}{} \\
\end{tabular}
\end{document}