horizontal line command

This commit is contained in:
Jan Benda 2021-03-06 00:56:28 +01:00
parent f47aad4684
commit dc0eae61dc
4 changed files with 159 additions and 135 deletions

View File

@ -82,10 +82,18 @@
\setbeamercolor{message item symbol}{fg=red}
\setbeamercolor{verse}{fg=, bg=black!15}
\setbeamercolor{verse line top}{fg=green}
\setbeamercolor{verse line bottom}{fg=green}
\setbeamercolor{quote}{fg=, bg=black!15}
\setbeamercolor{quote symbol}{fg=red}
\setbeamercolor{quote line top}{fg=red}
\setbeamercolor{quote line bottom}{fg=red}
\setbeamercolor{quotation}{fg=, bg=black!15}
\setbeamercolor{quotation symbol}{fg=blue}
\setbeamercolor{quotation line top}{fg=blue}
\setbeamercolor{quotation line bottom}{fg=blue}
\setbeamercolor{section in toc}{parent={normal text}}
\setbeamercolor{subsection in toc}{parent={normal text}}

View File

@ -83,8 +83,18 @@
\setbeamercolor{message item symbol}{fg=utgold}
\setbeamercolor{verse}{fg=, bg=utgreen!20}
\setbeamercolor{verse line top}{fg=utgreen}
\setbeamercolor{verse line bottom}{fg=utgreen}
\setbeamercolor{quote}{fg=, bg=utgreen!20}
\setbeamercolor{quote symbol}{fg=utred}
\setbeamercolor{quote line top}{fg=}
\setbeamercolor{quote line bottom}{fg=}
\setbeamercolor{quotation}{fg=, bg=utgreen!20}
\setbeamercolor{quotation symbol}{fg=utblue}
\setbeamercolor{quotation line top}{fg=}
\setbeamercolor{quotation line bottom}{fg=}
\setbeamercolor{section in toc}{parent={normal text}}
\setbeamercolor{subsection in toc}{parent={normal text}}

View File

