비머 스타일 노드의 텍스트 색상

비머 스타일 노드의 텍스트 색상

나는 'metropolis' 비머 테마 + 글꼴 사양 + Fira 글꼴을 기반으로 간단한 .sty 파일을 작성했습니다. 나는 제목 페이지에서 MWE처럼 저자와 기관이 한 줄씩 표시되는 아이디어를 좋아합니다. 즉, 저자/기관당 한 줄입니다. 이 레이아웃의 단점은 \author 및 \institution 매크로를 사용하려면 \\동일한 inst를 형성하는 별도의 공동 작성자와 함께 인수를 전달해야 한다는 것입니다. align=left그 일을 처리합니다. 문제는 새 단락이 기본 색상인 검정색을 사용하고 더 이상 \usebeamercolor[fg]{author}. color = \usebeamercolor[fg]{author}노드 정의에 사용하면 Missing \endcsname inserted오류가 발생합니다. color = white이것이 내가 지금 하고 있는 일이지만 이는 색상을 하드 코딩하는 것을 의미하므로 피하는 것이 좋습니다. 해결책은 다음과 같이 저자 목록을 분할하는 것입니다.\@authors 목록을 \and로 분할합니다.저자를 다시 살펴보지만 제가 하고 있는 일에는 너무 과한 것 같습니다. \usebeamercolor[fg]{author}모든 저자에게 적용할 수 있는 더 간단한 방법이 있나요 ?

MWE:

\documentclass[11pt, aspectratio=169]{beamer}  % 
\usetheme[]{metropolis}

% Requirement
\usepackage{tikz}
\usepackage{fontspec}

% colors
\definecolor{BGlightBlu}{HTML}{3461AA}

% Fonts
\newfontfamily{\RuLight}{Rubik Light}

% Settings
\setbeamercolor*{author}{fg = white}


% innertheme 

\defbeamertemplate*{title page}{thisStyle}[1][]
{%

\begin{tikzpicture}[remember picture,overlay]
  \draw[fill=BGlightBlu, BGlightBlu] (current page.south west) rectangle
   (current page.north east);

% Title
\node
[   align=left,
    xshift=.6cm,
    yshift = 1cm, 
    minimum width=0.8\textwidth,
    text width=0.7\textwidth,
    anchor = west, 
    font = {\RuLight \LARGE},
    text = white,
    execute at begin node=\setlength{\baselineskip}{0.7\baselineskip}
] (title) at (current page.west)
{
    \inserttitle
};

% Author 
\node
[   
    below=0.6cm,
    align=left,
    anchor = north west,
    xshift=.6cm,
    font={\RuLight \footnotesize},
    align=left,
%   color=white, %works
%     color = \usebeamercolor[fg]{author}, % 'Missing \endcsname' error
    execute at begin node=\setlength{\baselineskip}{01.2\baselineskip}
] (author) at (title.south west){  \usebeamercolor[fg]{author} \insertauthor
                        };  

% Inst
\node
[   
    xshift = 0.5\textwidth,
    below=0.6cm,
    align=left,
    anchor = north west,
    font={\RuLight \footnotesize},
    align=left,
    color=white,
    execute at begin node=\setlength{\baselineskip}{1.2\baselineskip}
] (inst) at (title.south west){ \insertinstitute };

\end{tikzpicture}
}

\title[]{The title is so long that it needs two lines}
\author[]{Me Myself  \\    My First Coauthor, My Second Coauthor}
\institute[]{My Place alone (MPA)  \\ Their place, together (TPT)} 


\begin{document}

\begin{frame}[plain]
\maketitle
\end{frame}

\end{document}

제목 프레임

이제 오류를 재현하기 위해 BgMWE.tex와 beamerthemeMWE.sty의 코드를 분할했습니다.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  beamerthemeMWE.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\mode<presentation>
\usetheme[]{metropolis}

% Requirement
\usepackage{tikz}

% Settings
\setbeamercolor*{author}{fg = red}

% innertheme 

\setbeamertemplate{background}{
  \begin{tikzpicture}
  \draw[fill=BGlightBlu, BGlightBlu] (current page.south west) rectangle
   (current page.north east);
  \ifnum\thepage>1\relax%
   \fill[white,opacity=1] (0,0) rectangle(\the\paperwidth,\the\paperheight);
   \fi
  \end{tikzpicture}
}

