emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to wavy/double underline an org-mode link?


From: Sharon Kimble
Subject: Re: [O] How to wavy/double underline an org-mode link?
Date: Mon, 24 Jul 2017 14:22:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Eric S Fraga <address@hidden> writes:

> On Saturday, 22 Jul 2017 at 10:35, Sharon Kimble wrote:
>
> [...]
>
>> I've found that I can underline each org-mode link by putting '_' before
>> and after each link, which is then exported to a latex file and built
>> into the pdf and does work. But, I am already underlining each glossary
>> entry in the main body of the text, so to differentiate I would like
>> either a wavy underline, or a double underline. But how please?
>
> Have a look at org-link-parameters variable and this page for LaTeX
> suggestions on how to double-underline:
>
> http://tex.stackexchange.com/questions/249616/ddg#249617

Thanks to Eric and Rasmus who replied.

I did try using a double-underline but it looked so horrible I changed
it very quickly!

This is what I've ended up using -

--8<---------------cut here---------------start------------->8---

%% 
https://tex.stackexchange.com/questions/311132/how-to-style-hrefs-underlined-and-coloured-throughout-the-document?noredirect=1&lq=1

\usepackage{ulem}

\makeatletter
\begingroup
  \catcode`\$=6 %
  \catcode`\#=12 %
  address@hidden
    \hyper@@link{$1}{$2}{\dashuline{$4}}% or \underline
    \endgroup
  }%
\endgroup
\makeatother

%% 
https://tex.stackexchange.com/questions/49862/having-all-links-underlined-with-dotted-line?noredirect=1&lq=1

\usetikzlibrary{calc}

\makeatletter
address@hidden
address@hidden

\newcommand{\formatlink}[1]{%
   % --- save the box to be displayed (so that e.g. footnote counters do not
   %     get incremented twice)
   address@hidden
   % --- calculate the width of the box for later use
   address@hidden@box}}%
   % --- draw the link
   \tikz[baseline=(todotted.base)]{
   \node[inner sep=-1pt,outer sep=0pt] (todotted) address@hidden;
   \draw[dotted, thick] 
      ($(todotted.base)-(address@hidden,2pt)$) -- +(address@hidden,0); 
   }%
}

\AtBeginDocument{%
   % --- replace \ref command
   % \let\oldref=\ref
   % \renewcommand\ref[1]{\formatlink{\oldref{#1}}}
   % --- replace hyperref command
   \let\oldhyperref=\hyperref
   \renewcommand\hyperref[2][]{\formatlink{\oldhyperref[#1]{#2}}}
   % --- replace footnote command
   % \let\oldfootnote=\footnote
   % \renewcommand\footnote[1]{\formatlink{\footnotemark}\footnotetext{#1}}
   % --- replace cite command
   % \let\oldcite=\cite
   % \renewcommand\cite[1]{\formatlink{\oldcite{#1}}}
   % --- introduce secref command   
   % \newcommand\secref[1]{\hyperref[#1]{Section \oldref{#1}}}
}
\makeatother
--8<---------------cut here---------------end--------------->8---

I've saved it as 'code-1.tex' and just use it as '#+latex_header:
\input{/home/boudiccas/research/code-1}' at the end of my package list
in my org-mode source document.

And its now working perfectly. 

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk  
Debian 9.0, fluxbox 1.3.5-2, emacs 25.1.1, org-mode 9.0.9

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]