乳胶中的跳线(“继续第...页”)?

乳胶中的跳线(“继续第...页”)?

许多报纸/通讯的头版都有几篇文章,但每篇文章的头版只有一段。每段这样的开头都以“跳转行”结束 - 即“继续第 XX 页”形式的语句。文章的其余部分将出现在第 XX 页。

有没有办法在乳胶中做到这一点?

当然,我可以手动完成。但想法是为每个主题分配一定数量的首页英寸,然后让 latex 自动按分配的长度剪切每个主题并继续其他部分。

我的乳胶输入可能如下所示:

\ContinuedBox{A}{2in}{x1 x2 x3 ... x1000}
\ContinuedBox{B}{1in}{y1 y2 y3 ... y1000}
\newpage \Continuation{A}
\newpage \Continuation{B}

然后输出的第 1 页将是 2 英寸的 x1 x2 ... x100(例如)后跟“续第 2 页”,然后是 1 英寸的 y1 y2 ... y50(例如)后跟“续第 3 页”。第 2 页将有 x101 到 x1000,第 3 页将有 y51 到 y1000。

答案1

更新:2015/06/02:我已将jumplinesv0.2 包上传到 CTAN - 它将很快在那里和 TeXLive 上提供几周后没耐心的读者可以从我的网站下载。

注意:这是一个初步的解决方案一些需要解决的警告!

\documentclass[12pt,twocolumn]{article}



\usepackage{tcolorbox}%
\usepackage{blindtext}%
\usepackage{xcolor}%
\usepackage{hyperref}

\tcbuselibrary{breakable}

\newbox\articlebox%
\newbox\upperarticlebox%

\newlength{\articleboxheight}%

\newcounter{myarticle}


