6

Could someone help with the following sample code where the href does not really result in a hyperlink in resulting pdf when build with pdflatex.

\documentclass[landscape,a0paper,fontscale=0.285]{baposter}

\title{Summary}

\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}


\usepackage{xcolor}
\usepackage{tabu}

\usepackage{hyperref}

\usepackage{palatino} % Use the Palatino font
\usepackage[font=small,labelfont=bf]{caption} % Required for specifying captions to tables and figures

\begin{document}
\begin{poster}
{
 bgColorOne=white, 
 bgColorTwo=white,
}

{\bf\textsc{Bhagvad Geeta Summary}\vspace{0.5em}} % Poster title


\headerbox{Bhagvad Geeta Summary}{name=saar, column=1,span=2, row=0}{

Your world is a \href{http://www.google.com}{perception} based by your 
prejudices, shaped by your fears, fueled by your ignorance.
}

\end{poster}
\end{document}
4
3

The font scaling done by baposter, through the class option fontscale, results in misplacing the links. With certain page size and fontscale combinations, it can be shown that the links are indeed produced, and they are active, but they are not associated with the linked item. Setting paper size to a0paper and fontscale=0.9 demonstrates this result - that is, the links are produced, but they are misplaced.

The solution here is to set the class option, fontscale=1.0. This necessitates setting all the font sizes manually in the posterbox environment. This is because setting fontscale=1.0, together with a large paper size, results in text that is too small for a large poster.

The MWE includes several tests that demonstrate use of the posterbox keys, textfont for setting the size of the posterbox text and headerfont for setting the size of the posterbox header content. These keys can be used globally for all posterboxes, as well as for individual posterboxes.

It is also possible to use the \fontsize{fontsize}{baselineskip}\selectfont syntax inside a posterbox to make the text larger.

The MWE tests links created with \href, \url and \autocite. The output shows the links correctly associated with the linked text.

There is further commentary in the MWE to explain what it does.

I did encounter one thing I don't understand (well, there are lots of things I don't understand yet in LaTeX), but when I used the \fontsize{fontsize}{baselineskip}\selectfont syntax, the baselineskip doesn't appear to be correct inside a posterbox, unless I put the text in a parbox.

This is the MWE:

\documentclass[landscape,a0paper,fontscale=1.0]{baposter}
\usepackage{biblatex}
\usepackage{helvet}    %scaleable, sans serif font
\usepackage{microtype}
\usepackage{hyperref}
\hypersetup{%
    citebordercolor=red,
    urlbordercolor=orange,
    pdfborder=0 0 5}
\addbibresource{\jobname.bib}
\renewcommand{\rmdefault}{\sfdefault} % Default font is sans serif

% https://tex.stackexchange.com/a/240950. Thanks Mico.
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
    @article{something,
       author = "FirstName MiddleName LastName",
       title  = "A very long and tedious title that says absolutely nothing",
       journal= "Circularity Today",
       year= 5678,
       volume = 1,
       number = 2,
       pages  = "3-4",
    }
\end{filecontents}

\begin{document}

\begin{poster}
{
columns=2,
background=none,
headerborder=closed,
borderColor=green,
textborder=rectangle,
headershade=plain,
headerColorOne=green!40!white,
boxColorOne=green!10!white,
textfont=\huge, % font definition for body of posterbox
headerfont=\Huge\scshape, % font definition for header of posterbox
}
{} % Logo left
{\fontsize{150}{150}\selectfont\bfseries\textsc{Summary}} % Poster title
{} % Authors
{} % Logo right
\begin{posterbox}[name=box1,column=0,span=1,row=0]{Box 1}
Lorem ipsum dolor sit amet, \href{http://www.google.com}{consectetur} adipiscing elit.
Pellentesque hendrerit felis vitae dolor tempus posuere. Morbi et justo dapibus, dictum.
\end{posterbox}

% Use the textfont or headerfont keys to adjust the font size
\begin{posterbox}[name=box2,column=0,span=1,below=box1,headerfont=\large,textfont=\normalfont]{Box 2}
Lorem ipsum dolor sit amet, \href{http://www.google.com}{consectetur} adipiscing elit.
Pellentesque hendrerit felis vitae dolor tempus posuere. Morbi et justo dapibus, dictum.
\end{posterbox}

% Or use \fontsize{fontsize}{baseline}\selectfont
\begin{posterbox}[name=box3,column=0,span=1,below=box2]{Box 3}
\fontsize{20}{25}\selectfont
Lorem ipsum dolor sit amet, \href{http://www.google.com}{consectetur} adipiscing elit.
Pellentesque hendrerit felis vitae dolor tempus posuere. Morbi et justo dapibus, dictum.
\end{posterbox}

% Larger font
\begin{posterbox}[name=box4,column=0,span=1,below=box3]{Box 4}
\fontsize{50}{60}\selectfont
Lorem ipsum dolor sit amet, \href{http://www.google.com}{consectetur} adipiscing elit.
Pellentesque hendrerit felis vitae dolor tempus posuere. Morbi et justo dapibus, dictum.
\end{posterbox}

% Baseline skip doesn't look correct. Add a parbox.
\begin{posterbox}[name=box5,column=0,span=1,below=box4]{Box 5}
\parbox{\boxwidth-1cm}{%
\fontsize{50}{60}\selectfont
Lorem ipsum dolor sit amet, \href{http://www.google.com}{consectetur} adipiscing elit. 
Pellentesque hendrerit felis vitae dolor tempus posuere. Morbi et justo dapibus, dictum.
}
\end{posterbox}

% Even larger
\begin{posterbox}[name=box6,column=0,span=1,below=box5]{Box 6}
\parbox{\boxwidth-1cm}{%
\fontsize{80}{100}\selectfont
Lorem ipsum dolor sit amet, \href{http://www.google.com}{consectetur} adipiscing elit.
Pellentesque hendrerit felis vitae dolor tempus posuere. Morbi et justo dapibus, dictum.
}
\end{posterbox}

% Look at the baseline again without parbox. Don't know what's happening here.
\begin{posterbox}[name=box7,column=0,span=1,below=box6]{Box 7}
\fontsize{80}{120}\selectfont
Lorem ipsum dolor sit amet, \href{http://www.google.com}{consectetur} adipiscing elit.
Pellentesque hendrerit felis vitae dolor tempus posuere. Morbi et justo dapibus, dictum.
\end{posterbox}

% A box with a citation
\begin{posterbox}[name=box8,column=1,span=1,row=0]{Box 8}
\parbox{\boxwidth-1cm}{%
\fontsize{80}{120}\selectfont
This is a citation: \autocite{something}

This is a url: \url{https://tex.stackexchange.com}
}
\end{posterbox}

% A box with a bibliography that links to the citation
\begin{posterbox}[name=box9,column=1,span=1,aligned=box6,bottomaligned=box7]{References} % Note: aligned key is undocumented
\parbox{\boxwidth-1cm}{%
\renewcommand{\bibfont}{\fontsize{40}{50}\selectfont} % or any other  appropriate font command
\printbibliography[heading=none]
}
\end{posterbox}

\end{poster}
\end{document}

This is the output: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.