Discussion:
[tex-k] kpathsea and compilation by a web server
mario chiari
2014-02-27 18:00:18 UTC
Permalink
Hi

my first post on this list. I hope it is the proper forum to ask help
for my problem.

I have been a LaTeX user for some time, but with a very basic knowledge
on how it works.

On my local web server Apache (Linux platform), I create and compile a
number of .tex file calling some php script from a web client. This has
been working without main issues.

For a recent job, I need to output some cyrillic text. I am able to do
so, if a compile a myfile.tex file from my shell (or from within an
editor as Kile) as the root user.
However, if a call from a web client a php script with instructions

`/usr/local/texlive/2013/bin/i386-linux/latex --interaction batchmode
myfile.tex`;

compilation partially fails, in particular cyrillic letters are not
rendered.

I have tried to execute my php script from a shell as the apache user,
and I got the following error
............
LaTeX Font Warning: Font shape `T2A/wncyr/m/n' undefined
(Font) using `T2A/cmr/m/n' instead on input line 2.

kpathsea: Running mktextfm larm1728
mkdir: cannot create directory `././var/www/.texlive2013': Permission
denied
mktextfm: mktexdir /var/www/.texlive2013/texmf-var/fonts/tfm/lh/lh-t2a
failed.
kpathsea: Appending font creation commands to missfont.log.
! Font T2A/cmr/m/n/17.28=larm1728 at 17.28pt not loadable: Metric (TFM)
**************

However, by setting

chown apache:apache /var/www/

i get instead
******************
LaTeX Font Warning: Font shape `T2A/wncyr/m/n' undefined
(Font) using `T2A/cmr/m/n' instead on input line 2.
kpathsea: Running mktextfm larm1728
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1;
nonstopmode; input larm1728
This is METAFONT, Version 2.718281 (TeX Live 2013)
kpathsea: Running mktexmf larm1728
mktexmf: /var/www/.texlive2013/texmf-var/fonts/source/lh/lh-t2a/larm1728.mf: successfully generated.
--snip--
*******************
and eventually I get a fine output.

The bad news is that is not good enough, compilation still fails if I
call the same php script from my web client.

What I note is that mktexmf creates larm1728.mf within /var/www/, where
instead my DocumentRoot is /var/www/html/ (i can not chenge that)

I suspect the/a issue is
that .texlive2013/texmf-var/fonts/source/lh/lh-t2a/larm1728.mf should be
somewhere else within my DocumentRoot, as to be available to the web
server.

However, I do not see where exactly and how to force mktexmf to create
it there.
I appreciate your advise.

mario
Reinhard Kotucha
2014-02-27 22:26:22 UTC
Permalink
Post by mario chiari
Hi
my first post on this list. I hope it is the proper forum to ask
help for my problem.
Hi Mario,
it's not necessary to ask on this list too.

Even if you think that kpathsea is the culprit, Karl Berry is
subscribed to the TeX Live list as well. Furthermore, I'm convinced
that it's not a kpathsea problem at all.

It's not advisable to invoke latex like this:

/usr/local/texlive/2013/bin/i386-linux/latex --interaction \
batchmode myfile.tex

The preferred way is to add the TeX Live bin/ directory to PATH:

PATH=/usr/local/texlive/2013/bin/i386-linux:$PATH \
latex --interaction batchmode myfile.tex

After all, I recommend to continue the discussion on the TeX Live
list, simply because there are much more listeners and because I'm
convinced that kpathsea isn't the culprit.

Regards,
Reinhard
--
----------------------------------------------------------------------------
Reinhard Kotucha Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------
Norbert Preining
2014-02-27 22:36:16 UTC
Permalink
Post by Reinhard Kotucha
it's not necessary to ask on this list too.
Agreed, this list is about technical implementation.

Mario, your problem is a simple problem of setup.

If you cannot find help at the TeX Live list, why not do one
of the usual things in this case:
* use tex.stackexchange
* ask on texhax
* ask a TeX consultant

Everything works properly, as you have seen. The problem is with your
web setup.

If I am thee I can fix it, sure.

Concerning the placement of generated files: you could read the
*documentation* where it is explained in which place new files are
created ... hint hint texmf-dist/web2c/mktex.cnf


Norbert

------------------------------------------------------------------------
PREINING, Norbert http://www.preining.info
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
jay
2014-02-27 21:05:04 UTC
Permalink
Post by Norbert Preining
Everything works properly, as you have seen. The problem is with your
web setup.
If I am thee I can fix it, sure.
This is grammatically incorrect, for the same reason that "it's me" is
incorrect. It should have been, "If I am thou, I can fix it".


Jay F. Shachter
6424 N Whipple St
Chicago IL 60645-4111
(1-773)7613784 landline
(1-410)9964737 GoogleVoice
jay at m5.chicago.il.us
http://m5.chicago.il.us

"Quidquid latine dictum sit, altum videtur"
Reinhard Kotucha
2014-02-27 23:43:47 UTC
Permalink
Post by jay
This is grammatically incorrect, for the same reason that "it's me"
is incorrect. It should have been, "If I am thou, I can fix it".
You should appreciate at least that Norbert didn't reply in his native
language.

Regards,
Reinhard
--
----------------------------------------------------------------------------
Reinhard Kotucha Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------
Joachim Schrod
2014-02-28 01:50:50 UTC
Permalink
Post by jay
Post by Norbert Preining
If I am thee I can fix it, sure.
This is grammatically incorrect, for the same reason that "it's me" is
incorrect. It should have been, "If I am thou, I can fix it".
and then, topping it...
Post by jay
"Quidquid latine dictum sit, altum videtur"
Du bist ein Klugschei?er.

(This is grammatically correct[tm].)

Cheers,
Joachim
Norbert Preining
2014-02-28 02:57:50 UTC
Permalink
Hi everyone,

let us stop this.

I answered him on the TL mailing list with more details. No need
to extend this here.
Post by jay
Post by Norbert Preining
If I am thee I can fix it, sure.
This is grammatically incorrect, for the same reason that "it's me" is
incorrect. It should have been, "If I am thou, I can fix it".
BTW, I normally don't speak/write old English. It was a very trivial case
of a stuck key in my old laptop, should have been
there
instead of thee

;-)

And no, I don't add any Latin quote here, although I studied it at
the university!

Norbert

------------------------------------------------------------------------
PREINING, Norbert http://www.preining.info
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
Loading...