@ -8,7 +8,6 @@
\ProvidesPackage{beamerthemelines}[2021/02/28 beamer theme with horizontal lines]
\RequirePackage{tikz}
\RequirePackage{xstring}
\RequirePackage{pifont}
\newif\if@beamer@footline@author
@ -66,6 +65,27 @@
% no headline:
\setbeamertemplate{headline}[default]
%%%%% horizontal line %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% a horizontal line on top of a box over the whole linewidth
% arguments: name of color theme, width of line
\newcommand{\beamer@horizontal@line@top}[2]{%
\ifbeamercolorempty[fg]{#1}{}{%
\begin{beamercolorbox}[vmode]{#1}
\rule{\linewidth}{#2}
\end{beamercolorbox}%
\par\nointerlineskip}%
}
% a horizontal line below a box over the whole linewidth
% arguments: name of color theme, width of line
\newcommand{\beamer@horizontal@line@bottom}[2]{%
\ifbeamercolorempty[fg]{#1}{}{%
\par\nointerlineskip%
\begin{beamercolorbox}[vmode]{#1}
\rule{\linewidth}{#2}
\end{beamercolorbox}}%
}
%%%%% page numbers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -235,14 +255,7 @@
%%%%% frametitle line:
\defbeamertemplate{frametitle line}{text}[1][1pt]%
{
\ifbeamercolorempty[fg]{frametitle line}{}{%
\nointerlineskip%
\begin{beamercolorbox}[wd=\textwidth,dp=0pt,ht=#1,sep=0pt]{frametitle line}%
\rule{\columnwidth}{#1}%
\end{beamercolorbox}%
}%
}
{\beamer@horizontal@line@bottom{frametitle line}{#1}}
\defbeamertemplate{frametitle line}{page}[1][1pt]%
{
\ifbeamercolorempty[fg]{frametitle line}{}{%
@ -370,23 +383,15 @@
\newcommand{\block@lines@begin}[3]{%
\par\vskip\medskipamount%
\usebeamerfont{block title#1}%
\IfStrEq{\insertblocktitle}{}{}{% % IfStrEq does not work for theorems!
\ifbeamercolorempty[fg]{block line#1 top}{}{%
\nointerlineskip
\begin{beamercolorbox}[wd=\linewidth,ht=#2]{block line#1 top}
\rule{\linewidth}{#2}
\end{beamercolorbox}
\nointerlineskip%
}
\setbox0=\hbox{\insertblocktitle\unskip}% does not work for theorem?!
\ifdim\wd0=0pt\else%
\beamer@horizontal@line@top{block line#1 top}{#2}
\begin{beamercolorbox}[wd=\linewidth,ht=2.4ex,dp=0.9ex,leftskip=2mm,rightskip=2mm]{block title#1}
\strut\insertblocktitle
\end{beamercolorbox}}
\nointerlineskip
\ifbeamercolorempty[fg]{block line#1 middle}{}{%
\begin{beamercolorbox}[wd=\linewidth,ht=#3]{block line#1 middle}
\rule{\linewidth}{#3}
\end{beamercolorbox}
\nointerlineskip}%
\fi
\nointerlineskip
\beamer@horizontal@line@top{block line#1 middle}{#3}
\usebeamerfont{block body#1}%
\begin{beamercolorbox}[wd=\linewidth,colsep=2mm]{block body#1}
}
@ -394,12 +399,7 @@
\newcommand{\block@lines@end}[2]{%
\vspace{-0.4ex}%
\end{beamercolorbox}%
\ifbeamercolorempty[fg]{block line#1 bottom}{}{%
\nointerlineskip
\begin{beamercolorbox}[wd=\linewidth,ht=#2]{block line#1 bottom}
\rule{\linewidth}{#2}
\end{beamercolorbox}
}%
\beamer@horizontal@line@bottom{block line#1 bottom}{#2}
}
%%%%% block environment:
@ -434,22 +434,12 @@
\newcommand{\theorem@lines@begin}[3]{%
\par\vskip\medskipamount%
\usebeamerfont{#1 title}%
\ifbeamercolorempty[fg]{#1 line top}{}{%
\nointerlineskip
\begin{beamercolorbox}[wd=\linewidth,ht=#2]{#1 line top}
\rule{\linewidth}{#2}
\end{beamercolorbox}
\nointerlineskip%
}
\beamer@horizontal@line@top{#1 line top}{#2}
\begin{beamercolorbox}[wd=\linewidth,ht=2.4ex,dp=0.9ex,leftskip=2mm,rightskip=2mm]{#1 title}
\strut \insertblocktitle
\end{beamercolorbox}
\nointerlineskip
\ifbeamercolorempty[fg]{#1 line middle}{}{%
\begin{beamercolorbox}[wd=\linewidth,ht=#3]{#1 line middle}
\rule{\linewidth}{#3}
\end{beamercolorbox}
\nointerlineskip}%
\beamer@horizontal@line@top{#1 line middle}{#3}
\usebeamerfont{#1 body}%
\begin{beamercolorbox}[wd=\linewidth,colsep=2mm]{#1 body}
}
@ -457,12 +447,7 @@
\newcommand{\theorem@lines@end}[2]{%
\vspace{-0.4ex}%
\end{beamercolorbox}%
\ifbeamercolorempty[fg]{#1 line bottom}{}{%
\nointerlineskip
\begin{beamercolorbox}[wd=\linewidth,ht=#2]{#1 line bottom}
\rule{\linewidth}{#2}
\end{beamercolorbox}
}%
\beamer@horizontal@line@bottom{#1 line bottom}{#2}
}
\newenvironment<>{theoremblock}[1]{%
@ -492,20 +477,24 @@
\setbeamertemplate{message symbol}[circle]
% see quotation environment defined in
% /usr/share/texmf/tex/latex/beamer/base/beamerbaselocalstructure.sty
% for an alternative implementation based on list with empty item!
\newcommand{\message@box@body}{
\begin{beamercolorbox}[wd=\linewidth,colsep=1mm,leftskip=1mm,rightskip=1mm]{message}
\begin{beamercolorbox}[vmode,colsep=1mm,leftskip=1mm,rightskip=1mm]{message}
\setbox0=\hbox{\usebeamertemplate{message symbol}\unskip}%
\ifdim\wd0=0pt%
\strut\insertmessage
\else
\usebeamercolor[fg]{message symbol}
\parbox[t][][t]{1.8ex}{\usebeamertemplate{message symbol}}%
\usebeamercolor[fg]{message}
\parbox[t][][t]{\dimexpr\hsize-3.5ex\relax}{\raggedright\insertmessage}
\begin{list}
{\usebeamercolor[fg]{message symbol}
\usebeamertemplate{message symbol}}
{\itemindent 0pt
\labelwidth 1ex
\labelsep 0.6ex
\leftmargin 2.5ex
\rightmargin 1mm}
\item\relax\usebeamercolor[fg]{message}\relax
\insertmessage
\end{list}
\vspace{-0.6ex}
\fi
\end{beamercolorbox}
}
@ -519,19 +508,9 @@
\defbeamertemplate{message}{lines}[2]{%
\par\vskip\medskipamount%
\usebeamerfont{message}%
\ifbeamercolorempty[fg]{message line top}{}{%
\nointerlineskip
\begin{beamercolorbox}[wd=\linewidth,ht=#1]{message line top}
\rule{\linewidth}{#1}
\end{beamercolorbox}
\nointerlineskip}%
\beamer@horizontal@line@top{message line top}{#1}
\message@box@body
\ifbeamercolorempty[fg]{message line bottom}{}{%
\nointerlineskip%
\begin{beamercolorbox}[wd=\linewidth,ht=#2]{message line bottom}
\rule{\linewidth}{#2}
\end{beamercolorbox}}%
\medskip
\beamer@horizontal@line@bottom{message line bottom}{#2}
}
\setbeamertemplate{message}[lines]{1pt}{1pt}
@ -549,7 +528,7 @@
% pbk , phv, pnc, qcs
\newcommand{\openquote}[1][4]{\tikz[baseline]{%
\useasboundingbox (0, 0) rectangle (1ex, 1.7ex);
\node[scale=#1, xshift=-0.6ex, yshift=-0.77ex] at (current bounding box.north east) {\fontfamily{pbk}\selectfont\textquotedblleft};
\node[scale=#1, xshift=-0.45ex, yshift=-0.73ex] at (current bounding box.north east) {\fontfamily{pbk}\selectfont\textquotedblleft};
}}
\def\insertquoteauthor{}
@ -583,7 +562,7 @@
\defbeamertemplate{quotation symbol}{default}{}
\defbeamertemplate{quotation symbol}{quotes}[1][5]{\usebeamercolor[fg]{quotation symbol}\openquote[#1]}
\setbeamertemplate{quotation symbol}[quotes][6]
\setbeamertemplate{quotation symbol}[quotes][4]
\defbeamertemplate{quotation author separator}{default}{}
\defbeamertemplate{quotation author separator}{dash}{ --- }
@ -597,8 +576,13 @@
\setbeamertemplate{quotation author}[rightline] % none, left, right, rightline
\defbeamertemplate*{quotation begin}{none}{}
\defbeamertemplate*{quotation end}{none}{}
\defbeamertemplate{quotation begin}{none}{}
\defbeamertemplate{quotation begin}{lines}[1][1pt]{\beamer@horizontal@line@top{quotation line top}{#1}\vskip1ex}
\setbeamertemplate{quotation begin}[lines][0.5pt]
\defbeamertemplate{quotation end}{none}{}
\defbeamertemplate{quotation end}{lines}[1][1pt]{\beamer@horizontal@line@bottom{quotation line bottom}{#1}}
\setbeamertemplate{quotation end}[lines][0.5pt]
% see definition in /usr/share/texmf/tex/latex/beamer/base/beamerbaselocalstructure.sty
\renewenvironment<>{quotation}[1][]
@ -608,20 +592,33 @@
\usebeamertemplate{quotation begin}
\usebeamerfont*{quotation}%
\usebeamercolor{quotation}%
\list{}{
\leftmargin 3em
\rightmargin 2em
\listparindent 1.5em
\itemindent \listparindent
\labelsep \listparindent
\advance\labelsep by 1.5ex\relax
\parsep \z@ \@plus\p@
}%
\item[\usebeamertemplate{quotation symbol}]\relax
\setbox0=\hbox{\usebeamertemplate{quotation symbol}\unskip}%
\ifdim\wd0=0pt
\list{}{
\leftmargin 1em
\rightmargin 1em
\listparindent 1.5em
\itemindent \listparindent
\parsep \z@ \@plus\p@
}%
\item\relax
\else
\list{}{
\leftmargin 2.5em
\rightmargin 2em
\listparindent 1.5em
\itemindent \listparindent
\labelsep \listparindent
\advance\labelsep by 1.5ex\relax
\parsep \z@ \@plus\p@
}%
\item[\usebeamertemplate{quotation symbol}]\relax
\fi
}
{%
\usebeamertemplate{quotation author}
\endlist\usebeamertemplate{quotation end}
\endlist
\usebeamertemplate{quotation end}
\endbeamercolorbox
\endactionenv%
}
@ -631,7 +628,7 @@
\defbeamertemplate{quote symbol}{default}{}
\defbeamertemplate{quote symbol}{quotes}[1][5]{\usebeamercolor[fg]{quote symbol}\openquote[#1]}
\setbeamertemplate{quote symbol}[quotes][6]
\setbeamertemplate{quote symbol}[quotes][4]
\defbeamertemplate{quote author separator}{default}{}
\defbeamertemplate{quote author separator}{dash}{ --- }
@ -645,35 +642,56 @@
\setbeamertemplate{quote author}[rightline] % none, left, right, rightline
\defbeamertemplate*{quote begin}{none}{}
\defbeamertemplate*{quote end}{none}{}
\defbeamertemplate{quote begin}{none}{}
\defbeamertemplate{quote begin}{lines}[1][1pt]{\beamer@horizontal@line@top{quote line top}{#1}\vskip1ex}
\setbeamertemplate{quote begin}[lines][0.5pt]
\defbeamertemplate{quote end}{none}{}
\defbeamertemplate{quote end}{lines}[1][1pt]{\beamer@horizontal@line@bottom{quote line bottom}{#1}}
\setbeamertemplate{quote end}[lines][0.5pt]
\renewenvironment<>{quote}[1][]
{ \def\insertquoteauthor{#1}
\actionenv#2%
\beamercolorbox[vmode]{quote}
\usebeamertemplate{quote begin}
\beamercolorbox[vmode]{quote}%
\usebeamertemplate{quote begin}%
\usebeamerfont*{quote}%
\usebeamercolor{quote}%
\list{}{
\leftmargin 3em
\rightmargin 2em
\labelsep 1.5ex
\parsep 1ex
}%
\item[\usebeamertemplate{quote symbol}]\relax
\setbox0=\hbox{\usebeamertemplate{quote symbol}\unskip}%
\ifdim\wd0=0pt
\list{}{
\leftmargin 1em
\rightmargin 1em
\parsep 1ex
}%
\item\relax%
\else
\list{}{
\leftmargin 2.5em
\rightmargin 2em
\labelsep 1.5ex
\parsep 1ex
}%
\item[\usebeamertemplate{quote symbol}]\relax%
\fi%
}
{%
\usebeamertemplate{quote author}
\endlist\usebeamertemplate{quote end}
\endbeamercolorbox
\endlist
\usebeamertemplate{quote end}
\endbeamercolorbox%
\endactionenv%
}
% verse environment:
\defbeamertemplate*{verse begin}{none}{}
\defbeamertemplate*{verse end}{none}{}
\defbeamertemplate{verse begin}{none}{}
\defbeamertemplate{verse begin}{lines}[1][1pt]{\beamer@horizontal@line@top{verse line top}{#1}\vskip1ex}
\setbeamertemplate{verse begin}[lines][0.5pt]
\defbeamertemplate{verse end}{none}{}
\defbeamertemplate{verse end}{lines}[1][1pt]{\beamer@horizontal@line@bottom{verse line bottom}{#1}}
\setbeamertemplate{verse end}[lines][0.5pt]
\renewenvironment<>{verse}
{ \actionenv#1%
@ -689,7 +707,8 @@
\item\relax
}
{%
\endlist\usebeamertemplate{verse end}
\endlist
\usebeamertemplate{verse end}
\endbeamercolorbox
\endactionenv%
}
@ -699,14 +718,7 @@
%%%%% title page graphic line:
\defbeamertemplate{title page graphic line}{default}[1][1ex]%
{
\ifbeamercolorempty[fg]{title page graphic line}{}{%
\nointerlineskip%
\begin{beamercolorbox}[wd=1\textwidth,dp=0pt,ht=#1,sep=0pt]{title page graphic line}%
\rule{1\linewidth}{#1}%
\end{beamercolorbox}%
}%
}
{\beamer@horizontal@line@bottom{title page graphic line}{#1}}
\setbeamertemplate{title page graphic line}[default][1.5ex]
@ -714,14 +726,7 @@
%%%%% title page title line:
\defbeamertemplate{title page title line}{default}[1][1ex]%
{
\ifbeamercolorempty[fg]{title page title line}{}{%
\nointerlineskip%
\begin{beamercolorbox}[wd=1\textwidth,dp=0pt,ht=#1,sep=0pt]{title page title line}%
\rule{1\linewidth}{#1}%
\end{beamercolorbox}%
}%
}
{\beamer@horizontal@line@bottom{title page title line}{#1}}
\setbeamertemplate{title page title line}[default][0.2ex]
@ -861,10 +866,7 @@
% section page separator: text
\defbeamertemplate{section name separator}{text}[1][1pt]%
{
{\usebeamercolor[fg]{section name separator}
\rule[-0.5ex]{#1}{2.4ex}}
}
{{\usebeamercolor[fg]{section name separator}\rule[-0.5ex]{#1}{2.4ex}}}
\setbeamertemplate{section name separator}[text][1pt]
@ -907,10 +909,7 @@
% subsection page separator: text
\defbeamertemplate{subsection name separator}{text}[1][1pt]%
{
{\usebeamercolor[fg]{subsection name separator}
\rule[-0.5ex]{#1}{2.4ex}}
}
{{\usebeamercolor[fg]{subsection name separator}\rule[-0.5ex]{#1}{2.4ex}}}
\setbeamertemplate{subsection name separator}[text][1pt]

View File

@ -238,28 +238,35 @@
\verb!\messagebox{Take home message}!
\end{block}
\vfill
Hello, you!
\messagebox{Take home message}
Did you get it?
\vfill
Use it!
\end{frame}
\begin{frame}[fragile]{Quotations}
Let's start with a poem:
\begin{verse}
A \verb!verse! environment.\\With a second line.
\end{verse}
\vfill
Quote something of somebody:
\begin{quotation}
A \verb!quotation! environment.\\With a second line.
Quote something of somebody with indentation:
\begin{quotation}[Me And Myself]
A \verb!quotation! environment. There is a lot to talk about and
it really takes a lot of words to express this. Most likely this
does not fit into a single line. We might even need yet another
full new line.
Here we even start a second paragraph.
\end{quotation}
\vfill
Quote something else of somebody else:
Quote something else of somebody else (empty author argument):
\begin{quote}
A \verb!quote! environment.\\With a second line.
A \verb!quote! environment.
With a second line.
\end{quote}
\vfill
... to be improved (with huge quotation marks and horizontal lines)
Here is a poem:
\begin{verse}
A \verb!verse! environment ---\\with a second line.
\end{verse}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%