%  [images_colour_marginal-notes.tex]
%
%  this file illustrates
% 1. PSTRICKS to import an image.
% 2. PSTRICKS to rotate an image and text
% 3. \mnotes from [petr_olsak.mac]
% 4. coloured text via the dpctex package
% 5. \printdate  in [additional.mac]

%%%%%%%%%%%%%%%%   XETEX INPUTS    %%%%%%%%%%%%%
%  These macro files are explained in more detail at the top of each file. Here I have
%       a brief indication of the content.


\input format_XETEX.mac 
              %  spacing, special symbols ...
\input unicode_latin.mac
               % French and German accented letters
\input macros.mac
            % information boxes, special formats
\input ancestors.mac
             % abbreviations used in my genealogical texts !!
%
\input additional.mac   % \printdate+ \raggedleft (for right to left)
%
\input petr_olsak.mac
              % Petr Olsak's collection of pure Tex macros: tables, marginal notes ..
%
% ===>   have to put [my_fonts.mac] AFTER [petr_olsak.mac]  which redefines \rm 
\input my_fonts.mac  
              %  different fonts at various sizes; e.g \bftwenty
              % PSTRICKS is used for importing images
              % there is a form after \bye
              % the shell file [photos2eps] (in the directory SHELL_FILES)
              % will convert all your .jpg and .png files to .eps

              
\input pstricks  % need for centring
\input epsf      % need for importing eps

\input color   %  this is part of David Carlisle's "graph­ics-pln" package (available at CTAN)
                      %. it allows typesetting text in colour via \definecolor \textcolor and \colorbox
                      %  color can also be obtained via  [petr_olsak.mac], section 8 and
                      %  PSTRICKS

%%%%%%%%%%%%%%%%    END  XETEX INPUTS    %%%%%%%%%%%%%

%%%%%%%%%%%%%%%%    VARIOUS COMMANDS    %%%%%%%%%%%%%

\topglue  0pt       
\topskip  18pt      

