3

I'm looking for a conditional that checks if the visual processor puts the depictable content of the macro that is going to be expanded at a specific place on the page where the content is placed.

The conditional should help me with the following task:

I have consecutive paragraphs that are separated by ornaments. Each ornament should only be processed if it's not the first box on the current page and if it's not the last box on the current page.

If my limited knowledge is right TeX's text processor has nothing to do with the placement of the calculated boxes on the actual page. So the questioned conditional should instruct the visual processor to put the wanted information into an auxiliary file that could be read on the second pass.

Is it possible to request such information from the visual processor to operate with it in the source file?


Addendum:

Although it takes a while until i grasp the effect of the \leaders directive i managed it with your help!

This is how it looks without using any leaders directive:

enter image description hereenter image description here

This is how it looks with \cleaders:

enter image description hereenter image description here

\documentclass{article}

\usepackage[pdf]{pstricks}
\usepackage{psvectorian}
\usepackage{lipsum}

\newlength\TextDividerHeight
\setlength\TextDividerHeight{11ex}

\newcommand{\TextDivider}{%
    \cleaders
        \vbox to \TextDividerHeight{%
            \vfil
            \centering%
            \psvectorian[color=black,scale=0.35]{88}%
            \vfil
        }%
    \vskip \TextDividerHeight
}

\begin{document}

    \section{section}
    \lipsum[1]
    \TextDivider
    \lipsum[1]
    \TextDivider
    \lipsum[1]
    \TextDivider
    \lipsum[1]
    \TextDivider
    \lipsum[1]
    \TextDivider
    \lipsum[1]
    \TextDivider
    \lipsum[1]
    \TextDivider
    \lipsum[1]
    \TextDivider

    \section{section}

\end{document}
  • 2
    The ornament should be realized with \leaders, so it behaves like glue that disappears at page breaks. Can you add an example, please? – egreg Aug 15 '13 at 11:43
  • Thanks a lot for stating \leaders! – user1146332 Aug 16 '13 at 10:12
8

enter image description here

Your description of TeX's processing model doesn't really match the way it works, there is no "visual processor" really.

As mentioned in comments, you basically want the decoration to act like a space and be discarded when space is discarded, TeX calls such constructs leaders

\documentclass{article}

\addtolength\textheight{-20\baselineskip}

\def\a{One two three four five six seven eight nine ten. }
\def\b{Red yellow blue green. }
\def\c{\a\a\b\b\a\b\a\b\a}

\def\sep{%
\par
\vspace{1pt plus 5pt}%
\xleaders
\hbox to \textwidth{\hss\S\S\S\hss}
\vskip\baselineskip
\vspace{1pt plus 5pt}%
}
\begin{document}


\c

\sep

\b\c

\sep

\a\a\c\b

\sep

\b\a\a\c\b

\sep

\c\c

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.