제목 색상을 이미지 배경으로 바꾸기

제목 색상을 이미지 배경으로 바꾸기

에 대한 후속 질문입니다.이미지를 Pspicture에 완벽하게 맞추는 편리한 방법

코드를 고려해보세요

\documentclass[a5paper,12pt,onecolumn,openany,final]{book}
\usepackage[hmargin=0.7in,vmargin=0.75in]{geometry}
\usepackage{pstricks,psvectorian}
\usepackage{scalerel} % For Vertical Stretch of Letters
\usepackage{graphicx}
\usepackage{color}

% Overlay Title
\newcommand{\mytitle}[1]% #1 = title
{\bgroup
  \Huge
  \sbox0{\parbox{\columnwidth}{\centering\textbf{\color{black}#1}}}%
  \sbox1{\parbox{\columnwidth}{\centering\textbf{\color{white}#1}}}%
  \usebox0\llap{\raisebox{1.45pt}{\usebox1}}
\egroup}

\begin{document}
\thispagestyle{empty}

\begin{pspicture}(-5,-5)(5,12)%
\psframe[linecolor=black,linewidth=4pt](-5,-5)(5,12)% 
\rput(0,3.5){\includegraphics[width=.87\linewidth,height=1.49\linewidth]{example-image-a}}
\end{pspicture}

\newpage
\thispagestyle{empty}

\begin{pspicture}(-5.09,-5.09)(5.09,12.09)%
\renewcommand*{\psvectorianDefaultColor}{yellow!65!red}%
\psframe[fillcolor=yellow!65!red,fillstyle=solid](-5,-5)(5,12) 
\psframe[linecolor=black,linewidth=4pt](-5.09,-5.09)(5.09,12.09)% 

% TITLE 
\rput(0,6.25){\vstretch{1.25}{\mytitle{CUT-OUT TITLE}}}
\rput(0,5){\vstretch{1.25}{\mytitle{AND PLACE}}}
\rput(0,3.75){\vstretch{1.25}{\mytitle{OVER IMAGE}}}
\end{pspicture}%
\end{document}

두 페이지의 출력을 생성합니다.

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

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

질문: 어떻게 하면 세 줄로 된 선을 효과적으로 잘라낼 수 있을까요?흰색 부분1페이지에 제목을 추가 pspicture한 다음 이를 pspicture1페이지 이미지에 오버레이하면 pspicture제목이 더 이상 흰색이 아니지만 배경용 1페이지 이미지가 포함된 2페이지가 나타납니다.
메모:에서 생성된 원본 검정색 오버레이는 \mytitle수정된 에서 계속 표시됩니다 pspicture.

답변1

에서만 작동latex->dvips->ps2dpf

\documentclass{book}
\usepackage{pstricks}
\usepackage{graphicx}
\usepackage{pst-char}
\DeclareFixedFont{\RM}{T1}{ptm}{b}{n}{2cm}
\begin{document}

\begin{pspicture}(-5,-5)(5,12)%
\begin{pscharclip}[linewidth=0.1pt]{\rput(0,3.5){\RM\shortstack{Cut-out title\\line 2\\line 3}}}%
\rput[lb](-5,-5){\includegraphics[width=10cm,height=17cm]{example-image-a}}
\end{pscharclip}
%\psframe[linecolor=black,linewidth=4pt,dimen=inner](-5,-5)(5,12)% 
\end{pspicture}

\end{document}

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

답변2

\pscharclip패키지 와 함께 제공되는 기능을 활용할 수 있습니다 pst-text.

\documentclass[a5paper,12pt,onecolumn,openany,final]{book}
\usepackage[hmargin=0.7in,vmargin=0.75in]{geometry}
\usepackage{pstricks,psvectorian,pst-text}
\usepackage{scalerel} % For Vertical Stretch of Letters
\usepackage{graphicx}
\usepackage{color}

% Overlay Title
\newcommand{\mytitle}[1]{% #1 = title
    \parbox{\columnwidth}{\centering\Huge\textbf{#1}}%
}

\newcommand{\mytitleA}[1]% #1 = title
{\bgroup
  \Huge\textbf{#1}%
\egroup}

\begin{document}
\thispagestyle{empty}

\begin{pspicture}(-5.09,-5.09)(5.09,12.09)%
\renewcommand*{\psvectorianDefaultColor}{yellow!65!red}%
\psframe[fillcolor=yellow!65!red,fillstyle=solid](-5,-5)(5,12) 
\psframe[linecolor=black,linewidth=4pt](-5.09,-5.09)(5.09,12.09)% 

% TITLE 
\newdimen{\shiftedY}
\pssetlength{\shiftedY}{5cm}
\psaddtolength{\shiftedY}{-1.45pt}

\rput(0,\shiftedY){\vstretch{1.25}{\mytitle{CUT-OUT TITLE \\ AND PLACE \\ OVER IMAGE}}}

\pscharclip[linewidth=0pt,linestyle=none]{
    \rput(0,5){\vstretch{1.25}{\mytitle{CUT-OUT TITLE \\ AND PLACE \\ OVER IMAGE}}}
}
    \rput(0,3.5){\includegraphics[width=.87\linewidth,height=1.49\linewidth]{example-image-a}}
\endpscharclip

\end{pspicture}%
\end{document}

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


사용이 좋은 제안시작점으로 Ti를 사용하여 다음을 수행할 수 있습니다.케이Z. 귀하의 예를 최대한 비슷하게 재현하려고 노력했지만 특히 글꼴 크기와 관련하여 여전히 다른 것 같습니다. 어쨌든 주요 아이디어가 분명하기를 바랍니다. 이를 컴파일하려면 PDFLaTeX 또는 LuaLaTeX를 사용해야 합니다.

\documentclass[a5paper,12pt,onecolumn,openany,final]{book}\usepackage[hmargin=0.7in,vmargin=0.75in]{geometry}

\usepackage{tikz}
\usetikzlibrary{fadings}

\newcommand{\mytitle}[2]{%
    \begin{tikzfadingfrompicture}[name=mytitle, color=transparent!0]
    
        % create fading from title
        \node[text width=\linewidth, align=center, font=\bfseries\Huge, yscale=1.25, transform shape] at (current page.center) {#2};
        
    \end{tikzfadingfrompicture}%
    \begin{tikzpicture}[overlay, remember picture]
    
        % orange background
        \fill[yellow!65!red, draw=black, line width=8pt] (current page.south west) rectangle (current page.north east);
    
        % text title shadow
        \fill[path fading=mytitle, fit fading=false, fading transform={shift=(current page.center)}, transform canvas={xshift=1pt, yshift=-1pt}] (current page.south west) rectangle (current page.north east);
        
        % text title cut out
        \fill[path fading=mytitle, fit fading=false, fading transform={shift=(current page.center)}, path picture={\node at (path picture bounding box.center) {
            \includegraphics[height=\paperheight, width=\paperwidth, keepaspectratio]{#1}
        };}] (current page.south west) rectangle (current page.north east);

    \end{tikzpicture}%
}

\begin{document}
\thispagestyle{empty}

\mytitle{background}{CUT-OUT TITLE \\ AND PLACE \\ OVER IMAGE}

\end{document}

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

관련 정보