Merge commit '05c65163ecd0ce7bdb7c6807de683266b98e5b28'

This commit is contained in:
Takeshi KOMIYA
2020-07-05 01:28:15 +09:00
3 changed files with 64 additions and 9 deletions

44
CHANGES
View File

@@ -36,6 +36,50 @@ Bugs fixed
Testing
--------
Release 3.2.0 (in development)
==============================
Dependencies
------------
Incompatible changes
--------------------
Deprecated
----------
Features added
--------------
Bugs fixed
----------
* #7715: LaTeX: ``numfig_secnum_depth > 1`` leads to wrong figure links
Testing
--------
Release 3.1.2 (in development)
==============================
Dependencies
------------
Incompatible changes
--------------------
Deprecated
----------
Features added
--------------
Bugs fixed
----------
Testing
--------
Release 3.1.1 (released Jun 14, 2020)
=====================================

View File

@@ -215,12 +215,13 @@ class LiteralIncludeReader:
text = text.expandtabs(self.options['tab-width'])
return text.splitlines(True)
except OSError:
raise OSError(__('Include file %r not found or reading it failed') % filename)
except UnicodeError:
except OSError as exc:
raise OSError(__('Include file %r not found or reading it failed') %
filename) from exc
except UnicodeError as exc:
raise UnicodeError(__('Encoding %r used for reading included file %r seems to '
'be wrong, try giving an :encoding: option') %
(self.encoding, filename))
(self.encoding, filename)) from exc
def read(self, location: Tuple[str, int] = None) -> Tuple[str, int]:
if 'diff' in self.options:

View File

@@ -881,52 +881,62 @@
\g@addto@macro\spx@preBthefigure{\fi}}%
\fi
\ifnum\spx@opt@numfigreset>1
\AtBeginDocument{%
\@addtoreset{figure}{section}%
\@addtoreset{table}{section}%
\@addtoreset{literalblock}{section}%
\ifspx@opt@mathnumfig
\@addtoreset{equation}{section}%
\fi
\fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@section>\z@\arabic{section}.}%
\g@addto@macro\spx@preBthefigure{\fi}%
\fi
\ifnum\spx@opt@numfigreset>2
\AtBeginDocument{%
\@addtoreset{figure}{subsection}%
\@addtoreset{table}{subsection}%
\@addtoreset{literalblock}{subsection}%
\ifspx@opt@mathnumfig
\@addtoreset{equation}{subsection}%
\fi
\fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@subsection>\z@\arabic{subsection}.}%
\g@addto@macro\spx@preBthefigure{\fi}%
\fi
\ifnum\spx@opt@numfigreset>3
\AtBeginDocument{%
\@addtoreset{figure}{subsubsection}%
\@addtoreset{table}{subsubsection}%
\@addtoreset{literalblock}{subsubsection}%
\ifspx@opt@mathnumfig
\@addtoreset{equation}{subsubsection}%
\fi
\fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@subsubsection>\z@\arabic{subsubsection}.}%
\g@addto@macro\spx@preBthefigure{\fi}%
\fi
\ifnum\spx@opt@numfigreset>4
\AtBeginDocument{%
\@addtoreset{figure}{paragraph}%
\@addtoreset{table}{paragraph}%
\@addtoreset{literalblock}{paragraph}%
\ifspx@opt@mathnumfig
\@addtoreset{equation}{paragraph}%
\fi
\fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@subparagraph>\z@\arabic{subparagraph}.}%
\g@addto@macro\spx@preBthefigure{\fi}%
\fi
\ifnum\spx@opt@numfigreset>5
\AtBeginDocument{%
\@addtoreset{figure}{subparagraph}%
\@addtoreset{table}{subparagraph}%
\@addtoreset{literalblock}{subparagraph}%
\ifspx@opt@mathnumfig
\@addtoreset{equation}{subparagraph}%
\fi
\fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@subsubparagraph>\z@\arabic{subsubparagraph}.}%
\g@addto@macro\spx@preBthefigure{\fi}%
\fi