Skip to content

Read number lines in a file - in LaTeX

Probably a rare needed feature, but i had to count the number lines in a text file - in LaTeX. Continue reading "Read number lines in a file - in LaTeX"
  • Twitter
  • Bookmark Read number lines in a file - in LaTeX at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Read number lines in a file - in LaTeX
  • Bloglines Read number lines in a file - in LaTeX
  • Technorati Read number lines in a file - in LaTeX
  • Fark this: Read number lines in a file - in LaTeX
  • Bookmark Read number lines in a file - in LaTeX at YahooMyWeb
  • Bookmark Read number lines in a file - in LaTeX at Furl.net
  • Bookmark Read number lines in a file - in LaTeX at reddit.com
  • Bookmark Read number lines in a file - in LaTeX at blinklist.com
  • Bookmark Read number lines in a file - in LaTeX at Spurl.net
  • Bookmark Read number lines in a file - in LaTeX at Simpy.com
  • Bookmark Read number lines in a file - in LaTeX at blogmarks
  • Bookmark Read number lines in a file - in LaTeX with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Generate random number in LaTeX

It is possible to generate random numbers in a TeX document. For a gimmick i wanted a random line from a text file in my slides. The first step was to find a random number.

Continue reading "Generate random number in LaTeX"
  • Twitter
  • Bookmark Generate random number in LaTeX at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Generate random number in LaTeX
  • Bloglines Generate random number in LaTeX
  • Technorati Generate random number in LaTeX
  • Fark this: Generate random number in LaTeX
  • Bookmark Generate random number in LaTeX at YahooMyWeb
  • Bookmark Generate random number in LaTeX at Furl.net
  • Bookmark Generate random number in LaTeX at reddit.com
  • Bookmark Generate random number in LaTeX at blinklist.com
  • Bookmark Generate random number in LaTeX at Spurl.net
  • Bookmark Generate random number in LaTeX at Simpy.com
  • Bookmark Generate random number in LaTeX at blogmarks
  • Bookmark Generate random number in LaTeX with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Include and exclude latex-beamer frames

For my slides i sometimes want to disable parts of the presentation, as example: if the operating system is Linux, i don't need Solaris installation instructions. The \ifthenelse{<condition>}{...true...}{...false...} from the ifthen package works very well for normal frames, but it fails, if there are examples (verbatim environment) in the code.

In such a case \iftrue and \iffalse are much more lazy than \ifthenelse and compiling the examples results no longer in latex parser errors. The downside of this solution: i need to predefine the condition, but in my case i have them in a separate file anyway.

The definition looks like:

\newboolean{usesolaris}
\ifthenelse{\equal{\targetos}{solaris}}{
  \setboolean{usesolaris}{true}
}{
  \setboolean{usesolaris}{false}
}

I have defined the variable \targetos, which contains a string with the currently used platform name for my presentation. If the string matches "solaris", the boolean \usesolaris is set to "true", else to "false". Latex compiles the "\ifusesolaris" definition from the boolean, which i later can use to include or exclude frames:

\ifusesolaris
\begin{frame}[fragile]
  ... frame content
\end{frame
}
\fi

In addition, it is also possible to add code for the case where \usesolaris is false. Just add \else and the code before \fi.

  • Twitter
  • Bookmark Include and exclude latex-beamer frames at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Include and exclude latex-beamer frames
  • Bloglines Include and exclude latex-beamer frames
  • Technorati Include and exclude latex-beamer frames
  • Fark this: Include and exclude latex-beamer frames
  • Bookmark Include and exclude latex-beamer frames at YahooMyWeb
  • Bookmark Include and exclude latex-beamer frames at Furl.net
  • Bookmark Include and exclude latex-beamer frames at reddit.com
  • Bookmark Include and exclude latex-beamer frames at blinklist.com
  • Bookmark Include and exclude latex-beamer frames at Spurl.net
  • Bookmark Include and exclude latex-beamer frames at Simpy.com
  • Bookmark Include and exclude latex-beamer frames at blogmarks
  • Bookmark Include and exclude latex-beamer frames with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Create a newspaper in TeX

My problem: for our wedding i need a small magazine with a foto in front, the flow sheet, some notes for the music and some more additional informations. The decision was to create A5 sheets and print them doublesided on an A4 paper, so you actually need at least 4 A5 sheets to fill one paper.


The first attempt was OpenOffice, but if you have more than one A4 paper, it's really hard to have the sheets in the correct order. For one paper you need sheet 1 and 4 and sheet 2 and 3 adjoin each other. If you have 8 sheets, you need 1 and 8 together, 2 and 7 and so on ...

Thats complicated to do in OpenOffice (maybe there's a way to do this, but i don't know it).


So after some minutes i changed over to Tex, took one of my existing makefiles and modified it a bit. With the following makefile you can just create sheet after sheet in your TeX-file, type 'make' and you get 2 PDFs, one with the odd pages and one with the even pages. Thats all, what you have to do.

Oh, make sure, you have an exact number of pages (4, 8, 12, ...) ;-)

Continue reading "Create a newspaper in TeX"
  • Twitter
  • Bookmark Create a newspaper in TeX at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Create a newspaper in TeX
  • Bloglines Create a newspaper in TeX
  • Technorati Create a newspaper in TeX
  • Fark this: Create a newspaper in TeX
  • Bookmark Create a newspaper in TeX at YahooMyWeb
  • Bookmark Create a newspaper in TeX at Furl.net
  • Bookmark Create a newspaper in TeX at reddit.com
  • Bookmark Create a newspaper in TeX at blinklist.com
  • Bookmark Create a newspaper in TeX at Spurl.net
  • Bookmark Create a newspaper in TeX at Simpy.com
  • Bookmark Create a newspaper in TeX at blogmarks
  • Bookmark Create a newspaper in TeX with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

itemize in tabular

If you want to put an itemize list inside a tabular environment, the tabular column must be a \parbox typ (thats: p{...}).
  • Twitter
  • Bookmark itemize in tabular at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg itemize in tabular
  • Bloglines itemize in tabular
  • Technorati itemize in tabular
  • Fark this: itemize in tabular
  • Bookmark itemize in tabular at YahooMyWeb
  • Bookmark itemize in tabular at Furl.net
  • Bookmark itemize in tabular at reddit.com
  • Bookmark itemize in tabular at blinklist.com
  • Bookmark itemize in tabular at Spurl.net
  • Bookmark itemize in tabular at Simpy.com
  • Bookmark itemize in tabular at blogmarks
  • Bookmark itemize in tabular with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca