-6

I am trying to program a custom command which uses tcolorbox and I can't seem to set two options for fonttitle. I tried it in two different ways and none seems to work. You will find the difference in all of these if you scroll all to the right - look at the very end of the longest line.

This command doesn't work:

\newcommand{\vprasanje}[4]{
\begin{tcolorbox}[breakable,left=5mm,right=5mm,top=5mm,bottom=5mm,toptitle=0mm,bottomtitle=0mm,lefttitle=0mm,righttitle=0mm,boxrule=0.15mm,arc=0.25mm,colback=headcolor!2!white,colframe=headcolor!100!white,title=\refstepcounter{zap_stevilka_vprasanja}\label{#1}{\underline{\makebox[\textwidth]{\textbf{\glava \faBookmark~\arabic{zap_stevilka_vprasanja}:}~\textit{"{#2}"}\hfill\vphantom{Žg}}}}\newline{\makebox[\textwidth]{\hfill{\scriptsize \glava \faGraduationCap \uppercase{\textbf{Viri}}:~~\textit{#3}}}},fonttitle=\hypersetup{linkcolor=white},fonttitle=\hypersetup{urlcolor=white}]
#4
\end{tcolorbox}
}

This one doesn't either:

\newcommand{\vprasanje}[4]{
\begin{tcolorbox}[breakable,left=5mm,right=5mm,top=5mm,bottom=5mm,toptitle=0mm,bottomtitle=0mm,lefttitle=0mm,righttitle=0mm,boxrule=0.15mm,arc=0.25mm,colback=headcolor!2!white,colframe=headcolor!100!white,title=\refstepcounter{zap_stevilka_vprasanja}\label{#1}{\underline{\makebox[\textwidth]{\textbf{\glava \faBookmark~\arabic{zap_stevilka_vprasanja}:}~\textit{"{#2}"}\hfill\vphantom{Žg}}}}\newline{\makebox[\textwidth]{\hfill{\scriptsize \glava \faGraduationCap \uppercase{\textbf{Viri}}:~~\textit{#3}}}},fonttitle=\hypersetup{linkcolor=white,urlcolor=white}]
#4
\end{tcolorbox}
}

But this one does!

\newcommand{\vprasanje}[4]{
\begin{tcolorbox}[breakable,left=5mm,right=5mm,top=5mm,bottom=5mm,toptitle=0mm,bottomtitle=0mm,lefttitle=0mm,righttitle=0mm,boxrule=0.15mm,arc=0.25mm,colback=headcolor!2!white,colframe=headcolor!100!white,title=\refstepcounter{zap_stevilka_vprasanja}\label{#1}{\underline{\makebox[\textwidth]{\textbf{\glava \faBookmark~\arabic{zap_stevilka_vprasanja}:}~\textit{"{#2}"}\hfill\vphantom{Žg}}}}\newline{\makebox[\textwidth]{\hfill{\scriptsize \glava \faGraduationCap \uppercase{\textbf{Viri}}:~~\textit{#3}}}},fonttitle=\hypersetup{linkcolor=white,urlcolor=white}]
#4
\end{tcolorbox}
}

So is it impossible to change colors of url's and links at the same time?

  • 5
    Please provide a compilable document with this code, not just fragments! – user31729 Dec 27 '16 at 17:02
  • 4
    Well, we shall glue a document together for you then? – user31729 Dec 27 '16 at 17:06
  • 4
    Well, the second and the third are identical. So how can you say the second doesn't work and the third does work? And what is the meaning of "doesn't work"? As they are only macros and no use is given, nor any desired output, this is quite meaningless. – Pieter van Oostrum Dec 27 '16 at 17:43
  • 5
    and beside adding a complete document please also add some line breaks. I don't want to "scroll all to the right". – Ulrike Fischer Dec 27 '16 at 21:40
  • 3
    If this is all you need to produce the problem, you have such a different TeX installation from me that it would clearly be pointless my attempting to help you. – cfr Dec 28 '16 at 2:47
-1

Parameter allcolors in \hypersetup{} solves this problem. Source: options for appearance of links in hyperref

| improve this answer | |

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