From 095a7aacbb0570f22a9c11a51344b19a0d1864a3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 23 Mar 2013 22:58:28 +0000 Subject: embrac (23mar13) git-svn-id: svn://tug.org/texlive/trunk@29483 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/embrac/README | 4 +- Master/texmf-dist/doc/latex/embrac/embrac_en.pdf | Bin 103283 -> 446076 bytes Master/texmf-dist/doc/latex/embrac/embrac_en.tex | 91 ++++++----------- .../doc/latex/embrac/embrac_kerning_test.tex | 7 +- Master/texmf-dist/tex/latex/embrac/embrac.sty | 113 +++++++++++++++------ 5 files changed, 120 insertions(+), 95 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/embrac/README b/Master/texmf-dist/doc/latex/embrac/README index 338e83f5a2e..36acbf2d469 100644 --- a/Master/texmf-dist/doc/latex/embrac/README +++ b/Master/texmf-dist/doc/latex/embrac/README @@ -3,13 +3,13 @@ the EMBRAC package Upright Brackets in Emphasized Text -2012/11/04 v0.2 +2013/03/22 v0.3 -------------------------------------------------------------------------- Clemens Niederberger Web: https://bitbucket.org/cgnieder/embrac/ E-Mail: contact@mychemistry.eu -------------------------------------------------------------------------- -Copyright 2012 Clemens Niederberger +Copyright 2012--2013 Clemens Niederberger This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/doc/latex/embrac/embrac_en.pdf b/Master/texmf-dist/doc/latex/embrac/embrac_en.pdf index d5b565923d0..1119a0ba223 100644 Binary files a/Master/texmf-dist/doc/latex/embrac/embrac_en.pdf and b/Master/texmf-dist/doc/latex/embrac/embrac_en.pdf differ diff --git a/Master/texmf-dist/doc/latex/embrac/embrac_en.tex b/Master/texmf-dist/doc/latex/embrac/embrac_en.tex index d37bc700592..d23b8dd10f7 100644 --- a/Master/texmf-dist/doc/latex/embrac/embrac_en.tex +++ b/Master/texmf-dist/doc/latex/embrac/embrac_en.tex @@ -1,8 +1,7 @@ -% arara: xelatex -% arara: makeindex: { sort: true, style: embrac_en.ist } +% arara: pdflatex % arara: biber -% arara: xelatex -% arara: xelatex +% arara: pdflatex +% arara: pdflatex % -------------------------------------------------------------------------- % the EMBRAC package % @@ -53,50 +52,13 @@ gobble = 1 } -\cnpkgcolors{ - main => cnpkgred , - key => yellow!40!brown , - module => cnpkgblue , - link => black!90 -} - -\usepackage{libertineotf} -\setmainfont[ - Numbers={OldStyle,Proportional}, - SmallCapsFont=Linux Libertine Capitals O, - SmallCapsFeatures={LetterSpace=1.5,Scale=.975}, - SlantedFont=Linux Libertine Slanted O, - Ligatures=TeX]{Linux Libertine O} -\setsansfont[ - Numbers={OldStyle,Proportional}, - Scale=1.0025, - SmallCapsFont=Linux Biolinum Capitals O, - SmallCapsFeatures={LetterSpace=.5,Scale=.95}, - ItalicFont=Linux Biolinum Slanted O, - SlantedFont=Linux Biolinum Slanted O, - Ligatures=TeX]{Linux Biolinum O} -\setmonofont[Scale=.802]{DejaVu Sans Mono} - -\makeatletter -\DeclareRobustCommand{\sustyle}{% - \not@math@alphabet\sustyle\relax - \addfontfeatures{VerticalPosition=Superior}} -\DeclareTextFontCommand{\textsu}{\sustyle} -\def\ifcomma#1{\ifx#1,\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} -\DeclareRobustCommand*\textsuperscript[1]{% - \expandafter\ifcomma\expandafter{#1} - {\@textsuperscript{\selectfont#1}} - {\textsu{#1}}} -\makeatother - +\usepackage{libertinehologopatch} \usepackage{fnpct} - +\cnpkgusecolorscheme{friendly} \renewcommand*\othersectionlevelsformat[3]{% \textcolor{main}{#3\autodot}\enskip} \renewcommand*\partformat{% \textcolor{main}{\partname~\thepart\autodot}} -\usepackage{scrpage2} -\pagestyle{scrheadings} \newcommand*\Default[1]{% \hfill\llap{% @@ -145,25 +107,28 @@ \end{filecontents} % index: -\usepackage{makeidx} -\begin{filecontents}{\jobname.ist} +\usepackage{imakeidx} +\begin{filecontents*}{\jobname.ist} heading_prefix "{\\bfseries " heading_suffix "\\hfil}\\nopagebreak\n" headings_flag 1 - delim_0 "\\dotfill " - delim_1 "\\dotfill " - delim_2 "\\dotfill " - delim_r "\\textendash" + delim_0 "\\dotfill\\hyperpage{" + delim_1 "\\dotfill\\hyperpage{" + delim_2 "\\dotfill\\hyperpage{" + delim_r "}\\textendash\\hyperpage{" + delim_t "}" suffix_2p "\\nohyperpage{\\,f.}" suffix_3p "\\nohyperpage{\\,ff.}" -\end{filecontents} -\makeindex +\end{filecontents*} +\indexsetup{noclearpage,othercode=\footnotesize} +\makeindex[options={-s \jobname.ist},intoc,columns=3] \usepackage{fixfoot} \DeclareFixedFootnote\manythanks{Many thanks again for his kind permission to use it!} \RenewEmph{[}[-0.045em,.02em]{]}[.055em,-.09em] \ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em] + \begin{document} \section{License and Requirements}\secidx{License}\secidx{Requirements} @@ -186,10 +151,11 @@ package probably wouldn't exist. \item[v0.1a] The command \cmd{RenewEmph} has been renamed into \cmd{ChangeEmph} and a new slightly different \cmd{RenewEmph} has been added. \item[v0.2] Improved interaction with \paket{biblatex}. + \item[v0.3] Added support for \paket*{fontspec}'s \cmd{textsi}. \end{description} \section{About}\label{sec:about}\secidx{About} -\begin{zitat}[{\cite[85]{bringhurst04}}] +\begin{zitat}[{{\cite[85]{bringhurst04}}}] Parentheses and brackets are not letters, and it makes little sense to speak of them as roman or italic. There are vertical parentheses and sloped ones, and the parentheses on italic fonts are almost always sloped, but vertical parentheses @@ -210,7 +176,8 @@ Both this quote from~\citetitle{bringhurst04} by Robert Bringhurst and the article \citetitle{dtk12-dw} by Dominik Waßenhoven~\cite{dtk12-dw} inspired this package. Indeed, \embrac heavily borrows from the code \citeauthor{dtk12-dw} provided in his article\manythanks. The code was originally provided by Bruno -Le~Floch\manythanks\ answering a question on \{TeX.SE\}~\cite{lefloch11}. +Le~Floch\manythanks\ answering a question on +\href{http://tex.stackexchange.com}{TeX.sx}~\cite{lefloch11}. \embrac tries to redefine \cmd{emph} and \cmd{textit} in a way that neither parentheses nor square brackets are sloped. In an ideal world you of course @@ -228,8 +195,11 @@ Both the commands \cmd{emph} and \cmd{textit} are redefined: \begin{beschreibung} \Befehl{emph}*{} \Befehl{textit}*{} + \Befehl{textsi}*{}\newline + This command is only defined and thus redefined if you loaded \paket{fontspec}, + \emph{i.e.} if you're compiling your document with \XeLaTeX{} or \LuaLaTeX. \end{beschreibung} -They now both have a \code{*} argument that restores the original behaviour. +They now have a \code{*} argument that restores the original behaviour. Otherwise they're used just as before. Let's see the example again: @@ -339,7 +309,7 @@ Deleting a pair removes it completely from \embrac's mechanism. All information about the pair and its kerning values will be lost. So if you want the effects to be temporary use grouping. \begin{beispiel} - \DeleteEmph[] + \DeleteEmph{[}{]} \emph{This is emphasized [sic] text.} \\ \emph{This is emphasized text (as you can see).} \end{beispiel} @@ -352,7 +322,7 @@ documentation. \section{biblatex Compatibility}\secidx{biblatex Compatibility} This is \embrac's only package option: \begin{beschreibung} - \Option{biblatex}{\default{true}|on|parens|false||off|none}\Default{false} + \Option{biblatex}{\default{true}|on|parens|false|off|none}\Default{false} If set to \code{true} (or one of its aliases) parentheses and squared brackets as defined by \paket{biblatex} with \cmd{bibleftparen}, \cmd{bibrightparen}, \cmd{bibleftbracket} and \cmd{bibrightbracket} are treated the same way (if @@ -380,8 +350,8 @@ Both commands are local. \secidx*{Turn \embrac Temporarily Off} \section{Watch out!}\secidx{Watch Out} -Please be aware that \embrac does not affect \cmd{itshape} nor the commands -\cmd{em} or \cmd{it} (which you shouldn't use in a \LaTeX\ document, anyway). +Please be aware that \embrac does not affect \cmd{itshape} nor \cmd{em} (nor +\cmd{it} which you shouldn't use in a \LaTeX{} document, anyway). \begin{beispiel} \itshape This is italic [sic] text. \end{beispiel} @@ -389,8 +359,7 @@ Please be aware that \embrac does not affect \cmd{itshape} nor the commands \printbibliography -\setindexpreamble{Section titles are indicated \textbf{bold}, packages -\textsf{sans serif}, commands \code{\textbackslash\textcolor{code}{brown}} - and options \textcolor{key}{\code{yellow}}.\par\bigskip} +\indexprologue{\noindent Section titles are indicated \textbf{bold}, packages +\textsf{sans serif}, commands \cmd*{brown} and options \key*{yellow}.} \printindex \end{document} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/embrac/embrac_kerning_test.tex b/Master/texmf-dist/doc/latex/embrac/embrac_kerning_test.tex index 93c1d4437cd..ec1425c169d 100644 --- a/Master/texmf-dist/doc/latex/embrac/embrac_kerning_test.tex +++ b/Master/texmf-dist/doc/latex/embrac/embrac_kerning_test.tex @@ -31,11 +31,14 @@ % feel free to contact me. % -------------------------------------------------------------------------- \documentclass{scrartcl} -\usepackage[T1]{fontenc} -\usepackage{embrac} +% \usepackage[T1]{fontenc} +\usepackage{fontspec} % load desired font, for example: % \usepackage{libertine} +\setmainfont{Minion Pro} + +\usepackage{embrac} \begin{document} % see the default: diff --git a/Master/texmf-dist/tex/latex/embrac/embrac.sty b/Master/texmf-dist/tex/latex/embrac/embrac.sty index 30ee698d037..c5967aa1fb4 100644 --- a/Master/texmf-dist/tex/latex/embrac/embrac.sty +++ b/Master/texmf-dist/tex/latex/embrac/embrac.sty @@ -8,7 +8,7 @@ % Web: https://bitbucket.org/cgnieder/embrac/ % E-Mail: contact@mychemistry.eu % -------------------------------------------------------------------------- -% Copyright 2012 Clemens Niederberger +% Copyright 2012--2013 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -34,8 +34,8 @@ \RequirePackage { expl3 , xparse , l3keys2e } \ProvidesExplPackage {embrac} - {2012/11/04} - {0.2} + {2013/03/22} + {0.3} {Upright Brackets in Emphasized Text} \bool_new:N \l__embrac_treat_biblatex_bool @@ -60,26 +60,35 @@ biblatex .default:n = true } -% save original commands: -\cs_new_eq:Nc \__embrac_orig_emph:n { emph~ } -\cs_generate_variant:Nn \__embrac_orig_emph:n { V } +\prg_new_conditional:Npnn \__embrac_if_fontspec: { T } + { + \@ifpackageloaded{fontspec} + { \prg_return_true: } + { \prg_return_false: } + } -\cs_new_eq:Nc \__embrac_orig_textit:n { textit~ } -\cs_generate_variant:Nn \__embrac_orig_textit:n { V } +% save original commands, delay until begin document to catch `fontspec's +% redefinitions: +\AtBeginDocument{ + \cs_new_eq:Nc \__embrac_orig_emph:n { emph~ } + \cs_generate_variant:Nn \__embrac_orig_emph:n { V } + \cs_new_eq:Nc \__embrac_orig_textit:n { textit~ } + \cs_generate_variant:Nn \__embrac_orig_textit:n { V } + \__embrac_if_fontspec:T + { + \cs_new_eq:Nc \__embrac_orig_textsi:n { textsi~ } + \cs_generate_variant:Nn \__embrac_orig_textsi:n { V } + } +} % preparations: \cs_new_eq:NN \embrac_braces_format:n \textup \cs_new_eq:NN \__embrac_kern:n \skip_horizontal:n -\cs_new:Npn \__embrac_empty_or_no_value:nTF #1#2#3 +\prg_new_conditional:Npnn \__embrac_empty_or_no_value:n #1 { F,TF } { - \IfNoValueTF { #1 } { #2 } - { \tl_if_blank:nTF { #1 } { #2 } { #3 } } - } -\cs_new:Npn \__embrac_empty_or_no_value:nF #1#2 - { - \IfNoValueF { #1 } - { \tl_if_blank:nF { #1 } { #2 } } + \IfNoValueTF { #1 } { \prg_return_true: } + { \tl_if_blank:nTF { #1 } { \prg_return_true: } { \prg_return_false: } } } % -------------------------------------------------------------------------- @@ -91,7 +100,7 @@ \prop_new:N \l__embrac_emph_cbrackets_after_prop % do the replacing: -\cs_new:Npn \__embrac_replace_brackets:N #1 +\cs_new_protected:Npn \__embrac_replace_brackets:N #1 { \prop_map_inline:Nn \l__embrac_emph_obrackets_prop { @@ -117,7 +126,7 @@ } % internal \emph command: -\cs_new:Npn \__embrac_emph:n #1 +\cs_new_protected:Npn \__embrac_emph:n #1 { \tl_set:Nx \l__embrac_tmpa_tl { #1 } \__embrac_replace_brackets:N \l__embrac_tmpa_tl @@ -125,15 +134,28 @@ } % internal \textit command: -\cs_new:Npn \__embrac_textit:n #1 +\cs_new_protected:Npn \__embrac_textit:n #1 { \tl_set:Nn \l__embrac_tmpa_tl { #1 } \__embrac_replace_brackets:N \l__embrac_tmpa_tl \__embrac_orig_textit:V \l__embrac_tmpa_tl } +% internal \textsi command: +\AtBeginDocument{ + \__embrac_if_fontspec:T + { + \cs_new_protected:Npn \__embrac_textsi:n #1 + { + \tl_set:Nn \l__embrac_tmpa_tl { #1 } + \__embrac_replace_brackets:N \l__embrac_tmpa_tl + \__embrac_orig_textsi:V \l__embrac_tmpa_tl + } + } + } + % biblatex compatibility: -\cs_new:Npn \__embrac_treat_bibparens: +\cs_new_protected:Npn \__embrac_treat_bibparens: { \bool_if:NT \l__embrac_treat_biblatex_bool { @@ -144,7 +166,7 @@ } } -\cs_new:Npn \__embrac_treat_bibemph: +\cs_new_protected:Npn \__embrac_treat_bibemph: { \bool_if:NT \l__embrac_treat_biblatex_bool { @@ -176,6 +198,22 @@ \group_end: } +% internal \textsi command, second layer: +\AtBeginDocument{ + \__embrac_if_fontspec:T + { + \cs_new_protected:Npn \__embrac_new_textsi:w #1#2 + { + \group_begin: + \__embrac_treat_bibparens: + \IfBooleanTF { #1 } + { \__embrac_orig_textsi:n { #2 } } + { \__embrac_textsi:n { #2 } } + \group_end: + } + } + } + % user command \emph: \RenewDocumentCommand \emph { sm } { \__embrac_new_emph:w #1 { #2 } } @@ -184,6 +222,15 @@ \RenewDocumentCommand \textit { sm } { \__embrac_new_textit:w #1 { #2 } } +% user command \textsi: +\AtBeginDocument{ + \__embrac_if_fontspec:T + { + \RenewDocumentCommand \textsi { sm } + { \__embrac_new_textsi:w #1 { #2 } } + } + } + % -------------------------------------------------------------------------- % TURNING EMBRAC OFF AND ON: % turning embrac off: @@ -193,6 +240,8 @@ { \__embrac_orig_emph:n { ##2 } } \RenewDocumentCommand \textit { sm } { \__embrac_orig_textit:n { ##2 } } + \RenewDocumentCommand \textsi { sm } + { \__embrac_orig_textsi:n { ##2 } } } % turning embrac on: @@ -202,12 +251,14 @@ { \__embrac_new_emph:w ##1 { ##2 } } \RenewDocumentCommand \textit { sm } { \__embrac_new_textit:w ##1 { ##2 } } + \RenewDocumentCommand \textsi { sm } + { \__embrac_new_textsi:w ##1 { ##2 } } } % -------------------------------------------------------------------------- % ADDING AND REMOVING BRACKETS: % internal add command: -\cs_new:Npn \__embrac_add_to_emph:nnnnnn #1#2#3#4#5#6 +\cs_new_protected:Npn \__embrac_add_to_emph:nnnnnn #1#2#3#4#5#6 { \__embrac_empty_or_no_value:nTF { #2 } { \prop_put_if_new:Nnn \l__embrac_emph_obrackets_prop { #1 } { 0pt } } @@ -224,16 +275,16 @@ } % internal delete command: -\cs_new:Npn \__embrac_remove_from_emph:nn #1#2 +\cs_new_protected:Npn \__embrac_remove_from_emph:nn #1#2 { - \prop_del:Nn \l__embrac_emph_obrackets_prop { #1 } - \prop_del:Nn \l__embrac_emph_obrackets_before_prop { #1 } - \prop_del:Nn \l__embrac_emph_cbrackets_prop { #2 } - \prop_del:Nn \l__embrac_emph_cbrackets_after_prop { #2 } + \prop_remove:Nn \l__embrac_emph_obrackets_prop { #1 } + \prop_remove:Nn \l__embrac_emph_obrackets_before_prop { #1 } + \prop_remove:Nn \l__embrac_emph_cbrackets_prop { #2 } + \prop_remove:Nn \l__embrac_emph_cbrackets_after_prop { #2 } } % internal renew command: -\cs_new:Npn \__embrac_renew_emph:nnnnnn #1#2#3#4#5#6 +\cs_new_protected:Npn \__embrac_renew_emph:nnnnnn #1#2#3#4#5#6 { \__embrac_empty_or_no_value:nTF { #2 } { \prop_put:Nnn \l__embrac_emph_obrackets_prop { #1 } { 0pt } } @@ -250,7 +301,7 @@ } % internal change command: -\cs_new:Npn \__embrac_change_emph:nnnnnn #1#2#3#4#5#6 +\cs_new_protected:Npn \__embrac_change_emph:nnnnnn #1#2#3#4#5#6 { \prop_if_in:NnT \l__embrac_emph_obrackets_prop { #1 } { @@ -320,4 +371,6 @@ 2012/06/29 - v0.1a - renamed \RenewEmph => \ChangeEmph and added new \RenewEmph 2012/07/24 - v0.1b - adapted to deprecated functions in l3kernel and l3packages 2012/11/04 - v0.2 - extended `biblatex' option: parens/full - - changed buggy definition of \EmbracOff and \EmbracOn \ No newline at end of file + - changed buggy definition of \EmbracOff and \EmbracOn +2013/03/22 - v0.3 - made definitions robust where appropriate + - added support for `fontspec's \textsi \ No newline at end of file -- cgit v1.2.3