diff options
Diffstat (limited to 'Dokument/Biblioteksuppgift')
| -rw-r--r-- | Dokument/Biblioteksuppgift/Biblioteksuppgift.tex | 6 | ||||
| -rw-r--r-- | Dokument/Biblioteksuppgift/lips.cls | 257 | ||||
| -rw-r--r-- | Dokument/Biblioteksuppgift/url.sty | 313 |
3 files changed, 573 insertions, 3 deletions
diff --git a/Dokument/Biblioteksuppgift/Biblioteksuppgift.tex b/Dokument/Biblioteksuppgift/Biblioteksuppgift.tex index 66b2344..58a8bf8 100644 --- a/Dokument/Biblioteksuppgift/Biblioteksuppgift.tex +++ b/Dokument/Biblioteksuppgift/Biblioteksuppgift.tex @@ -109,15 +109,15 @@ Följande alternativ kan specificeras till dokumentmallen: \subsection{Patent i USA} -En "canister purge method" (kapselrengöringsmetod) kan minska antalet komponenter för ett aktivt purgesystem. En aktiv purge operation är genomförd med hjälp av att använda tryckvärde med en insugningstrycksenor (intake pressure sensor). Istället för en tryckvärde uppmätt med en bakre tryckgivare (rear-end pressure sensor) efter att en magnetventil (solenoid) för spolningskontroll (purge) är fullt öppen.\footnote{url{ +En "canister purge method" kan minska antalet komponenter för ett aktivt purgesystem. En aktiv purge operation är genomförd med hjälp av att använda tryckvärde uppmätt med en insugningstrycksenor (intake pressure sensor). Istället för att använda tryckvärde uppmätt med en bakre tryckgivare (rear-end pressure sensor) efter att en "purge control solenoid valve" är fullt öppen.\footnote{url{ https://worldwide.espacenet.com/publicationDetails/biblio?DB=EPODOC&II=0&ND=3&adjacent=true&locale=en_EP&FT=D&date=20191121&CC=US&NR=2019353112A1&KC=A1}} \section{Vetenskapliga artiklar} -\subsection{Ytterligare en rubrik på nivå 2} -\lipsum[10] +\subsection{Vetenskapliga artiklar} +\ diff --git a/Dokument/Biblioteksuppgift/lips.cls b/Dokument/Biblioteksuppgift/lips.cls new file mode 100644 index 0000000..7e80195 --- /dev/null +++ b/Dokument/Biblioteksuppgift/lips.cls @@ -0,0 +1,257 @@ +%% This simple template was written by Erik Frisk <erik.frisk@liu.se> +%% for use with the CDIO/LIPS courses at Linköping University. +%% +%% If you find them usefeul, great! If you have constructive suggestions or +%% comments, send me an email and I will consider your comments. + +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{lips}[2015/11/01 v1.0 LaTeX class for typesetting LIPS documents] + +% Declare options +\DeclareOption{swedish}{\def\@lipslang{swedish}} +\DeclareOption{english}{\def\@lipslang{english}} + +\DeclareOption{oneside}{\PassOptionsToClass{oneside}{scrartcl}} +\DeclareOption{twoside}{\PassOptionsToClass{twoside}{scrartcl}} + +\DeclareOption{10pt}{\PassOptionsToClass{10pt}{scrartcl}} +\DeclareOption{11pt}{\PassOptionsToClass{11pt}{scrartcl}} +\DeclareOption{12pt}{\PassOptionsToClass{12pt}{scrartcl}} + +\ExecuteOptions{english} +\ExecuteOptions{10pt} +\ExecuteOptions{oneside} + +\ProcessOptions + +% Load scrartcl class +\LoadClass[headinclude,footinclude,a4paper]{scrartcl} + +% Load packages +\RequirePackage[ +nochapters, % Turn off chapters since this is an article +%beramono, % Use the Bera Mono font for monospaced text (\texttt) +%eulermath,% Use the Euler font for mathematics +pdfspacing, % Makes use of pdftex’ letter spacing capabilities via the microtype package +dottedtoc +]{classicthesis} % The layout is based on the Classic Thesis style + +\RequirePackage{babel} +\RequirePackage[T1]{fontenc} +\RequirePackage[utf8]{inputenc} +\RequirePackage{arsclassica} % Modifies the Classic Thesis package +\RequirePackage{graphicx} % Required for including images +\RequirePackage{hyperref} +\RequirePackage{url} +\RequirePackage{microtype} +\RequirePackage{listings} +%\RequirePackage{palatino} +\RequirePackage{times} +%\RequirePackage{supertabular} +\RequirePackage{longtable} +\RequirePackage[textwidth=165mm,textheight=230mm]{geometry} +\RequirePackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template +\RequirePackage{amsmath,amssymb,amsthm} % For including math equations, theorems, symbols, etc +\RequirePackage{varioref} % More descriptive referencing + + +\def\name@groupemail{Group E-mail} +\def\name@Homepage{Homepage} +\def\name@Orderer{Orderer} +\def\name@Customer{Customer} +\def\name@Supervisor{Supervisor} +\def\name@Responsible{Course Responsible} +\def\name@Phone{Phone} +\def\name@Email{E-mail} +\def\name@Requirement{Requirement} +\def\name@Description{Description} +\def\name@Priority{Priority} +\def\name@contprev{cont. from previous page} +\def\name@contnext{cont. on next page} +\def\name@Author{Author} +\def\name@Date{Date} +\def\name@Reviewed{Reviewed} +\def\name@Approved{Approved} +\def\name@ProjId{Project Identity} + +\ifthenelse{\equal{\@lipslang}{swedish}}{ + \def\name@groupemail{Grupp E-post} + \def\name@Homepage{Hemsida} + \def\name@Orderer{Beställare} + \def\name@Customer{Kund} + \def\name@Supervisor{Handledare} + \def\name@Responsible{Kursansvarig} + \def\name@Phone{Tfn} + \def\name@Email{E-post} + \def\name@Requirement{Krav} + \def\name@Description{Beskrivning} + \def\name@Priority{Prioritet} + \def\name@contprev{forts. från föregående sida} + \def\name@contnext{forts. på nästa sida} + \def\name@Author{Författare} + \def\name@Date{Datum} + \def\name@Reviewed{Granskad} + \def\name@Approved{Godkänd} + \def\name@ProjId{Projektidentitet} +}{} + +\def\projecttitle#1{\gdef\@projecttitle{#1}} + +\def\version#1{\gdef\@version{#1}} + +\def\reviewed#1#2{\gdef\@reviewed{#1}\gdef\@revieweddate{#2}} +\def\approved#1#2{\gdef\@approved{#1}\gdef\@approveddate{#2}} + +\def\coursename#1{\gdef\@coursename{#1}} +\def\coursecode#1{\gdef\@coursecode{#1}} + +\def\courseresponsible#1{\gdef\@courseresponsible{#1}} +\def\courseresponsiblephone#1{\gdef\@courseresponsiblephone{#1}} +\def\courseresponsibleemail#1{\gdef\@courseresponsibleemail{#1}} + +\def\supervisor#1{\gdef\@supervisor{#1}} +\def\supervisorphone#1{\gdef\@supervisorphone{#1}} +\def\supervisoremail#1{\gdef\@supervisoremail{#1}} + +\def\groupname#1{\gdef\@groupname{#1}} +\def\groupemail#1{\gdef\@groupemail{\url{#1}}} +\def\groupwww#1{\gdef\@groupwww{\url{#1}}} + +\def\orderer#1{\gdef\@orderer{#1}} +\def\ordererphone#1{\gdef\@ordererphone{#1}} +\def\ordereremail#1{\gdef\@ordereremail{\url{#1}}} + +\def\customer#1{\gdef\@customer{#1}} +\def\customerphone#1{\gdef\@customerphone{#1}} +\def\customeremail#1{\gdef\@customeremail{\url{#1}}} + +\def\smalllogo#1{\gdef\@smalllogo{#1}} +\def\biglogo#1{\gdef\@biglogo{#1}} + +\renewcommand{\maketitle}{% + \pagestyle{scrheadings} + + \clearscrheadfoot + \@ifundefined{@smalllogo}{\ihead{}}{\ihead{\includegraphics[width=.2\textwidth]{\@smalllogo}}} + \chead{\@projecttitle} + \ohead{\@date} + \ifoot{\@coursecode\hspace*{5mm}\@coursename\\\@title} + \ofoot{{\@groupname\\\@groupemail}} + + \pagenumbering{Roman} + \vspace*{4cm} + \begin{center} + \vspace*{3mm} + {\Huge \@title}\\ + \vspace*{3mm} {\large \@author}\\ + \vspace*{10mm} {\large \@date}\\ + \vspace*{10mm} + {\large Version \@version} + \end{center} + \vfill + \@ifundefined{@biglogo}{}{ + \begin{figure}[htbp] + \centering + \includegraphics[width=0.5\textwidth]{\@biglogo} + \end{figure} + \vfill + } + \begin{center} + Status + \end{center} + \begin{tabular}{|p{.33\textwidth}|p{.33\textwidth}|p{.33\textwidth}|} + \hline + \name@Reviewed & \@reviewed & \@revieweddate\\ + \hline + \name@Approved & \@approved & \@approveddate \\ + \hline + \end{tabular} + \cleardoublepage + \pagestyle{scrheadings} +} + +\newcommand{\makeprojectid}{% + \begin{center} + \large\name@ProjId + \end{center} + + \begin{tabular}{ll} + \name@groupemail: & \@groupemail\\[5mm] + \name@Homepage: & \@groupwww\\[5mm] + \name@Orderer: & \@orderer\\ + & \name@Phone: \@ordererphone\\ + & \name@Email: \@ordereremail\\[5mm] + \name@Customer: & \@customer\\ + & \name@Phone: \@customerphone\\ + & \name@Email: \@customeremail\\[5mm] + \name@Supervisor: & \@supervisor\\ + & \name@Phone: \@supervisorphone\\ + & \name@Email: \@supervisoremail\\[5mm] + \name@Responsible: & \@courseresponsible\\ + & \name@Phone: \@courseresponsiblephone\\ + & \name@Email: \@courseresponsibleemail + \end{tabular} +} + + +% Requirements +\newcounter{reqcnt} +\newcommand{\requirementno}{\refstepcounter{reqcnt}\thereqcnt} +% \newenvironment{requirements}{% +% \begin{center}% +% \tablefirsthead{\hline \name@Requirement & \name@Description & \name@Priority \\ +% \hline \hline}% +% \tablehead{\hline \multicolumn{3}{|l|}{\footnotesize\textsl{\name@contprev}}\\\hline \name@Requirement & \name@Description & \name@Priority\\\hline \hline}% +% \tabletail{\hline \multicolumn{3}{|r|}{\footnotesize\textsl{\name@contnext}}\\\hline}% +% \tablelasttail{\hline}% + +% \begin{supertabular*}{\textwidth}{@{\extracolsep{\fill}}|c|p{100mm}|c|}}{% +% \end{supertabular*} +% \end{center} +% } + +\newenvironment{requirements}{% + \begin{center} + \begin{longtable}{|c|p{100mm}|c|} + \hline + \name@Requirement & \name@Description & \name@Priority\\ + \hline + \hline + \endfirsthead + \hline + \multicolumn{3}{|l|}% + {\footnotesize\textsl{\name@contprev}} \\ + \hline + \name@Requirement & \name@Description & \name@Priority\\ + \hline + \endhead + \hline + \multicolumn{3}{|r|}% + {\footnotesize\textsl{\name@contnext}} \\ + \hline + \endfoot + \hline + \endlastfoot + }{% + \end{longtable} + \end{center} +} + + +\setcounter{tocdepth}{2} +\setlength{\footheight}{26pt} +\setlength{\headheight}{33pt} + +\graphicspath{{Figures/}} % Set the default folder for images + +\hypersetup{ +%draft, % Uncomment to remove all links (useful for printing in black and white) +colorlinks=true, breaklinks=true, bookmarks=true,bookmarksnumbered, +urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webgreen, % Link colors +pdftitle={}, % PDF title +pdfauthor={}, % PDF Author +pdfsubject={}, % PDF Subject +pdfkeywords={}, % PDF Keywords +pdfcreator={pdfLaTeX}, % PDF Creator +pdfproducer={LaTeX with hyperref and ClassicThesis} % PDF producer +} diff --git a/Dokument/Biblioteksuppgift/url.sty b/Dokument/Biblioteksuppgift/url.sty new file mode 100644 index 0000000..801214f --- /dev/null +++ b/Dokument/Biblioteksuppgift/url.sty @@ -0,0 +1,313 @@ +% url.sty ver 3.4 16-Sep-2013 Donald Arseneau asnd@triumf.ca +% Copyright 1996-2013 Donald Arseneau, Vancouver, Canada. +% This program can be used, distributed, and modified under the terms +% of the LaTeX Project Public License, version 2 or later. +% +% A form of \verb that allows linebreaks at certain characters or +% combinations of characters, accepts reconfiguration, and can usually +% be used in the argument to another command. It is intended for email +% addresses, hypertext links, directories/paths, etc., which normally +% have no spaces. The font may be selected using the \urlstyle command, +% and new url-like commands can be defined using \urldef. +% +% Usage: Conditions: +% \url{ } If the argument contains any "%" or "^^", or ends with +% "\", it can't be used in the argument to another command. +% The argument must not contain unbalanced braces. +% \url| | ...where "|" is any character not used in the argument and not +% "{" or a space. The same restrictions as above except that the +% argument may contain unbalanced braces. +% \urldef\xyz\url{ } +% \xyz a defined-url: "\xyz" can be used anywhere, no matter what +% characters it contains. +% \DeclareUrlCommand\abc{settings}: makes \abc{ } like \url{ } with settings +% +% See url.tex/url.pdf for documentation. Some info after \endinput +% +% Required catcodes during loading: letters @ = letter, +% ` = > < . [ ] + - digits = other, +% { } \ ~ # % $ _ ^ = their normal + +% default style assignments +\def\UrlBreaks{\do\.\do\@\do\\\do\/\do\!\do\_\do\|\do\;\do\>\do\]% + \do\)\do\,\do\?\do\&\do\'\do+\do\=\do\#}% +\def\UrlBigBreaks{\do\:\do@url@hyp}% +\def\UrlNoBreaks{\do\(\do\[\do\{\do\<}% +% any ordinary characters that aren't usually: +\def\UrlOrds{\do\*\do\-\do\~\do\'\do\"\do\-}% +\def\UrlSpecials{\do\ {\Url@space}\do\%{\Url@percent}\do\^^M{\Url@space}% + \Url@force@Tilde}% package option may force faked text-ascii-tilde + +\@namedef{Url@OT1encSpecials}{% + % *Some* latin-1 or windows characters that ot1 has elsewhere: OE oe ss + \do\^^8c{\mathchar30 }\do\^^9c{\mathchar27 }\do\^^df{\mathchar25 }% + \do\~{\lower.45ex\hbox{\m@th$\mathchar126$}}% For tt style + % lots more to add, but I should later link into inputenc + \do\^^b5{\mu}% + \Url@OTnonTT % more for any but typewriter + } + +\def\Url@OTnonTT{\do\<{\langle}\do\>{\mathbin{\rangle}}\do + \_{\_\penalty\@m}\do\|{\mid}\do\{{\lbrace}\do\}{\mathbin{\rbrace}}\do + \\{\mathbin{\backslash}}\UrlTildeSpecial} + +% *Some* latin-1 or windows characters. Most will pass through safely to T1 enc +% mu inverted-? OE oe +% lots more to add, but I should later link into inputenc +\@namedef{Url@T1encSpecials}{\do\^^b5{\mu}\do\^^bf{\mathchar190 }% + \do\^^8c{\mathchar215 }\do\^^9c{\mathchar247 }\do\^^df{\mathchar255 }% + \do\^^ff{\mathchar184 }} + +\@namedef{Url@LY1encSpecials}{\do\~{\mathchar158 }} + +\def\UrlTildeSpecial{\do\~{\raise.45ex\hbox{\m@th$\scriptstyle\sim$}}} +\let\Url@force@Tilde\relax + +\def\url@ttstyle{% + \@ifundefined{selectfont}{\def\UrlFont{\tt}}{\def\UrlFont{\ttfamily}}} + +\def\url@rmstyle{% + \@ifundefined{selectfont}{\def\UrlFont{\rm}}{\def\UrlFont{\rmfamily}}} + +\def\url@sfstyle{% + \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\sffamily}}} + +\def\url@samestyle{\def\UrlFont{}} + +\@ifundefined{strip@prefix}{\def\strip@prefix#1>{}}{} +\@ifundefined{verbatim@nolig@list}{\def\verbatim@nolig@list{\do\`}}{} + +% \Url sets up the reading the argument verbatim if possible +\def\Url{% + \Url@movingtest + \ifmmode\@inmatherr$\fi %$ + \let\do\@makeother \dospecials % verbatim catcodes + \catcode`{\@ne \catcode`}\tw@ % with exceptions + \catcode`\ =10 % allow "\url {x}" + \catcode`\#=6 % always # -> ##, so I can later convert ## -> # + \@ifnextchar\bgroup{\obeyspaces\obeylines\Url@z}\Url@y} + +% \Url@y read arguments delimited like |...|, passing to \Url@z +\def\Url@y#1{\catcode`{11 \catcode`}11\obeyspaces\obeylines + \def\@tempa##1#1{\Url@z{##1}}\@tempa} + +% \Url@z read arguments delimited like {...}, verbatimizes with \meaning, +% performs character translations, then invokes the formatter. +\def\Url@z#1{\toks@{#1}\edef\Url@String{\the\toks@}% + \edef\Url@String{\expandafter\strip@prefix\meaning\Url@String}% +%\if\urldebug \message{------------------------------------------------------}% +%\message{ \Url@String}\fi +% \meaning introduces spurious spaces in the text, so it would be nice +% to preserve the real spaces before \meaning, but that doesn't work -- +% we can only do replacement on streams of non-syntactic characters. + \Url@ObeySp % may be no-op; otherwise put ordinary (12) space characters +%\if\urldebug \message{ \Url@String}\fi +% we left the catcode of # with its normal value (6) so \meaning +% doubles it to ##. Now we convert back to single #. This allows +% \url{#} to appear in the arguments of other commands, where we can't +% make # be an ordinary character. We make the single # active rather +% than `other' to support hyperref.sty. + \Url@acthash +%\if\urldebug \message{ \Url@String}\fi +% Also make % active to support hyperref. + \Url@actpercent +% now do any hyper referencing due to hyperref (or perform a url-def) + \Url@HyperHook +% Now do the formatting in a group (can also have \Url@HyperHook take +% this as an argument. + {\Url@FormatString}% + \endgroup} + +\let\Url@ObeySp\@empty +\let\UrlRight\@empty +\let\UrlLeft\@empty +\let\Url@HyperHook\@empty + +% This is the normal way to format the strings, using math mode. +\def\Url@FormatString{% + \UrlFont \Url@MathSetup + $\fam\z@ \textfont\z@\font + \expandafter\UrlLeft\Url@String\UrlRight + \m@th$% +% \if\urldebug \showlists \fi +}% + +\def\Url@MathSetup{% + \medmuskip\Urlmuskip \thickmuskip\medmuskip \thinmuskip0mu% + \relpenalty\UrlBigBreakPenalty \binoppenalty\UrlBreakPenalty + \expandafter\let\expandafter\UrlEncSpecials\csname Url@\f@encoding encSpecials\endcsname + % Insert test for unknown encodings here \ifx\UrlEncSpecials\relax + \ifdim\fontdimen\thr@@\font=\z@ \let\Url@OTnonTT\relax \fi + \@tempcnta\z@ % \fam\multiply\@tempcnta\@cclvi + \let\do\set@mathcode \UrlOrds % ordinary characters that were special + \advance\@tempcnta 8192 \UrlBreaks % bin + \advance\@tempcnta 4096 \UrlBigBreaks % rel + \advance\@tempcnta 4096 \UrlNoBreaks % open + \let\do\set@mathact \UrlSpecials \UrlEncSpecials % active + \let\do\set@mathnolig \verbatim@nolig@list % prevent ligatures +} + +\def\set@mathcode#1{\count@`#1\advance\count@\@tempcnta +%\message{Set mathcode of \string #1 (\number`#1) = \number`#1 + \number\@tempcnta. }% +\mathcode`#1\count@} +\def\set@mathact#1#2{\mathcode`#1=32768 \begingroup + \lccode`\~`#1\lowercase{\endgroup\def~}{#2}} +\def\set@mathnolig#1{\ifnum\mathcode`#1<32768 + \begingroup\lccode`\~`#1\lowercase{\endgroup + \edef~}{\mathchar\number\mathcode`#1\sb{\/}}% + \mathcode`#1=32768 \fi} + +\def\Url@movingtest{\begingroup + \ifx\let\HyPsd@LetCommand % we are already in a pdf string! + \expandafter\Url@unmove \fi % give the argument and hope for the best + \let\Url@moving\relax\relax\relax + \ifx\Url@moving\relax\else \expandafter\Url@unmove \fi + \endgroup} +\long\def\Url@unmove#1\Url@y{\endgroup \ifx\protect\relax\else\protect\Url\fi} +\edef\Url@moving{\csname Url Error\endcsname} +\expandafter\edef\Url@moving + {\csname url used in a moving argument.\endcsname} +\expandafter\expandafter\expandafter \let \Url@moving\@undefined + +\def\urldef#1#2{\begingroup \setbox\z@\hbox\bgroup + \def\Url@HyperHook##1\endgroup{\Url@def{#1}{#2}}% + % Because hyperref breaks \urldef and does not define its own (Grrrr!)... + \def\url@##1{\egroup\endgroup\DeclareRobustCommand#1{#2{##1}}}% + #2} +\def\Url@def#1#2{% + \toks0\expandafter{\Url@String}% + \protected@edef\Url@String{\Url@String}% + \toks1\expandafter{\Url@String}% + \edef\Url@String{\endgroup\egroup\endgroup\def + \expandafter\noexpand\csname\expandafter\@gobble\string#1 \endcsname + {\noexpand\Url@eitherdef{\the\toks1}{\noexpand#2{\the\toks0}}}}% + \Url@String + \edef#1{\noexpand\protect + \expandafter\noexpand\csname\expandafter\@gobble\string#1 \endcsname}% + } +\def\Url@eitherdef{\ifx\let\HyPsd@LetCommand % we are already in a pdf string! + \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi} + +\def\urlstyle#1{\expandafter\protect\csname url@#1style\endcsname} + +\def\DeclareUrlCommand#1#2{\def#1{\leavevmode\begingroup #2\Url}} + +% Sample (and default) configuration: +% +\DeclareUrlCommand\url{} +\urlstyle{tt} +% +\newmuskip\Urlmuskip \Urlmuskip=0mu +\mathchardef\UrlBreakPenalty=\binoppenalty +\mathchardef\UrlBigBreakPenalty=\relpenalty +% +% picTeX defines \path, so declare it optionally: +\@ifundefined{path}{\DeclareUrlCommand\path{\urlstyle{tt}}}{} +% +% too many styles define \email like \address, so I will not define it. +% \DeclareUrlCommand\email{\urlstyle{rm}} + +% Process LaTeX \package options +% +\let\Url@sppen\@M +\def\Url@space{\penalty\Url@sppen} +\def\do@url@hyp{}% by default, no breaks after hyphens + +\@ifundefined{ProvidesPackage}{ +}{\ProvidesPackage + {url}[2013/09/16 \space ver 3.4 \space Verb mode for urls, etc.] +\DeclareOption{hyphens}{\def\do@url@hyp{\do\-}}% allow breaks after hyphens +\DeclareOption{obeyspaces}{\let\Url@ObeySp\relax}% a flag for later +\DeclareOption{spaces}{\def\Url@sppen{\UrlBreakPenalty}} +\DeclareOption{LY1}{} +\DeclareOption{T1}{} +\DeclareOption{allowmove}{\let\Url@moving\@empty} +\DeclareOption{lowtilde}{% + \def\UrlTildeSpecial{\do\~{\raise.2ex\hbox{\m@th$\scriptstyle\sim$}}} + \let\Url@force@Tilde\UrlTildeSpecial +} +\ProcessOptions\relax +\ifx\Url@ObeySp\relax % [obeyspaces] was declared + \begingroup \lccode`+=32 \lowercase + {\endgroup \def\Url@ObeySp{\Url@Edit\Url@String{ }{+}}} + \def\Url@space{\penalty\Url@sppen\ } +\fi +} +\ifx\f@encoding\undefined \def\f@encoding{OT1}\fi + +\begingroup +% \Url@acthash: convert `other' (doubled) ## to active # +% \Url@actpercent: convert `other' % to active % + \lccode`+=`\# \lccode`\~=`\# + \lowercase {\long\gdef\Url@acthash{\Url@Edit\Url@String{++}{~}% + \ifnum\mathcode`\#<32768 \def~{\#}\fi}}% + \lccode`+=`\% \lccode`\~=`\% + \lowercase {\long\gdef\Url@actpercent{\Url@Edit\Url@String{+}{~}% + \ifnum\mathcode`\%<32768 \def~{\%}\fi}}% + \catcode13=12 % + \gdef\Url@percent{\@ifnextchar^^M{\@gobble}{\mathbin{\mathchar`\%}}}% +\endgroup% + +% Edit macro #1 changing all appearances of pattern #2 to replacement #3. +% The replacement is recursive, so don't put the search pattern into the +% replacement text! + +{ \catcode`Q=3 + +\gdef\Url@Edit#1#2#3{% + \begingroup % \tracingall + \def\DOE@a{\endgroup\def#1}% Just so I can \expandafter it safely. + \def\DOE@b##1#2##2Q##3{\@ifblank{##2}% if finished, + {\DOE@c ##1Q}% then remove \@empty's and redefine macro + {\DOE@b##1##3##2Q{##3}}% else, re-iterate + }% the leading \@empty preserves braces, as does the trailing pattern: + \expandafter\DOE@b\expandafter\@empty #1\@empty#2Q{#3}} +\gdef\DOE@c#1\@empty Q{\expandafter\DOE@a\expandafter{#1}} +% +% \@ifblank (LaTeX syntax) --- checks if parameter is blank (Spaces +% count as blank) use \@ifblank{#1}{true case}{false case} etc +\long\gdef\@ifblank#1{\@Ifbl@nk#1QQ\@secondoftwo\@firstoftwo!}% +\long\gdef\@Ifbl@nk#1#2Q#3#4#5!{#4} + +} % restore Q catcode + + +%\ifx\urldebug\@undefined \def\urldebug{01}\fi + +\endinput +% For documentation, please see accompanying url.tex (url.pdf) +% Package Options: obeyspaces, hyphens, spaces, lowtilde +% +% Revision History: +% ver 1.1 6-Feb-1996: +% Fix hyphens that wouldn't break and ligatures that weren't suppressed. +% ver 1.2 19-Oct-1996: +% Package option for T1 encoding; Hooks: "\UrlLeft" and "\UrlRight". +% ver 1.3 21-Jul-1997: +% Prohibit spaces as delimiter characters; change ascii tilde in OT1. +% ver 1.4 02-Mar-1999: +% LaTeX license; moving-argument-error +% ver 1.5 28-Mar-1999: +% possibility of spacing around break characters; re-settable penalties +% ver 1.6 20-Jun-2002: +% un-double #, fix obeyed-spaces, ignore trailing %, hook for hyperref +% (\Url@HyperHook), no macros in pre-processed url string (in \Url@String), +% limit catcode change of ~. +% ver 3.0 June 2003/Nov 2003: +% \DeclareUrlCommand; make font encoding automatic (only a few inputenc characters +% are supported yet - needs refactoring); reverse penalties. +% ver 3.1 Mar 2004: +% Remove spurious spaces in \url@XXstyle commands. +% ver 3.2 June 2005: +% Fix cmsy-symbols in tt bug (from 3.0); LY1 encoding bug; Enable plain +% with miniltx (again); Define the \urldef for hyperref; Lower "sim" tilde +% a little; fix \lowercase error in \UrlSpecials handling. +% ver 3.3 April 2006: +% Fix some encoding bugs and remove 8-bit characters. lowtilde option +% ver 3.4 Sept 2013: +% \@nomatherr->\@inmatherr. & is now another \UrlBreak character. +% The End + +Test file integrity: ASCII 32-57, 58-126: !"#$%&'()*+,-./0123456789 +:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ + |
