Here's a solution that uses fancyhdr
combined with the geometry
package, and using the optional arguments of the parbox
command.
\documentclass{article}
\usepackage[left=2cm,right=2cm,
headheight=2in,bottom=2cm]{geometry}
\usepackage[demo]{graphicx}
\usepackage{fancyhdr}
\usepackage{lipsum}
\lhead{\parbox[b][.75in][t]{2cm}{\includegraphics[height=0.75in]{translogo}}}
\chead{\parbox[b][.75in][t]{5cm}{INTEROFFICE MEMO \\ Document Name}}
\rhead{\parbox[b][.75in][t]{4cm}{ \today \\ \\ TOP \\ Confidential document}}
\begin{document}
\pagestyle{fancy}
\lipsum
\end{document}
You can use a simple \fbox
to get a box around each element
\lhead{\fbox{\parbox[b][.75in][t]{4cm}{\includegraphics[height=0.75in,width=4cm]{translogo}}}}
\chead{\fbox{\parbox[b][.75in][t]{5cm}{INTEROFFICE MEMO \\ Document Name}}}
\rhead{\fbox{\parbox[b][.75in][t]{4cm}{ \today \\ \\ TOP \\ Confidential document}}}
Here is an example of setting somethings up for hi-lock
mode.
First define a face:
(defface af-bold-yellow-box '((t (:background "yellow"
:foreground "black"
:bold t
))) "yellow-box-face")
Then you can define a macro to apply your faces to specified regular expressions.
(defun z-hi-lock-quizzes ()
;; this next line is necessary to correct sloppy hi-locking
(if (not hi-lock-mode)
(progn (hi-lock-mode -1)
(hi-lock-mode 1))
(hi-lock-mode)
(hi-lock-mode))
(highlight-regexp "^%-\\*-mode:LaTeX.*$" (quote hi-conceal-content));
(highlight-regexp "^%-@-(.+$" (quote hi-lock-page-break));
)
I define various macros to address highlighting different features. And then I write an interactive
macro which assembles and applies these.
(defun ae-hi-lock-features ()
(interactive)
(z-hi-lock-quizzes)
... call other functions ...
)
FYI I believe all the various faces I use here are faces I've defined. Even in the examples below. But faces are defined as I've illustrated above.
adding to font-lock features
Here's some code that I've used to add elements to font-lock
features. But, it's been so long since I wrote this, I don't really know if the following is sufficient to get all the desired results
(setq ae-keywords:tex-mode:list
(list '( comment "^\\s *\\(%.+$\\)" 'hi-pink )
'( newpara "\\(^%-=-.+$\\)" 'hi-skyblue-boldred-border )
'( newsect "\\(^%-\\#-.+$\\)" 'hi-goldback-boldbluefront-border )
'( newpage "\\(^%-@-(.+$\\)" 'hi-lock-page-break )
'( tab "\\(\t\\)" 'hi-lightblue-red-text-border )
'( begin.doc "\\(\\\\\\(begin\\|end\\\){document}\\)" 'hi-goldback-boldbluefront-border)
'( comment.b "\\(%\\.\\.%.*$\\)" 'hi-darkblue-lightblue-text)
'( multiplechoice.a "\\(^\\[o\\] .+$\\)" 'hi-light-multiple-choices)
'( multiplechoice.b "\\(^\\[[\\?\\.\\ ]\\] .+$\\)" 'hi-goldback-boldbluefront-border)
'( multiplechoice.c "\\(^\\[x\\] .+$\\)" 'hi-light-multiple-choice-answer)
))
(dolist (elt ae-keywords:tex-mode:list)
(font-lock-add-keywords nil (list (list (nth 1 elt) 1 (nth 2 elt) 'append)))
)
If the above seem too elaborate, you can do something a bit more direct as in
(font-lock-add-keywords nil '(("\\(hello\\) \\(World\\)"
2
'hi-goldback-boldbluefront-border)))
EDIT
I think what you probably want to do is something more like
(font-lock-add-keywords 'latex-mode '(("<regex>"
<level-of-subexpression>
'<face-name>)))
You probably want to set <level-of-subexpression>
to 0, but using subexpressions you can get nice effects as in my hello World
example.
Best Answer