mybeamer#

../_images/sphx_glr_mybeamer.svg
\documentclass[
	unicode, 
	11pt,
%	handout
	]{beamer}

% Set this =0 to show else hide
\def\showanswers{1}
\newcommand{\hide}[1]{
  \ifnum\showanswers=0
	  #1
  \else
    \textbf{\textcolor{lightgray}{[}}\phantom{#1}\textbf{\textcolor{lightgray}{]}}\,%  
  \fi
}


\usepackage{cleveref}
% \crefname{definition}{定義}{定義}
% \crefname{proposition}{命題}{命題}
% \crefname{theorem}{定理}{定理}
% \crefname{example}{例}{例}
% \crefname{lemma}{補題}{補題}
% \crefname{problem}{問}{問}
% \crefname{example}{例}{例}
% \crefname{collorary}{系}{系}
\crefname{equation}{}{}
\crefname{figure}{}{}
\crefname{table}{}{}


\renewcommand{\figurename}{}
\renewcommand{\tablename}{}
% \crefname{chapter}{章}{章}
% \crefname{remark}{注意}{注意}
% \crefname{section}{¥S}{¥S}
% \crefname{subsection}{¥S}{¥S}


%% font関係
\usepackage{luatexja} % 日本語出力
\usepackage{luatexja-fontspec}
\usepackage[deluxe]{luatexja-preset}
\renewcommand{\kanjifamilydefault}{\gtdefault} % 規定をゴシック体に
\usepackage{unicode-math} % for XeLaTeX & LuaLaTex; bmやboldsymbolは使えない
\setmathfont{STIX Two Math} % メイン


%% beamer theme
\usetheme[
    block=fill, % ブロックに背景をつける
    progressbar=foot, % フッターにプログレスバー
    numbering=fraction, % 合計ページ数を表示
]{metropolis}


\usepackage[svgnames]{xcolor}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{derivative}
\usepackage{lipsum}

\usepackage[most]{tcolorbox}
\tcbuselibrary{theorems, skins, breakable, hooks}
\tcbset{nobeforeafter}
\usepackage{booktabs}
\usepackage{tikz} %% drawer
\usepackage{tikz-3dplot}
\usetikzlibrary{backgrounds,fit,shadows,patterns,patterns.meta,decorations.markings,quotes,angles,arrows.meta,decorations.pathreplacing,tikzmark,overlay-beamer-styles}
\usepackage{tabularx}

\usepackage{pgfplots} %% plotter
\usepgfplotslibrary{fillbetween,groupplots,statistics}
\pgfplotsset{compat=newest,
  set layers=standard
  } 

\tikzset{>=latex}

\tikzset{
  % 好みで短縮名も用意
  show/.style={visible on=#1},      % \uncover<…> 相当
  onlyshow/.style={alt=#1{opacity=1}{opacity=0}}, % \only<…> 的
}


\tcbset{
  zigzag_lower/.is choice,
  zigzag_lower/true/.style={
    overlay unbroken={
      \path[font=\footnotesize] (frame.south) node[gray] (cont) {(続く)};
      \draw[very thick,lightgray,decoration={zigzag,amplitude=0.3mm},decorate, 
          preaction={draw=white,line width=5pt} % ← 背景を白く塗る
      ]
       (frame.south west) -- (cont.west)
       (frame.south east) -- (cont.east);
    },
  },
  zigzag_lower/.default=true,
}

\tcbset{
  zigzag_upper/.is choice,
  zigzag_upper/true/.style={
    overlay unbroken={
      \path[font=\footnotesize] (frame.north) node[gray] (cont) {(続き)};
      \draw[very thick,lightgray,decoration={zigzag,amplitude=0.3mm},decorate, 
          preaction={draw=white,line width=5pt} % ← 背景を白く塗る
      ]
       (frame.north west) -- (cont.west)
       (frame.north east) -- (cont.east);
    },
  },
  zigzag_upper/.default=true,
}

\tcbset{
  zigzag/.is choice,
  zigzag/true/.style={
    overlay unbroken={
      \path[font=\footnotesize] (frame.north) node[gray] (cont) {(続き)};
      \draw[very thick,lightgray,decoration={zigzag,amplitude=0.3mm},decorate, 
          preaction={draw=white,line width=5pt} % ← 背景を白く塗る
      ]
       (frame.north west) -- (cont.west)
       (frame.north east) -- (cont.east);
      
      \path[font=\footnotesize] (frame.south) node[gray] (cont) {(続く)};
      \draw[very thick,lightgray,decoration={zigzag,amplitude=0.3mm},decorate, 
          preaction={draw=white,line width=5pt} % ← 背景を白く塗る
      ]
       (frame.south west) -- (cont.west)
       (frame.south east) -- (cont.east);
    },
  },
  zigzag/.default=true,
}



\tcbset{
   % ベース(全スタイル共通)
   mybase/.style={
    beamer,
    breakable,
    no shadow,
    enhanced jigsaw,
    fonttitle=\bfseries,
    enhanced jigsaw,
    width=\linewidth+3em, % ← 枠を全体的に広げる
    enlarge left by=-1.5em, % ← 左右位置を外側にずらす
    enlarge right by=-1.5em,
    after skip=0.3em,
    top=3mm,                % ← ここを追加(本文の位置を1mm下げる)
    attach boxed title to top left={xshift=2mm,yshift=-3mm},
    boxed title style={boxrule=0pt,colframe=black},
    myblock/segmented/.style={segmentation style={dashed,thick,black}},
    myblock/segmented/.default=true,
  },
  block/.style={
    mybase,
    colframe=black,fonttitle=\bfseries,
    colbacktitle=black,
    coltitle=white,
  },
  defn/.style={
    mybase,
    colback=white!80!gray,
    colframe=black,
		colbacktitle=white!50!gray,
    coltitle=black,
  },
  prop/.style={
    mybase,
    colback=white!80!gray,
    colframe=black,
		colbacktitle=black,
    coltitle=white,
  },
  rmk/.style={
    mybase,
    colback=Yellow!30!white,
    colframe=Yellow,
		colbacktitle=Gold,
    coltitle=black,    
  },
  exam/.style={
    mybase,
    colback=Green!10!white,
    colframe=Green,
		colbacktitle=Green,
  },
  prob/.style={
    mybase,
    colback=Red!20!white,
    colframe=Red,
		colbacktitle=Red,
    coltitle=white,
  },
  summary/.style={
    mybase,
    colframe=black,fonttitle=\bfseries,
    colbacktitle=black,
    coltitle=white,    
  },
}



% セクション関係
\newcounter{secctr}
\newcounter{subsecctr}[secctr] % secctr が進むと subsecctr を 0 に戻す

% 初期値(必要なら)
\setcounter{secctr}{0}
\setcounter{subsecctr}{1}

% --- マクロ定義 ---
\newcommand{\mysec}[1]{%
  \refstepcounter{secctr}% 番号を進める(ラベルにも使えるように refstep)
  \section{\S~\thesecctr~~~#1}% 表示
}

\newcommand{\mysubsec}[1]{%
  \refstepcounter{subsecctr}%
  \subsection{\S~\thesecctr.\thesubsecctr~~~#1}%
}

% section が進んだときに subsecctr を 1 にセット
\makeatletter
\@addtoreset{subsecctr}{section} % 念のためリセットを明示
\pretocmd{\section}{\setcounter{subsecctr}{1}}{}{}
\makeatother

\newcommand{\secref}[1]{\S \ref*{#1}\ \nameref*{#1} }


\title{title}
\subtitle{第-回 subtitle}
\author{name}
\institute{affiliation}
\date{\number\year\number\month\number\day}

\begin{document}

%\maketitle

%\begin{frame}[t]{目次}
%    \vspace{1em}
%    \tableofcontents
%\end{frame}

%\mysec{aaa}\label{sec:aaa}
\mysubsec{bbb}\label{subsec:bbb}
\begin{frame}[t]
	\frametitle{\nameref{sec:bbb}}
	\begin{tcolorbox}[defn, title={Def. (derivative)}, zigzag_lower]
	$$
	f(x) = \lim_{\Delta x\to 0} \frac{f(\hide{x+\Delta x}) - f(x)}{\Delta x},\qquad 
		\int_{-\infty}^{\infty} f(x)\odif{x}
	$$
	\end{tcolorbox}
	
	\bigskip 
	
	\begin{tcolorbox}[exam, zigzag]
	\lipsum[1][1-1]
	\end{tcolorbox}

	\bigskip
	
	\begin{tcolorbox}[rmk, zigzag_upper]
		\centering
	  \begin{tikzpicture}[
	  	declare function={
        gauss(\x,\m,\s)= 1 / ( sqrt(2*pi) * (\s) )*exp(-( ( (\x)-(\m) )^2 )/( 2*(\s)^2));
      	},
      ]
	    \begin{groupplot}[
        group style = {group size=2 by 1, horizontal sep=2cm},
        width=0.35\linewidth,
        axis y line=middle, 
        axis x line=bottom,
        ticklabel style={font=\footnotesize},
        label style={font=\small},
        xlabel={$x$},
        ylabel={$f(x)$},
        ylabel style={above},
        xlabel style={below right},
        clip=false,
  	   	]
	      \nextgroupplot[]
	      \addplot [domain=-2.8:2.8,smooth, name path=f, black,very thick] {gauss(x, 0, 1)};
      
  	    \nextgroupplot[]
	      \addplot [domain=-2.8:2.8,samples=100, name path=f, black,very thick] {gauss(x, 0, 0.1)};
      \end{groupplot}
    \end{tikzpicture}
	\end{tcolorbox}
\end{frame}

\end{document}