summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-03-06 01:07:33 +0000
committerKarl Berry <karl@freefriends.org>2010-03-06 01:07:33 +0000
commitf276a23ea2fc902e50521314bd7378a95c9e4de9 (patch)
tree9f038067b71488e8e592c76a3e74951011666199 /Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty
parent48e45d82921aca1f3b8fe0bfc9ff3abbb4bb81b4 (diff)
dlfltxb update (4mar10)
git-svn-id: svn://tug.org/texlive/trunk@17337 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty')
-rw-r--r--Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty38
1 files changed, 35 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty
index ae7cd5ce1b7..5788d06adbf 100644
--- a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty
+++ b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty
@@ -1,4 +1,4 @@
-\ProvidesPackage{dlfltxbmisc}[2008/01/01 v0.2 by Lars Madsen]
+\ProvidesPackage{dlfltxbmisc}[2010/03/04 v0.3 by Lars Madsen]
% This package be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -84,7 +84,7 @@
\newcommand\dbx[1][5mm]{\ifmmode\mathord{\@dbx{#1}}\else\@dbx{#1}\fi}
-% powerfull macro by Morten Høgholm, this enables you to measure the
+% powerfull macro by Morten H\o gholm, this enables you to measure the
% length of the previous paragraf.
\newdimen\lastlinedim
\def\getlastlinesize{%
@@ -103,10 +103,11 @@
% of bibtex entries. It eats up the added '.' and typesets the main
% argument (an URL) in a raggedright manner, wrapped up into the
% previous paragraph. It looks pretty cool.
-\newcommand\addurl[3][\textsc{url}:]{%
+\newcommand\addurl[3][\textsf{URL}:]{%
\getlastlinesize{}%
\vskip-2\baselineskip%
\begingroup%
+ \urlstyle{sf}
\def\UrlNoBreaks{\do\(\do\[\do\{\do\<\do\:\do\.}%\]
\RaggedLeft%
\fussy%
@@ -127,4 +128,35 @@
\endgroup%
}
+\AtBeginDocument{\providecommand\href[2]{#2}}
+\DeclareUrlCommand\mypath{\urlstyle{sf}}
+%\urlstyle{rm}
+\newcommand\addCTAN[3][\textsf{CTAN}:]{%
+ \getlastlinesize{}%
+ \vskip-2\baselineskip%
+ \begingroup%
+% \urlstyle{rm}
+ \def\UrlNoBreaks{\do\(\do\[\do\{\do\<\do\:\do\.}%\]
+ \RaggedLeft%
+ \fussy%
+ \hbadness=10000% cheating
+ \addtolength\lastlinedim{-\bibhang}%
+ \fboxsep=0pt%
+ \fboxrule=0pt%
+ \fbox{\hbox to \lastlinedim{\hfill \footnotesize \strut \hfill}}%
+ \ifdim \lastlinedim > 0.6\linewidth\relax% we break
+ \nopagebreak\vskip-3pt%
+ \else%
+ % special thanks to Dan Luecking for this, since my original
+ % \hspace{\fill} failed miserably
+ \hskip1em plus 5em minus .7em
+ \fi%
+ {\footnotesize
+ \href{http://mirror.ctan.org/#2}{#1~~{\mypath{#2}}}} %
+ \par%
+ \endgroup%
+}
+
+\newcommand\CTAN[1]{%
+ {\footnotesize\href{http://mirror.ctan.org/#1}{\textsf{CTAN:}~{\mypath{#1}}}}}