diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/artthreads |
Initial commit
Diffstat (limited to 'macros/latex/contrib/artthreads')
-rw-r--r-- | macros/latex/contrib/artthreads/README.md | 27 | ||||
-rw-r--r-- | macros/latex/contrib/artthreads/artthreads.dtx | 390 | ||||
-rw-r--r-- | macros/latex/contrib/artthreads/artthreads.ins | 61 | ||||
-rw-r--r-- | macros/latex/contrib/artthreads/docs/artthreads_man.pdf | bin | 0 -> 141045 bytes | |||
-rw-r--r-- | macros/latex/contrib/artthreads/docs/artthreads_man.tex | 434 | ||||
-rw-r--r-- | macros/latex/contrib/artthreads/examples/article_tech.tex | 109 | ||||
-rw-r--r-- | macros/latex/contrib/artthreads/examples/article_tst.tex | 78 |
7 files changed, 1099 insertions, 0 deletions
diff --git a/macros/latex/contrib/artthreads/README.md b/macros/latex/contrib/artthreads/README.md new file mode 100644 index 0000000000..d3cb0470cd --- /dev/null +++ b/macros/latex/contrib/artthreads/README.md @@ -0,0 +1,27 @@ +The artthreads Package +Author: D. P. Story +Version: v1.1 +Dated: 2016/04/09 + +Through the commands of the artthreads package, create PDF article threads, +a concept/feature of Adobe Reader/Acrobat that has been around since the +product's beginning. The use of article threads typically only makes sense in +a document in which the text is in a multi-column format. + +Set the article threads after the composition of the document is completed. +The method of setting the threads is very visual not automatic as in the +threadcol package of Scott Patkin (available for pdftex only). + +The artthreads package supports all drivers: dvips, pdflatex (which includes +lualatex), dvipdfm, dvipdfmx, and xelatex. + +Unpack the distribution by latexing artthreads.ins. + +Enjoy. + +D. P. Story +www.acrotex.net +dpstory@uakron.edu +dpstory@acrotex.net + + diff --git a/macros/latex/contrib/artthreads/artthreads.dtx b/macros/latex/contrib/artthreads/artthreads.dtx new file mode 100644 index 0000000000..3eda077151 --- /dev/null +++ b/macros/latex/contrib/artthreads/artthreads.dtx @@ -0,0 +1,390 @@ +%\iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% artthreads.sty package, 2016-04-09 %% +%% Copyright (C) 2016 D. P. Story %% +%% dpstory@uakron.edu %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%</copyright> +%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%<package>\ProvidesPackage{artthreads} +%<package> [2016/04/09 v1.1 Support for article threads (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex]{hyperref} +\usepackage{fancyvrb,array,calc} +%\pdfstringdefDisableCommands{\let\\\textbackslash} +%\EnableCrossrefs \CodelineIndex +\RecordChanges +\bgroup\ttfamily +\gdef\brpr#1{\char123\relax#1\char125\relax}\egroup +\def\ameta#1{\ensuremath{\langle\textsl{\texttt{#1}}\rangle}} +\def\meta#1{\textsl{\texttt{#1}}} +\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}} +\def\cs#1{\texttt{\bslash#1}} +\DeclareRobustCommand{\tmspace}[3]{% + \ifmmode\mskip#1#2\else\kern#1#3\fi\relax} +\renewcommand{\,}{\tmspace+\thinmuskip{.1667em}} +\let\thinspace\, +\renewcommand{\!}{\tmspace-\thinmuskip{.1667em}} +\let\negthinspace\! +\renewcommand{\:}{\tmspace+\medmuskip{.2222em}} +\let\medspace\: +\newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}} +\renewcommand{\;}{\tmspace+\thickmuskip{.2777em}} +\let\thickspace\; +\newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}} +\makeatletter +\renewcommand{\paragraph} + {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt} + {\normalfont\normalsize\bfseries}} +\renewenvironment{quote}[1][] + {\def\@rgi{#1}\ifx\@rgi\@empty + \let\rghtm\@empty\else\def\rghtm{\rightmargin\leftmargin}\fi + \list{}{\rghtm} %{\rightmargin\leftmargin}% + \item\relax} + {\endlist} +\makeatother +\begin{document} +\def\CMD#1{\textbackslash#1} + \GetFileInfo{artthreads.sty} + \title{\textsf{artthreads}: Support for article threads} + \author{D. P. Story\\ + Email: \texttt{dpstory@acrotex.net}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \renewenvironment{theglossary}{% + \let\efill\relax + \begin{itemize}}{\end{itemize}} + \value{GlossaryColumns}=1 + \DocInput{artthreads.dtx} + \PrintIndex +\end{document} +%</driver> +% \fi +% \MakeShortVerb{|} +% \StopEventually{} +% +% \DoNotIndex{\def,\edef,\gdef,\xdef,\global,\long,\let} +% \DoNotIndex{\expandafter,\string,\the,\ifx,\else,\fi} +% \DoNotIndex{\csname,\endcsname,\relax,\begingroup,\endgroup} +% \DoNotIndex{\DeclareTextCommand,\DeclareTextCompositeCommand} +% \DoNotIndex{\space,\@empty,\special} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \section{Introduction} +% This package is used to create \textit{article threads} around blocks of content. Generally, +% article threads are used with multi-column documents, such as newspapers or newsletters, or +% anything that uses a multi-column format. +% +% The creation of the article threads should occur as the final step of the document composition. +% There is nothing automatic about placing the threads, {\TeX} does not lend itself to the creation +% of the threads. For the purpose of placing the threads, the options \texttt{preview} and +% \texttt{viewMagWin} are integral. +% +% \section{Options and Required Packages} +% \begin{macrocode} +\RequirePackage{xkeyval} +\RequirePackage{ifpdf}[2006/02/20] +\RequirePackage{ifxetex}[2006/08/21] +\@ifundefined{ifpdfmarkup}{\newif\ifpdfmarkup}{}\pdfmarkupfalse +\ifpdf\else\ifxetex\else\pdfmarkuptrue\fi\fi +% \end{macrocode} +% \paragraph*{Driver options.} Three options, \DescribeMacro{dvips,dvipsone}\texttt{dvips} (the default) +% and \texttt{dvipsone}, both of which require \textbf{Adobe Distiller} +% as the PDF creator; the \DescribeMacro{pdftex}\texttt{pdftex} allows for the same functionality +% for the \textsf{pdflatex} executable. We also support \DescribeMacro{xetex,dvipdfm,dvipdfmx}\texttt{dvipdfm} +% and its extensions. +% +% \paragraph*{Preview options.} The \DescribeMacro{preview}\texttt{preview} +% option is a carry over from \textsf{eforms}. When selected, all form fields are outlined; useful when +% setting the location of fields in a dvi previewer. The other option is \texttt{viewMagWin} +% \DescribeMacro{viewMagWin} will show the viewing windows surrounding the target. This is the rectangle +% that will be jumped to. Use this option to adjust the size of the window to your needs. +% When either of the last two options has an exclamation point prior, that means to +% turn off the switch. You can conveniently use \texttt{viewMagWin} to see the viewing window, +% then change it to \DescribeMacro{!viewMagWin}\texttt{!viewMagWin} to remove the visible window. Cool. +% Similarly, you can turn off \texttt{preview} using \DescribeMacro{!preview}\texttt{!preview}. +% \begin{macrocode} +% \end{macrocode} +% All options are passed to the \textsf{fitr} package, which contains a lot of the code +% used in this package. +% \begin{macrocode} +\DeclareOptionX{pdftex}{\PassOptionsToPackage{\CurrentOption}{fitr}} +% \end{macrocode} +% Distiller based drivers. +% \begin{macrocode} +\DeclareOptionX{dvips}{\PassOptionsToPackage{\CurrentOption}{fitr}} +\DeclareOptionX{dvipsone}{\PassOptionsToPackage{\CurrentOption}{fitr}} +% \end{macrocode} +% \textsf{dvipdfm} and its variants. +% \begin{macrocode} +\DeclareOptionX{dvipdfm}{\PassOptionsToPackage{\CurrentOption}{fitr}} +\DeclareOptionX{dvipdfmx}{\PassOptionsToPackage{\CurrentOption}{fitr}} +\DeclareOptionX{xetex}{\PassOptionsToPackage{\CurrentOption}{fitr}} +% \end{macrocode} +% \begin{macrocode} +\DeclareOptionX{preview}{\PassOptionsToPackage{\CurrentOption}{fitr}} +\DeclareOptionX{!preview}{\PassOptionsToPackage{\CurrentOption}{fitr}} +\DeclareOptionX{viewMagWin}{\PassOptionsToPackage{\CurrentOption}{fitr}} +\DeclareOptionX{!viewMagWin} + {\PassOptionsToPackage{\CurrentOption}{fitr}} +\ProcessOptionsX +% \end{macrocode} +% \section{The Main Code} +% We require the package \textsf{fitr}, as we use many commands from that package. +% We pass all options to \textsf{fitr}. +% \begin{macrocode} +\RequirePackage{fitr}[2016/04/04] +% \end{macrocode} +% Some scratch counters, lengths, boxes. +% \begin{macrocode} +\newif\ifnewarticle +\newcounter{artthrdcnt} +\def\CntArt{0}\def\CntArtInfo{0} +\def\inc@CntMacro#1{{\@tempcnta#1\relax\advance\@tempcnta1\relax + \xdef#1{\the\@tempcnta}}} +\def\artM@rk{[\space} +% \end{macrocode} +% \paragraph*{Key-values for \cs{setThreadInfo}} We set up +% key-values\DescribeMacro{title}\DescribeMacro{author}\DescribeMacro{subject}^^A +% \DescribeMacro{keywords} for the thread \textsf{Info} dictionary. Only the title +% is required, that's why a default value of \texttt{thread-<num>} is otherwise provided. +% \begin{macrocode} +\define@key{artthrd}{title}[]{\def\threadTitle{#1}} + \let\threadTitle\@empty +\define@key{artthrd}{author}[]{\def\threadAuthor{#1}} + \let\threadAuthor\@empty +\define@key{artthrd}{keywords}[]{\def\threadKeywords{#1}} + \let\threadKeywords\@empty +\define@key{artthrd}{subject}[]{\def\threadSubject{#1}} + \let\threadSubject\@empty +% \end{macrocode} +% Use \DescribeMacro{\setThreadInfo}\cmd{\setThreadInfo} prior to the opening of a +% new thread using \cs{cArticle}. Through its key-values, set the title, author, +% keywords, and subject of the thread. For \textsf{pdftex}, only title is supported. +% \begin{macrocode} +\newcommand{\setThreadInfo}[1]{\inc@CntMacro\CntArtInfo + \let\threadTitle\@empty\let\threadAuthor\@empty + \let\threadKeywords\@empty\let\threadSubject\@empty + \setkeys{artthrd}{#1}\ifx\threadTitle\@empty + \def\threadTitle{thread-\CntArtInfo}\fi +} +\def\bArtErrMsg{When starting a new article thread + (\string\cArticle)\MessageBreak + first use \string\setThreadInfo\space to set the title,\MessageBreak + author, subject, and keywords} +% \end{macrocode} +% \paragraph*{Additional key-values for threads} In addition to the key-values provided +% by \textsf{fitr}, we provide a few more. The two keys +% \DescribeMacro{addtow}\texttt{addtow} and \DescribeMacro{addtoh}\texttt{addtoh} +% adds to the reading border of the threads. These are set through the +% command \DescribeMacro{\setAddToBorder}\cs{setAddToBorder}. For the most part, +% choices for \texttt{addtow} (add to the width) and \texttt{addtoh} (add to the height) +% should be set for the whole document. Initially, \texttt{addtow=0,addtoh=0}. +% \begin{macrocode} +\define@key{@rtthrd}{addtow}[0]{% + \fitr@defaultbp{\artthrd@@addtow}{#1}} +\def\artthrd@@addtow{0} +\define@key{@rtthrd}{addtoh}[0]{% + \fitr@defaultbp{\artthrd@@addtoh}{#1}} +\def\artthrd@@addtoh{0} +\newcommand{\setAddToBorder}[1]{\setkeys{@rtthrd}{#1}} +% \end{macrocode} +% The \DescribeMacro{\bArticle}\cmd{\bArticle} is used to start an article thread. The thread +% may continue with \cs{cArticle}. Both commands have a required argument, consisting of +% key-values defined by \textsf{fitr}. +% The following is the syntax, with appropriate keys defined in \texttt{fitr}. +% \begin{quote}\ttfamily +% \string\cArticle\char123lift=\ameta{length},width=\ameta{length},height=\ameta{length}\char125 +% \end{quote} +% \begin{macrocode} +\newcommand{\bArticle}{\begingroup\inc@CntMacro\CntArt + \ifnum\CntArt=\CntArtInfo\relax\else + \PackageError{artthreads}{\bArtErrMsg}{See package documentation + for \string\setThreadInfo}\fi + \newarticletrue\set@rectart +} +% \end{macrocode} +% The only difference between \DescribeMacro{\cArticle}\cmd{\cArticle} and +% \cmd{\bArticle} is the stepping of the counter \cmd{\CntArt} +% and the setting of the switch \cmd{ifnewarticle}. +% \begin{macrocode} +\newcommand{\cArticle}{\begingroup\newarticlefalse\set@rectart} +% \end{macrocode} +% \cmd{\set@rectart} continues \cs{bArticle}/\cs{cArticle}. +% \begin{macrocode} +\newcommand{\set@rectart}[1]{\def\fitr@artrect@argi{#1}% + \edef\temp@exp{\noexpand\setkeys{fitr}{#1}}\temp@exp + \set@@rectart} +% \end{macrocode} +% \cmd{\set@@rectart} is the main command for building the thread. +% \begin{macrocode} +\def\set@@rectart{\def\fitr@setBL{0pt}% + \@ifundefined{ef@Bbox}{\let\fitr@FLB@ction\Bbox}% + {\let\fitr@FLB@ction\ef@Bbox}% + \get@fitr@dimen{% + \parbox[\fitr@@refPt][\fitr@@height]{\fitr@@width}% + {\kern0pt\fitr@FLB@ction{\fitr@@width}{\fitr@@height}\kern0pt}% + }% + \makebox[0pt][l]{\hspace*{\fitr@@shift}\smash{% + \raisebox{\fitr@@lift-\fitr@setBL}{% +% \end{macrocode} +% Actually insert the thread code here by inserting \cs{setThre@d}. +% \begin{macrocode} + \setThre@d{\artthrd@@addtow}{\artthrd@@addtoh}% + \unhbox\fitr@bbox + \fitr@urxury@fixup{\artthrd@@addtow}{\artthrd@@addtoh}{}% + }}}\setlength{\fboxsep}{0pt}% +% \end{macrocode} +% Now place an extended border around the viewing area +% \begin{macrocode} + \ifviewMagWin + \fitr@length=\artthrd@@addtow bp + \fitr@length=2\fitr@length + \addtolength{\fitr@length}{\fitr@@width}% + \edef\fitr@@width{\the\fitr@length}% + \fitr@length=\artthrd@@addtoh bp + \fitr@length=2\fitr@length + \addtolength{\fitr@length}{\fitr@@height}% + \edef\fitr@@height{\the\fitr@length}% + \setlength\fitr@length{-\artthrd@@addtow bp}% + \addtolength\fitr@length{\fitr@@shift}% + \makebox[0pt][l]{\hspace*{\fitr@length}\smash{% + \setlength\fitr@length{\fitr@@lift-\fitr@setBL}% + \if\fitr@@refPt b% + \addtolength\fitr@length{-\artthrd@@addtoh bp}\else + \if\fitr@@refPt t% + \addtolength\fitr@length{\artthrd@@addtoh bp}% + \fi\fi + \raisebox{\fitr@length}% + {\fbox{\parbox[\fitr@@refPt][\fitr@@height]% + {\fitr@@width}{\kern0pt\hfill\vfill\kern0pt}}}}% + }% + \fi +\endgroup} +% \end{macrocode} +% \paragraph*{Driver dependent macros} The \cs{ThrBbox} macros perform different tasks +% depending on the driver. +% \begin{macrocode} +\if@fitr@dvipdfm +% \end{macrocode} +% For the \textsf{dvipdfm} and friends +% \begin{macrocode} +\def\ThrBbox#1#2{% + \fitr@length=#1bp + \fitr@length=2\fitr@length + \advance\fitr@length\wd\fitr@bbox + \edef\fitr@xetex@view@width{\the\fitr@length}% + \fitr@length=#2bp + \advance\fitr@length\ht\fitr@bbox + \edef\fitr@xetex@view@height{\the\fitr@length}% + \fitr@length=#2bp + \advance\fitr@length\dp\fitr@bbox + \edef\fitr@xetex@view@depth{\the\fitr@length}% +}\else\ifx\fitr@driver\fitr@pdftex@driver +% \end{macrocode} +% For the \textsf{pdftex} and friends +% \begin{macrocode} +\def\ThrBbox#1#2{% + \fitr@length=#1bp + \fitr@length=2\fitr@length + \advance\fitr@length\wd\fitr@bbox + \edef\fitr@pdftex@view@width{\the\fitr@length}% + \fitr@length=#2bp + \advance\fitr@length\ht\fitr@bbox + \edef\fitr@pdftex@view@height{\the\fitr@length}% + \fitr@length=#2bp + \advance\fitr@length\dp\fitr@bbox + \edef\fitr@pdftex@view@depth{\the\fitr@length}% +}\else\ifx\fitr@driver\fitr@dvipsone@driver +% \end{macrocode} +% For the \textsf{dvipsone} driver +% \begin{macrocode} +\def\ThrBbox#1#2{% + currentpoint 2 copy % + \the\fitr@depth\space add #2\space PDFtoTeX add % y1 + exch #1\space PDFtoTeX sub exch % x1 + 4 2 roll exch + \the\fitr@width\space add #1\space PDFtoTeX add exch % x2 + \the\fitr@height\space sub #2\space PDFtoTeX sub} % y2 +\else\ifx\fitr@driver\fitr@dvips@driver +% \end{macrocode} +% For the \textsf{dvips} driver +% \begin{macrocode} +\def\ThrBbox#1#2{% Uses \fitr@bbox + currentpoint 2 copy % + \the\fitr@depth\space SPtoDvips add + #2\space BPToDvips add % y1 + exch #1\space BPToDvips sub exch % x1 + 4 2 roll exch + \the\fitr@width\space SPtoDvips add + #1\space BPToDvips add exch % x2 + \the\fitr@height \space SPtoDvips sub + #2\space BPToDvips sub} % y2 +\fi\fi\fi\fi +% \end{macrocode} +% \paragraph*{Code to set the thread} The \cs{setThre@d} macros are driver dependent. +% \begin{macrocode} +\def\setThre@d#1#2{% + \fitr@defaultbp{\aWd}{#1}\fitr@defaultbp{\aHt}{#2}% + \edef\tmp@exp{\noexpand\set@rtThrd{\aWd}{\aHt}}\tmp@exp +} +\if@fitr@dvipdfm +% \end{macrocode} +% For the \textsf{dvipdfm} and friends +% \begin{macrocode} +\def\set@rtThrd#1#2{\ThrBbox{#1}{#2}% + \smash{\raisebox{-\fitr@xetex@view@height+#2bp}% + {\makebox[0pt][l]{\hspace*{-#1bp}% + \@pdfm@mark{thread @artthrd\CntArt\space + width \fitr@xetex@view@width\space + height \fitr@xetex@view@height\space + depth \fitr@xetex@view@depth\space + << /Title (\threadTitle) +\ifnewarticle + /Author (\threadAuthor) + /Subject (\threadSubject) + /Keywords (\threadKeywords) +\fi >>}}}}}\else\ifx\fitr@driver\fitr@pdftex@driver +% \end{macrocode} +% \textsf{pdftex} and friends +% \begin{macrocode} +\def\set@rtThrd#1#2{\ThrBbox{#1}{#2}% + \makebox[0pt][l]{\hspace*{-#1bp}% + \pdfthread + width \fitr@pdftex@view@width\space + height \fitr@pdftex@view@height\space + depth \fitr@pdftex@view@depth\space + name {\threadTitle}}}\else +% \end{macrocode} +% For drivers that use PostScript and the \textbf{pdfmark}. +% \changes{v1.1}{2016/04/09}{Removed the Page key and dependence on the refcount package} +% \begin{macrocode} +\def\set@rtThrd#1#2{\literalps@out{\artM@rk + /Rect [\ThrBbox{\artthrd@@addtow}{\artthrd@@addtoh}] + /Title (\threadTitle) +\ifnewarticle + /Author (\threadAuthor) + /Subject (\threadSubject) + /Keywords (\threadKeywords) +\fi + /ARTICLE pdfmark}} +\fi\fi +% \end{macrocode} +% \begin{macrocode} +%</package> +% \end{macrocode} +%\Finale +\endinput diff --git a/macros/latex/contrib/artthreads/artthreads.ins b/macros/latex/contrib/artthreads/artthreads.ins new file mode 100644 index 0000000000..6d646d872b --- /dev/null +++ b/macros/latex/contrib/artthreads/artthreads.ins @@ -0,0 +1,61 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1999-2012 D. P. Story +%% +%% This file is part of the `AcroTeX eDucation Bundle'. +%% ------------------------------------------- +%% +%% It may be distributed under the conditions of the LaTeX Project Public +%% License, either version 1.2 of this license or (at your option) any +%% later version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2016/01/12} +\def\batchfile{artthreads.ins} + +\input docstrip +\ifx\generate\undefined + \Msg{**********************************************} + \Msg{*} + \Msg{* This installation requires docstrip} + \Msg{* version 2.4 or later.} + \Msg{*} + \Msg{* An older version of docstrip has been input} + \Msg{*} + \Msg{**********************************************} + \errhelp{Move or rename old docstrip.tex and get a newer one.} + \errmessage{Old docstrip in input path} + \batchmode + \csname @@end\endcsname\end +\fi + +\keepsilent +\askforoverwritefalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\preamble +\endpreamble + +\generate +{% + \file{artthreads.sty}{\from{artthreads.dtx}{copyright,package}} +} + + +\Msg{***************************************************************} +\Msg{*} +\Msg{* \space To finish the installation you have to copy the files } +\Msg{*} +\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput diff --git a/macros/latex/contrib/artthreads/docs/artthreads_man.pdf b/macros/latex/contrib/artthreads/docs/artthreads_man.pdf Binary files differnew file mode 100644 index 0000000000..5420d548a7 --- /dev/null +++ b/macros/latex/contrib/artthreads/docs/artthreads_man.pdf diff --git a/macros/latex/contrib/artthreads/docs/artthreads_man.tex b/macros/latex/contrib/artthreads/docs/artthreads_man.tex new file mode 100644 index 0000000000..93967ebf06 --- /dev/null +++ b/macros/latex/contrib/artthreads/docs/artthreads_man.tex @@ -0,0 +1,434 @@ +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv,forcolorpaper,tight*,latextoc,pro}, + eforms,aebxmp +]{aeb_pro} +\usepackage{graphicx,array,fancyvrb} +\usepackage{aeb_mlink} +%\usepackage{myriadpro} +%\usepackage{calibri} +\usepackage[altbullet]{lucidbry} + +\usepackage[dvipsone,!viewMagWin,!preview]{artthreads} +\usepackage{lipsum,multicol} +\raggedcolumns + +\makeatletter +\renewenvironment{quote}[1][] + {\def\@rgi{#1}\ifx\@rgi\@empty + \let\rghtm\@empty\else\def\rghtm{\rightmargin\leftmargin}\fi + \list{}{\rghtm} %{\rightmargin\leftmargin}% + \item\relax} + {\endlist} +\makeatother +\renewcommand{\hproportionwebtitle}{.8} + +%\usepackage{makeidx} +%\makeindex +\usepackage{acroman} + + +\usepackage[active]{srcltx} + +\urlstyle{tt} + +%\def\tutpath{doc/tutorial} +%\def\tutpathi{tutorial} +%\def\expath{../examples} + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={The \textsf{artthreads} Package + \texorpdfstring{\\[1ex]\Large}{: }Creating article threads for multi-column documents}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject=Documentation for artthreads package, + talksite={\url{www.acrotex.net}}, + version={1.0}, + Keywords={LaTeX, article threads, multi-column documents, AcroTeX}, + copyrightStatus=True, + copyrightNotice={Copyright (C) \the\year, D. P. Story}, + copyrightInfoURL={http://www.acrotex.net} +} + +\universityLayout{fontsize=Large} +\titleLayout{fontsize=LARGE} +\authorLayout{fontsize=Large} +\tocLayout{fontsize=Large,color=aeb} +\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb} +\subsectionLayout{indent=-31.25pt,color=aeb} +\subsubsectionLayout{indent=0pt,color=aeb} +\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}} + +\optionalPageMatter{% +\begin{center} +\fcolorbox{blue}{webyellow}{ +\begin{minipage}{.67\linewidth}% +\textbf{\textcolor{red}{Stop!}} Before you read this documentation, take a moment to change +your preferences: On your menu system if \app{Adobe Acrobat/Reader}, select \textsf{Edit\,>\,\penalty0Preferences\,>\,\penalty0General}, and \emph{clear +the checkbox} for the item named \textsf{Make Hand tool select text \& +images}, as listed under \textsf{Basic Tools} on that dialog box. +(\textsf{Ctrl+K} or \textsf{Command+K} is the shortcut to the Preferences +dialog box on \app{Windows} and \app{Mac OS}, respectively.) This makes reading an article thread +much easier. Look for the hand icon with a down arrow on it.\hfill\dps +\end{minipage}} +\end{center} +} + + +\begin{docassembly} +\addWatermarkFromFile({ + bOnTop:false, + cDIPath:"C:/Users/Public/Documents/ManualBGs/Manual_BG_Print_AeB.pdf" +}); +\executeSave(); +\end{docassembly} + +\begin{document} + +\maketitle + +\selectColors{linkColor=black} +\tableofcontents +\selectColors{linkColor=webgreen} + +\setAddToBorder{addtow=5bp,addtoh=0bp} + +\newcommand\showArtPanel[1][Article]{\pushButton[ + \CA{#1}\A{\Named{ArticleThreads} + \Next{/S/Thread /D(\threadTitle)}}]{Btn}{}{11bp}} + + +\section{Introduction} + +\setThreadInfo{title=Introduction,author=D. P. Story, + subject=Introduction to article threads,keywords={AeB, PDF, LaTeX}}% + + +\begin{multicols}{2} +\noindent\makebox[0pt][r]{\showArtPanel[Intro]\relax\kern11bp}% +\bArticle{lift=\baselineskip,width=\linewidth,height=2.5in}% +\noindent Through the commands of the \pkg{artthreads} package, you can +create \textit{article threads}, a concept/feature of \app{Adobe +Reader/Acrobat} that has been around since the product's beginning. The use +of article threads typically only makes sense in a document in which the text +is in a multi-column format, or, perhaps, a single narrow column. + +When a document uses a multiple column format, it is often difficult, or at +the very least inconvenient, to read it. When document page is fit into the viewing +window, the text may be two small to read. This requires the reader, that's +you, to adjust the magnification (zoom) level of the page to fit a column of +text comfortably in the application window.\vadjust{\noindent +\cArticle{lift=2\baselineskip,width=\linewidth,height=2.5in}} +Once the column is fitted, additional navigation is needed to move the window +view down one column, then up to the top of the next column. Think of trying +to read a digital newspaper with many columns. Such navigation is tedious and +distracts from reading the information begin presented. + +Set the article threads after the composition of the document is completed. +The method of setting the threads is \emph{very visual} not automatic as in +the \pkg{threadcol} package of Scott Patkin. + +\end{multicols} + +\section{Navigating an article thread} + +\setThreadInfo{title=Navigation,author=D. P. Story, + subject=Navigation to article threads,keywords={AeB, PDF, LaTeX}}% + +\begin{multicols}{2} +\noindent\makebox[0pt][r]{\showArtPanel[Navigate]\kern11bp}% +\bArticle{lift=\baselineskip,width=\linewidth,height=4.2in}% +\noindent Perhaps you noticed the `Intro' button on exhibit in this previous +section or the `Navigate' button in this section as well. Clicking these +buttons reveals the \textsf{Article} panel in the left-hand navigation pane. +Listed there are all the articles created for this documentation. +Right-clicking on any of the listed article names brings up a context menu; +select \textsf{Read Article} to begin reading or choose \textsf{Properties} +to see the thread info, which (may) include the title, author, subject, and +keywords. + +\paragraph*{Begin an article thread.} There are two of ways to begin +reading a thread: (1)~first open the \textsf{Article} pane +(\textsf{View\,\penalty0>\penalty0\,\penalty0Show/Hide\,\penalty0>\,\penalty0Navigation +Panes\,>\,Articles}), left-click an article title and select \textsf{Read +Article}, or simple double-click an article title; or (2) place your mouse +pointer over text, if it changes to a hand with an arrow on it, the text is +part of an article thread, simply click on it to begin. + +\paragraph*{Navigating a thread.} Once you have initiated \textsf{Read +Article}, you can navigate through the article thread using any of the +following methods\vadjust{\noindent +\cArticle{lift=2\baselineskip,width=\linewidth,height=4.2in}}: (1)~click in +an area when the mouse is a hand icon with an arrow on it to move forward +(shift-click to move back); (2) press the \textsf{Enter} key to move forward +(or shift+\textsf{Enter} to move back); or (3) the page down (or page up) +keys will also move you around within the thread. + +There may be problems in getting the hand icon with the arrow on it to +appear, if this is the case, open the \textsf{Preferences} menu, +\textsf{Edit\,>\,\penalty0Preferences\,>\,\penalty0General}, and \emph{clear +the checkbox} for the item named \textsf{Make Hand tool select text \& +images}, as listed under \textsf{Basic Tools} on that dialog box. +(\textsf{Ctrl+K} or \textsf{Command+K} is the shortcut to the Preferences +dialog box on \app{Windows} and \app{Mac OS}, respectively.) + +\paragraph*{Exploring threads.} Now that you have explored the operation of +article threads and see how they work, the next thing to do is to see how +they are created with the \pkg{artthreads} package. +\end{multicols} + +\section{Creating article threads} + +We begin by including the \pkg{artthreads} package in your document. +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()] +\usepackage[!ameta(options)]{artthreads} +\end{Verbatim} +The \pkg{artthreads} package brings in the \pkg{fitr} package +(\url{http://ctan.org/pkg/fitr}), many commands from that package are used. +In fact, the same set of package options are used. + +\setThreadInfo{title=Package options,author=D. P. Story, + subject=options of the artthreads package,keywords={AeB, PDF, LaTeX}}% + + +\paragraph*{Package options.} +The package has ten options: six driver options and four viewing +options. +\begin{multicols}{2}\previewtrue\viewMagWintrue +\setAddToBorder{addtow=10bp,addtoh=10bp} +\begin{itemize} +\item \bArticle{lift=\baselineskip,width=\linewidth,height=2.5in}% + \textbf{Driver Options:} These are \texttt{dvips} (the default), + \texttt{dvipsone}, and \texttt{pdftex} (which includes the use of + \textsf{lualatex}), \texttt{dvipdfm}, \texttt{dvipdfmx}, and + \texttt{xetex}. If you specify one of the first two, it is assumed that + you are using \textsf{Adobe Distiller} as your PDF creator. + + The \textsf{fitr} package checks whether the \textsf{web} package is + loaded, if so, its uses the driver used by \textsf{web}; otherwise + \textsf{fitr} auto-detects for \textsf{pdftex} and \textsf{xetex}. If + no driver is passed, and neither \textsf{pdftex} nor \textsf{xetex} are + detected, then \textsf{dvips} is the default driver. + +\setAddToBorder{addtow=0bp,addtoh=0bp} + + \item \cArticle{lift=\baselineskip,width=\linewidth,height=2.5in}% + \textbf{Viewing Options:} When you specify \texttt{preview}, the + bounding boxes for the article threads are shown in the + dvi-previewer (or the PDF document); you can turn off this preview + by specifying \texttt{!preview} (or removing \texttt{preview} + entirely from the option list). The other option type is + \texttt{viewMagWin}, when this option the viewing window, a + rectangular region, becomes visible in the dvi-previewer (or in the + PDF document); specifying \texttt{!viewMagWin} turns off this type + of preview. + +%\item[] The effects of the viewing options will be illustrated later in this +%document, see \autoref{previewEx} on page~\pageref*{previewEx}. +\end{itemize} +\end{multicols} +You'll notice the two rectangular regions around the left column. The inner +one is made visible by the \texttt{preview} option (or locally by +\cs{previewtrue}), you can see that it covers `precisely' the text of the +item. The outer rectangle is exposed by the \texttt{viewMagWin} option (or +locally by \cs{viewMagWintrue}). When you view the thread -- and you do not +define an `extra' border around the viewing area -- the inner rectangle is +use. The text in this inner rectangle may not be entirely adequate for +reading as it is very `tight' around the text. It is for this reason, we +expand the viewing area by a specified amount. Compare the reading comfort of +the left column verses the right column. (Try viewing the column thread with +a narrow application window.) + +You may have also that the viewer returns to the same page view the page was +in prior to reading the thread. + +\paragraph*{The article info.} The specifications for an article thread require +it to have a title, and to optionally have key-values for author, subject, and keywords. +\bVerb\takeMeasure{\string\setThreadInfo\{title=\ameta{text},author=\ameta{text},}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\setThreadInfo{title=!ameta(text),author=!ameta(text), +!qquad(subject=!ameta(text),keywords={!ameta(list)})} +\end{dCmd} +\endgroup\noindent If no value of \texttt{title} is provided, \pkg{artthreads} uses +a generated value of \texttt{thread-\ameta{num}}. The \cs{setThreadInfo} +command must appear prior to the opening the thread (see \cs{bArticle} below) +to which it applies, if it does not, a {\LaTeX} error occurs. The drivers +\opt{dvips}, \opt{dvipsone}, \opt{xetex} (\opt{dvipdfm}, \opt{dvipdfmx}) +support all four keys; however, \opt{pdftex} only supports the \texttt{title} +key. + +\paragraph*{The article thread commands.} There is one command +(\cs{bArticle}) for beginning an article thread, and another (\cs{cArticle}) +to continue that thread. +\bVerb\takeMeasure{\string\bArticle\darg{\meta{KV-pairs}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\bArticle{!meta(KV-pairs)} +\cArticle{!meta(KV-pairs)} +\end{dCmd} +\endgroup\noindent Before illustrating \cs{bArticle} and \cs{cArticle}, the +\meta{KV-pairs} are described first. +\begin{itemize} +\item \texttt{width=\ameta{length}}: The value of \opt{width} sets the + width of the thread to \ameta{length}; \ameta{length} is usually, but + not always, \cs{linewidth}. Dimension arithmetic is supported with the + value of \opt{width} (\texttt{width=\cs{linewidth}\,+\,3pt}, for + example). + +\item \texttt{height=\ameta{length}}: The value of \opt{height} sets the + height of the thread to \ameta{length}. As with the \opt{width} key, + dimension arithmetic is supported by \opt{height}; for + example, \texttt{height=3in\,+\,2\cs{baselineskip}}. + +\item \texttt{lift=\ameta{length}}: This key-value lifts (raises) the + article thread window up (or down) by an amount of \ameta{length}; for + example, \texttt{lift=15pt} (or \texttt{lift=-15pt}). The default is a + lift of \texttt{0pt}. Dimension arithmetic is supported. + +\item \texttt{shift=\ameta{length}}: The amount of horizontal shift of the + article thread; positive to the right, negative to the left. For + example, \texttt{shift=-1in} shifts the button/viewing window 1 inch to + the left. The default is \texttt{0pt}. Dimension arithmetic is supported. +\end{itemize} +One last command before the examples. + +\paragraph*{Setting the expanded (add to) border.} It is often convenient to +set the basic thread dimensions (\texttt{width=\cs{linewidth},height=3in}), +but is harder to expand and position the thread to a wider or higher thread +region. Use the \cs{setAddToBorder} command to expand, or add to, the +dimensions of the thread rectangular dimensions. +\bVerb\takeMeasure{\string\setAddToBorder\darg{addtow=\ameta{length},addtoh=\ameta{length}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\setAddToBorder{addtow=!ameta(length),addtoh=!ameta(length)} +\end{dCmd} +\endgroup\noindent The \opt{addtow} key adds \ameta{length} to the left and right +sides of the rectangular boundary of the thread; \opt{addtoh} adds +\ameta{length} to the top and bottom of the rectangular boundary of the +thread. The default dimensions for these two keys are \texttt{0pt}. +\begin{multicols}{2}\setThreadInfo{title=Illustrate \string\\setAddToBorder}% +\noindent\setAddToBorder{addtow=10bp,addtoh=10bp}\previewtrue\viewMagWintrue +{\small\verb|\setAddToBorder{addtow=10bp,|\\ +\null\qquad\verb|addtoh=10bp}|}\\\vadjust{\noindent\bArticle{lift=3\baselineskip,width=\linewidth,height=6\baselineskip}} +In this column we've set a \texttt{10bp} border around the thread. When you click +on the reading area, the viewer should zoom to the width of the wider rectangle. +\vfill +\columnbreak +\noindent\setAddToBorder{addtow=4bp,addtoh=4bp}\previewtrue\viewMagWintrue +{\small\verb|\setAddToBorder{addtow=4bp,|\\ +\null\qquad\verb|addtoh=4bp}|}\\\vadjust{\noindent\cArticle{lift=3\baselineskip,width=\linewidth,height=6\baselineskip}} +In this column, we've set a \texttt{4bp} border. Again, when you click on the +reading area, the viewer should zoom to the width of the wider rectangle. +\end{multicols} +\newtopic\noindent\textbf{Tip:} The values of \opt{addtow} and \opt{addtoh} should be in big +points (\texttt{bp}) for greater accuracy as these are converted to +Postscript or PDF dimensions, depending on the driver. + +\paragraph*{Methodology with examples.} Now we've come to final part of this +documentation, a description of the methodology, accompanied by examples. As +pointed out early in this documentation, the method for applying the article +threads is very visual. Compose your document content first, and then insert the +document threads. Page~\arabic{page} +\begin{center}\previewtrue\viewMagWintrue +\begin{minipage}{.8\linewidth}\parindent=20pt\relax +We illustrate the techniques in a single column of goodly width. +First we declare our add to border dimension and article info +\begin{Verbatim}[fontsize=\small] +\setAddToBorder{addtow=4bp,addtoh=4bp} +\setThreadInfo{title=Methodology,author=D. P. Story} +\end{Verbatim} +There are two places to begin a thread: (1) at the very beginning of a paragraph; +and (2) from within a paragraph. Method~(1) is preferred. We begin the next paragraph +with +\begin{Verbatim}[fontsize=\small] +\noindent\bArticle{lift=\baselineskip, + width=\linewidth,height=1in+3\baselineskip}% +Now we begin our deep thoughts... +\end{Verbatim} +\setAddToBorder{addtow=4bp,addtoh=4bp} +\setThreadInfo{title=Methodology,author=D. P. Story} +\noindent\bArticle{lift=\baselineskip,width=\linewidth,height=1in+3\baselineskip}% +Now we begin our deep thoughts. During this development phase, the options +\opt{preview} and \opt{viewMagWin} should be in effect. In a \EXT{DVI} +viewer, we can see the bounding rectangles. We can see its too low, too long +and so on. For users of \app{pdflatex}, \app{xelatex}, etc., view your +documents in the \EXT{DVI} previewer first (or view them as a \EXT{PDF}). +I've used \texttt{lift=\string\baselineskip} to raise up the thread rectangle +by that mount to enclose the first line. The value of \opt{width} is usually +\cs{linewidth}, but the value of \opt{height} may have to be adjusted, in this +example, I've ``tweaked'' the \texttt{1in} by \texttt{3\string\baselineskip}. + +\newtopic Naturally, after you're satisfied, you then remove +\opt{preview} and \opt{viewMagWin} or change them to +\opt{!preview} and \opt{!viewMagWin}. Another possible location is from within +a paragraph, here, we continue the previous thread using the \cs{cArticle} command +in conjunction with the \cs{vadjust} {\TeX} primitive\vadjust{\noindent +\cArticle{lift=5\baselineskip,width=\linewidth,height=2in+\baselineskip}}. +Between the end of the word `primitive' and the period (.) ending the sentence, I've place +\begin{Verbatim}[fontsize=\small] +primitive\vadjust{\noindent\cArticle{lift=5\baselineskip, + width=\linewidth,height=2in+\baselineskip}}. Between the +\end{Verbatim} +The value of \texttt{lift=5\string\baselineskip} we chosen because the +original positioning of the thread rectangle was too low by about five lines. +The value of \texttt{height} was chosen to cover the paragraph once the +complete paragraph was composed. + +\previewfalse\viewMagWinfalse +We now declare \verb|\previewfalse\viewMagWinfalse|. + +\noindent\cArticle{lift=\baselineskip,width=\linewidth,height=.5in+3\baselineskip}\indent +Of course, in this example, it was entirely unnecessary to insert the +\cs{cArticle} mid-paragraph, it would have been better placed at the +beginning of the paragraph. Placing \cs{cArticle} mid-paragraph is useful for +multi-column formats. When the paragraph flows from the first column the +second column, use the \cs{vadjust} technique to cover the portion of the +text that flows to the right column. +\end{minipage} +\end{center} +By the way, notice the use of \cs{noindent}, this is +oftentimes needed to position the article thread in the left margin of the +text block. + +\paragraph*{The demo file.} The demo file \texttt{article\_tech.tex} +reproduces the discussion on methods, it is found in the \texttt{examples} +folder. + + +\setThreadInfo{title=Final Thread,{author=D. P. Story, Ph.D.}} + +\newtopic\noindent In this documentation, I've covered the content with many article threads; normally, +for multi-column content, one thread per column is sufficient. +\begin{multicols}{2} %\previewtrue +\noindent\bArticle{lift=\baselineskip,width=\linewidth,height=6.7in}\indent +\lipsum[2] + +\lipsum[4] + +\lipsum[6] + +\noindent\cArticle{lift=3\baselineskip,width=\linewidth,height=6.7in}\indent +\lipsum[7] + +\lipsum[10] + +\lipsum[12] + +\noindent\cArticle{lift=10\baselineskip,width=\linewidth,height=4in-\baselineskip}\indent +\lipsum[14] + +\noindent\cArticle{lift=8\baselineskip,width=\linewidth,height=4in-\baselineskip}\indent +\lipsum[16] + +\end{multicols} + +\paragraph*{The demo file.} The demo file for this package is \texttt{article\_tst.tex}, +available in the \texttt{examples} folder. + + +\section{My retirement} + +Now, I simply must get back to it. \dps + +\end{document} diff --git a/macros/latex/contrib/artthreads/examples/article_tech.tex b/macros/latex/contrib/artthreads/examples/article_tech.tex new file mode 100644 index 0000000000..10505b3cad --- /dev/null +++ b/macros/latex/contrib/artthreads/examples/article_tech.tex @@ -0,0 +1,109 @@ +\documentclass{article} +\usepackage[forcolorpaper]{web} +\usepackage[!viewMagWin,!preview]{artthreads} +\usepackage{fancyvrb} +\usepackage{multicol} + +\useFullWidthForPaper % from web +\providecommand{\cs}[1]{\texttt{\char`\\#1}} + +% A selection of pushbutton actions for articles +\def\toggleArticlePane{\pushButton[ + \CA{Article}\A{\Named{ShowHideArticles}}]{TAPBtn}{}{11bp}} +\def\toggleArticlePaneRead{\pushButton[ + \CA{Article}\A{\Named{ShowHideArticles} + \Next{/S/Thread/D(\threadTitle)}}]{TAPRBtn}{}{11bp}} +\def\showArticlePane{\pushButton[ + \CA{Article}\A{\Named{ArticleThreads}}]{SAPBtn}{}{11bp}} +\def\showArticlePaneRead{\pushButton[ + \CA{Article}\A{\Named{ArticleThreads} + \Next{/S/Thread /D(\threadTitle)}}]{SAPRBtn}{}{11bp}} +% Links may be used as well, here is only one such, this link below is hard-wired +% modify as needed. +%\setLink[\A{/S/Thread/D(Methodology)}]{Read Article} + +\setAddToBorder{addtow=4bp,addtoh=4bp} + +\begin{document} + +%\noindent +%The two article threads: \setLink[\A{/S/Thread/D(Lipsum)}]{Read Lipsum} +%and \setLink[\Color{red}\A{/S/Thread/D(more Lipsum)}]{Read more Lipsum}. + + +\noindent +Below is a description of the \setLink[\linktxtcolor{red}\A{/S/Thread/D(Methodology)}]{methodology} +for developing article threads. You +may compile this document using any of the usual drivers (options +\texttt{dvips}, \texttt{pdftex}, \texttt{xetex}, \texttt{dvipdfm}, \texttt{dvipdfmx}). +Play around with various combinations of \texttt{preview}, \texttt{!preview}, +\texttt{viewMagWin}, and \texttt{!viewMagWin}. + +\setThreadInfo{ + title=Methodology, + author=D. P. Story, + subject=Article thread test, + keywords={AeB, PDF, LaTeX} +} + +\begin{multicols}{2} +\noindent\bArticle{lift=\baselineskip,width=\linewidth,height=4in+2\baselineskip}\indent +There are two places to begin a thread: (1) at the very beginning of a paragraph; +and (2) from within a paragraph. Method~(1) is preferred. We began this paragraph +with +\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small] +\noindent\bArticle{lift=\baselineskip, + width=\linewidth, + height=4in+2\baselineskip}\indent +There are two places... +\end{Verbatim} +Place article threads after you've finished composing your document. While +placing threads, one or both of the options \texttt{preview} or +\texttt{viewMagWin} should be in effect. In a \textsf{DVI} viewer, we can see +the bounding rectangles. We can see its too low, too long and so on. For +users of \textsf{pdflatex}, \textsf{xelatex}, etc., view your documents in +the \textsf{DVI} previewer first (or view them as a \textsf{PDF}). I've used +\texttt{lift=\string\baselineskip} to raise up the thread rectangle by that +mount to enclose the first line. The value of \texttt{width} is usually +\cs{linewidth}, but the value of \texttt{height} may have to be adjusted, in +this example, I've ``tweaked'' the \texttt{4in} by +\texttt{2\string\baselineskip}. + +Naturally, after you're satisfied, you then remove \texttt{preview} and +\texttt{viewMagWin} or change them to \texttt{!preview} and +\texttt{!viewMagWin}. Method~(2): Another possible location is from within a +paragraph, here, we continue the current thread using the \cs{cArticle} +command in conjunction with the \cs{vadjust} {\TeX} +primitive\vadjust{\noindent +\cArticle{lift=2\baselineskip,width=\linewidth,height=4in+2\baselineskip}}. +Between the end of the word `primitive' and the period (.) ending the +sentence, I've place +\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small] +primitive\vadjust{\noindent + \cArticle{lift=2\baselineskip, + width=\linewidth, + height=4in+2\baselineskip}}. + Between the ... +\end{Verbatim} +The value of \texttt{lift=2\string\baselineskip} we chosen because the +original positioning of the thread rectangle was too low by about two lines. +The value of \texttt{height} was chosen to cover the paragraph once the +complete paragraph was composed. + +Of course, in this example, it was unnecessary to insert the \cs{cArticle} +mid-paragraph, it would have been better placed at the beginning of a +paragraph and `lifting' more. Placing \cs{cArticle} mid-paragraph is useful +for multi-column formats. When the paragraph flows from the first column the +second column, use the \cs{vadjust} technique to cover the portion of the +text that flows to the right column. + +By the way, notice the use of \cs{noindent}, this is +oftentimes needed to position the article thread in the left margin of the +text block. +\end{multicols} + +\noindent +Adding text to the columns will change the positions of the article threads, for +this reason, the threads need to be inserted after the document is finished. + +\end{document} diff --git a/macros/latex/contrib/artthreads/examples/article_tst.tex b/macros/latex/contrib/artthreads/examples/article_tst.tex new file mode 100644 index 0000000000..6333cf24d6 --- /dev/null +++ b/macros/latex/contrib/artthreads/examples/article_tst.tex @@ -0,0 +1,78 @@ +\documentclass{article} +\usepackage[dvipsone,!viewMagWin,!preview]{artthreads} +\usepackage{multicol,lipsum} +\hypersetup{colorlinks} + +% A selection of pushbutton actions for articles +\def\toggleArticlePane{\pushButton[ + \CA{Article}\A{\Named{ShowHideArticles}}]{TAPBtn}{}{11bp}} +\def\toggleArticlePaneRead{\pushButton[ + \CA{Article}\A{\Named{ShowHideArticles} + \Next{/S/Thread/D(\threadTitle)}}]{TAPRBtn}{}{11bp}} +\def\showArticlePane{\pushButton[ + \CA{Article}\A{\Named{ArticleThreads}}]{SAPBtn}{}{11bp}} +\def\showArticlePaneRead{\pushButton[ + \CA{Article}\A{\Named{ArticleThreads} + \Next{/S/Thread /D(\threadTitle)}}]{SAPRBtn}{}{11bp}} +% Links may be used as well, here is only one such, this link below is hard-wired +% modify as needed. +%\setLink[\A{/S/Thread/D(Lipsum)}]{Read Article} + +\setAddToBorder{addtow=10bp,addtoh=10bp} + +\begin{document} + +\noindent +The two article threads: \setLink[\A{/S/Thread/D(Lipsum)}]{Read Lipsum} +and \setLink[\A{/S/Thread/D(more Lipsum)}]{Read more Lipsum}. + + +\setThreadInfo{title=Lipsum,author=D. P. Story,subject=Article thread test,keywords={AeB, PDF, LaTeX}}% + +\raggedcolumns +\begin{multicols}{2} +\noindent\makebox[0pt][r]{\showArticlePaneRead\kern11bp}% +\bArticle{lift=\baselineskip,width=\linewidth,height=\textheight}% +This is a series of paragraphs to fill the multi-columns of this document. It is imperative +that we have a lot of text to fill these columns, but I fear that I don't know what to write. + +Well, here goes. \lipsum[2] + +That went well, more? \lipsum[4] + +Ok, I have the hang of it now. \lipsum[6] + +\noindent\cArticle{lift=9\baselineskip,width=\linewidth,height=\textheight}\indent +Continuing now with \lipsum[8] + +I'm on a roll, \lipsum[10] + +\end{multicols} + +\newpage + +\noindent +Same `article' but broken down into smaller pieces as an exercise. + +\setThreadInfo{title=more Lipsum,author=D. P. Story,subject=Article thread test,keywords={AeB, PDF, LaTeX}}% +\begin{multicols}{2}\previewtrue % locally turn on preview +\noindent\bArticle{lift=\baselineskip,width=\linewidth,height=3in+3\baselineskip}% +This is a series of paragraphs to fill the multi-columns of this document. It is imperative +that we have a lot of text to fill these columns, but I fear that I don't know what to write. + +Well, here goes. \lipsum[2] + +\noindent\cArticle{lift=\baselineskip,width=\linewidth,height=4in-2\baselineskip}\indent +That went well, more? \lipsum[4] + +Ok, I have the hang of it now. \lipsum[6] + +\noindent\cArticle{lift=9\baselineskip,width=\linewidth,height=4in+2\baselineskip}\indent +Continuing now with \lipsum[8] + +\noindent\cArticle{lift=\baselineskip,width=\linewidth,height=3in-\baselineskip}\indent +I'm on a roll, \lipsum[10] + +\end{multicols} + +\end{document} |