From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- .../contrib/artthreads/examples/article_tech.tex | 109 +++++++++++++++++++++ .../contrib/artthreads/examples/article_tst.tex | 78 +++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 macros/latex/contrib/artthreads/examples/article_tech.tex create mode 100644 macros/latex/contrib/artthreads/examples/article_tst.tex (limited to 'macros/latex/contrib/artthreads/examples') 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} -- cgit v1.2.3