\newcommand{\FrontPageTeaser}[2]{%
\refstepcounter{myarticle}
\begingroup
\setlength{\articleboxheight}{#1}
\setbox\articlebox=\vbox{#2}

\setbox\upperarticlebox=\vsplit\articlebox to \articleboxheight

\begin{tcolorbox}[boxsep=0pt,boxrule=0pt,arc=0pt]%[lowerbox=ignored, lower separated=true,savelowerto=articlecontinued.cont]
\noindent\unvbox\upperarticlebox\par \label{myarticle::teaser::\number\value{myarticle}}
\flushright\textit{\bfseries Continued on Page \pageref{myarticle::\number\value{myarticle}}}
\end{tcolorbox}%

\begin{tcolorbox}[breakable,float=htb,boxsep=0pt,boxrule=0pt] 
\textit{\bfseries Continued from page \pageref{myarticle::teaser::\number\value{myarticle}}}
\noindent\unvbox\articlebox \label{myarticle::\number\value{myarticle}}
\end{tcolorbox}\par%
\endgroup
}%

\begin{document}


\clearpage


\FrontPageTeaser{3in}{\blindtext[5]}
\FrontPageTeaser{3in}{\textcolor{blue}{\blindtext[3]}}

\FrontPageTeaser{5in}{\textcolor{blue}{\blindtext[10]}}



\end{document}

在此处输入图片描述

一些改进的版本,但尚未完成

\documentclass[12pt,a4paper,twocolumn]{scrartcl}


\usepackage[svgnames]{xcolor}%

\usepackage[ngerman,english]{babel}
\usepackage[tmargin=2cm,bmargin=1.5cm]{geometry}
\usepackage[demo]{graphicx}%
\usepackage{scrpage2}
\usepackage{tcolorbox}%
\usepackage{blindtext}%
\usepackage{xparse}%
\usepackage{xkeyval}
\usepackage{afterpage}
\usepackage{hyperref}



\setcounter{totalnumber}{10}
\setcounter{topnumber}{3}
\setcounter{bottomnumber}{3}
\renewcommand{\floatpagefraction}{0.75}
\renewcommand{\floatpagefraction}{0.75}


\tcbuselibrary{breakable}

\makeatletter
\define@key{teasers}{TeaserHeadline}{%
  \def\TeaserMacroTeaserHeadline{#1}%
}%

\define@key{teasers}{TeaserHeight}[2in]{%
  \def\TeaserMacroTeaserHeight{#1}%
}%

\newcounter{issue}
\setcounter{issue}{1}

\afterpage{\clearpage}

\makeatother

\presetkeys{teasers}{TeaserHeight=2in}{}

\newbox\articlebox%
\newbox\teaserbox%

\newlength{\articleboxheight}%

\newcounter{myarticle}


\NewDocumentCommand\FrontPageTeaser{+o+m}{%
\refstepcounter{myarticle}
\begingroup%
\IfValueTF{#1}{%
  \setkeys{teasers}{#1}%
}{
  \typeout{Nothing!}
}
\setlength{\articleboxheight}{\TeaserMacroTeaserHeight}%
\setbox\articlebox=\vbox{\noindent#2}%
\setbox\teaserbox=\vsplit\articlebox to \articleboxheight% Split the input to teaser box and a continued box
\begin{tcolorbox}[breakable,boxsep=0pt,boxrule=0pt,left=0pt,right=0pt, arc=0pt,auto outer arc,colback=white,title={\ifdef{\TeaserMacroTeaserHeadline}{\TeaserMacroTeaserHeadline}{}}]
  \phantomsection\label{myarticle::teaser::\number\value{myarticle}}\unvbox\teaserbox\par%
  \vskip 0.3\baselineskip
  \raggedleft\textit{\bfseries Continued on Page \pageref{myarticle::\number\value{myarticle}}}
\end{tcolorbox}%
\begin{tcolorbox}[breakable,float=tbp,boxsep=0pt,left=0pt,boxrule=1pt,arc=0pt,auto outer arc,colback=white,colbacktitle=yellow,coltitle=black,break at=\textheight]% 
 \bfseries Continued from page \pageref{myarticle::teaser::\number\value{myarticle}}\par
 \phantomsection\label{myarticle::\number\value{myarticle}}%
 \noindent\unvbox\articlebox%
\end{tcolorbox}%
\endgroup
}%

\begin{document}
\pagestyle{scrheadings}
\clearscrheadings
\chead{\textbf{\large \TeX~StackExchange News}}%
\ihead{Issue \theissue}
\ohead{\today}


\FrontPageTeaser[TeaserHeight=2in,TeaserHeadline={Breaking News}]{\Large\textbf{egreg's reputation jumped over 5 billion yesterday}\par\begin{center}\includegraphics[scale=0.3]{bild_erwin_schroedinger}\end{center}\par
\blindtext[2]}%
\FrontPageTeaser[TeaserHeight=3in]{\textcolor{red}{\blindtext[10]}}%
\FrontPageTeaser[TeaserHeight=5in]{\textcolor{blue}{\selectlanguage{ngerman}\blindtext[10]}}%
\clearpage
\end{document}

在此处输入图片描述

包的第一个版本 ## 颜色只能与 一起使用lualatex

\NeedsTeXFormat{LaTeX2e}%
\ProvidesPackage{jumplines}[2015/01/04 v0.1 -- Teaser/Continued articles with hyperlinks]
%%%
%% License: LaTeX Project Public License version 1.3 
%% Copyright (2015) Dr. Christian Hupfer 
%% Author: Christian Hupfer [email protected]
%%
%%%%

\RequirePackage{etex}%
\RequirePackage{etoolbox}[2011/01/03 2.2]%
\RequirePackage{xparse}%
\RequirePackage{xkeyval}[2012/10/14 v2.6b]%
\RequirePackage[svgnames]{xcolor}
\RequirePackage[breakable]{tcolorbox}%

\RequirePackage{tocloft}
\RequirePackage{ifluatex}

\ifluatex
\RequirePackage{luacolor}%  Recommended
\fi


%%%% Key - Value definitions

\NewDocumentCommand{\listofarticlesname}{}{List of Articles}%
\newlistof{article}{art}{\listofarticlesname}%
\newlistof{contarticle}{cont}{\listofarticlesname}%




\define@key{jumpline}{ArticleHeadline}{%
  \def\JLKVMacroArticleHeadline{#1}%
}%

\define@key{jumpline}{ArticleAuthor}{%
  \def\JLKVMacroArticleAuthor{#1}%
}%

% Length related keys

\define@key{jumpline}{ArticleFullHeight}{%
  \def\JLKVMacroArticleFullHeight{#1}%
}%

\define@key{jumpline}{TeaserHeight}[2in]{%
  \def\JLKVMacroTeaserHeight{#1}%
}%

\define@key{jumpline}{ContinuedArticleHeight}{%
  \def\JLKVMacroContinuedArticleHeight{#1}%
}%

\define@key{jumpline}{ContinuedFromTopskip}{%
  \def\JLKVMacroContinuedFromTopskip{#1}%
}%
\define@key{jumpline}{ContinuedFromBottomskip}{%
  \def\JLKVMacroContinuedFromBottomskip{#1}%
}%

\define@key{jumpline}{ContinuedOnTopskip}{%
  \def\JLKVMacroContinuedOnTopskip{#1}%
}%

\define@key{jumpline}{ContinuedOnBottomskip}{%
  \def\JLKVMacroContinuedOnBottomskip{#1}%
}%

\define@key{jumpline}{ContinuedArticleBottomskip}{%
  \def\JLKVMacroContinuedArticleBottomskip{#1}%
}%

% Keys for optional teaser/continued article content and options

\define@key{jumpline}{TeaserHeaderContent}{%
  \def\JLKVMacroTeaserHeaderContent{#1}%
}%

\define@key{jumpline}{TeaserHeaderOptions}{%
  \def\JLKVMacroTeaserHeaderOptions{#1}%
}%

\define@key{jumpline}{ContinuedArticleHeaderContent}{%
  \def\JLKVMacroContinuedArticleHeaderContent{#1}%
}%


\define@key{jumpline}{ContinuedArticleHeaderOptions}{%
  \def\JLKVMacroContinuedArticleHeaderOptions{#1}%
}%

\presetkeys{jumpline}{TeaserHeight=2in,
                      ContinuedOnTopskip={0.4\baselineskip},
                      ContinuedOnBottomskip={0pt},
                      ContinuedFromTopskip={0.4\baselineskip},
                      ContinuedFromBottomskip={0pt},%
                      ContinuedArticleBottomskip={20pt},%
                      TeaserHeaderContent={},
                      TeaserHeaderOptions={breakable,leftlower=0pt,rightlower=0pt,boxrule=0pt,left=0pt,right=0pt, arc=0pt,auto outer arc,colbacktitle=black,coltitle=white,toptitle=2mm,bottomtitle=2mm,after={\parskip=0pt}},
                      ContinuedArticleHeaderOptions={breakable,leftlower=0pt,rightlower=0pt,boxsep=0pt,boxrule=0pt,left=0pt,right=0pt,arc=0pt,auto outer arc,colbacktitle=black,coltitle=white,toptitle=2mm,bottomtitle=2mm,righttitle=1mm}
                    }{}%




\newcounter{@@jumplines@@internaldocounter}%

\newlength{\@@jumplines@@articleheight}%
\newlength{\@@jumplines@@teaserboxheight}%


\xdef\ContinuedArticleList{}%
\xdef\TeaserBoxList{}%
\xdef\JumplineOptionsList{}%

\listcsadd{ContinuedArticleList}{}%
\listcsadd{TeaserBoxList}{}%
\listcsxadd{JumplineOptionsList}{}%



\NewDocumentCommand\JumplineArticle{+o+m}{%    Provide later on for a starred version
  \refstepcounter{article}%
  \newbox\articlebox%
  \newbox\teaserbox%
  \begingroup%
  \IfValueTF{#1}{%
    \setkeys{jumpline}{#1}%
  }{%
    \typeout{Nothing!}%
  }%
  \setlength{\@@jumplines@@teaserboxheight}{\JLKVMacroTeaserHeight}%
  \global\setbox\articlebox=\vbox{\noindent#2}%
  \setlength{\@@jumplines@@articleheight}{\the\ht\articlebox}%
  \global\setbox\teaserbox=\vsplit\articlebox to \@@jumplines@@teaserboxheight% Split the input to teaser box and a continued box 
  \listcsxadd{TeaserBoxList}{\number\teaserbox}%
  \listcsxadd{ContinuedArticleList}{\number\articlebox}%
  % Transfer options to the child box handlers
  \listcsxadd{JumplineOptionsList}{\unexpanded{#1},ContinuedArticleHeight={\the\ht\articlebox},ArticleFullHeight={\the\@@jumplines@@articleheight}}%
  \endgroup%
}%


\NewDocumentCommand{\DisplayJumplineTeaser}{+m+m}{%
  \begingroup%
  \setkeys{jumpline}{#1}%
  \begin{tcolorbox}[title={Article \thearticle~\ifdef{\JLKVMacroArticleHeadline}{\JLKVMacroArticleHeadline}{}},
    code={\pgfkeysalsofrom\JLKVMacroTeaserHeaderOptions}]
    \ifdef{\JLKVMacroTeaserHeaderContent}{%
      \JLKVMacroTeaserHeaderContent}{}%
  \end{tcolorbox}%
  \phantomsection%
  \label{jlarticle::teaser::\number\value{article}}%
  \ifdef{\JLKVMacroArticleHeadline}{%
    \addcontentsline{art}{section}{\thearticle~\JLKVMacroArticleHeadline}
  }{%
    \addcontentsline{art}{section}{\thearticle}%
  }%
  % Now unbox it
  \noindent\unvbox#2%
  \vskip\JLKVMacroContinuedOnTopskip%
  \ifdef{\JLKVMacroArticleAuthor}{\raggedleft By \JLKVMacroArticleAuthor\par}{}%
  \ifdimless{\JLKVMacroArticleFullHeight}{\JLKVMacroTeaserHeight}{%
  }{% 
    \raggedleft\textit{\bfseries Continued on Page \pageref{jlarticle::\number\value{article}}} % Change later on to be more configurable!
  }%
  \vskip\JLKVMacroContinuedOnBottomskip%
  \endgroup%
}%



\NewDocumentCommand{\DisplayContinuedArticle}{+m+m}{%
  \begingroup%
  \setkeys{jumpline}{#1}%
  \ifdimgreater{\JLKVMacroArticleFullHeight}{\JLKVMacroTeaserHeight}{%
    \begin{tcolorbox}[title={\raggedleft Continued from Article \ref{jlarticle::teaser::\number\value{article}} on page \pageref{jlarticle::teaser::\number\value{article}}},code={\pgfkeysalsofrom\JLKVMacroContinuedArticleHeaderOptions}]%
      \ifdef{\JLKVMacroContinuedArticleHeaderContent}{%
        \JLKVMacroContinuedArticleHeaderContent}{%
      }%
    \end{tcolorbox}%
    \phantomsection\label{jlarticle::\number\value{article}}%
    \ifdef{\JLKVMacroArticleHeadline}{%
      \addcontentsline{cont}{section}{\thearticle~\JLKVMacroArticleHeadline}%
    }{%
      \addcontentsline{cont}{section}{\thearticle}%
    }%
    \noindent\unvbox#2%
  }{}%
  \endgroup%
}%

\NewDocumentCommand{\@@jumplines@@showcontinuedarticle}{+m}{%
  \refstepcounter{article}%
  \begingroup%
  \setcounter{@@jumplines@@internaldocounter}{0}%
  \renewcommand{\do}[1]{%
    \stepcounter{@@jumplines@@internaldocounter}%
    \ifnumequal{\value{@@jumplines@@internaldocounter}}{\value{article}}{%
      \DisplayContinuedArticle{##1}{#1}%
      \listbreak%
    }{}}%
  \dolistcsloop{JumplineOptionsList}%
  \endgroup%
}%

\NewDocumentCommand{\@@jumplines@@showteaser}{+m}{%
  \refstepcounter{article}%
  \begingroup%
  \setcounter{@@jumplines@@internaldocounter}{0}%
  \renewcommand{\do}[1]{%
    \stepcounter{@@jumplines@@internaldocounter}%
    \ifnumequal{\value{@@jumplines@@internaldocounter}}{\value{article}}{%
      \DisplayJumplineTeaser{##1}{#1}%  
      \listbreak%
    }{%
      % Do nothing in this case
    }%
  }% End of \do definition
  \dolistcsloop{JumplineOptionsList}%
  \endgroup%
}%


\NewDocumentCommand{\ShipoutArticleTeasers}{}{%
  % Do it for safety reasons%
  \setcounter{article}{0}%
  \forlistcsloop{\@@jumplines@@showteaser}{TeaserBoxList}%
}%

\NewDocumentCommand{\ShipoutArticleHangingArticles}{}{%
  \setcounter{article}{0}%
  \forlistcsloop{\@@jumplines@@showcontinuedarticle}{ContinuedArticleList}%
}%

\endinput

驱动程序文档

\documentclass[12pt,a4paper,twocolumn]{scrartcl}


\usepackage{graphicx}%
\usepackage{blindtext}%
\usepackage{jumplines}

\usepackage[bookmarksopen=true]{hyperref}


\begin{document}

\listofarticle
\listofcontarticle

\clearpage


\JumplineArticle[TeaserHeight=2in,ArticleHeadline={Breaking News}]{%
  \Large\textbf{Nothing special on the dark side of the moon}\par
  \begin{center}\includegraphics[scale=0.3]{example-image-a}\end{center}\par
  \blindtext[2]
}%
\JumplineArticle[TeaserHeight=2in,ArticleAuthor={Gandalf},ContinuedOnTopskip=1cm,ContinuedOnBottomskip=2cm,TeaserHeaderContent={A short article}]{\color{red}{\blindtext[10]}}%
\JumplineArticle[TeaserHeight=2in,ContinuedArticleHeaderContent={More information}]{\textcolor{blue}{\blindtext[1]\textcolor{Green}{Showing}\blindtext[2]}}%
\JumplineArticle[TeaserHeight=3in,ArticleHeadline={\Huge Breaking News}]{\Huge \sffamily The World is a Globe\par\begin{center}\includegraphics[scale=0.3]{example-image-b}\end{center}\par
  {\color{violet}{\( E = mc^2\)}}}%
\JumplineArticle[TeaserHeight=2in]{{{\color{brown}{\blindtext[10]}}}}%
\JumplineArticle[TeaserHeight=8in]{\textcolor{blue}{\blindtext[10]}}%
\JumplineArticle[TeaserHeight=2in]{\textcolor{Goldenrod}{\blindtext[10]}}%
\JumplineArticle[TeaserHeight=2in,ArticleAuthor={\textcolor{violet}{Some guy from the LaTeX3 - team}}]{\Huge \begin{center}\includegraphics[scale=0.2]{example-image-c}\end{center} \centering "I can't wait for \LaTeX3"}

\ShipoutArticleTeasers%

\clearpage

\ShipoutArticleHangingArticles%


\end{document}

在此处输入图片描述 在此处输入图片描述

相关内容