\overfullrule=0pt
\tracingoutput  = 0   % file - minimum information ( =1  for full)
\tracingonline  = 0   % screen - minimum information ( =1  for full

%%%%%%%%%%%%%%%%   END  VARIOUS COMMANDS    %%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%    DIMENSIONS    %%%%%%%%%%%%%
\pdfpageheight=11truein   % !!
\pdfpagewidth= 8.5truein   %!!

\vsize =  8.50 in       %!!  
{\hsize = 5.94 in      %!!

\voffset = 0.5 truecm   %!!
\hoffset = 0.70truecm    %!!

\baselineskip = 14pt    % default = 12pt	

%%%%%%%%%%%%%%%%%   END DIMENSIONS    %%%%%%%%%%%%%

%%%%%%%%%%%    FOOTER & HEADER          %%%%%%%%%%%%%%%%%

%         =======> 3 CHANGES TO MAKE   <=========

 \nopagenumbers
 
                 %1 was chosen so that I will notice and change
                 %       in final versions
 \pageno =1    %   3 CHANGES TO MAKE 

 %  this  footer puts a page number in bold at the bottom of each page, EXCEPT FIRSTand \bsl mnote
 \footline =  {      % THE FOOTLINE MATERIAL IS IN ENCLOSED IN {}  aussi connu sous le nom known as  my grandson
                       \ifnum \pageno =1  % do nothing  <== keep with false #      
                                    \else  
                                   {\centreline{\bf \folio}}  % centerline closes here for page #
                       \fi   % this  matches \ifnum	
                   } 	   
 %
                                  %           NO DATES HERE,  ONLY IN TITLE
\headline =  {% THE FOOTLINE MATERIAL IS IN ENCLOSED IN {} 
                     \centreline{    % CAN NOT PUT \centreline AFTER ELSE,  FOULS UP!
                               \ifnum \pageno =1  % do nothing  <== keep with false #      
                      	            \else   
                                       {\bfthirteen  Images, Colour, Marginal Notes}
                                \fi % THIS  MATCHES \IFNUM
                                   }   %THIS MATCHS CENTERLINE
                }   % THIS MATCHES { WITH \FOOTLINE  

%%%%%%%%%%%%%%%%%%%%  END FOOTER AND  HEADER  %%%%%%%%%%%%%%%%%%%%% 
%
% %%%%%%%%%%%%%%%%%%%%  TEXT STARTS % %%%%%%%%%%%%%%%%%%%% 
%
 {\rm    %  !! 12.5pt  I like a larger font, defined in [my_fonts.mac]
%aussi connu sous le nom known as  my grandson
% 
{\verysmall . } % !! 0.1pt  used to move  text up via \vskip -20pt\nin  !!
%
\vskip -30pt\nin     % \nin = \noindent, see [format_XETEX.mac]
% 
\printdate   % in [additional.mac]
%
%
% NOTE:   \un is defined in [format_XETEX.mac]. It leaves a little space before and after underscore
%                         \def\un{\kern -0.85pt \gl\_\gl }and \bsl mnote
%
\centreline{\bftwenty Images, Colour, Marginal Notes}  %  \bftwenty defined in [my_fonts.mac]
%
\mni    % \medskip\noindent  see [format_XETEX.mac]
%
% NOTE:                     \[  \] and \( \) are defined in [format_XETEX.mac] to leave a little space
%                                before the text.
% NOTE:                     \def\[{{\rm \char"005B\gl}} 
%
Starting with the image \[chevalier\unl de\unl la\unl croix\unl rouge.jpg\], I 
converted it to:
\[chevalier\unl de\unl la\unl croix\unl rouge.eps\]. 
%
% NOTE:            \bsl and \fsl are defined in [format_XETEX.mac] 
% NOTE:             \def\bsl{\char"005C\gl}
To convert use {\it photos2eps\/} in \[SHELL\unl FILES\], or  another image to .eps converter. 
\mni
I then imported the file via the {\tt PSTRICKS} command:
\sni
\centreline{\bsl centreline\lbr\bsl epsfxsize = 4.5truein\bsl epsfbox\lbr chevalier\unl de\unl la\unl croix\unl rouge.eps\rbr\rbr}
\sni
I keep a ready to use {\tt PSTRICKS}
form after \bsl bye and I change the width to suit.
\mni
        \fixmnotes\right
%                                               NOTE GOES BEFORE TEXT
 \definecolor{mix}{rgb}{0.80000,  0.67843,  0.55686}
 %                                  these numbers are explained with the note at the end
 \mnoteskip = -15pt   % lower the note
                   \mnote{\colorbox{mix}{see the notes}}  %  MOVE UP for double notes
% 
\nin
\kern -5pt Note the use of \bsl definecolor, \bsl textcolor, \bsl colorbox  from the
\bsl color package and  \bsl mnote from  \[petr\unl olsak.mac\].\hskip 17pt \lower 1.1pt\hbox{\libertineEAAA}
%
\vskip 20pt
% 
% PSTRICKS FORM	     Change the width to suit 
	  \centreline{\epsfxsize = 4.1truein\epsfbox{chevalier_de_la_croix_rouge.eps}}
\vskip 10 truept

% red is already defined in \color
\centreline{ 
\textcolor{red}{\bftwenty  Le Chevalier de la Croix Rouge} 
                  }
%
\vskip 0.7cm\nin 
%
P.S. Le Chevalier est mon petit fils  Daniel. Il avait six ans lors de notre combat (j'ai perdu). 
%
\vskip 1.0cm\nin
%
If you do not want the picture centred, put it in a \bsl hbox and use \bsl hskip:
\vskip 0.5cm\nin
%
 \raise 0.75truein\hbox{\bf  Le Chevalier }
 \hskip 0.6cm \hbox{\epsfysize = 1.5truein\epsfbox{chevalier_de_la_croix_rouge.eps}}
 \hskip 0.6cm \raise 0.75truein\hbox{\bf   de la Croix Rouge}
 %
 \vskip55pt\nin
 You can also use  {\tt PSTRICKS} with \bsl rput to rotate everything:
 %
 \vskip 5.0cm\nin
% 
 \hskip 5.7cm \rput{-45}{\hbox{\epsfysize = 1.5truein\epsfbox{chevalier_de_la_croix_rouge.eps}}
 \hskip 0.6cm \raise 0.75truein\hbox{\bf  Le Chevalier de la Croix Rouge}}
%
 \vskip 5.1cm\nin  % the bounding box extends way down!
% 
 There are many other great things that one can do with Herbert Voß's wonderful {\tt PSTRICKS}:
 \Th \lower 1.1pt\hbox{\libertineEAAA}\TH
 {\tt tug.org\fsl PSTricks\fsl}.
 %
\vfill\eject

 % \[  is set in roman, for use in italicized texts\hskip 17pt \lower 1.1pt\hbox{\libertineEAAA}
\centreline{\bffourteen Notes}
\mni
\item{} {\itfourteen mnotes is contained in \[petr\unl olsak.mac\]\/}
\mni
\item{} The colour \colorbox{mix}{\lq mix\rq} used  with \bsl mnote above,
was obtained as follows:
\vskip 11pt
% PSTRICKS FORM	  
	  \centreline{\epsfxsize = 3.5truein\epsfbox{kcolorchooser_mix_light_brown.eps}}
\vskip 4 truept
          \centreline{Picking the colour for \lq mix\rq}
          \mni
\itemitem{} I opened up {\tt kcolorchooser} and chose the colour that I desired. The RGB numbers were: 204 173 142.
To calculate the fraction of 255 \[the range for each  of these primary colours is 0\th \dots 255\]
that these integers represent I put these numbers in {\tt Octave}:
\sni
{\tteleven
\leftskip = 1.3cm
\obeyspaces
\obeylines
%
octave:1> e = [204 173 142];
octave:2> F = e/255;
octave:3> disp(F)
0.80000   0.67843   0.55686
}
\mni
\itemitem{} I simply grabbed these decimal fractions from the terminal and defined \lq mix\rq\ as follows:
\sni
\itemitem{} \bsl definecolor\gl\lbr\gl mix\gl\rbr\th \lbr\gl rgb\gl\rbr\th \lbr\gl 0.80000,\th   0.67843,\th   0.55686\gl\rbr\gl. 
\mni
The coloured box for the note was then created via the command:
\mni
\centreline{{\bsl colorbox\lbr\gl mix\gl\rbr\gl}\gl \lbr see the notes\rbr}
\mni
The red title of the picture was created via the command:
\mni
\centreline{\bsl textcolor\lbr\gl red\gl\rbr \lbr\gl\bsl bftwenty  Le Chevalier de la Croix Rouge\gl\rbr}
 \mni
 The date and time of printing was done via \bsl printdate \(in \[additional.mac\]\). 
%%%%%%%%%%%%%%%%%%%%%%%%%%%
	      % KEEP THIS ENDING!!!   had when needed headers
\vfill\eject 
%%
            }  %  ends roman
	    \par} % ends \hsize
	    \bye
	    
%%%%%%%%%%%%%%%  FORMS %%%%%%%%%%%%%%%%
%   
% PSTRICKS FORM	  
	  \centreline{\epsfxsize = 6.5truein\epsfbox{*.eps}}
\vskip 4 truept
          \centreline{}
%
\vskip 0.7cm\nin 
%
	    
	   
