Como escrever esse tipo de texto colorido em LaTeX?

Como escrever esse tipo de texto colorido em LaTeX?

Preciso adicionar o seguinte texto ao meu documento de látex. atualmente criei uma imagem e adicionei ao documento.

Preciso saber uma maneira simples de adicioná-lo como text , ao meu projeto mais recente.

Uma necessidade adicional é centralizá-lo na página e usar um tamanho de fonte maior que a fonte padrão. (O texto padrão do meu documento é seis 12pt.) Não há necessidade de adicionar uma borda.

insira a descrição da imagem aqui

Responder1

Assim?

\documentclass{article}

\usepackage{xcolor}

\begin{document}

\begin{center}
    \Large\sl
    \textcolor{red}{S}ince \textcolor{red}{E}veryone \textcolor{red}{C}an \textcolor{red}{R}ead, \textcolor{red}{E}ncoding \textcolor{red}{T}ext \textcolor{red}{I}n \textcolor{red}{N}eutral \textcolor{red}{S}entences \textcolor{red}{I}s \textcolor{red}{D}oubtfully \textcolor{red}{E}ffective

    \vspace{1cm}\LARGE\color{red}
    `Secret inside'
\end{center}

\end{document}

Responder2

Percebi que o OP já aceitou uma das respostas fornecidas até agora. Apenas para fornecer alguma variedade, aqui está uma solução que fornece uma macro LaTeX chamada \boldredcapsque renderiza todas as letras maiúsculas em seu argumento em negrito e vermelhoautomaticamente. Não há necessidade de aplicar muitas \textbf{\textcolor{red}{...}}instruções manualmente. A macro LaTeX \boldredcapsdepende da poderosa função de string de Lua gsubpara realizar seu trabalho.

insira a descrição da imagem aqui

% !TEX TS-program = lualatex
\documentclass[12pt]{article}
\usepackage{xcolor}   % for "\textcolor" macro
\usepackage{ragged2e} % for "\Centering" macro
\usepackage{luacode}  % for "\luaexec" macro
%% Define a LaTeX macro called "\boldredcaps":
\newcommand\boldredcaps[1]{\luaexec{%
   yyy = "#1"
   yyy = yyy:gsub ( "\%u" , "\\textbf{\\textcolor{red}{\%0}}" )
   tex.sprint ( yyy )
}}

%% Concoct steganographic message:
\newcommand{\blurb}{Since Everyone Can Read, Encoding Text In Neutral Sentences Is Doubtfully Effective.}

\begin{document}

\begin{figure}
\Large  % or "\large", or "\huge", etc
\sffamily\itshape
\Centering
\boldredcaps{\blurb} % <-- argument of \boldredcaps can be a macro 

\bigskip
\textbf{\textcolor{red}{`secret inside'}}
\rmfamily\upshape
\caption{Text Steganography}
\end{figure}

\end{document}

Responder3

Se você precisar fazer isso com frequência, pode ser automatizado usando xstringpara \StrSubstitutesubstituir um espaço por \textcolor{red}:

insira a descrição da imagem aqui

Código:

\documentclass{article}
\usepackage{xcolor}
\usepackage{xstring}

\newcommand*{\Hightlight}[1]{%
    \noexpandarg
    \StrSubstitute[0]{\textcolor{red}#1}{ }{ \textcolor{red}}[\FormattedString]%
    \FormattedString%
}%

\begin{document}
\Hightlight{Since Everyone Can Read, Encoding Text In Neutral Sentences Is Doubtfully Effective} 
\end{document}

Responder4

O código fornecido deve fornecer a imagem anexa. Combina com o que você queria? Você pode ajustar o código como desejar.

\documentclass{article}
\usepackage{xcolor}
\usepackage{framed}

\begin{document}
\begin{framed}
\centering
\textbf{\color{red} S}ince \textbf{\color{red} E}veryone \textbf{\color{red} C}an \textbf{\color{red} R}ead, \textbf{\color{red} E}ncoding \textbf{\color{red} T}ext \textbf{\color{red} I}n \textbf{\color{red} N}eutral \textbf{\color{red} S}entences \textbf{\color{red} I}s \textbf{\color{red} D}oubtfully \textbf{\color{red} E}ffective. \\ \vspace{5mm}
{\large \textbf{\color{red} 'Secret inside'}}
\end{framed}
\end{document}

insira a descrição da imagem aqui

informação relacionada