Commit Graph

115 Commits

Author SHA1 Message Date
Takeshi KOMIYA
71b653719d Fix #7610: incorrectly renders consecutive backslashes 2020-05-07 00:54:36 +09:00
Takeshi KOMIYA
a5036270c8
Merge pull request #7605 from tk0miya/refactor_tests
Refactor tests
2020-05-04 01:27:54 +09:00
Takeshi KOMIYA
f01ea79092 refactor: Pass a theme instance to LaTeXTranslator 2020-05-03 23:56:59 +09:00
Takeshi KOMIYA
a148a8e7cb Close #7530: html: Support nested <kbd> elements 2020-05-02 22:48:57 +09:00
Jesse Tan
7c1b673076 Add LaTeX styling hook for :kbd: role 2020-01-09 16:35:40 +01:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +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
Takeshi KOMIYA
660e746cf8 Fix #6738: latex: literal_block does not support raw unicode characters 2019-11-16 16:47:20 +09:00
Takeshi KOMIYA
9b2c1c679a Fix #6444: test: replace example.com by existing page 2019-06-05 23:42:24 +09:00
Takeshi KOMIYA
90bf81bd37 test: Use get_doctree() to load doctree files 2019-02-17 20:27:48 +09:00
Takeshi KOMIYA
61f1477942 Add testcase for XRefRole class 2019-02-16 21:23:01 +09:00
Takeshi KOMIYA
6748a6de2f Add testcase for download role 2019-02-16 21:23:01 +09:00
Takeshi KOMIYA
3ec032fa39 Replace :file: and :samp: roles by class based implementation 2019-02-16 12:37:46 +09:00
Takeshi KOMIYA
ea4d8ca08d Replace :guilabel: and :menuselection: roles by class based implementation 2019-02-16 02:30:28 +09:00
Takeshi KOMIYA
cb49a6b091 Fix :pep: and :rfc: roles are broken 2019-02-16 01:47:52 +09:00
Takeshi KOMIYA
66228fb60f Fix #5906: LaTeX Builder is not initialized correctly on test_markup 2019-01-08 01:30:25 +09:00
Takeshi KOMIYA
1c34501e85 refactor: Move \figurename to sphinxmessage.sty 2019-01-04 23:06:34 +09:00
Takeshi KOMIYA
7459d8771a Fix HTML: Invalid HTML5 file is generated for glossary (refs: #4611)
Note: It was caused by a glossary having multiple terms for one
description.
2019-01-03 18:17:17 +09:00
Takeshi KOMIYA
a0e1390472 Remove use of deprecated APIs 2019-01-03 13:27:33 +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
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
jfbu
30ec4b6bba Merge branch '1.8' 2018-12-16 18:34:05 +01:00
jfbu
88a019dc99 LaTeX: allow sphinxVerbatim usage without explicit "hllines" extra setup
Fixes: #5810
2018-12-16 16:54:28 +01:00
Takeshi KOMIYA
c6bd84a614 refactor: Remove u-prefix from strings 2018-12-16 21:28:51 +09:00
Takeshi KOMIYA
3863256cb6 Add SphinxTranslator as an abstract class 2018-12-03 22:30:56 +09:00
jfbu
2825e338c2 LaTeX: support for Greek and Cyrillic
0. do not escape Unicode Greek letters via LaTeX math mark-up: pass them
   through un-modified to LaTeX document,

1. if "fontenc" receives extra option LGR, then pdflatex will support
   Unicode Greek letters (not in math), and with extra option T2A it
   will support (most) Unicode Cyrillic letters.

2. for pdflatex with LGR, this will use "textalpha" LaTeX package and
   "substitutefont" package to set up some automatic font substitution
   to work around the unavailability of Greek with "times"
   package (which is default font package chosen by Sphinx for
   pdflatex), same with T2A and "substitutefont" for Cyrillic.

3. for xelatex/lualatex, set up Computer Modern Unicode as default font,
   as it supports Cyrillic and Greek scripts,

4. for platex, don't do anything special as the engine already has
   its default font supporting Cyrillic and Greek (even in math mode!)

Closes: #5251
Fixes:  #5248
Fixes:  #5247
2018-11-16 21:14:51 +01:00
Takeshi KOMIYA
848224f641 Add LaTeXBuilder.context: Build context object by builder 2018-08-13 23:52:44 +09:00
Michael Tesch
e368ac21ef proposed enhancement #4830 2018-04-20 13:13:00 +02:00
Takeshi KOMIYA
f7027049b1 Fix flake8 violations 2018-02-19 23:20:56 +09:00
Takeshi KOMIYA
4d040abafb Fix #4079: Add notranslate class to let Google Translate know they are not translatable 2018-01-13 20:25:49 +09:00
jfbu
309f38a91f Split out fancy LaTeX macros from `\sphinxcode into \sphinxupquote`
Since #2627 (1.4.4), `\code`, and then again at #3116 (1.5)
`\sphinxcode` which is the new name has become more complicated than the
original `\texttt{#1}`. This was to obtain straight quotes in PDF output,
and to allow long inline literals to break across lines.

This means though that users who want to customize `\sphinxcode`, for
example to not only do `\texttt` but to use some colour, have to copy
about 10 lines of complicated LaTeX macros which should be not modified
in any way. This commit moves all the code out of `\sphinxcode` into a
separate macro `\sphinxupquote`.

The LaTeX writer will output `\sphinxcode{\sphinxupquote{foo}}` in place
of former `\sphinxcode{foo}`. Moving the `\texttt` from innermost to
outermost level is with no consequence.
2018-01-03 08:46:19 +01:00
Takeshi KOMIYA
2426cedb8b A happy new year! 2018-01-01 01:06:58 +09:00
jfbu
70f8d4ddfc Support `:emphasize-lines:` in PDF output (closes #1238) 2017-12-10 12:37:36 +01:00
Takeshi KOMIYA
da0fda3b0b Add tests for default-role 2017-07-31 00:46:26 +09:00
shimizukawa
d497d74370 refs #3458: add sphinx.testing that are moved from /tests directory. 2017-05-14 20:47:15 +09:00
Dmitry Shachnev
edc7f30b9c Remove the custom smartypants code
Instead rely on docutils’ ‘smart_quotes’ option which is available
since docutils 0.10.

This adds support for internationalization: our code supported only
English quotes, while docutils code supports 27 different languages.

Closes #498, #580, #3345, #3472.
2017-04-25 14:17:13 +03:00
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00
Dmitry Shachnev
1717a95a77 Fix a test failure which was uncovered by the previous change
In PR #3527 the LaTeX output for quotes has changed, but the test was
not updated.
2017-03-15 11:29:50 +03:00
Dmitry Shachnev
6e0467ca77 test_markup: Make verify functions test both HTML and LaTeX outputs
Previously it would return after performing the HTML check, without
running the LaTeX one.
2017-03-14 22:34:51 +03:00
Jean-François B
3128a4327d More robust hyperlink macros in LaTeX output (refs #3317, #3340, #3533) (#3538)
More robust hyperlink macros in LaTeX output (refs #3317, #3340, #3533)
2017-03-11 16:53:53 +01:00
Takeshi KOMIYA
cf2061dfad Fix flake8 violations 2017-01-26 01:13:17 +09:00
shimizukawa
561abdd164 pytest optimizatoin:
- remote using deprecated decorators
- remove gen_with_app
- remove yield testing
- remove pytest warnings
- refactoring
2017-01-08 15:14:38 +09:00
shimizukawa
baaef9146d pytest: remove deprecated with_app decorator functions 2017-01-06 01:14:47 +09:00
Takeshi KOMIYA
50bf7960bd Uninstall sphinx directives and roles of domains after build 2016-09-21 10:48:52 +09:00
Takeshi KOMIYA
f8c1c65c21 Refactor sphinx.environment: Reimplemnt process_refonly_bullet_lists() as a transform 2016-09-15 02:29:50 +09:00
Takeshi KOMIYA
d281a32b3b Refactor sphinx.environment: Reimplement filter_messages() as a transform 2016-09-15 02:29:50 +09:00
Takeshi KOMIYA
8a9459b308 Merge branch 'stable' 2016-08-09 23:19:11 +09:00
Yoshiki Shibukawa
90b3c79895 fix html entity to fix epub error 2016-08-09 16:58:56 +09:00
jfbu
b3d8961ca8 Enhance latex text styling customizability 2016-06-17 19:48:52 +02:00