texlive[72554] Master/texmf-dist: notebeamer (15oct24)
commits+karl at tug.org
commits+karl at tug.org
Tue Oct 15 22:08:13 CEST 2024
Revision: 72554
https://tug.org/svn/texlive?view=revision&revision=72554
Author: karl
Date: 2024-10-15 22:08:12 +0200 (Tue, 15 Oct 2024)
Log Message:
-----------
notebeamer (15oct24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/notebeamer/README.md
trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer.pdf
trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer.tex
trunk/Master/texmf-dist/tex/latex/notebeamer/notebeamer.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.pdf
trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.tex
trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.pdf
trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.tex
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/notebeamer/figures/
Modified: trunk/Master/texmf-dist/doc/latex/notebeamer/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/notebeamer/README.md 2024-10-15 20:07:59 UTC (rev 72553)
+++ trunk/Master/texmf-dist/doc/latex/notebeamer/README.md 2024-10-15 20:08:12 UTC (rev 72554)
@@ -10,10 +10,4 @@
This work has the LPPL maintenance status `maintained`.
-The Current Maintainer of this work is [Mingyu Hsia](https://www.ctan.org/author/xia-my).
-
-## Derivative Works
-
-- [fadingimage](https://ctan.org/pkg/fadingimage): Package provides macros for inputting full width picture at the edges of pages quickly.
-
-- [litesolution](https://ctan.org/pkg/litesolution): Class designed for typesetting solutions of problems in exams, textbooks, etc.
+The Current Maintainer of this work is [Mingyu Xia](https://www.ctan.org/author/xia-my).
\ No newline at end of file
Added: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.pdf 2024-10-15 20:07:59 UTC (rev 72553)
+++ trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.pdf 2024-10-15 20:08:12 UTC (rev 72554)
Property changes on: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.tex 2024-10-15 20:08:12 UTC (rev 72554)
@@ -0,0 +1,18 @@
+ \documentclass[svgnames]{article}
+
+ \usepackage{geometry,notebeamer}
+ \geometry{margin = .75in}
+
+ \begin{document}
+
+ \includebeamer
+ [ color = MidnightBlue, ratio = .54, lines = 32, nup = 4,
+ pages = {2 - 4, 6 - 8}, lefthead = Chapter 1, righthead = Page~\thepage
+ ] { example-image-duck.pdf }
+
+ \includebeamer
+ [ color = MidnightBlue, ratio = .32, lines = 32, nup = 3,
+ pages = -, lefthead = Chapter 2, righthead = Page~\thepage
+ ] { example-image-a4-numbered.pdf }
+
+ \end{document}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo1.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.pdf 2024-10-15 20:07:59 UTC (rev 72553)
+++ trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.pdf 2024-10-15 20:08:12 UTC (rev 72554)
Property changes on: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.tex 2024-10-15 20:08:12 UTC (rev 72554)
@@ -0,0 +1,13 @@
+ \documentclass[svgnames,landscape]{article}
+
+ \usepackage{geometry,notebeamer}
+ \geometry{margin = .75in}
+
+ \begin{document}
+
+ \includebeamer
+ [ color = MidnightBlue, ratio = .57, sep = 4ex, nup = 1,
+ pages = -, lefthead = Chapter 3, righthead = Page~\thepage
+ ] { example-image-letter.pdf }
+
+ \end{document}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer-demo2.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer.tex 2024-10-15 20:07:59 UTC (rev 72553)
+++ trunk/Master/texmf-dist/doc/latex/notebeamer/notebeamer.tex 2024-10-15 20:08:12 UTC (rev 72554)
@@ -1,142 +1,80 @@
-\documentclass[11pt,svgnames]{article}
-\usepackage[notelinecolor=MidnightBlue,notemargin=.75in]{notebeamer}
-\usepackage{indentfirst,titlesec,authblk,hyperref,hologo,pgfpages,lipsum}
-\geometry{margin=1in}
-\titleformat*{\section}{\bfseries\large}
-\titleformat*{\subsection}{\bfseries\normalsize}
-\hologoFontSetup{general=\sffamily}
-\usepackage{datetime}\yyyymmdddate
-\usepackage[libertine,mono=false]{newtx}
-\usepackage{listings}
-\lstset{language=[LaTeX]TeX,basicstyle=\ttfamily,breaklines=true,columns=flexible}
-\hypersetup{colorlinks,urlcolor=MidnightBlue}
-\def\pkg#1{\textcolor{DarkGreen}{\textsf{#1}}}
-\def\mode#1{\textcolor{Indigo}{\textsf{#1}}}
-\def\cmd#1{\textcolor{MidnightBlue}{\texttt{\string#1}}}
+\documentclass[svgnames,letterpaper]{l3doc}
-\title{\bfseries The \pkg{notebeamer} Package}
-\author{Mingyu Hsia, \href{mailto:xiamyphys at hdu.edu.cn}{\ttfamily xiamyphys at hdu.edu.cn}}
-\affil{Hangzhou Dianzi University}
-\date{\today\quad Version 3.0b\thanks{\url{https://github.com/xiamyphys/notebeamer}}}
+\hypersetup{urlcolor = teal, filecolor = violet}
+\hologoFontSetup{general = \sffamily}
+\usepackage[mono = false]{libertine}
+\usepackage{hologo,verbatim,geometry,framed,notebeamer,pdfpages}
+\hologoFontSetup{general = \sffamily}
+\setlength{\oddsidemargin}{63pt}\setlength{\evensidemargin}{63pt}
+\FrameSep = 0pt
+\linespread{1.1}
+\usepackage{indentfirst}
+\setlength{\parindent}{2em}
+\usepackage[os = mac]{menukeys}
+\AddToHook{env/function/before}{\vspace{-.3\baselineskip}}
+\AddToHook{env/syntax/after}{\vspace{-.2\baselineskip}}
+\title
+{
+ \bfseries
+ The \cls{notebeamer} Package
+ \thanks{\url{https://github.com/xiamyphys/notebeamer}}
+}
+\author
+{
+ Mingyu Xia \texttt{<\href{mailto:xiamyphys at gmail.com}{xiamyphys at gmail.com}>}
+}
+\date{Version 4.0A, \today}
+
\begin{document}
\maketitle
-\begin{abstract}
+\section{Introduction}
-This is the document for the \pkg{notebeamer} package, which provides an easy way to input slides on notepages quickly for making annotations.
+The \pkg{notebeamer} package provides an easy way to input slides on notepages quickly for making annotations, based on \pkg{expl3} and \pkg{tikz}. It is compatible with \hologo{TeX} Live 2019 or later distributions, they all work fine for \hologo{pdfLaTeX} and \hologo{XeLaTeX} compilers. This is the English manual for the \pkg{notebeamer} package.
-Welcome to feedback bugs or ideas via email \href{mailto:xiamyphys at hdu.edu.cn}{\ttfamily xiamyphys at hdu.edu.cn} or \href{https://github.com/xiamyphys/notebeamer}{GitHub}.
+\section{Loading \pkg{notebeamer} and input}
-\end{abstract}
+Just like loading any class, write
-\section{Installing \pkg{notebeamer} and loading it}
+\begin{framed}
+ \begin{verbatim}
+ \usepackage{notebeamer}
+ \end{verbatim}
+\end{framed}
-Simply download \verb|notebeamer.cls| file from \href{https://github.com/xiamyphys/notebeamer}{GitHub} or \href{https://ctan.org/pkg/notebeamer}{CTAN} and save it under your working directory. However, I strongly suggest to use terminal to install and update all packages to the latest version
+\begin{function}{\includebeamer}
+ \begin{syntax}
+ \cs{includebeamer} \oarg{keyvals} \marg{filename} \oarg{keyvals}
+ \end{syntax}
+\end{function}
-\begin{verbatim}
- sudo tlmgr update --self --all
-\end{verbatim}
+The \cs{includebeamer} command can create pages with note lines, and import the specific pages of the \file{.pdf} file on the left side of the note pages. The optional argument accepts the following keys: \keys{\cmdmac~color} \keys{\cmdmac~ratio} \keys{\cmdmac~sep} \keys{\cmdmac~nup} \keys{\cmdmac~pages} \keys{\cmdmac~lefthead} \keys{\cmdmac~righthead}, and the mandatory argument can set the \file{.pdf} file that you want to insert.
-To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \hologo{TeX} distribution?}
+\begin{itemize}
+ \item The key \keys{\cmdmac~color} can set the color of the note lines, its default value is \cmd{black}.
+ \item The key \keys{\cmdmac~ratio} can set the ratio of the widths of imported beamer frames and empty area, its default value is \cmd{0.48}.
+ \item The key \keys{\cmdmac~sep} can set the vertical space between beamer frames, its default value is \cmd{2ex}.
+ \item The key \keys{\cmdmac~nup} can set the number of beamer frames on every physical page, its default value is \cmd{3}.
+ \item The key \keys{\cmdmac~pages} can select pages to insert. The argument is a comma separated list, containing page numbers, ranges of page numbers or any combination. Its default value is \cmd{1}.
+ \item The keys \keys{\cmdmac~lefthead} and \keys{\cmdmac~righthead} can set the left header and right header of the note pages.
+\end{itemize}
-\section{Key values of this package}
+\section{Working Examples}
-\begin{verbatim}
- \usepackage[notelinecolor=<color>,notemargin=<margin>]{notebeamer}
-\end{verbatim}
+For 4 logical pages per physical page and 3 logical pages per physical page
-This package has two keys: \cmd{notelinecolor} and \cmd{notemargin}.
+\begin{framed}
+ \verbatiminput{notebeamer-demo1.tex}
+\end{framed}
-The \cmd{notelinecolor} key can set the color notelines, the \cmd{notemargin} key can set the margin of notepages.
+For one logical page per page, landscape is recommanded:
-If you have not set the keys, the default values of the four keys will be applied
+\begin{framed}
+ \verbatiminput{notebeamer-demo2.tex}
+\end{framed}
-\begin{verbatim}
- notelinecolor=MidnightBlue, notemargin=.75in
-\end{verbatim}
+\includepdfmerge[nup = 2x2]
+ { notebeamer-demo1, -, notebeamer-demo2, -}
-Please set the geometry for the whole document \textbf{after} you set the notemargin, that is
-
-\begin{verbatim}
- \usepackage[notemargin=<margin>]{notebeamer} \geometry{<keyval list>}
-\end{verbatim}
-
-otherwise the notemargin configuration won't work.
-
-\section{The margin of notepages}
-
-The relation of the margin of notepages and the margin configuration of package \pkg{geometry} satisfies the following expression
-
-\begin{verbatim}
- topmargin = bottommargin = (\paperwidth-\textwidth)/3
- leftmargin = rightmargin = (2\paperheight-2\textheight)/5
-\end{verbatim}
-
-\section{Commands of \pkg{notebeamer}}
-
-\subsection{The \cmd{notechap} command}
-
-\begin{verbatim}
- \notechap [<notetitle>] {<filename>}
-\end{verbatim}
-
-This command can assign the following notetitle and the PDF file you want to input.
-
-\subsection{The \cmd{notelinenum} and \cmd{notecolumnratio} commands}
-
-\begin{verbatim}
- \notelinenum{<number>} \notecolumnratio{<number>}
-\end{verbatim}
-
-The two commands can assign the number of notelines and the ratio of columns on following notepages respectively. The default value of the number of notelines is \verb|27| and that of the ratio of columns is \verb|0.5|.
-
-\subsection{The \cmd{hidenotelinetrue} and \cmd{hidenotelinefalse} commands}
-
-Notepages after the \cmd{hidenotelinetrue} command the notelines will be hidden while notepages after command \cmd{hidenotelinefalse} the notelines will be restored.
-
-\subsection{The \cmd{newnotepage}}
-
-\begin{verbatim}
- \newnotepage[<number>] \newnotepage*[<number>]
-\end{verbatim}
-
-The \cmd{newnotepage} command can create empty notepage(s). If a star (*) is added after the command, the created empty notepage(s) won't have column rule.
-
-\subsection{The \cmd{includebeamer} command}
-
-\begin{verbatim}
- \includebeamer[<number of slides per page>]{<start page>}{<end page>}
-\end{verbatim}
-
-This commands will create notepages that were inserted images on the left sidnumber of slides per page and the last two variables can set the start page and end page of the PDF file you want to insert that assigned by the command \cmd{notechap}.
-
-\appendix
-\section{Related packages}
-
-\subsection{The \pkg{fadingimage} package}
-
-This package provides macros for inputting full width picture at the edges of pages quickly.
-
-\subsection{The \pkg{litesolution} class}
-
-This class is designed for typesetting solutions of problems in exams, textbooks, etc. The \pkg{notebeamer} package is contained in the \pkg{litesolution} class now.
-
-\clearpage
-\pgfpagesuselayout{4 on 1}[letterpaper]
-
-\notelinenum{27}\pagecolor{yellow!2}
-
-\notechap[Chapter 1. Introduction \& Fundamental Concepts]{figures/beamerdemo.pdf}
-\notecolumnratio{.57}
-\hidenotelinefalse \includebeamer[3]{2}{4}
-\notecolumnratio{.43}
-\hidenotelinetrue \includebeamer[4]{3}{6}
-
-\notechap[Phys. Rev. B. Volume 50, Number 8]{figures/paperdemo.pdf}
-\notecolumnratio{.72}
-\hidenotelinefalse \includebeamer[1]{2}{2}
-
-\notecolumnratio{.5} \newnotepage
-
-\end{document}
\ No newline at end of file
+\end{document}
Modified: trunk/Master/texmf-dist/tex/latex/notebeamer/notebeamer.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/notebeamer/notebeamer.sty 2024-10-15 20:07:59 UTC (rev 72553)
+++ trunk/Master/texmf-dist/tex/latex/notebeamer/notebeamer.sty 2024-10-15 20:08:12 UTC (rev 72554)
@@ -1,5 +1,5 @@
%% ***********************************************************
-%% Copyright 2024 by Mingyu Hsia <xiamyphys at hdu.edu.cn> *
+%% Copyright 2024 by M.Y. XIA <xiamyphys at gmail.com> *
%% *
%% This work may be distributed and/or modified under *
%% the conditions of the LaTeX Project Public License *
@@ -11,150 +11,193 @@
%% *
%% This work has the LPPL maintenance status `maintained'. *
%% *
-%% The Current Maintainer of this work is Mingyu Hsia. *
+%% The Current Maintainers of this work is M.Y. XIA *
%% *
%% This work consists of the files notebeamer.sty, *
%% and README.md. *
%% available at https://github.com/xiamyphys/notebeamer *
-%% Thanks `wipet' (https://petr.olsak.net/) provides *
-%% Beamers automatically inserts module *
%% ***********************************************************
-% !Mode:: "TeX:UTF-8"
-\NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesPackage{notebeamer}[2024/05/06 v3.0b Package provides macros for inputting slides on note papers quickly.]
-\RequirePackage{xkeyval}
+\RequirePackage{xparse}% For TeX Live 2019 - 2020 Compatibility
+\ProvidesExplPackage{notebeamer}{2024/10/15}{4.0A}
+ {Package provides macros for inputting slides on note papers quickly.}
-\DeclareOptionX{notelinecolor}{\gdef\@notelinecolor{#1}}
-\ExecuteOptionsX{notelinecolor=darkgray}
-\DeclareOptionX{notemargin}{\gdef\@notemargin{#1}}
-\ExecuteOptionsX{notemargin=.75in}
+\RequirePackage{l3graphics,tikz,tikzpagenodes}
-\DeclareOptionX*{\PackageWarning{notebeamer}{`\CurrentOption' ignored}}
-\ProcessOptionsX\relax
+\cs_new:Nn \int_div_roundup:nn { \fp_eval:n { ceil(#1/#2,0) } }
-\RequirePackage{geometry,calc,tikz}
-\newgeometry{margin=\@notemargin}
-\tikzset{every picture/.append style={%
- line join=round,line cap=round,thick}}
-\usetikzlibrary{calc}
+\seq_new:N \l__notebeamer_tmpa_seq
+\seq_new:N \l__notebeamer_tmpb_seq
+\clist_new:N \l__notebeamer_tmpa_clist
+\cs_set_nopar:Npn \notebeamer_range_to_list:nN #1#2
+ {
+ \clist_clear:N #2
+ \seq_set_split:Nnn \l__notebeamer_tmpa_seq { , } {#1}
+ \seq_map_inline:Nn \l__notebeamer_tmpa_seq
+ {
+ \tl_if_in:nnTF {##1}{ - }
+ {
+ \seq_set_split:Nnn \l__notebeamer_tmpb_seq { - } { ##1 }
+ \int_step_inline:nnn
+ { \seq_item:Nn \l__notebeamer_tmpb_seq { 1 } }
+ { \seq_item:Nn \l__notebeamer_tmpb_seq { 2 } }
+ { \clist_put_right:Nn #2 {####1} }
+ }
+ { \clist_put_right:Nn #2 {##1} }
+ }
+ }
-\newcounter{note}
-\NewDocumentCommand\notechap{o m}{
- \gdef\@notechap{#1}
- \gdef\@beamer{#2}
- \setcounter{note}{0}}
+\keys_define:nn { notebeamer / includebeamer }
+ {
+ pages .tl_set:N = \l__includebeamer_pages_tl,
+ pages .initial:n = 1,
+ nup .int_set:N = \l__includebeamer_nup_int,
+ nup .initial:n = 3,
+ lines .int_set:N = \l__includebeamer_lines_int,
+ color .tl_set:N = \l__includebeamer_color_tl,
+ color .initial:n = black,
+ ratio .fp_set:N = \l__includebeamer_ratio_fp,
+ ratio .initial:n = .48,
+ sep .dim_set:N = \l__includebeamer_sep_dim,
+ sep .initial:n = 2ex,
+ lefthead .tl_set:N = \l__includebeamer_lefthead_tl,
+ righthead .tl_set:N = \l__includebeamer_righthead_tl,
+ }
-\newlength\hnotemargin\newlength\vnotemargin
-\setlength\hnotemargin{(\paperwidth-\textwidth)/3}
-\setlength\vnotemargin{(2\paperheight-2\textheight)/5}
-\newlength\notewidth\newlength\noteheight
-\setlength\notewidth{\paperwidth-2\hnotemargin}
-\setlength\noteheight{\paperheight-2\vnotemargin}
-\newlength\notelinespace
+\int_new:N \l__notebeamer_pages_total_int
+\int_new:N \l__notebeamer_pages_residue_int
+\cs_new_protected_nopar:Npn \__notebeamer_empty_note_aux:
+ {
+ \tikz [ remember~picture, overlay ]
+ {
+ \draw [ very~thick, \l__includebeamer_color_tl!80 ]
+ (current~page~text~area.north~west) --
+ (current~page~text~area.north~east)
+ node [ at~start, above~right, font = \sffamily\Large\bfseries ]
+ { \l__includebeamer_lefthead_tl }
+ node [ above~left, font = \sffamily\Large\bfseries ]
+ { \l__includebeamer_righthead_tl };
+ \draw [ very~thick, \l__includebeamer_color_tl!80 ]
+ (current~page~text~area.south~west) --
+ (current~page~text~area.south~east);
+ \int_step_inline:nn { \l__includebeamer_lines_int - 1 }
+ {
+ \draw [ thick, \l__includebeamer_color_tl!60 ]
+ ([shift =
+ {(
+ \fp_use:N \l__includebeamer_ratio_fp \textwidth,
+ -\textheight/\l__includebeamer_lines_int * ##1
+ )}
+ ]current~page~text~area.north~west) --++
+ (\fp_eval:n { 1 - \l__includebeamer_ratio_fp } \textwidth,0);
+ }
+ }
+ \pagestyle{empty}
+ }
-\def\notelinenum#1{%
- \gdef\@notelinenum{#1}
- \setlength\notelinespace{\noteheight/#1}}
-\ifcsname @notelinenum\endcsname
-\else
- \gdef\@notelinenum{27}
- \setlength\notelinespace{\noteheight/27}
-\fi
-\def\notecolumnratio#1{\gdef\@notecolumnratio{#1}}
-\ifcsname @notecolumnratio\endcsname
-\else
- \gdef\@notecolumnratio{.5}
-\fi
-
-\newif\ifhidenoteline
-
-\def\@onepaper#1{
- \refstepcounter{note}\addtocounter{note}{-1}
- \clearpage\thispagestyle{empty}
- \begin{tikzpicture}[remember picture,overlay]
- %%%%%% notepage lines
- \draw [\@notelinecolor,opacity=.8,very thick] ($(current page.north west)+(\hnotemargin,-\vnotemargin)$) --++ (\notewidth,0) node [above right,at start,yshift=1ex] {\large\bfseries\sffamily\ifcsname @notechap\endcsname\@notechap\fi} node [above left,yshift=1ex] {\large\bfseries\sffamily Page \thepage\quad}; % 顶部粗线
- \draw [\@notelinecolor,opacity=.8,thick] ($(current page.south west)+(\hnotemargin,\vnotemargin)$) --++ (\notewidth,0); % 底部粗线
- \ifhidenoteline\else
- \foreach \a in {2,...,\@notelinenum}
- \draw [\@notelinecolor,opacity=.4,thick] ($(current page.south west)+(\hnotemargin,{\vnotemargin+(\a-1)*\notelinespace})$) --++ (\notewidth,0); % 横线
- \fi
- %%%%%% imput file
- \node [below,yshift=\thenote*\noteheight-1ex,inner sep=0pt] at ($(current page.north west)+(\hnotemargin+.5*\@notecolumnratio*\notewidth,-\vnotemargin)$) {\ifcsname @notechap\endcsname\includegraphics[width=\dimeval{\@notecolumnratio\notewidth},page=#1]{\@beamer}\fi};
- \end{tikzpicture}
+\cs_new_protected_nopar:Npn \__notebeamer_includebeamer_aux:n #1
+ {
+ \graphics_get_pagecount:nN {#1} \l__includebeamer_filepages_int
+ \tl_if_eq:NnTF \l__includebeamer_pages_tl { - }
+ {
+ \notebeamer_range_to_list:nN
+ { 1 - \l__includebeamer_filepages_int } \l__notebeamer_tmpa_clist
+ }
+ {
+ \exp_args:NV
+ \notebeamer_range_to_list:nN
+ \l__includebeamer_pages_tl \l__notebeamer_tmpa_clist
+ }
+ \int_set:Nn \l__notebeamer_pages_total_int
+ {
+ \int_div_roundup:nn { \clist_count:N \l__notebeamer_tmpa_clist }
+ { \l__includebeamer_nup_int } - 1
+ }
+ \int_set:Nn \l__notebeamer_pages_residue_int
+ {
+ \int_eval:n
+ {
+ \clist_count:N \l__notebeamer_tmpa_clist -
+ \l__includebeamer_nup_int * \l__notebeamer_pages_total_int
+ }
+ }
+ \int_step_inline:nn { \int_use:N \l__notebeamer_pages_total_int }
+ {
+ \clearpage
+ \__notebeamer_empty_note_aux:
+ \int_step_inline:nn { \l__includebeamer_nup_int }
+ {
+ \tikz [ remember~picture, overlay ]
+ {
+ \node
+ [
+ yshift = - ( ####1 - 1 ) *
+ \textheight/\l__includebeamer_nup_int
+ ] at
+ ([shift =
+ {(
+ \fp_use:N \l__includebeamer_ratio_fp \textwidth/2,
+ -\textheight/\l__includebeamer_nup_int/2
+ )}
+ ]current~page~text~area.north~west)
+ {
+ \includegraphics
+ [
+ height =
+ \dim_eval:n
+ {
+ \textheight/\l__includebeamer_nup_int -
+ \l__includebeamer_sep_dim
+ },
+ page =
+ \clist_item:Nn \l__notebeamer_tmpa_clist
+ { ####1 + \l__includebeamer_nup_int * ( ##1 - 1 ) }
+ ] {#1}
+ };
+ }
+ }
+ \clearpage
+ }
+ \__notebeamer_empty_note_aux:
+ \int_step_inline:nn { \int_use:N \l__notebeamer_pages_residue_int }
+ {
+ \tikz [ remember~picture, overlay ]
+ {
+ \node
+ [
+ yshift = - ( ##1 - 1 ) * \textheight/\l__includebeamer_nup_int
+ ] at
+ ([shift =
+ {(
+ \fp_use:N \l__includebeamer_ratio_fp \textwidth/2,
+ -\textheight/\l__includebeamer_nup_int/2
+ )}
+ ]current~page~text~area.north~west)
+ {
+ \includegraphics
+ [
+ height =
+ \dim_eval:n
+ {
+ \textheight/\l__includebeamer_nup_int -
+ \l__includebeamer_sep_dim
+ },
+ page =
+ \clist_item:Nn \l__notebeamer_tmpa_clist
+ {
+ \l__includebeamer_nup_int *
+ \l__notebeamer_pages_total_int + ##1
+ }
+ ] {#1}
+ };
+ }
+ }
+ \clearpage
+ }
+\NewDocumentCommand{\includebeamer}{ O{} m O{} }{
+ \group_begin:
+ \keys_set:nn { notebeamer / includebeamer } { #1 #3 }
+ \__notebeamer_includebeamer_aux:n {#2}
+ \group_end:
}
-\def\@threebeamer#1#2#3{
- \refstepcounter{note}\addtocounter{note}{-1}
- \clearpage\thispagestyle{empty}
- \begin{tikzpicture}[remember picture,overlay]
- %%%%%% notepage lines
- \draw [\@notelinecolor,opacity=.8,very thick] ($(current page.north west)+(\hnotemargin,-\vnotemargin)$) --++ (\notewidth,0) node [above right,at start,yshift=1ex] {\large\bfseries\sffamily\ifcsname @notechap\endcsname\@notechap\fi} node [above left,yshift=1ex] {\large\bfseries\sffamily Page \thepage\quad}; % 顶部粗线
- \draw [\@notelinecolor,opacity=.8,thick] ($(current page.south west)+(\hnotemargin,\vnotemargin)$) --++ (\notewidth,0); % 底部粗线
- \ifhidenoteline\else
- \foreach \a in {2,...,\@notelinenum}
- \draw [\@notelinecolor,opacity=.4,thick] ($(current page.south west)+(\hnotemargin+\@notecolumnratio*\notewidth+1ex,{\vnotemargin+(\a-1)*\notelinespace})$) --++ ({(1-\@notecolumnratio)*\notewidth-1ex},0); % 横线
- \fi
- \draw [\@notelinecolor!80,opacity=.5,very thick] ($(current page.south west)+(\hnotemargin+\@notecolumnratio*\notewidth,\vnotemargin+1ex)$) --++ (0,\noteheight-2ex); % 分栏线
- %%%%%% imput file
- \foreach \n in {#1,#2,#3}
- \node [yshift=(2*#1-2*\n-1)*\noteheight/6+\thenote*\noteheight,inner sep=0pt] at ($(current page.north west)+(\hnotemargin+.5*\@notecolumnratio*\notewidth,-\vnotemargin)$) {\ifcsname @notechap\endcsname\includegraphics[height=\dimeval{\noteheight/3-2ex},page=\n]{\@beamer}\fi};
- \end{tikzpicture}
-}
-
-\def\@fourbeamer#1#2#3#4{
- \refstepcounter{note}\addtocounter{note}{-1}
- \clearpage\thispagestyle{empty}
- \begin{tikzpicture}[remember picture,overlay]
- \draw [\@notelinecolor,opacity=.8,very thick] ($(current page.north west)+(\hnotemargin,-\vnotemargin)$) --++ (\notewidth,0) node [above right,at start,yshift=1ex] {\large\bfseries\sffamily\ifcsname @notechap\endcsname\@notechap\fi} node [above left,yshift=1ex] {\large\bfseries\sffamily Page \thepage\quad}; % 顶部粗线
- \draw [\@notelinecolor,opacity=.8,thick] ($(current page.south west)+(\hnotemargin,\vnotemargin)$) --++ (\notewidth,0); % 底部粗线
- \ifhidenoteline\else
- \foreach \a in {2,...,\@notelinenum}
- \draw [opacity=.5,\@notelinecolor,opacity=.4,thick] ($(current page.south west)+(\hnotemargin+\@notecolumnratio*\notewidth+1ex,{\vnotemargin+(\a-1)*\notelinespace})$) --++ ({(1-\@notecolumnratio)*\notewidth-1ex},0); % 横线
- \fi
- \draw [\@notelinecolor,opacity=.5,very thick] ($(current page.south west)+(\hnotemargin+\@notecolumnratio*\notewidth,\vnotemargin+1ex)$) --++ (0,\noteheight-2ex); % 分栏线
- %%%%%% imput file
- \foreach \n in {#1,#2,#3,#4}
- \node [yshift=(2*#1-2*\n-1)*\noteheight/8+\thenote*\noteheight,inner sep=0pt] at ($(current page.north west)+(\hnotemargin+.5*\@notecolumnratio*\notewidth,-\vnotemargin)$) {\ifcsname @notechap\endcsname\includegraphics[height=\dimeval{\noteheight/4-2ex},page=\n]{\@beamer}\fi};
- \end{tikzpicture}
-}
-
-\ExplSyntaxOn\cs_new_eq:NN \Repeat \prg_replicate:nn\ExplSyntaxOff
-\NewDocumentCommand\newnotepage{s O{1}}{\Repeat{#2}{
- \refstepcounter{note}
- \clearpage\thispagestyle{empty}
- \begin{tikzpicture}[remember picture,overlay]
- \draw [\@notelinecolor,opacity=.8,very thick] ($(current page.north west)+(\hnotemargin,-\vnotemargin)$) --++ (\notewidth,0) node [above right,at start,yshift=1ex] {\large\bfseries\sffamily\ifcsname @notechap\endcsname\@notechap\fi} node [above left,yshift=1ex] {\large\bfseries\sffamily Page \thepage\quad}; % 顶部粗线
- \draw [\@notelinecolor,opacity=.8,thick] ($(current page.south west)+(\hnotemargin,\vnotemargin)$) --++ (\notewidth,0); % 底部粗线
- \ifhidenoteline\else
- \foreach \a in {2,...,\@notelinenum}
- \draw [\@notelinecolor,opacity=.4,thick] ($(current page.south west)+(\hnotemargin,{\vnotemargin+(\a-1)*\notelinespace})$) --++ (\notewidth,0); % 横线
- \fi
- \IfBooleanF{#1}{% 分栏线
- \draw [\@notelinecolor,opacity=.5,very thick] ($(current page.south west)+(\hnotemargin+\@notecolumnratio*\notewidth,\vnotemargin+1ex)$) --++ (0,\noteheight-2ex);}
-\end{tikzpicture}}
-}
-
-\newcount\tmpnum
-\def\valnum#1{%
- \ifnum\maxnum>\numexpr\tmpnum+#1\relax
- \the\numexpr\tmpnum+#1\relax \else \maxnum\fi}
-\NewDocumentCommand\includebeamer{ o m m }{%
- \ifnum #1=1
- \def\maxnum{#3}\tmpnum=#2
- \loop
- \unless\ifnum\tmpnum>#3 \@onepaper{\valnum0}
- \advance\tmpnum by1
- \repeat\fi
- \ifnum #1=3
- \def\maxnum{#3}\tmpnum=#2
- \loop
- \unless\ifnum\tmpnum>#3 \@threebeamer{\valnum0}{\valnum1}{\valnum2}
- \advance\tmpnum by3
- \repeat\fi
- \ifnum #1=4
- \def\maxnum{#3}\tmpnum=#2
- \loop
- \unless\ifnum\tmpnum>#3 \@fourbeamer{\valnum0}{\valnum1}{\valnum2}{\valnum3}
- \advance\tmpnum by4
- \repeat\fi}
+% End of file notebeamer.sty
More information about the tex-live-commits
mailing list.