Question

Je veux avoir un texte apparaissent semi-transparent, mais pas d'une manière de superposition (où il devient éventuellement solide) juste en permanence semi-transparent. Pour les questions compliquer, le texte en question fait partie d'un matrix:

$
\begin{matrix}
          & \{-2,3,5,0,8\} & \\
    \{-2,3,5,0\} & & \{-2,3,5,8\} \\
          & \{-2,3,5\} &
\end{matrix}
$

Je veux la troisième ligne dans la matrice pour être semi-transparente. Est-il possible de le faire?

Était-ce utile?

La solution

Edit:. amélioré la solution en la transformant en une commande avec un argument optionnel

D'accord, découvert comment le faire:

\newcommand{\semitransp}[2][35]{\color{fg!#1}#2}

...

$
\begin{matrix}
       & \{-2,3,5,0,8\} & \\
    \{-2,3,5,0\} & & \{-2,3,5,8\} \\
      & \semitransp{\{-2,3,5\}} &
\end{matrix}
$

Le paramètre optionnel contrôle la transparence. Alors \semitransp[20]{text} est plus léger et \semitransp[60]{text} est plus lourd. La valeur par défaut 35 semble bon sur mon écran d'ordinateur. Il est encore à voir comment il semble projeté sur un mur.

Autres conseils

La réponse de Ari peut travailler pour lui (et en 2010), mais la commande donnée fera tout le texte suivant transparent, non seulement le texte donné.

Une meilleure solution pour faire que le texte donné transparent:

\newcommand{\semitransp}[2][35]{\textcolor{fg!#1}{#2}}
% Swap \color with \textcolor and add another curly brackets pair.

...

$
\begin{matrix}
   & \{-2,3,5,0,8\} & \\
\{-2,3,5,0\} & & \{-2,3,5,8\} \\
  & \semitransp{\{-2,3,5\}} &
\end{matrix}
$

Pour obtenir de véritables semi-transparence, on peut utiliser \pgfsetfillopacity. L'avantage par rapport à feindre l'opacité en mélangeant la couleur de premier plan à l'arrière-plan est que ce sera aussi si l'il y a une image d'arrière-plan ou un autre élément de couleur.

\documentclass{beamer}

\begin{document}

\begin{frame}
$
\begin{matrix}
          & \{-2,3,5,0,8\} & \\
    \{-2,3,5,0\} & & \{-2,3,5,8\} \\
          & {\pgfsetfillopacity{0.2}\{-2,3,5\}} &
\end{matrix}
$

\end{frame} 


\setbeamertemplate{background canvas}{\includegraphics[width=\paperwidth]{example-grid-100x100bp}}


\begin{frame}
$
\begin{matrix}
          & \{-2,3,5,0,8\} & \\
    \{-2,3,5,0\} & & \{-2,3,5,8\} \\
          & {\pgfsetfillopacity{0.2}\{-2,3,5\}} &
\end{matrix}
$

\end{frame}     

\end{document}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top