How to only color external links in LaTeX

Package hyperref is quite handy for making a compiled LaTeX document more accessible, by allowing to quickly jump to references (back to the text with package backref), section headings (from the table of contents) and weblinks.

By default, links are marked by a coloured rectangles, which only appear on screen, not in print. If one wants to get rid of the rectangles, there are options. However, there is also the colorlinks that marks hyperlinks by changing their text colour. However, these makes all link types become coloured. There is a way to reset certain link types to the default text colour, just by setting their colour to an empty value like this:


The trick is the empty value for linkcolor. It applies to internal links (e.g. entries in the table of contents listing), which are thus not touched. This trick can be extended to the other fields citecolor, anchorcolor if needed, to either not change or change their colour.

The definitive full-frame graphic command for beamer in LaTeX

After my previous post on the same topic, I have improved upon the command considerably. This time, it is based on Matthew Leingang’s answer on the question Image on full slide in beamer package.


\fullframegraphic[optional credits]{path/to/image}

To use, copy this definition in your preamble. Requires package tikz.

\begin{tikzpicture}[remember picture,overlay]%
\node[at=(current] {%
% optional argument: credits on lower-right corner
\node[at=(current page.south east), anchor=south east,font=\tiny,text=white,fill=black,fill opacity=.5,text opacity=1,inner sep=2pt,text height=1ex,text depth=.25ex] {#1};%

Visual example (for the credits overlay):


Source: File:DA_Cambridge_c1937.jpg on Wikimedia Commons

How to horizontally align beamer columns with surrounding text

If you (like me) assumed that placing two columns width 50% of textwidth next to each other would align with preceding or following text on a beamer slide, then you are mistaken (like me).

Fortunately, a discussion on Bug #262: Provide more usable columns environment showed a viable solution in form of the optional argument onlytextwidth.

However, in order to use it successfully, one must then take care of spacing oneself. Here is my result of some experimentation:


Here is the corresponding document source code:



\begin{frame}{Testing columns spacing}{How to achieve 
correctly spaced columns with beamer}
\emph{The documentation doesn't tell you anything about 
the alignment of the columns or the space in between them.
In particular, the side effect of totalwidth (which 
changes the columns to be left aligned within the 
textarea of the slide rather than center aligned on the 
This slide shows the successfull result to align the 
margins of these two columns with the surrounding text to 
exactly \lstinline{\\textwidth}.
What to do?

Do your own math and specify column widths with spacing. 
These columns have equal width of 
{Issue \#262}: Provide more usable columns environment}

Full-frame graphics on a LaTeX beamer presentation

This snippet defines the custom command \fullframegraphic. Paste it into the document preamble (header) of your presentation:


Then, you can create a full-frame graphic slide anywhere (outside a frame) using


Further reading

How to use TikZ for inline polygons

The trick is to define inner sep=0pt when beginning the tikzpicture environment, as I learned from pgf bug report #172 minimum size in regular polygon fails for small length from last year. Here is a minimum working example, adapted to my use case of inline polygon symbols with roughly text height, i.e. 2ex in my case:


\newcommand{\poly}[2]{\tikz[inner sep=0pt] {%
\node[regular polygon,%
regular polygon sides=#1,%
regular polygon rotate=#2,%
minimum size=2ex, fill] (0,0) {};}}

Triangle upwards \poly{3}{0}, 
triangle downward \poly{3}{180} 
and diamond \poly{4}{45}.

This snippet yields the following result:


How to use custom colours in LaTeX

I will post short minimum working examples (MWEs) of minimal LaTeX documents, showing a certain feature in action. Though the well-maintained LaTeX Wikibook is a much more extensive resource than a collection of such examples could ever be, they show directly compilable examples compared to isolated snippets.

I start simple: custom text colours, using different colour models. Shown here are RGB (0-255) and HTML (00-FF) style definitions. The text shows two different ways to access them. Bonus: these colours can be used in TikZ as well.


\definecolor{cool}{RGB}{0, 110, 220}
\definecolor{heat}{RGB}{240, 120, 40}
I am some \textcolor{heat}{really hot}, 
though \textcolor{cool}{also cold} text.
{\color{pink}Bright colors} are discouraged.