\defbeamertemplate*{title page}{MWE}[1][]
{%

\begin{tikzpicture}[remember picture,overlay]

% Title
\node
[   align=left,
    xshift=.6cm,
    yshift = 1cm, 
    minimum width=0.8\textwidth,
    text width=0.7\textwidth,
    anchor = west, 
    font = { \LARGE},
    text = white,
    execute at begin node=\setlength{\baselineskip}{0.7\baselineskip}
] (title) at (current page.west)
{
    \inserttitle
};

% Author 
\node
[   
    below=0.6cm,
    align=left,
    anchor = north west,
    xshift=.6cm,
    font={ \footnotesize},
    align=left,
    color = author.fg, % Here is the source of the error
    execute at begin node=\setlength{\baselineskip}{0.8\baselineskip}
] (author) at (title.south west){  \insertauthor
                        };  

% Inst
\node
[   
    xshift = 0.5\textwidth,
    below=0.6cm,
    align=left,
    anchor = north west,
    font={ \footnotesize},
    align=left,
    color=white,
    execute at begin node=\setlength{\baselineskip}{0.8\baselineskip}
] (inst) at (title.south west){ \insertinstitute };

\node[below=0.5cm,
     align=left,
     anchor = north west,
     font={ \large},
     color=white,
] (date) at (author.south west){ \insertdate};
\end{tikzpicture}[action]{%
{\usebeamercolor[fg]{author}}% just to initialize the colour
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  BgMWE.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt, aspectratio=169]{beamer}  % 
\usetheme{MWE}


\title[]{The title is so long that it needs two lines}
\author[]{Me Myself  \\    My First Coauthor, My Second Coauthor}
\institute[]{My Place alone (MPA)  \\ Their place, together (TPT)} 


\begin{document}

\begin{frame}[plain]
\maketitle
\end{frame}

\end{document}

MWE.tex를 컴파일하면 다음과 같은 결과가 나옵니다.MWE.tex:14: Package xcolor Error: Undefined color `author.fg'.

Type  H <return>  for immediate help.```

답변1

이전에 작성자 색상을 사용한 경우(간단한 {\usebeamercolor[fg]{author}}방법으로) 다음과 같이 전경 구성 요소에 액세스할 수 있습니다 author.fg.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  BgMWE.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt, aspectratio=169]{beamer}% 


\begin{filecontents*}[overwrite]{beamerthemeMWE.sty}
\mode<presentation>
\usetheme{moloch}% modern fork of the metropolis theme

% Requirement
\usepackage{tikz}

\definecolor{BGlightBlu}{HTML}{3461AA}

% Settings
\setbeamercolor*{author}{fg = red}

% innertheme 

\setbeamertemplate{background}{
  \begin{tikzpicture}
  \draw[fill=BGlightBlu, BGlightBlu] (current page.south west) rectangle
   (current page.north east);
  \ifnum\thepage>1\relax%
   \fill[white,opacity=1] (0,0) rectangle(\the\paperwidth,\the\paperheight);
   \fi
  \end{tikzpicture}
}

\defbeamertemplate*{title page}{MWE}[1][]
{%
\begin{tikzpicture}[remember picture,overlay]

% Title
\node
[   align=left,
    xshift=.6cm,
    yshift = 1cm, 
    minimum width=0.8\textwidth,
    text width=0.7\textwidth,
    anchor = west, 
    font = {\LARGE},
    text = white,
    execute at begin node=\setlength{\baselineskip}{0.7\baselineskip}
] (title) at (current page.west)
{\inserttitle};

% Author 
\node
[   
    below=0.6cm,
    align=left,
    anchor = north west,
    xshift=.6cm,
    font={\footnotesize},
    align=left,
    color = author.fg, % Here is the source of the error
    execute at begin node=\setlength{\baselineskip}{0.8\baselineskip}
] (author) at (title.south west){\insertauthor};

% Inst
\node
[   
    xshift = 0.5\textwidth,
    below=0.6cm,
    align=left,
    anchor = north west,
    font={\footnotesize},
    align=left,
    color=white,
    execute at begin node=\setlength{\baselineskip}{0.8\baselineskip}
] (inst) at (title.south west){\insertinstitute};

\node[below=0.5cm,
     align=left,
     anchor = north west,
     font={\large},
     color=white,
] (date) at (author.south west){\insertdate};
\end{tikzpicture}
}

{\usebeamercolor[fg]{author}}
\end{filecontents*}
\usetheme{MWE}


\title[]{The title is so long that it needs two lines}
\author[]{Me Myself  \\    My First Coauthor, My Second Coauthor}
\institute[]{My Place alone (MPA)  \\ Their place, together (TPT)} 


\begin{document}

\begin{frame}[plain]
\maketitle
\end{frame}

\end{document}

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

관련 정보