[tex-live] OT2 vs. T2A; compilation by apache user issues

mario chiari ml at mariochiari.net
Mon Feb 17 00:23:41 CET 2014


Hi

thanks for the reply.

On Sun, 2014-02-16 at 16:53 +0100, Zdenek Wagner wrote:
> 2014-02-15 19:03 GMT+01:00 mario chiari <ml at mariochiari.net>:
....

Question A:
> >
> > I use
> > \usepackage[OT2,T1]{fontenc}
> > \usepackage[american,russian,italian]{babel}
\usepackage[utf8]{inputenc} too
> > and define:
> > \newcommand\cyrillic{%
> > \renewcommand\rmdefault{wncyr}%
> > \renewcommand\sfdefault{wncyss}%
> > \renewcommand\encodingdefault{OT2}%
> > \normalfont
> > \selectfont}
> > \DeclareTextFontCommand{\textcyr}{\cyrillic}
> >
> > Everything works fine, but when I need something like
> > \section{\textcyr{}}.
> >
> > So, my first question, how do I fix that?
> >
> WHAT do you want to fix? How can we help without seeing the log?

I need to fix why \textcyr{Коминтерн} gives weird results when within a
\section{}. If \textcyr does not occur within \section (and similar)
everything runs fine.
Here the relevant log portion:
*******************
LaTeX Font Info: Try loading font information for OT2+wncyr on input
line 2.

(/usr/local/texlive/2010/texmf-dist/tex/latex/cyrillic/ot2wncyr.fd
File: ot2wncyr.fd 1999/12/17 v3.2a Computer Modern Cyrillic font
definitions
)
! Argument of \@sect has an extra }.
<inserted text> 
                \par 
l.2 \section{\textcyr{Коминтерн}}
                                          
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
{\normalfont \Large \bfseries }\relax \ifx \reserved at b \@let at token
\@tempswafal
se \ETC.
! Paragraph ended before \@sect was complete.
<to be read again> 
                   \par 
**********************

Question B:
> 
> > I have hacked from a forum a different setting:
> > \usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc} too
> > \DeclareRobustCommand{\textcyr}[1]{\foreignlanguage{russian}{#1}}
> >
> > The latter works fine too, as long as I run pdflatex from my command
> > line as user root.
> > However I need to create and compile a .tex file from within a php
> > script, and then compilation partly fails, cyrillic characters are not
> > rendered.
> > I understand that that is because the apache user launches the process:
> >
> Where is the environment defined and how? Apache does not know the
> complete PATH, see the setting of PassEnv and SetEnv directives in the
> Apache manual.
Do I really need to look at Apache configuration? Apache works fine when
I define \textcyr as above, question A.
> 
> How do you handle conversion of cyrillic to a latin transliteration in
> PHP? 
do I? 
> Are you sure the bug is not in the PHP script? 
Almost Yes: PHP produces a .tex file (using data from a mySQl table). If
I compile it by myself (as root), pdflatex compiles it fine. The issue
is when pdflatex is called from a PHP script (as apache).

> shouldn't it be
> better to require direct entry of cyrillic in UTF-8 and pass it
> directly without any conversion to XeLaTeX? You can then either change
> the font per language using Polyglossia or per Unicode block by
> ucharclasses.
???
> 
> > apache  /usr/local/texlive/2010/bin/i386-linux/pdflatex --interaction
> > batchmode  myfile.tex
> >
> > I am a newbie about this kind of issues, so my second question is: how do I fix that user issue?
> >
> Again, without seeing the log no one can guess what happens on your computer.

relevant log portion seems to be the following
***************************************
LaTeX Font Info:    Try loading font information for T2A+lmr on input
line 2.
LaTeX Font Info:    No file T2Almr.fd. on input line 2.

LaTeX Font Warning: Font shape `T2A/lmr/bx/n' undefined
(Font)              using `T2A/cmr/m/n' instead on input line 2.

! Font T2A/cmr/m/n/17.28=larm1728 at 17.28pt not loadable: Metric (TFM)
file no
t found.
<to be read again> 
                   relax 
l.2 \section{\textcyr{Коминтерн}.}
                                           
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.

Missing character: There is no \CA in font nullfont!
Missing character: There is no \EE in font nullfont!
Missing character: There is no \EC in font nullfont!
Missing character: There is no \E8 in font nullfont!
Missing character: There is no \ED in font nullfont!
Missing character: There is no \F2 in font nullfont!
Missing character: There is no \E5 in font nullfont!
Missing character: There is no \F0 in font nullfont!
Missing character: There is no \ED in font nullfont!

************************************************++

I appreciate your help
cheers
mario






More information about the tex-live mailing list