Hi
Le 26/09/2019 à 17:16, Pieter Claeys a écrit :
> Hi,
> I'm stuck on trying to generate a PDF of a greek translation (language code
> 'el')
>
> What I'm doing:
> - "make latex" -> produce .tex file
> - then, open with TexWorks and create pdf (or use pdflate command-line)
>
> That doesn't work, and based on reading the documentation, I added to
> latex_elements in conf.py
>
> latex_elements = {
> 'fontenc': r'\usepackage[LGR]{fontenc}',
> 'textgreek': r'\usepackage{textalpha,alphabeta}',
>
>
> But still I'm stuck at
>
> |
> Packageinputenc Error:Unicodecharacter Α(U+0391)
> (inputenc)notsetup forusewithLaTeX.
>
> Seethe inputenc packagedocumentation forexplanation.
> TypeH <return>forimmediate help.
> ...
>
> l.98...Απαιτήσειςσυστήματος}
> |
>
> Which is caused by the line 98 in the .tex file:
> |
> \chapter{Απαιτήσειςσυστήματος}
> |
>
> *
> *
> Anyone with experience with this?
>
>
> The top of my .tex file is:
> |
>
> %%GeneratedbySphinx.
>
> \def\sphinxdocclass{report}
>
> \documentclass[a4paper,10pt,greek]{sphinxmanual_customqaweb}
>
> \ifdefined\pdfpxdimen
>
> \let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
>
> \fi\sphinxpxdimen=.75bp\relax
>
>
> \PassOptionsToPackage{warn}{textcomp}
>
> \usepackage[utf8]{inputenc}
>
> \ifdefined\DeclareUnicodeCharacter
>
> %support both utf8 andutf8x syntaxes
>
> \ifdefined\DeclareUnicodeCharacterAsOptional
>
> \def\sphinxDUC#1{\DeclareUnicodeCharacter{"#1}}
>
> \else
>
> \let\sphinxDUC\DeclareUnicodeCharacter
>
> \fi
>
> \sphinxDUC{00A0}{\nobreakspace}
>
> \sphinxDUC{2500}{\sphinxunichar{2500}}
>
> \sphinxDUC{2502}{\sphinxunichar{2502}}
>
> \sphinxDUC{2514}{\sphinxunichar{2514}}
>
> \sphinxDUC{251C}{\sphinxunichar{251C}}
>
> \sphinxDUC{2572}{\textbackslash}
>
> \fi
>
> \usepackage{cmap}
>
> \usepackage[LGR]{fontenc}
>
> \usepackage{amsmath,amssymb,amstext}
>
> \usepackage{babel}
>
> \usepackage{substitutefont}
>
>
>
> \usepackage{times}
>
> \expandafter\ifx\csname T@LGR\endcsname\relax
>
> \else
>
> %LGR was declared asfont encoding
>
> \substitutefont{LGR}{\rmdefault}{cmr}
>
> \substitutefont{LGR}{\sfdefault}{cmss}
>
> \substitutefont{LGR}{\ttdefault}{cmtt}
>
> \fi
>
> \expandafter\ifx\csname T@X2\endcsname\relax
>
> \expandafter\ifx\csname T@T2A\endcsname\relax
>
> \else
>
> %T2A was declared asfont encoding
>
> \substitutefont{T2A}{\rmdefault}{cmr}
>
> \substitutefont{T2A}{\sfdefault}{cmss}
>
> \substitutefont{T2A}{\ttdefault}{cmtt}
>
> \fi
>
> \else
>
> %X2 was declared asfont encoding
>
> \substitutefont{X2}{\rmdefault}{cmr}
>
> \substitutefont{X2}{\sfdefault}{cmss}
>
> \substitutefont{X2}{\ttdefault}{cmtt}
>
> \fi
>
>
> \usepackage{textalpha,alphabeta}
>
> \usepackage[Sonny]{fncychap}
>
> \ChNameVar{\Large\normalfont\sffamily}
>
> \ChTitleVar{\Large\normalfont\sffamily}
>
> \usepackage{sphinx}
>
>
> \fvset{fontsize=\small}
>
> \usepackage{geometry}
>
>
> %Includehyperref last.
>
> \usepackage{hyperref}
>
> %Fixanchor placement forfigures withcaptions.
>
> \usepackage{hypcap}%it must be loaded after hyperref.
>
> %Setup styles of URL:it should be placed after hyperref.
>
> \urlstyle{same}
>
>
> \usepackage{sphinxmessages}
>
> \setcounter{tocdepth}{1}
>
>
>
>
> \title{QAWebEnterpriseUserGuide}
>
> \date{26de Σεπτεμβρίουde 2019}
>
> \release{}
>
> \author{Barco}
>
> \newcommand{\sphinxlogo}{\vbox{}}
>
> \renewcommand{\releasename}{}
>
> \makeindex
>
> \begin{document}
>
>
> \ifdefined\shorthandoff
>
> \ifnum\catcode`\=\string=\active\shorthandoff{=}\fi
>
> \ifnum\catcode`\"=\active\shorthandoff{"}\fi
>
> \fi
>
>
> \pagestyle{empty}
>
> \sphinxmaketitle
>
> \pagestyle{plain}
>
> \sphinxtableofcontents
>
> \pagestyle{normal}
>
> \phantomsection\label{\detokenize{index::doc}}
>
>
>
>
> \chapter{Απαιτήσειςσυστήματος}
>
> \label{\detokenize{system-requirements:system-requirements}}\label{\detokenize{system-requirements:requirements-system}}\label{\detokenize{system-requirements::doc}}
>
> |
>
>
>
>
I tried a skeleton project containing only this index.rst
===============================
Welcome to FOO's documentation!
===============================
*********************
Απαιτήσεις συστήματος
*********************
and
language = 'el'
latex_elements = {
'fontenc': r'\usepackage[LGR]{fontenc}',
'textgreek': r'\usepackage{textalpha,alphabeta}',
}
and "make latexpdf" works for me and produces seemingly valid PDF.
Perhaps your LaTeX installation is old?
You seem to be using a custom class maybe this is related to the problem?
I am not familiar with typesetting Greek documents with LaTeX +
\usepackage{babel}
and will check some docs later
>From testing directly with LaTeX it seems simply using "greek" as
documentclass option should be enough in combination with babel. The
non-existing times font in Greek encoding is automatically
substituted.
By the way, if one only specifies language = 'el'
Sphinx mark-up leads to execution of \substitutefont
which causes a problem because \usepackage{substitutefont} is not
added explicitly to latex preamble until one explicitly
also specifies
'fontenc': r'\usepackage[LGR]{fontenc}',
The Sphinx documentation was only given in relation
to small Greek snippets in a doucment whose main language is another one.
Some revision/update might be needed for Greek as main language indeed.
Anyway, as I said your configuratin does seem to work for me with Sphinx 2.0 and
TeXLive 2019
Curious to know the cause of the problem
Jean-François
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sphinx-users/qmio0d%2414g5%241%40blaine.gmane.org.