Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-30-2009, 08:38 AM   #1
Registered: Dec 2004
Location: Trondheim, Norway
Distribution: kubuntu 10.04
Posts: 308

Rep: Reputation: 31
LaTeX, placing graphics in header

I am helping with making a songbook in LaTeX. The songs are to be marked with how difficult they are to sing and how challenging the guitar chords. How hard would it be to set up so these "grades" can be changed for each song? The best would be to include a small pictogram (e.g. 5 small guitars, 2 shaded for a "level 2" song). on the top of each page. The book is being written as one main document with the songs as included files.

Is it even possible to include a graphic in the header without going down to plain TeX? The simplest(for writing, testing, and reuse) solution would be to define where to place the graphics in the preamble, and then just place a command in each song that tells the compiler which file to use for that song.

something like this:
%top of included file
\playability{2} %this would place the graphic with 2 shaded guitars in the page header
my guess that the fancyhdr package might be part of the solution, but it appears that the commands it uses are all placed in the preamble, am I wrong?
Old 04-30-2009, 09:25 AM   #2
Senior Member
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Stretch/Sid, Linux Mint DE
Posts: 4,631

Rep: Reputation: 711Reputation: 711Reputation: 711Reputation: 711Reputation: 711Reputation: 711Reputation: 711
It is possible to put a graphics in the header:


            Kaya Gobernador Debrot 240, Postbus 45, Bonaire, Nederlandse Antillen \\
            T: +599 717 5472, F: +599 717 5427, I:\\

This document was generated automatically and typeset with \LaTeXe.\\
However, to put a changing graphics in the header is somewhat more complicated. It is stated in the Latex not so short introduction that it can be done using the fancyhdr package as you expected. However, I can't give you example of that, but it should be documented in the fancyhdr package. Hope that helps.

Old 05-01-2009, 06:38 AM   #3
Registered: Dec 2004
Location: Trondheim, Norway
Distribution: kubuntu 10.04
Posts: 308

Original Poster
Rep: Reputation: 31
I found a solution in the fancyhdr manual, by combining the instructions for how to make a movie in the lower righthand corner with a custom counter and changing \rfoot to rhead, I got a small graphic in the top right corner. the coding was even a lot simpler than your example.


to change the picture I just use \setcounter{spill}{n} where n is the new number

Last edited by edgjerp; 05-01-2009 at 06:39 AM.
Old 05-20-2009, 01:42 PM   #4
LQ Newbie
Registered: May 2009
Location: Hamburg, Germany
Distribution: Ubuntu Linux
Posts: 12

Rep: Reputation: 2
graphics in header


Originally Posted by edgjerp View Post
Is it even possible to include a graphic in the header without going down to plain TeX?
here's an example showing graphics used in headers: Fancy chapter headings with TikZ. Solutions both for fancyhdr and scrpage2 are shown, using TikZ for graphics. But of course you could use \includegraphics instead, for instance with the textpos package that allows absolute positioning of graphics/boxes on the page.




graphic, latex, typeset

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Space above nad below the included graphics in document in latex srjoshi Linux - General 0 10-31-2007 07:57 AM
preventing LaTeX from placing a blank page first edgjerp Linux - Software 4 12-14-2006 09:34 PM
graphics with LaTeX edgjerp Linux - Software 1 11-18-2005 03:51 AM
pdf--->> latex, graphics possible? realos Linux - General 2 05-31-2004 04:50 AM
graphics problem in latex realos Linux - General 1 06-14-2003 09:24 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration