LaTeX에서 이런 종류의 컬러 텍스트를 작성하는 방법은 무엇입니까?

LaTeX에서 이런 종류의 컬러 텍스트를 작성하는 방법은 무엇입니까?

라텍스 문서에 다음 텍스트를 추가해야 합니다. 현재 이미지를 만들어 문서에 추가했습니다.

최신 프로젝트에 텍스트로 추가하는 간단한 방법을 알아야 합니다.

추가 요구 사항은 페이지 중앙에 배치하고 기본 글꼴보다 큰 글꼴 크기를 사용하는 것입니다. (내 문서 기본 텍스트는 6e 12pt입니다.) 테두리를 추가할 필요가 없습니다.

여기에 이미지 설명을 입력하세요

답변1

이와 같이?

\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}

답변2

OP가 지금까지 제공된 답변 중 하나를 이미 수락한 것으로 나타났습니다. 다양성을 제공하기 위해 \boldredcaps인수의 모든 대문자를 굵게 및 빨간색으로 렌더링하는 LaTeX 매크로를 제공하는 솔루션이 있습니다.자동으로. 많은 \textbf{\textcolor{red}{...}}지침을 직접 적용할 필요가 없습니다. LaTeX 매크로는 \boldredcapsLua의 강력한 문자열 기능을 사용하여 gsub작업을 수행합니다.

여기에 이미지 설명을 입력하세요

% !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}

답변3

이 작업을 자주 수행해야 하는 경우 공백을 다음으로 대체 xstring하여 자동화할 수 있습니다 .\StrSubstitute\textcolor{red}

여기에 이미지 설명을 입력하세요

암호:

\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}

답변4

제공된 코드는 동봉된 그림을 제공해야 합니다. 당신이 원했던 것과 맞나요? 원하는 대로 코드를 조정할 수 있습니다.

\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}

여기에 이미지 설명을 입력하세요

관련 정보