# Tag Info

3

In the following setup I tap into LaTeX marks mechanism in order to gauge whether a section starts/ends on a specific page. Based on this, an image is inserted in the background or not with the aid of eso-pic. \documentclass[twoside]{article} \usepackage{graphicx} \usepackage{eso-pic,titleps} \usepackage{lipsum} \newif\ifmysection ...

2

It depends on you actual intent, but you can add the background for all the pages in a sectional unit using a conditional on its number, for example to have the material only on the second section one could use: \documentclass{article} \usepackage{graphicx} \usepackage[contents={}]{background} \usepackage{lipsum} \AddEverypageHook{% ...

3

I'm experimenting with ocg-p. This is what I got so far: \documentclass[]{minimal} \usepackage{ocg-p} \usepackage{xcolor} \definecolor{testcol}{cmyk}{0,0,0.5,0} \begin{document} regular text % \begin{ocg}{layer name}{layer id}{initial visibility} \begin{ocg}[printocg=never]{Background}{1}{1} \colorbox{testcol}{text on Background layer} \end{ocg} regular ...

0

\documentclass[style=simple]{powerdot} \colorlet{myColor}{red!20}%%%% your background color \pddefinetemplate{basic}{ titlepos={.05\slidewidth,.93\slideheight}, titlewidth=.9\slidewidth,textheight=.66\slideheight, titlefont=\large\bfseries\raggedright, clockpos={.99\slidewidth,\slideheight}, lfpos={.03\slidewidth,.04\slideheight}, ...

6

If you are willing to use the tcolorbox package and its listings library, this is easy; using \newtcbinputlisting you can define a customizable macro which behaves pretty much as \lstinputlisting and with \newtcblisting you define your customizable version of lstlisting: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{beramono}% just for the ...

1

Inspired by Werner's answer, I have the following answer which directly uses \marks command in etex, for resolving the conflict between header sections and background sections. \documentclass[12pt]{book} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyhead[LE,RO]{\thepage} \fancyhead[RE]{Book Name} \fancyhead[LO]{\leftmark} ...

4

The problem here deals with the output routine and the fact that it doesn't coincide with the gathered text at the point of page shipout (it's asynchronous). One is typically grabbing information too late, since TeX has already gather text that will form part of the following page (stepping counters and such as it's gobbling the input stream). One way around ...

Top 50 recent answers are included