定义命令来排版字符

定义命令来排版字符

如果我运行下面的代码,则“Wesolowski”中的波兰语 L 不会排版。为了解决这个问题,我尝试定义一个命令来排版波兰语 L。在下面的代码中,我已在以下行中定义了该命令:

\newcommand{\PolishL}{l\llap{\raise0.2em \hbox{\tiny\slash}\kern-0.05em}}

但是这个命令仍然没有排版波兰语“L”

或者,有没有办法排版波兰语 L 而不必定义命令?

\documentclass{article}

\usepackage{alltt} % Paper size, default font size and one-sided paperR

\usepackage{nameref}

\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}

\usepackage{csquotes}

\usepackage{etex}

\usepackage{lmodern}

\usepackage{caption}
\captionsetup[table]{position=below}

\usepackage{placeins} % to control figure placement with \FloatBarrier

\usepackage{fontspec}
\setmainfont{Lucida Sans}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\PolishL}{l\llap{\raise0.2em \hbox{\tiny\slash}\kern-0.05em}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% biblatex----------------------------------------------------------------------------------------
\usepackage[style=authoryear-comp, maxcitenames=2, maxbibnames=99, uniquename=false, uniquelist=false,firstinits=true,sorting=nyt]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}

\usepackage{xpatch}

% No dot before number of articles
\xpatchbibmacro{volume+number+eid}{%
  \setunit*{\adddot}%
}{%
}{}{}

% Number of articles in parentheses
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}

\renewbibmacro{in:}{}

\addbibresource{refs.bib}
\bibliography{refs}


\addbibresource{\jobname.bib}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}

@incollection{WesolowskiFuller2012,
  title={Spatial variation and temporal shifts in habitat use by birds at the European scale},
  author={Weso{\PolishL}owski, Tomasz},
  editor={Fuller, Robert J},
  booktitle={Birds and Habitat: Relationships in Changing Landscapes},
  publisher={Cambridge University Press},
  address={Cambridge},
  year={2012}
}

\end{filecontents}
\begin{document}

    Some text \autocite{WesolowskiFuller2012}

\printbibliography

\end{document}

答案1

the open type导致您出现问题的原因可能只是/ font的真实名称truetype Lucida Sans。在我的系统上,它确实如此,Lucida Sans Unicode并且编译正常。

注意:我之所以评论是\addbiresource{refs.bib} 因为我没有。另外你不应该写\bibliography{refs}– 或者不要使用biblatex

\documentclass{article}

\usepackage{alltt} % Paper size, default font size and one-sided paperR

\usepackage{nameref}

\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}

\usepackage{csquotes}

\usepackage{etex}

\usepackage{lmodern}

\usepackage{caption}
\captionsetup[table]{position=below}

\usepackage{placeins} % to control figure placement with \FloatBarrier

\usepackage{fontspec}
\setmainfont{Lucida Sans Unicode}

% biblatex----------------------------------------------------------------------------------------
\usepackage[style=authoryear-comp, maxcitenames=2, maxbibnames=99, uniquename=false, uniquelist=false,firstinits=true,sorting=nyt]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}

\usepackage{xpatch}

% No dot before number of articles
\xpatchbibmacro{volume+number+eid}{%
  \setunit*{\adddot}%
}{%
}{}{}

% Number of articles in parentheses
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}

\renewbibmacro{in:}{}

%\addbibresource{refs.bib}
%\bibliography{refs}

\addbibresource{\jobname.bib}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{WesolowskiFuller2012,
  title={Spatial variation and temporal shifts in habitat use by birds at the European scale},
  author={Wesołowski, Tomasz},
  editor={Fuller, Robert J},
  booktitle={Birds and Habitat: Relationships in Changing Landscapes},
  publisher={Cambridge University Press},
  address={Cambridge},
  year={2012}
}
\end{filecontents}

\begin{document}

    Some text \autocite{WesolowskiFuller2012}.

\printbibliography

\end{document} 

在此处输入图片描述

相关内容