Commit Graph

420 Commits

Author SHA1 Message Date
Takeshi KOMIYA
e4e58a4f27 Close #10062: Change the default language to 'en'
Change the default language to `'en'` if any language is not set in
`conf.py`.
2022-01-12 02:45:52 +09:00
Takeshi KOMIYA
ce8039db1f Merge branch '4.x' 2022-01-01 20:04:19 +09:00
Takeshi KOMIYA
b84771dcd2 A happy new year! 2022-01-01 18:45:03 +09:00
jfbu
cc8e59e722 Merge branch 'master' into 9985_latex_on_master 2021-12-22 19:51:15 +01:00
jfbu
4235195e77 Fix a spelling typo in tests (s/änhlich/ähnlich) 2021-12-22 12:44:28 +01:00
jfbu
9e8e3f9a6e LaTeX: separate terms from their definitions by a CR (fix #9985) 2021-12-20 18:47:53 +01:00
David Ham
52aac40148 Update tests to match code changes. 2021-07-04 20:15:56 +01:00
David Ham
180c3c92a4 Test for LaTeX container output. 2021-05-15 21:53:36 +01:00
Takeshi KOMIYA
3937ea816f Fix #9009: LaTeX: "release" value with underscore leads to invalid LaTeX
The "release" variable is not escaped on the LaTeX output.
2021-03-17 01:24:03 +09:00
Takeshi KOMIYA
3059a999b2 Close #8326: Rename master_doc to root_doc
To describe the purpose more accurately, the `master_doc` is now renamed
to `root_doc`.  The old name is still available.  But it is recommeneded
to use new one from now on.
2021-02-28 17:10:57 +09:00
jfbu
b9c53c8ca6 Merge branch '3.x' into merge_3.x_into_master
Resolved Conflicts:
	sphinx/texinputs/sphinx.sty

Some hunks needed to go to sphinx/texinputs/sphinxlatexliterals.py,
others already belonged to split files.
2021-02-09 19:03:38 +01:00
jfbu
4a239bb886 Extra references to explicitly numbered footnote get page indication
To achieve this the simplest was to use also the \label/\ref mechanism
as for footnotes typeset using footnotetext. Removing the hack into
footnotehyper internal macro, we use an enriched scope, which will
enable references with same number to each generate correct links.
2021-02-06 22:00:47 +01:00
jfbu
6275a7756f Use \thesphinxscope mark-up (shorter, and may help trick for page scope) 2021-02-06 13:43:12 +01:00
jfbu
628c58abef Prepare for scope-limited footnote numbering 2021-02-06 10:45:50 +01:00
jfbu
a0b0a08e38 LaTeX footnotes from caption titles now hyperlinked in PDF
This is fifth item of #2616
2021-02-05 16:45:12 +01:00
jfbu
fbafb308b8 Merge branch '3.x' into master_with_merged_3.x 2021-02-02 18:01:55 +01:00
jfbu
7c7032dd05 Extend latex footnotes unit test 2021-02-02 00:10:45 +01:00
Takeshi KOMIYA
339ce2f894 Merge branch '3.x' 2021-01-30 11:49:08 +09:00
jfbu
d6e11b89e9 Fix suppression of needed whiteline, encapsulate into \sphinxAtStartPar
Define it to do nothing with lualatex engine
2021-01-29 10:40:50 +01:00
jfbu
185a2d27fe Fix #8780: long words in narrow columns may not be hyphenated
This is done by adding '\hskip0pt\relax\n' whenever a paragraph starts.
2021-01-29 00:24:44 +01:00
jfbu
99a8b7f37f LaTeX: update default font configuration
This replaces times package with tgtermes and tgheros (clones of Times and
Helvetica with better LaTeX support) and the monospace font from txfonts
package (txtt). This font is better matched with Times-like fonts than
Courier clones.

The changes applies to pdflatex/platex/uplatex.

Fixes: #8711
2021-01-20 23:03:08 +01:00
Takeshi KOMIYA
4b452338f9 Merge branch '3.x' 2021-01-01 13:57:19 +09:00
Takeshi KOMIYA
f996859420 A happy new year!
.. note::

   $ find sphinx tests LICENSE doc/conf.py -type f -exec sed -i '' -e 's/2007\-20../2007-2021/' {} \;
   $ git co sphinx/locale/**/*.js sphinx/templates/epub3/mimetype
2021-01-01 13:40:48 +09:00
Takeshi KOMIYA
1d9eeedde3 Fix #8508: LaTeX: uplatex becomes a default setting of latex_engine for Japanese
Since v2.3, Sphinx supports uplatex as an alternative of latex_engine for Japanese
docs (refs: #4186, #6841). uplatex is able to build a document without conversion
character encoding internally. It allows using unicode characters in documents.
Additionally, uplatex is compatible with platex (current default latex_engine for
Japanese docs).

This changes the default latex_engine for Japanese document to uplatex.
2020-11-29 15:09:49 +09:00
Takeshi KOMIYA
a00d62c445 Merge branch '3.x' 2020-11-22 16:04:07 +09:00
François Freitag
419e145e36
Make tests/ a Python package
Allows relative imports.
2020-11-20 19:43:02 +01:00
Takeshi KOMIYA
3a4ae2092a Merge branch '3.x' 2020-11-21 01:01:36 +09:00
Takeshi KOMIYA
21a3bd4127 refactor: Fix flake8 violations under tests/ directory 2020-11-15 17:15:40 +09:00
Takeshi KOMIYA
279e547860 Merge branch '3.x' 2020-11-12 02:50:43 +09:00
François Freitag
0949735210
Sort imports with isort
Keep imports alphabetically sorted and their order homogeneous across
Python source files.

The isort project has more feature and is more active than the
flake8-import-order plugin.

Most issues caught were simply import ordering from the same module.
Where imports were purposefully placed out of order, tag with
isort:skip.
2020-11-11 13:19:05 +01:00
Takeshi KOMIYA
327c187284 Merge branch '3.x' 2020-07-24 23:49:45 +09:00
Tetsuo Koyama
ae7c4cc3b8 fix typo 2020-07-19 00:43:11 +00:00
Takeshi KOMIYA
ec3754bd94 Merge branch '3.x' 2020-07-05 01:32:54 +09:00
Ram Rachum
53c1dff91c Fix exception causes all over the codebase 2020-06-14 14:37:16 +03:00
Takeshi KOMIYA
42aa293679 Merge branch '3.x' 2020-04-27 00:54:23 +09:00
Takeshi KOMIYA
05aff200b1 LaTeX: Add :confval:latex_theme_options to override theme options 2020-04-20 00:51:08 +09:00
Takeshi KOMIYA
1ca0b7ab62 LaTeX: Allow to override papersize and pointsize from LaTeX themes 2020-04-12 15:30:45 +09:00
Takeshi KOMIYA
3e0618ba3a Deprecate codes for docutils-0.13 or 0.14 2020-03-07 19:36:41 +09:00
Takeshi KOMIYA
b3b0d3ad2c refactor: latex: Move initialization of multilingual module to builder 2020-03-07 01:13:23 +09:00
Takeshi KOMIYA
cdbefb600f Support user defined LaTeX themes 2020-03-06 22:11:25 +09:00
Takeshi KOMIYA
4ab4100cc5 test: Add testcases for latex docclasses 2020-03-06 22:11:08 +09:00
Takeshi KOMIYA
bdd08b1516 test: encoding="utf-8" is no longer needed on reading text 2020-02-01 12:25:49 +09:00
Takeshi KOMIYA
4dd8b1022f test: Use read_text() and read_bytes() 2020-02-01 11:58:51 +09:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
Takeshi KOMIYA
72fa75cb9a Close #6837: LaTeX: Support a nested table 2019-12-22 18:00:58 +09:00
jfbu
30b26dd6a1 LaTeX: avoid quotes and TeX ligature replacements in PDF output
Refs: #6890

The comma character is not TeX-escaped because it is frequent in general
text and escaping it would make the LaTeX output larger for only dealing
with the problem of the LaTeX-ligature of ,, into a single character.
And one there is problem with the commas in options to Verbatim from
PygmentsBridge.

The hyphen character is escaped (not in ids and URIs!) to
\sphinxhyphen{} for both Unicode and non-Unicode engines. This is needed
to work around hyperref transforming -- and --- from section titles into
EN DASH resp. EM DASH in PDF bookmarks.

https://github.com/latex3/hyperref/issues/112

Note to expert LaTeX users: if Sphinx latex user with xelatex has

- turned off Smart Quotes for some reason,

- but does want TeX ligatures and thus overrode Sphinx
latex_elements['fontenc'] default (since #6888) to this effect,

then this should be added to LaTeX preamble:

    \def\sphinxhyphen#1{-}% (\protected is now not needed)
    \let\sphinxhyphenforbookmarks\sphinxhyphen
2019-12-15 14:19:50 +01:00
Jean-François B
9f7c7a34db
Merge pull request #6845 from jfbu/latex_do_not_escape_verticalbarchar
LaTeX: stop escaping | to LaTeX macro, except if in an index entry
2019-11-18 21:39:43 +01:00
jfbu
e720f0a1a2 LaTeX: stop escaping | to LaTeX macro, except if in an index entry 2019-11-18 01:57:07 +01:00
Takeshi KOMIYA
f3469bcc8f Make escape() and hlescape() as public APIs of texescape 2019-11-16 19:42:06 +09:00
Jean-François B
b070e5be52
Merge branch '2.0' into 6738_new_escape_for_unicode_latex_engine 2019-11-15 19:09:16 +01:00
Takeshi KOMIYA
4ec563fcff Close #6762: latex: Allow to load additonal LaTeX packages 2019-11-05 22:25:41 +09:00
Takeshi KOMIYA
56bbb08b2c Do not replace unicode characters by LaTeX macros on unicode supported LaTeX engines 2019-10-20 22:54:21 +09:00
Takeshi KOMIYA
cb22be80c2 Merge branch '2.2.1' into 2.0 2019-10-20 13:42:10 +09:00
Takeshi KOMIYA
a750371641 Fix #6652: Run tests with wrong latex_documents setting 2019-10-12 22:46:45 +09:00
jfbu
7be68b7c4b Add latexpdf support for Greek as main language (via xelatex use)
Closes: #6710
2019-10-01 10:27:43 +02:00
Takeshi KOMIYA
95723aa6f6 Fix flake8 violations 2019-07-01 00:28:30 +09:00
jfbu
65739a46ad LaTeX: refactor visit_enumerated_list() to use \sphinxsetlistlabels
Fixes: #6511
2019-06-29 19:27:40 +02:00
Takeshi KOMIYA
9b2c1c679a Fix #6444: test: replace example.com by existing page 2019-06-05 23:42:24 +09:00
Takeshi KOMIYA
91fceb4b5f Merge branch '2.0.2' into 2.0 2019-06-02 00:58:46 +09:00
Takeshi KOMIYA
4ded940ee5 Close #6239: latex: Support to build Chinese documents 2019-05-29 00:58:11 +09:00
Stefan Wallentowitz
ac0bb5132b Fix latex figure in admonition
Using figures in an admonition produces a LaTeX error ("Not in outer
par mode."). This is because it generates a float in a float. This can
be trivially fixed by overwriting the alignment to H, which is also
what is most probably intended.
2019-05-24 16:07:13 +02:00
Takeshi KOMIYA
b691fa804d Fix test: filename has been smallcased since 2.0 2019-03-10 17:07:15 +09:00
Takeshi KOMIYA
4bac6b56d0 Merge branch '1.8' into 2.0 2019-03-10 16:52:51 +09:00
Takeshi KOMIYA
05d3e37ef7 Fix #6149: LaTeX: :index: role titles causes build error of LaTeX 2019-03-10 02:07:02 +09:00
Takeshi KOMIYA
ac9e9c0745 Merge branch '1.8' into 2.0 2019-03-02 18:37:20 +09:00
Takeshi KOMIYA
9c2e7b6798 Fix #6067: LaTeX: images having a target are not aligned even if specified 2019-02-28 02:05:21 +09:00
Takeshi KOMIYA
6c244bdd69 Fix #6067: LaTeX: images having a target are concatenated to next line 2019-02-28 02:04:12 +09:00
jfbu
87058e6783 Remove from test never executed print(result) debugging info 2019-02-05 17:51:13 +01:00
jfbu
0d72052141 Merge branch 'master' into latex_safe_graphics 2019-02-05 17:46:00 +01:00
Takeshi KOMIYA
7b1755d21b Fix test: compile_latex_document() 2019-02-03 23:54:22 +09:00
Takeshi KOMIYA
b40ad9ffd4 Merge branch '1.8' 2019-02-03 23:20:26 +09:00
Takeshi KOMIYA
b7c679626a Fix #5948: LaTeX: duplicated labels are generated for sections 2019-02-03 22:33:24 +09:00
jfbu
669f9c3a13 LaTeX: safer image inclusion
Closes: #5956
2019-01-29 11:15:49 +01:00
jfbu
ff5031c96e Merge branch '1.8'
Resolved Conflicts:
	sphinx/writers/latex.py
2019-01-17 17:26:51 +01:00
jfbu
e7aee6e82a LaTeX: remove usage of \scalebox by incorporating scale in height/width
Closes: #5954
2019-01-14 16:04:04 +01:00
Takeshi KOMIYA
46334a2b00 Use subprocess.run() instead of Popen()
Since python3.5, subprocess.run() has been introduced. It works a
wrapper of Popen, and it looks much simple and better. This uses it
instead of Popen to make our code simple.
2019-01-13 23:25:54 +09:00
Takeshi KOMIYA
46b19b29f3 latex: Do escape_abbr() for author and project 2019-01-07 23:14:56 +09:00
Takeshi KOMIYA
68c90a26f1 quickstart: Simplify generated conf.py (for latex) 2019-01-07 23:06:14 +09:00
jfbu
259d5053fa LaTeX: fix `addtocaptions` for sphinxmessages.sty_t if 'babel' empty
For example if config setting `language` is 'ja'.

Refs: #5516
2019-01-06 10:05:02 +01:00
jfbu
af2bb9f80d Merge branch '1.8'
Conflicts:
	sphinx/writers/latex.py
	tests/test_build_latex.py

Also, modifications were needed in further files.

	modified:   CHANGES
	modified:   sphinx/templates/latex/sphinxmessages.sty_t
	modified:   sphinx/util/template.py
	modified:   sphinx/util/texescape.py
	modified:   sphinx/writers/latex.py
	modified:   tests/test_build_latex.py
2019-01-05 11:00:19 +01:00
jfbu
2259466d4b Remove some spaces added in last commit, which are ignored anyhow 2019-01-05 00:14:45 +01:00
jfbu
37f1aacd1f LaTeX do not strip spaces from numfig_format split at %s
Only for figure and table, currently. Code-bloks have some FIXME code to
still be handled.

PDF output should remain unchanged so this is backwards compatible. The
`\nobreakspace` from LaTeX default `\fnum@figure` is removed by a normal
space. If figname is an abbreviation, the dot is followed by a `\@` to
avoid double space. At the location where the `\@` is inserted the `@`
has catcode non-letter so a space after it is not swallowed.

MEMO: when this is will be moved to sphinxmessages.sty on master branch
it is needed to use `\@{}` or to modify locally catcode of `@` to avoid
space swallowing..

Closes: #5889
2019-01-04 23:53:17 +01:00
jfbu
18bf90822c Fix LaTeX writer handling of user custom numfig_format 2019-01-04 23:35:30 +01:00
Takeshi KOMIYA
cd28de5ba8 refactor: Move \literalblockname to sphinxmessage.sty 2019-01-04 23:06:34 +09:00
Takeshi KOMIYA
ebd484ead2 refactor: Move \tablename to sphinxmessage.sty 2019-01-04 23:06:34 +09:00
Takeshi KOMIYA
1c34501e85 refactor: Move \figurename to sphinxmessage.sty 2019-01-04 23:06:34 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00
Takeshi KOMIYA
1b1ebd2c75 A happy new year! 2019-01-02 16:00:30 +09:00
Takeshi KOMIYA
3905cb8b7c Merge branch '1.8' 2018-12-18 23:32:52 +09:00
jfbu
bd2ca4763c [tests] LaTeX: use latex engines with `--halt-on-error` option 2018-12-18 13:41:48 +01:00
Jon Dufresne
bade33c7e4 Remove unnecessary encoding cookie from Python source files
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:

https://docs.python.org/3/howto/unicode.html#the-string-type

> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...

Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
2018-12-16 12:22:12 -08:00
Takeshi KOMIYA
c6bd84a614 refactor: Remove u-prefix from strings 2018-12-16 21:28:51 +09:00
Takeshi KOMIYA
b56f4f9022 Remove print_function feature 2018-12-15 23:16:10 +09:00
Takeshi KOMIYA
389f756f88 refactor: special rubric for footnotes 2018-12-10 00:07:25 +09:00
jfbu
16f47cded9 Merge branch '1.8' 2018-11-06 18:30:21 +01:00
Takeshi KOMIYA
dcc4ac55bb latex: Move \pageautorefname to sphinxmessages.sty 2018-11-01 22:47:15 +09:00
jfbu
4df3b067b7 LaTeX: add styling to general index, similar to domain indices
Closes: #5579. Also closes #5576.
2018-10-31 19:22:34 +01:00
Takeshi KOMIYA
8b687ac304 Merge branch '1.8' 2018-11-01 01:24:12 +09:00
jfbu
f4d7b2e60e Fix invalid escape sequence \d in test (refs #5513) 2018-10-30 17:47:59 +01:00
Takeshi KOMIYA
e7e07fd697 Merge branch '1.8' 2018-10-16 09:57:54 +09:00