Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emojis are not usable in overlay-aware slides #769

Open
stone-zeng opened this issue Apr 4, 2022 · 4 comments
Open

Emojis are not usable in overlay-aware slides #769

stone-zeng opened this issue Apr 4, 2022 · 4 comments

Comments

@stone-zeng
Copy link

From stone-zeng/latex-emoji#12

The emoji characters will not disappear (or have opacity) when beamer covered item style is set to transparent:

\documentclass{beamer}
\usepackage{fontspec}
\setbeamercovered{transparent=0}
\begin{document}
\begin{frame}{Test}
\begin{itemize}[<+->]
\item This will appear on the first slide.
\item This will appear on the second slide.
  {\fontspec{Noto Color Emoji}[Renderer=HarfBuzz] 🩸}
\end{itemize}
\end{frame}
\end{document}
First Second
1 png-000001 1 png-000002
@samcarter
Copy link
Collaborator

You can avoid the problem with

% !TeX TS-program = lualatex

\documentclass{beamer}
\usepackage{fontspec}
\setbeamercovered{transparent=0}
\begin{document}
\begin{frame}{Test}
\begin{itemize}[<+->]
\item This will appear on the first slide.
\item This will appear on the second slide.
  \visible<.->{ \fontspec{Noto Color Emoji}[Renderer=HarfBuzz] 🩸}
\end{itemize}
\end{frame}
\end{document}

@stone-zeng
Copy link
Author

Yeah, but it clearly only works for transparent=0

@samcarter
Copy link
Collaborator

samcarter commented Apr 4, 2022

yes, but that's what the code in your question was using.

For other transparencies, you can overlay it with a semi-transparent shape, e.g. https://tex.stackexchange.com/a/354033/36296

% !TeX TS-program = lualatex

\documentclass{beamer}
\usepackage{fontspec}
\setbeamercovered{transparent=50}
\usepackage{tikz}
\begin{document}
\begin{frame}{Test}
\begin{itemize}[<+->]
\item This will appear on the first slide.
\item This will appear on the second slide.
      \begin{tikzpicture}
      \node[anchor=south west,inner sep=0] (B) at (4,0) {\fontspec{Noto Color Emoji}[Renderer=HarfBuzz] 🩸};
      \only<-1>{%
          \fill [draw=none, fill=white, fill opacity=0.5] (B.north west) -- (B.north east) -- (B.south east) -- (B.south west) -- (B.north west) -- cycle;
      }
      \end{tikzpicture}  
\end{itemize}
\end{frame}
\end{document}

document

@u-fischer
Copy link

beamer doesn't use real transparency here but mixes in colors to give it the same color as the background and so it doesn't affect graphics (and emoji are basically graphics). But one could probably use real transparency:

\documentclass{beamer}
\usepackage{fontspec}
\usepackage{transparent}
\setbeamercovered{transparent=30}

\makeatletter
\def\beamer@startcovered{%
  \beamer@smuggle{%
  \global\advance\beamer@coveringdepth by 1\relax%
  \beamer@actions{\pgfsys@begininvisible\aftergroup\beamer@@spacingcover}{%
     \pgfsys@endinvisible\aftergroup\beamer@@spacingcover%
     }%
  \def\opaqueness<##1>##2{%
    \only<##1>{%
      \beamer@actions{%
    \transparent{\fpeval{##2/100}}%
      }%
      {% end code needed???
      }}}%
  \ifnum\beamer@slideinframe<\beamer@minimum %ok, at beginning
    \begingroup
      \beamer@saveanother
      \advance\beamer@minimum by-\beamer@slideinframe
      \beamer@slideinframe=\beamer@minimum
      \beamer@uncoverbeforeactions
      \beamer@restoreanother
    \endgroup
  \else
    \begingroup
      \beamer@saveanother
      \advance\beamer@slideinframe by-\beamer@minimum
      \beamer@uncoverafteractions
      \beamer@restoreanother
    \endgroup
  \fi
  \beamer@do
  }%
}

\begin{document}
\begin{frame}{}
\begin{itemize}[<+->]
\item XX
\item 
  {\includegraphics[width=2cm]{example-image}\fontspec{Noto Color Emoji}[Renderer=HarfBuzz] 🩸}
  
\item xxxx  
  
\end{itemize}
\end{frame}
\end{document}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants