
Tento colocar texto em itálico no cabeçalho - no corpo do documento funciona bem, mas no cabeçalho não consigo ver a fonte em itálico.
Aqui está o MWE:
% Preview source code
%% LyX 2.3.2-2 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}
\AtBeginDocument{
\renewcommand\footnoterule{%
\kern -3pt
\hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
\kern 2.6pt
}}
\renewcommand{\labelenumii}{\labelenumi\arabic{enumii}.}
\lhead{aa\emph{aa}}
\makeatother
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\begin{english}[variant=american]%
aa\emph{aa}
\end{english}%
\end{document}
Você sabe como posso consertar isso?
Obrigado!
Responder1
Por algum motivo,David CLMnão parece conter glifos latinos em itálico. Como uma estranheza adicionalMiriam Mono CLMinclina-se na direção oposta às outras duas fontes.
Na sua pergunta, você definiu o idioma padrão como hebraico e a fonte padrão comoDavid CLM. Então é isso que você obtém no seu cabeçalho. Se você quiser o inglês no seu cabeçalho e a fonte padrão em inglês do Latin Modern Roman, você pode usar: \lhead{\textenglish{aa\emph{aa}}}
, mas não obterá o hebraico se quiser, é claro.
Além disso, observe que scrartcl
há um aviso para não usar fancyhdr
com esta classe. KOMA-Script possui sua própria maneira de personalizar cabeçalhos e rodapés.
Dê uma olhada neste teste para ver o que está acontecendo:
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\newfontfamily\hebrewfont{David CLM}[Script=Hebrew]
\newfontfamily\hebrewfonttt{Miriam Mono CLM}[Script=Hebrew]
\newfontfamily\hebrewfontsf{Simple CLM}[Script=Hebrew]
\begin{document}
\LR{David CLM}
\medskip
עברית \LR{Latin (Upright)}
{\itshape עברית \LR{Latin (Italic)}}
{\bfseries עברית \LR{Latin (Bold)}}
{\bfseries\itshape עברית \LR{Latin (Bold Italic)}}
\bigskip
\sffamily
\LR{Simple CLM}
\medskip
עברית \LR{Latin (Upright)}
{\itshape עברית \LR{Latin (Italic)}}
{\bfseries עברית \LR{Latin (Bold)}}
{\bfseries\itshape עברית \LR{Latin (Bold Italic)}}
\bigskip
\ttfamily
\LR{Miriam Mono CLM}
\medskip
עברית \LR{Latin (Upright)}
{\itshape עברית \LR{Latin (Italic)}}
{\bfseries עברית \LR{Latin (Bold)}}
{\bfseries\itshape עברית \LR{Latin (Bold Italic)}}
\end{document}
Responder2
Experimente isto:
\lhead{\textit{aa\emph{aa}}}
\textit
é o comando para colocar o texto em itálico.
Responder3
Eu compilei usando seu código-fonte. A solução é: você pode alterar a fonte da família usando o cabeçalho.
a)tente esta linha:
\lhead{\textrm{ aa\emph{aa}}}
o \textrm é definir serif (romano).
b)você pode usar \textsf para definir a família sans serif, tente esta linha:
\lhead{\textrm{ aa\emph{aa}}}
c)você pode usar \texttt para definir a família da máquina de escrever (monoespaçada), tente esta linha:
\lhead{\texttt{ aa\emph{aa}}}