ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
Code:
%top of included file
\singability{3}
\playability{2} %this would place the graphic with 2 shaded guitars in the page header
\section{songtitle}
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?
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.