texlive[44787] Master/texmf-dist: fvextra (10jul17)

commits+karl at tug.org commits+karl at tug.org
Fri Jul 14 01:09:20 CEST 2017


Revision: 44787
          http://tug.org/svn/texlive?view=revision&revision=44787
Author:   karl
Date:     2017-07-14 01:09:20 +0200 (Fri, 14 Jul 2017)
Log Message:
-----------
fvextra (10jul17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fvextra/fvextra.pdf
    trunk/Master/texmf-dist/source/latex/fvextra/fvextra.dtx
    trunk/Master/texmf-dist/source/latex/fvextra/fvextra.ins
    trunk/Master/texmf-dist/tex/latex/fvextra/fvextra.sty

Modified: trunk/Master/texmf-dist/doc/latex/fvextra/fvextra.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/fvextra/fvextra.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fvextra/fvextra.dtx	2017-07-13 23:09:07 UTC (rev 44786)
+++ trunk/Master/texmf-dist/source/latex/fvextra/fvextra.dtx	2017-07-13 23:09:20 UTC (rev 44787)
@@ -26,7 +26,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{fvextra}
 %<*package>
-    [2016/09/02 v1.2.1 fvextra - extensions and patches for fancyvrb]
+    [2017/07/08 v1.3.1 fvextra - extensions and patches for fancyvrb]
 %</package>
 %
 %<*driver>
@@ -128,7 +128,7 @@
 \def\fvextraprintopt#1(#2) (#3){%
   \vspace{0.1in}%
   \leavevmode%
-  \marginpar{\raggedleft\texttt{\textcolor{DarkGreen}{#1}}\ }%
+  \marginpar{\raggedleft\texttt{\small\textcolor{DarkGreen}{#1}}\ }%
   \kern-\parindent\textsf{(#2)}\hfill(default: \texttt{#3})\\}
 
 \newenvironment{optionlist}%
@@ -213,7 +213,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{2857}
+% \CheckSum{3003}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -232,6 +232,17 @@
 %   Right brace   \}     Tilde         \~}
 %
 %
+% \begin{changelog}{v1.3.1}{2017/07/08}
+% \item \texttt{beameroverlays} now works with \texttt{VerbatimOut}.
+% \end{changelog}
+%
+% \begin{changelog}{v1.3}{2017/07/08}
+% \item Added \texttt{beameroverlays} option, which enables \texttt{beamer} overlays using the \texttt{<} and \texttt{>} characters.
+% \item Added options \texttt{breakindentnchars}, \texttt{breaksymbolsepleftnchars} (alias \texttt{breaksymbolsepnchars}), \texttt{breaksymbolseprightnchars}, \texttt{breaksymbolindentleftnchars} (alias \texttt{breaksymbolindentnchars}), and \texttt{breaksymbolindentrightnchars}.  These are identical to the pre-existing options without the \texttt{nchars} suffix, except that they allow indentation to be specified as an integer number of characters rather than as a dimension.  As a result of these new options, \texttt{\string\settowidth} is no longer used in the preamble, resolving some font incompatibilities (\#4).
+% \item Clarified in the docs that \texttt{breaksymbolsepright} is a \emph{minimum}, rather than exact, distance.
+% \end{changelog}
+%
+%
 % \begin{changelog}{v1.2.1}{2016/09/02}
 % \item The package is now compatible with classes and packages that redefine \texttt{\string\raggedright}.
 % \item Fixed a bug that introduced extra space in inline contexts such as \texttt{\string\mintinline} when \texttt{breaklines=true} (\#3).
@@ -318,6 +329,12 @@
 %
 % \begin{optionlist}
 %
+% \item[beameroverlays (boolean) (false)]
+% Give the |<| and |>| characters their normal text meanings, so that \pkg{beamer} overlays of the form |\only<1>{...}| will work.  Note that something like |commandchars=\\\{\}| is required separately to enable macros.  This is not incorporated in the |beameroverlays| option because essentially arbitrary command characters could be used; only the |<| and |>| characters are hard-coded for overlays.
+%
+% With some font encodings and language settings, |beameroverlays| prevents literal (non-overlay) |<| and |>| characters from appearing correctly, so they must be inserted using commands.
+%
+%
 % \item[curlyquotes (boolean) (false)]
 % Unlike \fancyvrb, \pkg{fvextra} requires the \pkg{upquote} package, so the backtick (\texttt{\textasciigrave}) and typewriter single quotation mark (\texttt{\textquotesingle}) always appear literally by default, instead of becoming the left and right curly single quotation marks (\texttt{`'}).  This option allows these characters to be replaced by the curly quotation marks when that is desirable.
 %
@@ -616,10 +633,13 @@
 % The symbol inserted post-break for breaks inserted by |breakbefore|.
 %
 %
-% \item[breakindent (dimension) (0pt)]
+% \item[breakindent (dimension) (breakindentnchars)]
 % When a line is broken, indent the continuation lines by this amount.  When |breakautoindent| and |breakindent| are used together, the indentations add.  This  indentation is combined with |breaksymbolindentleft| to give the total actual left indentation.
 %
+% \item[breakindentnchars (integer) (0)]
+% This allows |breakindent| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
 %
+%
 % \item[breaklines (boolean) (false)]
 % Automatically break long lines.
 %
@@ -678,36 +698,45 @@
 % The symbol used at breaks (right) when |breaklines=true|. Does not appear at the end of the very last segment of a broken line.
 %
 %
-% \item[breaksymbolindent (dimension) (breaksymbolindentleft)]
+% \item[breaksymbolindent (dimension) (breaksymbolindentleftnchars)]
 % Alias for |breaksymbolindentleft|.
 %
+% \item[breaksymbolindentnchars (integer) (breaksymbolindentleftnchars)]
+% Alias for |breaksymbolindentleftnchars|.
 %
-% \item[breaksymbolindentleft (dimension) (\meta{width of 4 characters in teletype font at default point size})]
+%
+% \item[breaksymbolindentleft (dimension) (breaksymbolindentleftnchars)]
 % The extra left indentation that is provided to make room for |breaksymbolleft|.  This indentation is only applied when there is a |breaksymbolleft|.
 %
-%     This may be set to the width of a specific number of (fixed-width) characters by using an approach such as 
-% \begin{Verbatim}[gobble=2]
-% \newdimen\temporarydimen
-% \settowidth{\temporarydimen}{\ttfamily aaaa}
-% \end{Verbatim}
-% and then using |breaksymbolindentleft=\temporarydimen|.
+% \item[breaksymbolindentleftnchars (integer) (4)]
+% This allows |breaksymbolindentleft| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
 %
-%
-% \item[breaksymbolindentright (dimension) (\meta{width of 4 characters in teletype font at default point size})]
+% \item[breaksymbolindentright (dimension) (breaksymbolindentrightnchars)]
 % The extra right indentation that is provided to make room for |breaksymbolright|.  This indentation is only applied when there is a |breaksymbolright|.
 %
+% \item[breaksymbolindentrightnchars (integer) (4)]
+% This allows |breaksymbolindentright| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
 %
-% \item[breaksymbolsep (dimension) (breaksymbolsepleft)]
+%
+% \item[breaksymbolsep (dimension) (breaksymbolsepleftnchars)]
 % Alias for |breaksymbolsepleft|.
 %
+% \item[breaksymbolsepnchars (integer) (breaksymbolsepleftnchars)]
+% Alias for |breaksymbolsepleftnchars|.
 %
-% \item[breaksymbolsepleft (dimension) (1em)]
+%
+% \item[breaksymbolsepleft (dimension) (breaksymbolsepleftnchars)]
 % The separation between the |breaksymbolleft| and the adjacent text. 
 %
+% \item[breaksymbolsepleftnchars (integer) (2)]
+% Allows |breaksymbolsepleft| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
 %
-% \item[breaksymbolsepright (dimension) (1em)]
-% The separation between the |breaksymbolright| and the adjacent text.
+% \item[breaksymbolsepright (dimension) (breaksymbolseprightnchars)]
+% The \emph{minimum} separation between the |breaksymbolright| and the adjacent text.  This is the separation between |breaksymbolright| and the furthest extent to which adjacent text could reach.  In practice, |\linewidth| will typically not be an exact integer multiple of the character width (assuming a fixed-width font), so the actual separation between the |breaksymbolright| and adjacent text will generally be larger than |breaksymbolsepright|.  This ensures that break symbols have the same spacing from the margins on both left and right.  If the same spacing from text is desired instead, |breaksymbolsepright| may be adjusted.  (See the definition of |\FV at makeLineNumber| for implementation details.)
 %
+% \item[breaksymbolseprightnchars (integer) (2)]
+% Allows |breaksymbolsepright| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
+%
 % \end{optionlist}
 %
 %
@@ -1115,21 +1144,24 @@
 % \subsection{Hooks}
 %
 %
-% \begin{macro}{\FV at FormattingPrepHook}
-% This is a hook for extending |\FV at FormattingPrep|.  |\FV at FormattingPrep| is inside a group, before the beginning of processing, so it is a good place to add extension code.  This hook is used for such things as tweaking math mode behavior and preparing for |breakbefore| and |breakafter|.
+% \begin{macro}{\FV at FormattingPrep@PreHook}
+% \begin{macro}{\FV at FormattingPrep@PostHook}
+% These are hooks for extending |\FV at FormattingPrep|.  |\FV at FormattingPrep| is inside a group, before the beginning of processing, so it is a good place to add extension code.  These hooks are used for such things as tweaking math mode behavior and preparing for |breakbefore| and |breakafter|.  The |PreHook| should typically be used, unless \pkg{fancyvrb}'s font settings, whitespace setup, and active character definitions are needed for extension code.
 %    \begin{macrocode}
-\let\FV at FormattingPrepHook\@empty
+\let\FV at FormattingPrep@PreHook\@empty
+\let\FV at FormattingPrep@PostHook\@empty
 \expandafter\def\expandafter\FV at FormattingPrep\expandafter{%
-  \expandafter\FV at FormattingPrepHook\FV at FormattingPrep}
+  \expandafter\FV at FormattingPrep@PreHook\FV at FormattingPrep\FV at FormattingPrep@PostHook}
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 %
 % \begin{macro}{\FV at PygmentsHook}
-% This is a hook for turning on Pygments-related features for packages like \pkg{minted} and \pkg{pythontex} (\cref{sec:impl:pygments}).  It needs to be the first thing in |\FV at FormattingPrepHook|, since it will potentially affect some of the later things in the hook.  It is activated by |\VerbatimPygments|.
+% This is a hook for turning on Pygments-related features for packages like \pkg{minted} and \pkg{pythontex} (\cref{sec:impl:pygments}).  It needs to be the first thing in |\FV at FormattingPrep@PreHook|, since it will potentially affect some of the later things in the hook.  It is activated by |\VerbatimPygments|.
 %    \begin{macrocode}
 \let\FV at PygmentsHook\relax
-\g at addto@macro\FV at FormattingPrepHook{\FV at PygmentsHook}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at PygmentsHook}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1385,7 +1417,7 @@
 %    \begin{macrocode}
 \def\FV at SetupMathSpace{%
   \everymath\expandafter{\the\everymath\let\FV at Space\FancyVerbMathSpace}}
-\g at addto@macro\FV at FormattingPrepHook{\FV at SetupMathSpace}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at SetupMathSpace}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1420,7 +1452,7 @@
 %    \begin{macrocode}
 \def\FV at SetupMathFont{%
   \everymath\expandafter{\the\everymath\fontfamily{\familydefault}\selectfont}}
-\g at addto@macro\FV at FormattingPrepHook{\FV at SetupMathFont}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at SetupMathFont}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1444,7 +1476,7 @@
     \begingroup\lccode`\~=`\-\lowercase{\endgroup\def~}{-}%
   }%
 }
-\g at addto@macro\FV at FormattingPrepHook{\FV at SetupMathLigs}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at SetupMathLigs}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1594,6 +1626,21 @@
 % \end{macro}
 %
 %
+% \begin{macro}{beameroverlays}
+% Give |<| and |>| their normal catcodes (not |\active|), so that \pkg{beamer} overlays will work.  This modifies |\@noligs| because that is the only way to prevent the settings from being overwritten later.  This could have used |\FV at CatCodesHook|, but then it would have had to compare |\@noligs| to |\relax| to avoid issues when |\let\@noligs\relax| in |VerbatimOut|.
+%    \begin{macrocode}
+\define at booleankey{FV}{beameroverlays}%
+ {\let\FancyVerbBeamerOverlays\FV at BeamerOverlays}%
+ {\let\FancyVerbBeamerOverlays\relax}
+\def\FV at BeamerOverlays{%
+  \expandafter\def\expandafter\@noligs\expandafter{\@noligs
+    \catcode`\<=12\catcode`\>=12\relax}}
+\FV at AddToHook\FV at FormattingPrep@PreHook\FancyVerbBeamerOverlays
+\fvset{beameroverlays=false}
+%    \end{macrocode}
+% \end{macro}
+%
+%
 % \begin{macro}{curlyquotes}
 % Let \texttt{\textasciigrave} and \texttt{\textquotesingle} produce curly quotation marks \texttt{`} and \texttt{'} rather than the backtick and typewriter single quotation mark produced by default via \pkg{upquote}.
 %    \begin{macrocode}
@@ -1607,7 +1654,7 @@
       \begingroup\lccode`\~=`\`\lowercase{\endgroup\def~}{`}%
       \begingroup\lccode`\~=`\'\lowercase{\endgroup\def~}{'}}}%
    {}}
-\g at addto@macro\FV at FormattingPrepHook{\FancyVerbCurlyQuotes}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FancyVerbCurlyQuotes}
 \fvset{curlyquotes=false}
 %    \end{macrocode}
 % \end{macro}
@@ -2048,7 +2095,7 @@
     \stepcounter{FV at HighlightLinesStart}%
     \expandafter\FV at HighlightLinesParse@Range at Loop
   \fi}
-\g at addto@macro\FV at FormattingPrepHook{\FV at HighlightLinesPrep}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at HighlightLinesPrep}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2063,6 +2110,31 @@
 % \subsubsection{Options and associated macros}
 % Begin by defining keys, with associated macros, bools, and dimens.
 %
+% \begin{macro}{\FV at SetToWidthNChars}
+% Set a dimen to the width of a given number of characters.  This is used in setting several indentation-related dimensions.
+%    \begin{macrocode}
+\newcount\FV at LoopCount
+\newbox\FV at NCharsBox
+\def\FV at SetToWidthNChars#1#2{%
+  \FV at LoopCount=#2\relax
+  \ifnum\FV at LoopCount>0
+    \def\FV at NChars{}%
+    \loop
+    \ifnum\FV at LoopCount>0
+      \expandafter\def\expandafter\FV at NChars\expandafter{\FV at NChars x}%
+    \fi
+    \advance\FV at LoopCount by -1
+    \ifnum\FV at LoopCount>0
+    \repeat
+    \setbox\FV at NCharsBox\hbox{\FV at NChars}%
+    #1=\wd\FV at NCharsBox
+  \else
+    #1=0pt\relax
+  \fi
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{FV at BreakLines}
 % Turn line breaking on or off.  The |\FV at ListProcessLine| from \fancyvrb\ is |\let| to a (patched) version of the original or a version that supports line breaks.
 %    \begin{macrocode}
@@ -2076,15 +2148,39 @@
 %    \end{macrocode}
 % \end{macro}
 %
+%
+% \begin{macro}{\FV at BreakLinesIndentationHook}
+% A hook for performing on-the-fly indentation calculations when |breaklines=true|.  This is used for all |*NChars| related indentation.  It is important to use |\FV at FormattingPrep@PostHook| because it is always invoked \emph{after} any font-related settings.
+%    \begin{macrocode}
+\def\FV at BreakLinesIndentationHook{}
+\g at addto@macro\FV at FormattingPrep@PostHook{%
+  \ifFV at BreakLines
+    \FV at BreakLinesIndentationHook
+  \fi}
+%    \end{macrocode}
+% \end{macro}
+%
+%
 % \begin{macro}{\FV at BreakIndent}
-% Indentation of continuation lines.
+% \begin{macro}{\FV at BreakIndentNChars}
+% Indentation of continuation lines. 
 %    \begin{macrocode}
 \newdimen\FV at BreakIndent
-\define at key{FV}{breakindent}{\FV at BreakIndent=#1\relax}
-\fvset{breakindent=0pt}
+\newcount\FV at BreakIndentNChars
+\define at key{FV}{breakindent}{%
+  \FV at BreakIndent=#1\relax
+  \FV at BreakIndentNChars=0\relax}
+\define at key{FV}{breakindentnchars}{\FV at BreakIndentNChars=#1\relax}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakIndentNChars>0
+    \FV at SetToWidthNChars{\FV at BreakIndent}{\FV at BreakIndentNChars}%
+  \fi}
+\fvset{breakindentnchars=0}
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
+%
 % \begin{macro}{FV at BreakAutoIndent}
 % Auto indentation of continuation lines to indentation of original line.  Adds to |\FV at BreakIndent|.
 %    \begin{macrocode}
@@ -2114,44 +2210,89 @@
 %
 % 
 % \begin{macro}{\FV at BreakSymbolSepLeft}
+% \begin{macro}{\FV at BreakSymbolSepLeftNChars}
 % Separation of left break symbol from the text.
 %    \begin{macrocode}
 \newdimen\FV at BreakSymbolSepLeft
-\define at key{FV}{breaksymbolsepleft}{\FV at BreakSymbolSepLeft=#1\relax}
+\newcount\FV at BreakSymbolSepLeftNChars
+\define at key{FV}{breaksymbolsepleft}{%
+  \FV at BreakSymbolSepLeft=#1\relax
+  \FV at BreakSymbolSepLeftNChars=0\relax}
 \define at key{FV}{breaksymbolsep}{\fvset{breaksymbolsepleft=#1}}
-\fvset{breaksymbolsepleft=1em}
+\define at key{FV}{breaksymbolsepleftnchars}{\FV at BreakSymbolSepLeftNChars=#1\relax}
+\define at key{FV}{breaksymbolsepnchars}{\fvset{breaksymbolsepleftnchars=#1}}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakSymbolSepLeftNChars>0
+    \FV at SetToWidthNChars{\FV at BreakSymbolSepLeft}{\FV at BreakSymbolSepLeftNChars}%
+  \fi}
+\fvset{breaksymbolsepleftnchars=2}
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
+%
 % \begin{macro}{\FV at BreakSymbolSepRight}
+% \begin{macro}{\FV at BreakSymbolSepRightNChars}
 % Separation of right break symbol from the text.
 %    \begin{macrocode}
 \newdimen\FV at BreakSymbolSepRight
-\define at key{FV}{breaksymbolsepright}{\FV at BreakSymbolSepRight=#1\relax}
-\fvset{breaksymbolsepright=1em}
+\newcount\FV at BreakSymbolSepRightNChars
+\define at key{FV}{breaksymbolsepright}{%
+  \FV at BreakSymbolSepRight=#1\relax
+  \FV at BreakSymbolSepRightNChars=0\relax}
+\define at key{FV}{breaksymbolseprightnchars}{\FV at BreakSymbolSepRightNChars=#1\relax}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakSymbolSepRightNChars>0
+    \FV at SetToWidthNChars{\FV at BreakSymbolSepRight}{\FV at BreakSymbolSepRightNChars}%
+  \fi}
+\fvset{breaksymbolseprightnchars=2}
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 %
 % \begin{macro}{\FV at BreakSymbolIndentLeft}
+% \begin{macro}{\FV at BreakSymbolIndentLeftNChars}
 % Additional left indentation to make room for the left break symbol.
 %    \begin{macrocode}
 \newdimen\FV at BreakSymbolIndentLeft
-\settowidth{\FV at BreakSymbolIndentLeft}{\ttfamily xxxx}
-\define at key{FV}{breaksymbolindentleft}{\FV at BreakSymbolIndentLeft=#1\relax}
+\newcount\FV at BreakSymbolIndentLeftNChars
+\define at key{FV}{breaksymbolindentleft}{%
+  \FV at BreakSymbolIndentLeft=#1\relax
+  \FV at BreakSymbolIndentLeftNChars=0\relax}
 \define at key{FV}{breaksymbolindent}{\fvset{breaksymbolindentleft=#1}}
+\define at key{FV}{breaksymbolindentleftnchars}{\FV at BreakSymbolIndentLeftNChars=#1\relax}
+\define at key{FV}{breaksymbolindentnchars}{\fvset{breaksymbolindentleftnchars=#1}}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakSymbolIndentLeftNChars>0
+    \FV at SetToWidthNChars{\FV at BreakSymbolIndentLeft}{\FV at BreakSymbolIndentLeftNChars}%
+  \fi}
+\fvset{breaksymbolindentleftnchars=4}
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
+%
 % \begin{macro}{\FV at BreakSymbolIndentRight}
+% \begin{macro}{\FV at BreakSymbolIndentRightNChars}
 % Additional right indentation to make room for the right break symbol.
 %    \begin{macrocode}
 \newdimen\FV at BreakSymbolIndentRight
-\settowidth{\FV at BreakSymbolIndentRight}{\ttfamily xxxx}
-\define at key{FV}{breaksymbolindentright}{\FV at BreakSymbolIndentRight=#1\relax}
+\newcount\FV at BreakSymbolIndentRightNChars
+\define at key{FV}{breaksymbolindentright}{%
+  \FV at BreakSymbolIndentRight=#1\relax
+  \FV at BreakSymbolIndentRightNChars=0\relax}
+\define at key{FV}{breaksymbolindentrightnchars}{\FV at BreakSymbolIndentRightNChars=#1\relax}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakSymbolIndentRightNChars>0
+    \FV at SetToWidthNChars{\FV at BreakSymbolIndentRight}{\FV at BreakSymbolIndentRightNChars}%
+  \fi}
+\fvset{breaksymbolindentrightnchars=4}
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
+%
 % We need macros that contain the logic for typesetting the break symbols.  By default, the symbol macros contain everything regarding the symbol and its typesetting, while these macros contain pure logic.  The symbols should be wrapped in braces so that formatting commands (for example, |\tiny|) don't escape.
 % \begin{macro}{\FancyVerbBreakSymbolLeftLogic}
 % The left break symbol should only appear with continuation lines.  Note that |linenumber| here refers to local line numbering for the broken line, \emph{not} line numbering for all lines in the environment being typeset.
@@ -2252,7 +2393,7 @@
 % \end{macro}
 %
 % \begin{macro}{\FV at BreakBeforePrep}
-% We need a way to break before characters if and only if they have been specified as breaking characters.  It would be possible to do that via a nested conditional, but that would be messy.  It is much simpler to create an empty macro whose name contains the character, and test for the existence of this macro.  This needs to be done inside a |\begingroup...\endgroup| so that the macros do not have to be cleaned up manually.  A good place to do this is in |\FV at FormattingPrep|, which is inside a group and before processing starts.  The macro is added to |\FV at FormattingPrepHook|, which contains \fvextra\ exntensions to |\FV at FormattingPrep|, after |\FV at BreakAfterPrep| is defined below.
+% We need a way to break before characters if and only if they have been specified as breaking characters.  It would be possible to do that via a nested conditional, but that would be messy.  It is much simpler to create an empty macro whose name contains the character, and test for the existence of this macro.  This needs to be done inside a |\begingroup...\endgroup| so that the macros do not have to be cleaned up manually.  A good place to do this is in |\FV at FormattingPrep|, which is inside a group and before processing starts.  The macro is added to |\FV at FormattingPrep@PreHook|, which contains \fvextra\ exntensions to |\FV at FormattingPrep|, after |\FV at BreakAfterPrep| is defined below.
 %
 % The procedure here is a bit roundabout.  We need to use |\FV at EscChars| to handle character escapes, but the character redefinitions need to be kept local, requiring that we work within a |\begingroup...\endgroup|.  So we loop through the breaking tokens and assemble a macro that will itself define character macros.  Only this defining macro is declared global, and it contains \emph{expanded} characters so that there is no longer any dependence on |\FV at EscChars|.
 %
@@ -2360,9 +2501,9 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% Now that |\FV at BreakBeforePrep| and |\FV at BreakAfterPrep| are defined, add them to |\FV at FormattingPrepHook|, which is the \fvextra\ extension to |\FV at FormattingPrep|.  The ordering here is important, since |\FV at BreakAfterPrep| contains compatibility checks with |\FV at BreakBeforePrep|, and thus must be used after it.  Also, we have to check for the pdfTeX engine with \pkg{inputenc} using UTF-8, and use the |UTF| macros instead when that is the case.
+% Now that |\FV at BreakBeforePrep| and |\FV at BreakAfterPrep| are defined, add them to |\FV at FormattingPrep@PreHook|, which is the \fvextra\ extension to |\FV at FormattingPrep|.  The ordering here is important, since |\FV at BreakAfterPrep| contains compatibility checks with |\FV at BreakBeforePrep|, and thus must be used after it.  Also, we have to check for the pdfTeX engine with \pkg{inputenc} using UTF-8, and use the |UTF| macros instead when that is the case.
 %    \begin{macrocode}
-\g at addto@macro\FV at FormattingPrepHook{%
+\g at addto@macro\FV at FormattingPrep@PreHook{%
   \ifcsname pdfmatch\endcsname
   \ifx\pdfmatch\relax
   \else
@@ -2835,7 +2976,7 @@
 %
 %
 % \begin{macro}{\FV at BreakBeforePrep@UTF}
-% We need |UTF| variants of the |breakbefore| and |breakafter| prep macros.  These are only ever used with \pkg{inputenc} with UTF-8.  There is no need for encoding checks here; checks are performed in |\FV at FormattingPrepHook| (checks are inserted into it after the non-|UTF| macro definitions).
+% We need |UTF| variants of the |breakbefore| and |breakafter| prep macros.  These are only ever used with \pkg{inputenc} with UTF-8.  There is no need for encoding checks here; checks are performed in |\FV at FormattingPrep@PreHook| (checks are inserted into it after the non-|UTF| macro definitions).
 %    \begin{macrocode}
 \def\FV at BreakBeforePrep@UTF{%
   \ifx\FV at BreakBefore\@empty\relax
@@ -3371,7 +3512,7 @@
 %
 %
 % \begin{macro}{\VerbatimPygments}
-% This is the command that activates Pygments features.  It must be invoked before \verb|\begin{Verbatim}|, etc., but inside a |\begingroup...\endgroup| so that its effects do not escape into the rest of the document (for example, within the beginning of an environment.  It takes two arguments:  The Pygments macro that literally appears (|\PYG| for \pkg{minted} and \pkg{pythontex}), and the Pygments macro that should actually be used (|\PYG|\meta{style\_name} for \pkg{minted} and \pkg{pythontex}).  The two are distinguished because it can be convenient to highlight everything using the same literal macro name, and then |\let| it to appropriate values to change styles, rather than redoing all highlighting to change styles.  It modifies |\FV at PygmentsHook|, which is at the beginning of |\FV at FormattingPrepHook|, to make the actual changes at the appropriate time.
+% This is the command that activates Pygments features.  It must be invoked before \verb|\begin{Verbatim}|, etc., but inside a |\begingroup...\endgroup| so that its effects do not escape into the rest of the document (for example, within the beginning of an environment.  It takes two arguments:  The Pygments macro that literally appears (|\PYG| for \pkg{minted} and \pkg{pythontex}), and the Pygments macro that should actually be used (|\PYG|\meta{style\_name} for \pkg{minted} and \pkg{pythontex}).  The two are distinguished because it can be convenient to highlight everything using the same literal macro name, and then |\let| it to appropriate values to change styles, rather than redoing all highlighting to change styles.  It modifies |\FV at PygmentsHook|, which is at the beginning of |\FV at FormattingPrep@PreHook|, to make the actual changes at the appropriate time.
 %    \begin{macrocode}
 \def\VerbatimPygments#1#2{%
   \def\FV at PygmentsHook{\FV at VerbatimPygments{#1}{#2}}}

Modified: trunk/Master/texmf-dist/source/latex/fvextra/fvextra.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/fvextra/fvextra.ins	2017-07-13 23:09:07 UTC (rev 44786)
+++ trunk/Master/texmf-dist/source/latex/fvextra/fvextra.ins	2017-07-13 23:09:20 UTC (rev 44787)
@@ -1,4 +1,4 @@
-%% Copyright (C) 2016 by Geoffrey M. Poore <gpoore at gmail.com>
+%% Copyright (C) 2016-2017 by Geoffrey M. Poore <gpoore at gmail.com>
 %% --------------------------------------------------------------------------
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3
@@ -25,7 +25,7 @@
 
 This is a generated file.
 
-Copyright (C) 2016 by Geoffrey M. Poore <gpoore at gmail.com>
+Copyright (C) 2016-2017 by Geoffrey M. Poore <gpoore at gmail.com>
 --------------------------------------------------------------------------
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/fvextra/fvextra.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fvextra/fvextra.sty	2017-07-13 23:09:07 UTC (rev 44786)
+++ trunk/Master/texmf-dist/tex/latex/fvextra/fvextra.sty	2017-07-13 23:09:20 UTC (rev 44787)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2016 by Geoffrey M. Poore <gpoore at gmail.com>
+%% Copyright (C) 2016-2017 by Geoffrey M. Poore <gpoore at gmail.com>
 %% --------------------------------------------------------------------------
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3
@@ -20,7 +20,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{fvextra}
-    [2016/09/02 v1.2.1 fvextra - extensions and patches for fancyvrb]
+    [2017/07/08 v1.3.1 fvextra - extensions and patches for fancyvrb]
 \RequirePackage{ifthen}
 \RequirePackage{etoolbox}
 \RequirePackage{fancyvrb}
@@ -37,11 +37,12 @@
   to avoid a warning from the lineno package}}{}
 \def\FV at Space@ifx{\FV at Space}
 \def\FV at Tab@ifx{\FV at Tab}
-\let\FV at FormattingPrepHook\@empty
+\let\FV at FormattingPrep@PreHook\@empty
+\let\FV at FormattingPrep@PostHook\@empty
 \expandafter\def\expandafter\FV at FormattingPrep\expandafter{%
-  \expandafter\FV at FormattingPrepHook\FV at FormattingPrep}
+  \expandafter\FV at FormattingPrep@PreHook\FV at FormattingPrep\FV at FormattingPrep@PostHook}
 \let\FV at PygmentsHook\relax
-\g at addto@macro\FV at FormattingPrepHook{\FV at PygmentsHook}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at PygmentsHook}
 \edef\FV at hashchar{\string#}
 \edef\FV at dollarchar{\string$}
 \edef\FV at ampchar{\string&}
@@ -151,7 +152,7 @@
 \def\FancyVerbMathSpace{ }
 \def\FV at SetupMathSpace{%
   \everymath\expandafter{\the\everymath\let\FV at Space\FancyVerbMathSpace}}
-\g at addto@macro\FV at FormattingPrepHook{\FV at SetupMathSpace}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at SetupMathSpace}
 \begingroup
 \catcode`\'=\active
 \catcode`\^=7
@@ -168,7 +169,7 @@
 \endgroup
 \def\FV at SetupMathFont{%
   \everymath\expandafter{\the\everymath\fontfamily{\familydefault}\selectfont}}
-\g at addto@macro\FV at FormattingPrepHook{\FV at SetupMathFont}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at SetupMathFont}
 \def\FV at SetupMathLigs{%
   \everymath\expandafter{%
     \the\everymath
@@ -182,7 +183,7 @@
     \begingroup\lccode`\~=`\-\lowercase{\endgroup\def~}{-}%
   }%
 }
-\g at addto@macro\FV at FormattingPrepHook{\FV at SetupMathLigs}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at SetupMathLigs}
 \def\FV at BeginListFrame@Lines{%
   \begingroup
   \lineskip\z at skip
@@ -252,6 +253,14 @@
 \def\FV at MathEscape{\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}
 \FV at AddToHook\FV at CatCodesHook\FancyVerbMathEscape
 \fvset{mathescape=false}
+\define at booleankey{FV}{beameroverlays}%
+ {\let\FancyVerbBeamerOverlays\FV at BeamerOverlays}%
+ {\let\FancyVerbBeamerOverlays\relax}
+\def\FV at BeamerOverlays{%
+  \expandafter\def\expandafter\@noligs\expandafter{\@noligs
+    \catcode`\<=12\catcode`\>=12\relax}}
+\FV at AddToHook\FV at FormattingPrep@PreHook\FancyVerbBeamerOverlays
+\fvset{beameroverlays=false}
 \newbool{FV at CurlyQuotes}
 \define at booleankey{FV}{curlyquotes}%
  {\booltrue{FV at CurlyQuotes}}%
@@ -262,7 +271,7 @@
       \begingroup\lccode`\~=`\`\lowercase{\endgroup\def~}{`}%
       \begingroup\lccode`\~=`\'\lowercase{\endgroup\def~}{'}}}%
    {}}
-\g at addto@macro\FV at FormattingPrepHook{\FancyVerbCurlyQuotes}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FancyVerbCurlyQuotes}
 \fvset{curlyquotes=false}
 \def\FancyVerbFormatLine#1{#1}
 \def\FancyVerbFormatText#1{#1}
@@ -531,7 +540,26 @@
     \stepcounter{FV at HighlightLinesStart}%
     \expandafter\FV at HighlightLinesParse@Range at Loop
   \fi}
-\g at addto@macro\FV at FormattingPrepHook{\FV at HighlightLinesPrep}
+\g at addto@macro\FV at FormattingPrep@PreHook{\FV at HighlightLinesPrep}
+\newcount\FV at LoopCount
+\newbox\FV at NCharsBox
+\def\FV at SetToWidthNChars#1#2{%
+  \FV at LoopCount=#2\relax
+  \ifnum\FV at LoopCount>0
+    \def\FV at NChars{}%
+    \loop
+    \ifnum\FV at LoopCount>0
+      \expandafter\def\expandafter\FV at NChars\expandafter{\FV at NChars x}%
+    \fi
+    \advance\FV at LoopCount by -1
+    \ifnum\FV at LoopCount>0
+    \repeat
+    \setbox\FV at NCharsBox\hbox{\FV at NChars}%
+    #1=\wd\FV at NCharsBox
+  \else
+    #1=0pt\relax
+  \fi
+}
 \newboolean{FV at BreakLines}
 \define at booleankey{FV}{breaklines}%
   {\FV at BreakLinestrue
@@ -539,9 +567,22 @@
   {\FV at BreakLinesfalse
     \let\FV at ListProcessLine\FV at ListProcessLine@NoBreak}
 \AtEndOfPackage{\fvset{breaklines=false}}
+\def\FV at BreakLinesIndentationHook{}
+\g at addto@macro\FV at FormattingPrep@PostHook{%
+  \ifFV at BreakLines
+    \FV at BreakLinesIndentationHook
+  \fi}
 \newdimen\FV at BreakIndent
-\define at key{FV}{breakindent}{\FV at BreakIndent=#1\relax}
-\fvset{breakindent=0pt}
+\newcount\FV at BreakIndentNChars
+\define at key{FV}{breakindent}{%
+  \FV at BreakIndent=#1\relax
+  \FV at BreakIndentNChars=0\relax}
+\define at key{FV}{breakindentnchars}{\FV at BreakIndentNChars=#1\relax}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakIndentNChars>0
+    \FV at SetToWidthNChars{\FV at BreakIndent}{\FV at BreakIndentNChars}%
+  \fi}
+\fvset{breakindentnchars=0}
 \newboolean{FV at BreakAutoIndent}
 \define at booleankey{FV}{breakautoindent}%
   {\FV at BreakAutoIndenttrue}{\FV at BreakAutoIndentfalse}
@@ -552,19 +593,53 @@
 \define at key{FV}{breaksymbolright}{\def\FancyVerbBreakSymbolRight{#1}}
 \fvset{breaksymbolright={}}
 \newdimen\FV at BreakSymbolSepLeft
-\define at key{FV}{breaksymbolsepleft}{\FV at BreakSymbolSepLeft=#1\relax}
+\newcount\FV at BreakSymbolSepLeftNChars
+\define at key{FV}{breaksymbolsepleft}{%
+  \FV at BreakSymbolSepLeft=#1\relax
+  \FV at BreakSymbolSepLeftNChars=0\relax}
 \define at key{FV}{breaksymbolsep}{\fvset{breaksymbolsepleft=#1}}
-\fvset{breaksymbolsepleft=1em}
+\define at key{FV}{breaksymbolsepleftnchars}{\FV at BreakSymbolSepLeftNChars=#1\relax}
+\define at key{FV}{breaksymbolsepnchars}{\fvset{breaksymbolsepleftnchars=#1}}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakSymbolSepLeftNChars>0
+    \FV at SetToWidthNChars{\FV at BreakSymbolSepLeft}{\FV at BreakSymbolSepLeftNChars}%
+  \fi}
+\fvset{breaksymbolsepleftnchars=2}
 \newdimen\FV at BreakSymbolSepRight
-\define at key{FV}{breaksymbolsepright}{\FV at BreakSymbolSepRight=#1\relax}
-\fvset{breaksymbolsepright=1em}
+\newcount\FV at BreakSymbolSepRightNChars
+\define at key{FV}{breaksymbolsepright}{%
+  \FV at BreakSymbolSepRight=#1\relax
+  \FV at BreakSymbolSepRightNChars=0\relax}
+\define at key{FV}{breaksymbolseprightnchars}{\FV at BreakSymbolSepRightNChars=#1\relax}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakSymbolSepRightNChars>0
+    \FV at SetToWidthNChars{\FV at BreakSymbolSepRight}{\FV at BreakSymbolSepRightNChars}%
+  \fi}
+\fvset{breaksymbolseprightnchars=2}
 \newdimen\FV at BreakSymbolIndentLeft
-\settowidth{\FV at BreakSymbolIndentLeft}{\ttfamily xxxx}
-\define at key{FV}{breaksymbolindentleft}{\FV at BreakSymbolIndentLeft=#1\relax}
+\newcount\FV at BreakSymbolIndentLeftNChars
+\define at key{FV}{breaksymbolindentleft}{%
+  \FV at BreakSymbolIndentLeft=#1\relax
+  \FV at BreakSymbolIndentLeftNChars=0\relax}
 \define at key{FV}{breaksymbolindent}{\fvset{breaksymbolindentleft=#1}}
+\define at key{FV}{breaksymbolindentleftnchars}{\FV at BreakSymbolIndentLeftNChars=#1\relax}
+\define at key{FV}{breaksymbolindentnchars}{\fvset{breaksymbolindentleftnchars=#1}}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakSymbolIndentLeftNChars>0
+    \FV at SetToWidthNChars{\FV at BreakSymbolIndentLeft}{\FV at BreakSymbolIndentLeftNChars}%
+  \fi}
+\fvset{breaksymbolindentleftnchars=4}
 \newdimen\FV at BreakSymbolIndentRight
-\settowidth{\FV at BreakSymbolIndentRight}{\ttfamily xxxx}
-\define at key{FV}{breaksymbolindentright}{\FV at BreakSymbolIndentRight=#1\relax}
+\newcount\FV at BreakSymbolIndentRightNChars
+\define at key{FV}{breaksymbolindentright}{%
+  \FV at BreakSymbolIndentRight=#1\relax
+  \FV at BreakSymbolIndentRightNChars=0\relax}
+\define at key{FV}{breaksymbolindentrightnchars}{\FV at BreakSymbolIndentRightNChars=#1\relax}
+\g at addto@macro\FV at BreakLinesIndentationHook{%
+  \ifnum\FV at BreakSymbolIndentRightNChars>0
+    \FV at SetToWidthNChars{\FV at BreakSymbolIndentRight}{\FV at BreakSymbolIndentRightNChars}%
+  \fi}
+\fvset{breaksymbolindentrightnchars=4}
 \newcommand{\FancyVerbBreakSymbolLeftLogic}[1]{%
   \ifnum\value{linenumber}=1\relax\else{#1}\fi}
 \newcounter{FancyVerbLineBreakLast}
@@ -678,7 +753,7 @@
   \fi
 }
 \let\FV at BreakAfterPrep@PygmentsHook\relax
-\g at addto@macro\FV at FormattingPrepHook{%
+\g at addto@macro\FV at FormattingPrep@PreHook{%
   \ifcsname pdfmatch\endcsname
   \ifx\pdfmatch\relax
   \else



More information about the tex-live-commits mailing list