프레젠테이션에 Latex KOMA 프레젠테이션 템플릿 [1]을 사용하고 싶습니다. 하지만 나는 그것을 교체하고 싶다.달리는 머리(하위)섹션 제목 옆의 상단에 있습니다.
현재 Latex KOMA 프리젠테이션 템플릿[1]은 다음과 같습니다.
\documentclass[
paper=128mm:96mm, % The same paper size as used in the beamer class
fontsize=11pt, % Font size
pagesize, % Write page size to dvi or pdf
parskip=half-, % Paragraphs separated by half a line
]{scrartcl} % KOMA script (article)
\linespread{1.12} % Increase line spacing for readability
%------------------------------------------------
% Colors
\usepackage{xcolor} % Required for custom colors
% Define a few colors for making text stand out within the presentation
\definecolor{mygreen}{RGB}{44,85,17}
\definecolor{myblue}{RGB}{34,31,217}
\definecolor{mybrown}{RGB}{194,164,113}
\definecolor{myred}{RGB}{255,66,56}
% Use these colors within the presentation by enclosing text in the commands below
\newcommand*{\mygreen}[1]{\textcolor{mygreen}{#1}}
\newcommand*{\myblue}[1]{\textcolor{myblue}{#1}}
\newcommand*{\mybrown}[1]{\textcolor{mybrown}{#1}}
\newcommand*{\myred}[1]{\textcolor{myred}{#1}}
%------------------------------------------------
%------------------------------------------------
% Margins
\usepackage[ % Page margins settings
includeheadfoot,
top=3.5mm,
bottom=3.5mm,
left=5.5mm,
right=5.5mm,
headsep=6.5mm,
footskip=8.5mm
]{geometry}
%------------------------------------------------
%------------------------------------------------
% Fonts
\usepackage[T1]{fontenc} % For correct hyphenation and T1 encoding
\usepackage{lmodern} % Default font: latin modern font
%\usepackage{fourier} % Alternative font: utopia
%\usepackage{charter} % Alternative font: low-resolution roman font
\renewcommand{\familydefault}{\sfdefault} % Sans serif - this may need to be commented to see the alternative fonts
%------------------------------------------------
%------------------------------------------------
% Various required packages
\usepackage{amsthm} % Required for theorem environments
\usepackage{bm} % Required for bold math symbols (used in the footer of the slides)
\usepackage{graphicx} % Required for including images in figures
\usepackage{tikz} % Required for colored boxes
\usepackage{booktabs} % Required for horizontal rules in tables
\usepackage{multicol} % Required for creating multiple columns in slides
\usepackage{lastpage} % For printing the total number of pages at the bottom of each slide
\usepackage[english]{babel} % Document language - required for customizing section titles
\usepackage{microtype} % Better typography
\usepackage{tocstyle} % Required for customizing the table of contents
%------------------------------------------------
%------------------------------------------------
% Slide layout configuration
\usepackage{scrpage2} % Required for customization of the header and footer
\pagestyle{scrheadings} % Activates the pagestyle from scrpage2 for custom headers and footers
\clearscrheadfoot % Remove the default header and footer
\setkomafont{pageheadfoot}{\normalfont\color{black}\sffamily} % Font settings for the header and footer
% Sets vertical centering of slide contents with increased space between paragraphs/lists
\makeatletter
\renewcommand*{\@textbottom}{\vskip \z@ \@plus 1fil}
\newcommand*{\@texttop}{\vskip \z@ \@plus .5fil}
\addtolength{\parskip}{\z@\@plus .25fil}
\makeatother
% Remove page numbers and the dots leading to them from the outline slide
\makeatletter
\newtocstyle[noonewithdot]{nodotnopagenumber}{\settocfeature{pagenumberbox}{\@gobble}}
\makeatother
\usetocstyle{nodotnopagenumber}
\AtBeginDocument{\renewcaptionname{english}{\contentsname}{\Large Outline}} % Change the name of the table of contents
%------------------------------------------------
%------------------------------------------------
% Header configuration - if you don't want a header remove this block
\ihead{
\hspace{-2mm}
\begin{tikzpicture}[remember picture,overlay]
\node [xshift=\paperwidth/2,yshift=-\headheight] (mybar) at (current page.north west)[rectangle,fill,inner sep=0pt,minimum width=\paperwidth,minimum height=2\headheight,top color=mygreen!64,bottom color=mygreen]{}; % Colored bar
\node[below of=mybar,yshift=3.3mm,rectangle,shade,inner sep=0pt,minimum width=128mm,minimum height =1.5mm,top color=black!50,bottom color=white]{}; % Shadow under the colored bar
shadow
\end{tikzpicture}
\color{white}\runninghead} % Header text defined by the \runninghead command below and colored white for contrast
%------------------------------------------------
%------------------------------------------------
% Footer configuration
%\newlength{\footheight}
\setlength{\footheight}{8mm} % Height of the footer
\addtokomafont{pagefoot}{\footnotesize} % Small font size for the footnote
\ifoot{% Left side
\hspace{-2mm}
\begin{tikzpicture}[remember picture,overlay]
\node [xshift=\paperwidth/2,yshift=\footheight] at (current page.south west)[rectangle,fill,inner sep=0pt,minimum width=\paperwidth,minimum height=3pt,top color=mygreen,bottom color=mygreen]{}; % Green bar
\end{tikzpicture}
\myauthor\ \raisebox{0.2mm}{$\bm{\vert}$}\ \myuni % Left side text
}
\ofoot[\pagemark/\pageref{LastPage}\hspace{-2mm}]{\pagemark/\pageref{LastPage}\hspace{-2mm}} % Right side
%------------------------------------------------
%------------------------------------------------
% Section spacing - deeper section titles are given less space due to lesser importance
\usepackage{titlesec} % Required for customizing section spacing
\titlespacing{\section}{0mm}{0mm}{0mm} % Lengths are: left, before, after
\titlespacing{\subsection}{0mm}{0mm}{-1mm} % Lengths are: left, before, after
\titlespacing{\subsubsection}{0mm}{0mm}{-2mm} % Lengths are: left, before, after
\setcounter{secnumdepth}{0} % How deep sections are numbered, set to no numbering by default - change to 1 for numbering sections, 2 for numbering sections and subsections, etc
%------------------------------------------------
%----------------------------------------------------------------------------------------
% PRESENTATION INFORMATION
%----------------------------------------------------------------------------------------
\newcommand*{\mytitle}{Presentation Title} % Title
\newcommand*{\runninghead}{Running Head} % Running head displayed on almost all slides
\newcommand*{\myauthor}{John Smith} % Presenters name(s)
\newcommand*{\mydate}{\today} % Presentation date
\newcommand*{\myuni}{University of California --- Department of Statistics} % University or department
%----------------------------------------------------------------------------------------
\begin{document}
%----------------------------------------------------------------------------------------
\section{Displaying Text}
\clearpage
%----------------------------------------------------------------------------------------
\end{document}
나는 그것을 교체하려고 노력했다달리는 머리다음 사용자 정의 \currtitle
명령을 사용하여:
\makeatletter
\newcommand{\currtitle}{\ttl@savetitle}
\makeatother
%------------------------------------------------
% Header configuration - if you don't want a header remove this block
\ihead{
\hspace{-2mm}
\begin{tikzpicture}[remember picture,overlay]
\node [xshift=\paperwidth/2,yshift=-\headheight] (mybar) at (current page.north west)[rectangle,fill,inner sep=0pt,minimum width=\paperwidth,minimum height=2\headheight,top color=mygreen!64,bottom color=mygreen]{}; % Colored bar
\node[below of=mybar,yshift=3.3mm,rectangle,shade,inner sep=0pt,minimum width=128mm,minimum height =1.5mm,top color=black!50,bottom color=white]{}; % Shadow under the colored bar
shadow
\end{tikzpicture}
\color{white}\currtitle} % Header text defined by the \runninghead command below and colored white for contrast
그런데 슬라이드 내에서 섹션 제목을 어떻게 숨길 수 있나요? (녹색 머리글 표시줄 아래) 또는 (하위)섹션 제목을달리는 머리위치?
감사해요!
[1]http://www.latextemplates.com/template/koma-script-presentation
답변1
나는 댓글에서 TOC를 생성해야 하는지 물었고 답변 요청에 꽤 끈질기게 반응했습니다. 거기에는 꽤 그럴만한 이유가 있습니다.
현재 (이 솔루션/해결 방법을 사용하면) 섹션 제목이 전혀 인쇄되지 않습니다(를 사용하는 고전적인 의미에서 \@startsection
). 새 명령을 호출할 때마다 sectiona
페이지가 지워지지 않고(즉, 새 페이지/슬라이드 시작) 실행 중인 헤드가 업데이트되고 목차 항목이 생성됩니다. 섹션 정의를 갱신할 수도 있지만 이는 의 정의를 엉망으로 만들고 \tableofcontents
그림/표 목록이나 참고문헌 목록을 망칠 수도 있습니다.
Markus의 원본 논문은 몇 년이 지났고 많은 것이 변경되었습니다. 예를 들어 KOMA는 이제 titlesec
사용되기 때문에 큰 경고를 시작합니다 . KOMA 번들에 새로운 패키지가 scrlayer-scrpage
추가되어 런닝 헤드에 큰 기여를 했습니다.
요약하자면, 기사는 프리젠타틴에 KOMA 기사 클래스를 사용하는 프로토타입을 제시했습니다. 연마해야 할 거친 모서리가 있습니다. 프로토타입의 경우 몇 년 전에는 꽤 괜찮았지만 지금 당장은, 특히 제공된 템플릿에서 저는 이렇게 말하고 싶습니다. "손을 떼세요!"
주제로 돌아가서, 내가 무엇을 했나요? 별표 버전을 확인하기 위해 패키지 xparse를 사용했습니다. 별표 표시된 버전은 실행 중인 헤더(프레임 제목과 유사)를 업데이트하지만 toc 항목을 배치하지 않습니다. 또한 section
(어쨌든 사용되지 않는) 의 카운터는 1씩 증가합니다.
의 별표 표시된 명령을 사용하지 않는 경우 sectiona
toc-entry에 대한 선택적 제목을 선택할 수 있습니다. 이는 section 명령의 표준 동작과 동일합니다.
subsectiona
헤더를 업데이트하고 조금 더 작게 만들고 TOC에 하위 섹션 항목을 추가합니다.
면책조항: 제공된 템플릿에는 날카로운 모서리가 있습니다. 특히 오버레이나 멋진 기능이 훌륭하다고 생각한다면 이를 위해 설계된 클래스로 전환하세요.
오해하지 마십시오. 프레젠테이션에 scrartcl을 사용하는 것은 좋은 생각이지만 제공되는 모든 부가 기능을 결코 얻을 수는 없습니다
beamer
.
MWE에 중요한 것은 솔직히 말해서 다음과 같습니다. 많지는 않지만 여전히 ...
\usepackage{xparse}
%
\DeclareDocumentCommand\sectiona{s o m}{%
\clearpage%
\IfBooleanTF{#1}{%
\renewcommand{\runninghead}{#3}%
}{%
\refstepcounter{section}%JB: Please don't aske mw, %
%why i am doing this, as they aren't printed anyway%
\renewcommand{\runninghead}{#3}%always use the%
% mandatory argument for the runninghead%
\IfNoValueTF{#2}{%
\addsectiontocentry{}{#3}%
}{%
\addsectiontocentry{}{#2}%
}%
}%
}%
\newcommand\subsectiona[1]{%
\clearpage%
\refstepcounter{subsection}%
\renewcommand{\runninghead}{\small #1\par}%
\addsubsectiontocentry{}{#1}%
}%
%
이제 전체 예제가 복사/붙여넣기/컴파일 준비가 되었습니다.
\documentclass[
paper=128mm:96mm,
fontsize=11pt,
pagesize,
parskip=half-,
]{scrartcl}
\linespread{1.12}
\usepackage{bm}
\usepackage{xcolor}
\definecolor{mygreen}{RGB}{44,85,17}
\definecolor{myblue}{RGB}{34,31,217}
\definecolor{mybrown}{RGB}{194,164,113}
\definecolor{myred}{RGB}{255,66,56}
\newcommand*{\mygreen}[1]{\textcolor{mygreen}{#1}}
\newcommand*{\myblue}[1]{\textcolor{myblue}{#1}}
\newcommand*{\mybrown}[1]{\textcolor{mybrown}{#1}}
\newcommand*{\myred}[1]{\textcolor{myred}{#1}}
\usepackage[
includeheadfoot,
top=3.5mm,
bottom=3.5mm,
left=5.5mm,
right=5.5mm,
headsep=6.5mm,
footskip=8.5mm
]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{tikz}
\usepackage{lastpage}
\usepackage[english]{babel}
\usepackage{microtype}
\usepackage{tocstyle}
\usepackage{scrpage2}
\pagestyle{scrheadings}
\clearscrheadfoot
\setkomafont{pageheadfoot}{\normalfont\color{black}\sffamily}
\makeatletter
\renewcommand*{\@textbottom}{\vskip \z@ \@plus 1fil}
\newcommand*{\@texttop}{\vskip \z@ \@plus .5fil}
\addtolength{\parskip}{\z@\@plus .25fil}
\makeatother
\makeatletter
\newtocstyle[noonewithdot]{nodotnopagenumber}{\settocfeature{pagenumberbox}{\@gobble}}
\makeatother
\usetocstyle{nodotnopagenumber}
\AtBeginDocument{\renewcaptionname{english}{\contentsname}{Outline}}
\ihead{
\hspace{-2mm}
\begin{tikzpicture}[remember picture,overlay]
\node [xshift=\paperwidth/2,yshift=-\headheight] (mybar) at (current page.north west)[rectangle,fill,inner sep=0pt,minimum width=\paperwidth,minimum height=2\headheight,top color=mygreen!64,bottom color=mygreen]{};
\node[below of=mybar,yshift=3.3mm,rectangle,shade,inner sep=0pt,minimum width=128mm,minimum height =1.5mm,top color=black!50,bottom color=white]{};
shadow
\end{tikzpicture}
\color{white}\runninghead}
\setlength{\footheight}{8mm}
\addtokomafont{pagefoot}{\footnotesize}
\ifoot{
\hspace{-2mm}
\begin{tikzpicture}[remember picture,overlay]
\node [xshift=\paperwidth/2,yshift=\footheight] at (current page.south west)[rectangle,fill,inner sep=0pt,minimum width=\paperwidth,minimum height=3pt,top color=mygreen,bottom color=mygreen]{};
\end{tikzpicture}
\myauthor\ \raisebox{0.2mm}{$\bm{\vert}$}\ \myuni
}
\ofoot[\pagemark/\pageref{LastPage}\hspace{-2mm}]{\pagemark/\pageref{LastPage}\hspace{-2mm}}
\usepackage{titlesec}
\titlespacing{\section}{0mm}{0mm}{0mm}
\titlespacing{\subsection}{0mm}{0mm}{-1mm}
\titlespacing{\subsubsection}{0mm}{0mm}{-2mm}
\setcounter{secnumdepth}{0}
\newcommand*{\mytitle}{Presentation Title}
\usepackage{nameref}
\newcommand*{\runninghead}{}
\newcommand*{\myauthor}{John Smith}
\newcommand*{\mydate}{\today}
\newcommand*{\myuni}{University of California --- Department of Statistics}
\usepackage{xparse}
%
\DeclareDocumentCommand\sectiona{s o m}{%
\clearpage%
\IfBooleanTF{#1}{%
\renewcommand{\runninghead}{#3}%
}{%
\refstepcounter{section}%JB: Please don't aske mw, %
%why i am doing this, as they aren't printed anyway%
\renewcommand{\runninghead}{#3}%always use the%
% mandatory argument for the runninghead%
\IfNoValueTF{#2}{%
\addsectiontocentry{}{#3}%
}{%
\addsectiontocentry{}{#2}%
}%
}%
}%
\newcommand\subsectiona[1]{%
\clearpage%
\refstepcounter{subsection}%
\renewcommand{\runninghead}{\small #1\par}%
\addsubsectiontocentry{}{#1}%
}%
%
\begin{document}
\tableofcontents
\sectiona{a section}
Text in a section, runninghead updated
\sectiona{a different section}
Text in another section, runninghead updated
\subsectiona{a subsection}
The runninghead is now smaller, to distiguish it a bit from a
section
\sectiona*{a starred section}
Text in a starred section, runninghead updated, but no toc entry
\sectiona[toc entry]{running head}
an optional argument? REALLY?
\end{document}