Latex-url link manipulating - url

I am trying to insert a link like this: https://www.bing.com/search?q=latex%20&qs=n&form=QBRE&=Search%20%7B0%7D%20for%20%7B1%7D&=Search%20work%20for%20%7B0%7D&msbsrank=6_9_File_2&sp=-1&ghc=1&pq=latex%20&sc=9-6&sk=&cvid=9E08663E21964006BFBDECC6DB1F0884 to my document using latex.
I tried this line of code:
\href{https://www.bing.com/search?q=latex%20&qs=n&form=QBRE&=Search%20%7B0%7D%20for%20%7B1%7D&=Search%20work%20for%20%7B0%7D&msbsrank=6_9_File_2&sp=-1&ghc=1&pq=latex%20&sc=9-6&sk=&cvid=9E08663E21964006BFBDECC6DB1F0884}{\textit{\textbf{\underline{Something Linky}}}
And it produced an error.
Any help?

You are missing one closing } at the end:
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\href{https://www.bing.com/search?q=latex%20&qs=n&form=QBRE&=Search%20%7B0%7D%20for%20%7B1%7D&=Search%20work%20for%20%7B0%7D&msbsrank=6_9_File_2&sp=-1&ghc=1&pq=latex%20&sc=9-6&sk=&cvid=9E08663E21964006BFBDECC6DB1F0884}{\textit{\textbf{\underline{Something Linky}}}}
\end{document}

Related

Is there a way to make the a glossary entry clickable?

I'm making a glossary using the package \usepackage{glossaries}. This works fine but I have a slight problem.
I would like to make the word I call from the glossary (with \gls(a_word)) clickable, so the reader is automatically taken to the glossary entry that match the word he clicked on.
So far, I tried to use hyperlinks, without any success, and I couldn't find a similar problem on Internet nor on SO.
I hope you will be able to help me out with this!
Thanks by advance
Edit: Here's the code I'm using
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[nonumberlist,toc,chapter=chapter]{glossaries}
In glossary:
\makeglossaries
\setglossarypreamble{Source is INSEE}
\newglossaryentry{AAV}
{
name=AAV,
description={The description of what AAV is.}
}
In document:
sometextsometext (see \Gls{AAV}). Sometextsometext
If you load the hyperref package, the abbreviation will automatically be clickable:
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage[nonumberlist,toc]{glossaries}
\makeglossaries
\setglossarypreamble{Source is INSEE}
\newglossaryentry{AAV}
{
name=AAV,
description={The description of what AAV is.}
}
\begin{document}
sometextsometext (see \Gls{AAV}). Sometextsometext
\printglossaries
\end{document}

How can i use special characters (ä,ü..) in LaTeX package qrcode

Code with Vcard informations in it. How can i use sepcial german characters like ä,ü, and so on. My file is saved under utf-8 encoding. This minimal example gives error.
\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[]{qrcode}
\begin{document}
\qrcode{
BEGIN:VCARD\?
VERSION:4.0\?
N:Do;Jon;;Dr.\?
FN:Dr. Jon Do\?
ORG:Firma; Überirdische Firma\?
END:VCARD
}
\end{document}
I could solve the problem. But i do not know why it works..
Adding this line VERSION:3.0\? fixed the problem.

Latex Commands with URL

I am having trouble adding a URL to the Linkedin command. I want it to essentially print the Linkedin logo, text that I want to be explicitly seen, and a URL that the user will be redirected to upon clicking it. Below is the current .cls file.
.cls file:
\newcommand{\linkedinsymbol}{\faLinkedin}
\newcommand{\printinfo}[2]{\mbox{\textcolor{accent}{\normalfont #1}\hspace{0.5em}#2\hspace{2em}}}
\usepackage{hyperref}
\newcommand{\linkedin}[1]{\printinfo{\linkedinsymbol}{#1}}
I tried turning the last line into the following:
\newcommand{\linkedin}[2]{\printinfo{\linkedinsymbol}{#1}}{\url{#2}}
However, upon doing so, I get the following errors:
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.91 ...{\printinfo{\linkedinsymbol}{#1}}{\url{#2}
}
?
! Undefined control sequence.
\hyper#linkurl ...tionraw >>}\relax \Hy#colorlink
\#urlcolor #1\Hy#xspace#en...
l.91 ...{\printinfo{\linkedinsymbol}{#1}}{\url{#2}
}
?
! Undefined control sequence.
\close#pdflink ->\Hy#endcolorlink
\Hy#VerboseLinkStop \pdfendlink
l.91 ...{\printinfo{\linkedinsymbol}{#1}}{\url{#2}
}
?
Minimum Reproducible Example:
main.tex:
\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[10pt,letterpaper]{altacv}
\geometry{left=1cm,right=9cm,marginparwidth=6.8cm,marginparsep=1.2cm,top=1.25cm,bottom=1.25cm,footskip=2\baselineskip}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[default]{lato}
\usepackage[hidelinks]{hyperref}
\begin{document}
\linkedin{linkedin.com/in/varunjain-me}{www.linkedin.com/in/varunjain-me}
\end{document}
.cls file:
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\#ifl#t#r\fmtversion{2018/04/01}{\UseRawInputEncoding}{}
\ProvidesClass{altacv}[2018/07/27 AltaCV v1.1.4, yet another alternative class for a résumé/curriculum vitae.]
\newif\if#academicons
\DeclareOption{academicons}{\#academiconstrue}
\newif\if#normalphoto
\DeclareOption{normalphoto}{\#normalphototrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{extarticle}}
\ProcessOptions\relax
\LoadClass{extarticle}
\RequirePackage[margin=2cm]{geometry}
\RequirePackage{fontawesome}
\if#academicons
\ExplSyntaxOn
\msg_redirect_name:nnn { fontspec } { font-not-found } { none }
\ExplSyntaxOff
\RequirePackage{academicons}
\newfontfamily{\AI}{academicons.ttf}
\fi
\RequirePackage{xcolor}
\colorlet{accent}{blue!70!black}
\colorlet{heading}{black}
\colorlet{emphasis}{black}
\colorlet{body}{black!80!white}
\newcommand{\itemmarker}{{\small\textbullet}}
\newcommand{\ratingmarker}{\faCircle}
\RequirePackage{tikz}
\usetikzlibrary{arrows}
\RequirePackage[skins]{tcolorbox}
\RequirePackage{enumitem}
\setlist{leftmargin=*,labelsep=0.5em,nosep,itemsep=0.25\baselineskip,after=\vskip0.25\baselineskip}
\setlist[itemize]{label=\itemmarker}
\RequirePackage{graphicx}
\RequirePackage{etoolbox}
\RequirePackage{dashrule}
\RequirePackage{multirow,tabularx}
\RequirePackage{changepage}
\setlength{\parindent}{0pt}
\newcommand{\divider}{\textcolor{body!30}{\hdashrule{\linewidth}{0.6pt}{0.5ex}}\medskip}
\newenvironment{fullwidth}{%
\begin{adjustwidth}{}{\dimexpr-\marginparwidth-\marginparsep\relax}}
{\end{adjustwidth}}
\newcommand{\linkedinsymbol}{\faLinkedin}
\newcommand{\printinfo}[2]{\mbox{\textcolor{accent}{\normalfont #1}\hspace{0.5em}#2\hspace{2em}}}
\newcommand{\linkedin}[2]{\printinfo{\linkedinsymbol}{#1}}{\url{#2}}
Here is the code that ended up working for my scenario:
\documentclass{article}
\usepackage{fontawesome}
\usepackage{xcolor}
\usepackage{hyperref}
\colorlet{accent}{blue!70!black}
\begin{document}
\newcommand{\linkedinsymbol}{\faLinkedin}
% \newcommand{\printinfo}[2]{\mbox{\textcolor{accent}{\normalfont #1}\hspace{0.5em}#2\hspace{2em}}}
\newcommand{\weblinks}[3]{\mbox{\textcolor{accent}{\normalfont #1}\hspace{0.5em}{\href{#2}{#3}}\hspace{2em}}}
% \newcommand{\linkedin}[2]{\printinfo{\linkedinsymbol}{#1}{\url{#2}}}
\newcommand{\linkedin}[2]{\weblinks{\linkedinsymbol}{#1}{#2}}
\linkedin{http://linkedin.com/in/varunjain-me}{linkedin.com/in/varunjain}
\end{document}
This minimal example works for me:
\documentclass{article}
\usepackage{fontawesome}
\usepackage{xcolor}
\usepackage{hyperref}
\colorlet{accent}{blue!70!black}
\begin{document}
\newcommand{\linkedinsymbol}{\faLinkedin}
\newcommand{\printinfo}[2]{\mbox{\textcolor{accent}{\normalfont #1}\hspace{0.5em}#2\hspace{2em}}}
\newcommand{\linkedin}[2]{\printinfo{\linkedinsymbol}{#1}{\url{#2}}}
\linkedin{linkedin.com/in/varunjain-me}{www.linkedin.com/in/varunjain-me}
\end{document}
At least it produces some output... I don't know what exactly you expect, but you can probably take it from here.

Custom caption prefix

When using:
\begin{listing}
...
\caption{foo}
\end{listing}
The caption will say: Listing x: foo. How can I replace the word Listing with something else?
If you are using minted (I am, and my source looks like yours), you may want to try
\renewcommand{\listingscaption}{Some fancy listing}
You might want to read the manual
http://mirror.switch.ch/ftp/mirror/tex/macros/latex/contrib/listings/listings.pdf
page 32
\begin{listing}[caption=Some fancy listing]
or try
\begin{listing}[title=Some fancy listing]
or try
\renewcommand{\lstlistingname}{A funny listing}
Minimal example that works for me:
\documentclass{article}
\usepackage{listings}
\renewcommand{\lstlistingname}{Something}
\begin{document}
Some text.
\begin{lstlisting}[caption=wwww]
xxxx
\end{lstlisting}
Some more text.
\end{document}

LaTeX lstlisting underlined

Is there an easy way to have the complete code in a lstlisting environment underlined?
My current solution looks like this, but I'm not really happy with it.
\begin{lstlisting}[mathescape]
$\ul{if(gt(x1, 0)) then} $
...
\end{lstlisting}
Thanks for any tips.
According to page 5 in the user guide (found here):
\lstset{keywordstyle=\underbar}
If you want to underline the entire line (and not only the keywords), the best solution I can come up with is to do something along the lines below:
\usepackage{listings}
\newcommand{\lstul}[1]{\underline{\mbox{\tt #1}}}
\begin{document}
\begin{lstlisting}[mathescape]
$\lstul{if condition}$
$\lstul{statement 1}$
$\lstul{statement 2}$
...
\end{lstlisting}
\end{document}

Resources