powered by simpleCommunicator - 2.0.18     © 2024 Programmizd 02
Map
Форумы / Вопросы по форуму [закрыт для гостей] / Не работают Latex формулы
16 сообщений из 16, страница 1 из 1
Не работают Latex формулы
    #1888
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
исправление
Код
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
--- image_utils_inc.php.bak_20220322    2022-02-09 23:32:44.000000000 +0300
+++ image_utils_inc.php 2022-03-22 10:58:46.138494950 +0300
@@ -611,7 +611,8 @@
         throw new \Exception('Failed to create tex file!');
     }

-    $command = 'cd ' . $temp_dir . '; ' . '/usr/bin/latex' . ' ' . $hash . '.tex < /dev/null |grep ^!|grep -v Emergency > ' . $temp_dir . $hash . '.err 2> /dev/null 2>&1';
+    ////$command = 'cd ' . $temp_dir . '; ' . '/usr/bin/latex' . ' ' . $hash . '.tex < /dev/null |grep ^!|grep -v Emergency > ' . $temp_dir . $hash . '.err 2> /dev/null 2>&1';
+    $command = 'cd ' . $temp_dir . '; ' . '/usr/bin/latex' . ' ' . $hash . '.tex < /dev/null | grep ^! | grep -v Emergency > ' . $temp_dir . $hash . '.err > /dev/null 2>&1';
     //debug_message($command);
     if (shell_exec($command) === null) {
         //throw new \Exception('Unable to compile LaTeX formula!');
@@ -634,4 +635,4 @@
     @shell_exec('rm -f ' . $temp_dir . $hash . '.* 2>&1');
 } // create_latex_png
 //-------------------------------------------------------------------
-?>
\ No newline at end of file
+?>
Нужно придерживаться строго написания команды. не все интерпретаторы нормально принимают слитое написание после черты

|grep в терминале вручную сработает, так как загружается окружение пользователя, подключаются улучшения и т.п., а при вызове из скрипта обращается напрямую к интерпретатору и в результате была ошибка
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #1890
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
picturepicture
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #1896
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
defecator

вот тебе кирпич в тебя и типичный пример в стартовом посте и ответ на твой вопрос, какая разница, какая у тебя ос, у тебя что апач и пхп с мускулом другие?

в дебиане работает, в ред хате интерпретатор более строг к синтаксису
...
Рейтинг: 1 / 0
Нравится: Гарыныч
Не работают Latex формулы
    #2024
defecator
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
basename  22.03.2022, 11:20
[игнорируется]
defecator

вот тебе кирпич в тебя и типичный пример в стартовом посте и ответ на твой вопрос, какая разница, какая у тебя ос, у тебя что апач и пхп с мускулом другие?

в дебиане работает, в ред хате интерпретатор более строг к синтаксису
вообще похуй.
я на этот форум почти не захожу
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #66647
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Умник^практик  18.06.2022, 21:44
[игнорируется]
Картинка
🤫

форумлы проверяли, должно работать
работает в формате LATEX

\sqrt{\underbrace{11 + \dots +1}_{2n} - \underbrace{22 + \dots +2}_{n}} = \underbrace{33 + \dots +3}_{n}
picturepicture
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #66670
Умник^практик
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
basename  18.06.2022, 22:14
[игнорируется]
Умник^практик  18.06.2022, 21:44
[игнорируется]
Картинка
🤫

форумлы проверяли, должно работать
работает в формате LATEX

\sqrt{\underbrace{11 + \dots +1}_{2n} - \underbrace{22 + \dots +2}_{n}} = \underbrace{33 + \dots +3}_{n}
Картинка
[latex]Unable to compile LaTeX formula![/latex]
????? x^2
а теги те?
...
Изменено: 18.06.2022, 22:35 - Умник^практик
Рейтинг: 0 / 0
Не работают Latex формулы
    #66712
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Умник^практик  18.06.2022, 22:33
[игнорируется]
basename  18.06.2022, 22:14
[игнорируется]
Умник^практик  18.06.2022, 21:44
[игнорируется]
Картинка
🤫

форумлы проверяли, должно работать
работает в формате LATEX

\sqrt{\underbrace{11 + \dots +1}_{2n} - \underbrace{22 + \dots +2}_{n}} = \underbrace{33 + \dots +3}_{n}
Картинка
[latex]Unable to compile LaTeX formula![/latex]
????? x^2
а теги те?
так не работает оно. нужно в саециальном формате писать. ну вот как пример выше.
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #66729
Умник^практик
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
basename  18.06.2022, 23:16
[игнорируется]
Умник^практик  18.06.2022, 22:33
[игнорируется]
basename  18.06.2022, 22:14
[игнорируется]
Умник^практик  18.06.2022, 21:44
[игнорируется]
Картинка
🤫

форумлы проверяли, должно работать
работает в формате LATEX

\sqrt{\underbrace{11 + \dots +1}_{2n} - \underbrace{22 + \dots +2}_{n}} = \underbrace{33 + \dots +3}_{n}
Картинка
[latex]Unable to compile LaTeX formula![/latex]
????? x^2
а теги те?
так не работает оно. нужно в саециальном формате писать. ну вот как пример выше.
на языке LaTeX
при заключении в теги
"latex" и "/latex"

"
[latex]Unable to compile LaTeX formula![/latex]
"

И РУГАЕТСЯ...?
Похоже не всё инсталлировано.
Помниться Деда ворчал, что пришлось несколько гигабайт всякой всячины, что с LaTeXом идет, ставить.

PSS да, там много чего ..., а если весь LaTeX, то несколько десятков гигабайт
_______
PS верстки на LaTeX делал много раз
...
Изменено: 18.06.2022, 23:39 - Умник^практик
Рейтинг: 0 / 0
Не работают Latex формулы
    #66750
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Умник^практик  18.06.2022, 23:37
[игнорируется]
basename  18.06.2022, 23:16
[игнорируется]
Умник^практик  18.06.2022, 22:33
[игнорируется]
basename  18.06.2022, 22:14
[игнорируется]
Умник^практик  18.06.2022, 21:44
[игнорируется]
...
работает в формате LATEX

\sqrt{\underbrace{11 + \dots +1}_{2n} - \underbrace{22 + \dots +2}_{n}} = \underbrace{33 + \dots +3}_{n}
Картинка
[latex]Unable to compile LaTeX formula![/latex]
????? x^2
а теги те?
так не работает оно. нужно в саециальном формате писать. ну вот как пример выше.
на языке LaTeX
при заключении в теги
"latex" и "/latex"

"
[latex]Unable to compile LaTeX formula![/latex]
"

И РУГАЕТСЯ...?
Похоже не всё инсталлировано.
Помниться Деда ворчал, что пришлось несколько гигабайт всякой всячины, что с LaTeXом идет, ставить.

PSS да, там много чего ..., а если весь LaTeX, то несколько десятков гигабайт
_______
PS верстки на LaTeX делал много раз
Я не разбарась в нём совсем. Дед мне давал форумлу для проверки, ну вот она работает. Софта много ставилось, да. больше гига точно.
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #66751
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
basename  19.06.2022, 00:02
[игнорируется]
Умник^практик  18.06.2022, 23:37
[игнорируется]
basename  18.06.2022, 23:16
[игнорируется]
Умник^практик  18.06.2022, 22:33
[игнорируется]
basename  18.06.2022, 22:14
[игнорируется]
...
[latex]Unable to compile LaTeX formula![/latex]
????? x^2
а теги те?
так не работает оно. нужно в саециальном формате писать. ну вот как пример выше.
на языке LaTeX
при заключении в теги
"latex" и "/latex"

"
[latex]Unable to compile LaTeX formula![/latex]
"

И РУГАЕТСЯ...?
Похоже не всё инсталлировано.
Помниться Деда ворчал, что пришлось несколько гигабайт всякой всячины, что с LaTeXом идет, ставить.

PSS да, там много чего ..., а если весь LaTeX, то несколько десятков гигабайт
_______
PS верстки на LaTeX делал много раз
Я не разбарась в нём совсем. Дед мне давал форумлу для проверки, ну вот она работает. Софта много ставилось, да. больше гига точно.
при этом, отследить что-то в логах в этом случае невозможно

а вставь форумлу без тега, которую ты вставляешь, посмотрю варианты, может получится
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #66759
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Умник^практик [игнорируется] 

корчое, не ясно. ничего, кроме дедфорумлы не работает. Попробую посмотреть ещё
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #66842
Умник^практик
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
basename  19.06.2022, 00:13
[игнорируется]
Умник^практик [игнорируется] 

корчое, не ясно. ничего, кроме дедфорумлы не работает. Попробую посмотреть ещё
ситуативно похоже на какой-то кэш: не обрабатывает, а берет из кэша, и при этом latex недоустановлен (даже 'шевеление' добавлением пробела и т.п. дедопримера
отказно)
🧐
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #67405
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Умник^практик  19.06.2022, 05:19
[игнорируется]
basename  19.06.2022, 00:13
[игнорируется]
Умник^практик [игнорируется] 

корчое, не ясно. ничего, кроме дедфорумлы не работает. Попробую посмотреть ещё
ситуативно похоже на какой-то кэш: не обрабатывает, а берет из кэша, и при этом latex недоустановлен (даже 'шевеление' добавлением пробела и т.п. дедопримера
отказно)
🧐
На стадии установки форума проблема была в этом. 1888

Дед писал вызов команды в конвеере без пробелов. Не все дистрибутивы на это нормально реагирует

Дед дал проверенную формулу, она не работала, потом заработала, после исправления.

Что-там может недоусиановится - не знаю. Там пакет ставишь, он кучу всего сосет и либо успех, либо нет. То есть либо какие-то дополнительные модули нужно ставить.

Кэша в данном случае вроде никакого нет. Там вызов утилиты она картинку делает, картинка прикладывается и удаляется.

Короче, надо разбираться.
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #68037
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Умник^практик [игнорируется] 

Напрямую из консоли работает и создаёт выходной dvi.

Что-то с форумными скриптами, отлогировать это не получается. буду тыркать дедоскрипты.

Вот вывод работы программы latex
Код
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
[root@dragon tmp]# cat 790b8db3bc7b0b621b608359f87d79b4103c5cdd.log
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=latex 2022.6.20)  20 JUN 2022 13:32
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**790b8db3bc7b0b621b608359f87d79b4103c5cdd.tex
(./790b8db3bc7b0b621b608359f87d79b4103c5cdd.tex
LaTeX2e <2017-04-15>
Babel <3.17> and hyphenation patterns for 3 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2015/03/17 v1.2c Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15

(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
File: utf8.def 2017/01/28 v1.1t UTF-8 support for inputenc
Now handling font encoding OML ...
... no UTF-8 mapping file for font encoding OML
Now handling font encoding T1 ...
... processing UTF-8 mapping file for font encoding T1

(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu
File: t1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
   defining Unicode char U+00A0 (decimal 160)
   defining Unicode char U+00A1 (decimal 161)
   defining Unicode char U+00A3 (decimal 163)
   defining Unicode char U+00AB (decimal 171)
   defining Unicode char U+00AD (decimal 173)
   defining Unicode char U+00BB (decimal 187)
   defining Unicode char U+00BF (decimal 191)
   defining Unicode char U+00C0 (decimal 192)
   defining Unicode char U+00C1 (decimal 193)
   defining Unicode char U+00C2 (decimal 194)
   defining Unicode char U+00C3 (decimal 195)
   defining Unicode char U+00C4 (decimal 196)
   defining Unicode char U+00C5 (decimal 197)
   defining Unicode char U+00C6 (decimal 198)
   defining Unicode char U+00C7 (decimal 199)
   defining Unicode char U+00C8 (decimal 200)
   defining Unicode char U+00C9 (decimal 201)
   defining Unicode char U+00CA (decimal 202)
   defining Unicode char U+00CB (decimal 203)
   defining Unicode char U+00CC (decimal 204)
   defining Unicode char U+00CD (decimal 205)
   defining Unicode char U+00CE (decimal 206)
   defining Unicode char U+00CF (decimal 207)
   defining Unicode char U+00D0 (decimal 208)
   defining Unicode char U+00D1 (decimal 209)
   defining Unicode char U+00D2 (decimal 210)
   defining Unicode char U+00D3 (decimal 211)
   defining Unicode char U+00D4 (decimal 212)
   defining Unicode char U+00D5 (decimal 213)
   defining Unicode char U+00D6 (decimal 214)
   defining Unicode char U+00D8 (decimal 216)
   defining Unicode char U+00D9 (decimal 217)
   defining Unicode char U+00DA (decimal 218)
   defining Unicode char U+00DB (decimal 219)
   defining Unicode char U+00DC (decimal 220)
   defining Unicode char U+00DD (decimal 221)
   defining Unicode char U+00DE (decimal 222)
   defining Unicode char U+00DF (decimal 223)
   defining Unicode char U+00E0 (decimal 224)
   defining Unicode char U+00E1 (decimal 225)
   defining Unicode char U+00E2 (decimal 226)
   defining Unicode char U+00E3 (decimal 227)
   defining Unicode char U+00E4 (decimal 228)
   defining Unicode char U+00E5 (decimal 229)
   defining Unicode char U+00E6 (decimal 230)
   defining Unicode char U+00E7 (decimal 231)
   defining Unicode char U+00E8 (decimal 232)
   defining Unicode char U+00E9 (decimal 233)
   defining Unicode char U+00EA (decimal 234)
   defining Unicode char U+00EB (decimal 235)
   defining Unicode char U+00EC (decimal 236)
   defining Unicode char U+00ED (decimal 237)
   defining Unicode char U+00EE (decimal 238)
   defining Unicode char U+00EF (decimal 239)
   defining Unicode char U+00F0 (decimal 240)
   defining Unicode char U+00F1 (decimal 241)
   defining Unicode char U+00F2 (decimal 242)
   defining Unicode char U+00F3 (decimal 243)
   defining Unicode char U+00F4 (decimal 244)
   defining Unicode char U+00F5 (decimal 245)
   defining Unicode char U+00F6 (decimal 246)
   defining Unicode char U+00F8 (decimal 248)
   defining Unicode char U+00F9 (decimal 249)
   defining Unicode char U+00FA (decimal 250)
   defining Unicode char U+00FB (decimal 251)
   defining Unicode char U+00FC (decimal 252)
   defining Unicode char U+00FD (decimal 253)
   defining Unicode char U+00FE (decimal 254)
   defining Unicode char U+00FF (decimal 255)
   defining Unicode char U+0100 (decimal 256)
   defining Unicode char U+0101 (decimal 257)
   defining Unicode char U+0102 (decimal 258)
   defining Unicode char U+0103 (decimal 259)
   defining Unicode char U+0104 (decimal 260)
   defining Unicode char U+0105 (decimal 261)
   defining Unicode char U+0106 (decimal 262)
   defining Unicode char U+0107 (decimal 263)
   defining Unicode char U+0108 (decimal 264)
   defining Unicode char U+0109 (decimal 265)
   defining Unicode char U+010A (decimal 266)
   defining Unicode char U+010B (decimal 267)
   defining Unicode char U+010C (decimal 268)
   defining Unicode char U+010D (decimal 269)
   defining Unicode char U+010E (decimal 270)
   defining Unicode char U+010F (decimal 271)
   defining Unicode char U+0110 (decimal 272)
   defining Unicode char U+0111 (decimal 273)
   defining Unicode char U+0112 (decimal 274)
   defining Unicode char U+0113 (decimal 275)
   defining Unicode char U+0114 (decimal 276)
   defining Unicode char U+0115 (decimal 277)
   defining Unicode char U+0116 (decimal 278)
   defining Unicode char U+0117 (decimal 279)
   defining Unicode char U+0118 (decimal 280)
   defining Unicode char U+0119 (decimal 281)
   defining Unicode char U+011A (decimal 282)
   defining Unicode char U+011B (decimal 283)
   defining Unicode char U+011C (decimal 284)
   defining Unicode char U+011D (decimal 285)
   defining Unicode char U+011E (decimal 286)
   defining Unicode char U+011F (decimal 287)
   defining Unicode char U+0120 (decimal 288)
   defining Unicode char U+0121 (decimal 289)
   defining Unicode char U+0122 (decimal 290)
   defining Unicode char U+0123 (decimal 291)
   defining Unicode char U+0124 (decimal 292)
   defining Unicode char U+0125 (decimal 293)
   defining Unicode char U+0128 (decimal 296)
   defining Unicode char U+0129 (decimal 297)
   defining Unicode char U+012A (decimal 298)
   defining Unicode char U+012B (decimal 299)
   defining Unicode char U+012C (decimal 300)
   defining Unicode char U+012D (decimal 301)
   defining Unicode char U+012E (decimal 302)
   defining Unicode char U+012F (decimal 303)
   defining Unicode char U+0130 (decimal 304)
   defining Unicode char U+0131 (decimal 305)
   defining Unicode char U+0132 (decimal 306)
   defining Unicode char U+0133 (decimal 307)
   defining Unicode char U+0134 (decimal 308)
   defining Unicode char U+0135 (decimal 309)
   defining Unicode char U+0136 (decimal 310)
   defining Unicode char U+0137 (decimal 311)
   defining Unicode char U+0139 (decimal 313)
   defining Unicode char U+013A (decimal 314)
   defining Unicode char U+013B (decimal 315)
   defining Unicode char U+013C (decimal 316)
   defining Unicode char U+013D (decimal 317)
   defining Unicode char U+013E (decimal 318)
   defining Unicode char U+0141 (decimal 321)
   defining Unicode char U+0142 (decimal 322)
   defining Unicode char U+0143 (decimal 323)
   defining Unicode char U+0144 (decimal 324)
   defining Unicode char U+0145 (decimal 325)
   defining Unicode char U+0146 (decimal 326)
   defining Unicode char U+0147 (decimal 327)
   defining Unicode char U+0148 (decimal 328)
   defining Unicode char U+014A (decimal 330)
   defining Unicode char U+014B (decimal 331)
   defining Unicode char U+014C (decimal 332)
   defining Unicode char U+014D (decimal 333)
   defining Unicode char U+014E (decimal 334)
   defining Unicode char U+014F (decimal 335)
   defining Unicode char U+0150 (decimal 336)
   defining Unicode char U+0151 (decimal 337)
   defining Unicode char U+0152 (decimal 338)
   defining Unicode char U+0153 (decimal 339)
   defining Unicode char U+0154 (decimal 340)
   defining Unicode char U+0155 (decimal 341)
   defining Unicode char U+0156 (decimal 342)
   defining Unicode char U+0157 (decimal 343)
   defining Unicode char U+0158 (decimal 344)
   defining Unicode char U+0159 (decimal 345)
   defining Unicode char U+015A (decimal 346)
   defining Unicode char U+015B (decimal 347)
   defining Unicode char U+015C (decimal 348)
   defining Unicode char U+015D (decimal 349)
   defining Unicode char U+015E (decimal 350)
   defining Unicode char U+015F (decimal 351)
   defining Unicode char U+0160 (decimal 352)
   defining Unicode char U+0161 (decimal 353)
   defining Unicode char U+0162 (decimal 354)
   defining Unicode char U+0163 (decimal 355)
   defining Unicode char U+0164 (decimal 356)
   defining Unicode char U+0165 (decimal 357)
   defining Unicode char U+0168 (decimal 360)
   defining Unicode char U+0169 (decimal 361)
   defining Unicode char U+016A (decimal 362)
   defining Unicode char U+016B (decimal 363)
   defining Unicode char U+016C (decimal 364)
   defining Unicode char U+016D (decimal 365)
   defining Unicode char U+016E (decimal 366)
   defining Unicode char U+016F (decimal 367)
   defining Unicode char U+0170 (decimal 368)
   defining Unicode char U+0171 (decimal 369)
   defining Unicode char U+0172 (decimal 370)
   defining Unicode char U+0173 (decimal 371)
   defining Unicode char U+0174 (decimal 372)
   defining Unicode char U+0175 (decimal 373)
   defining Unicode char U+0176 (decimal 374)
   defining Unicode char U+0177 (decimal 375)
   defining Unicode char U+0178 (decimal 376)
   defining Unicode char U+0179 (decimal 377)
   defining Unicode char U+017A (decimal 378)
   defining Unicode char U+017B (decimal 379)
   defining Unicode char U+017C (decimal 380)
   defining Unicode char U+017D (decimal 381)
   defining Unicode char U+017E (decimal 382)
   defining Unicode char U+01CD (decimal 461)
   defining Unicode char U+01CE (decimal 462)
   defining Unicode char U+01CF (decimal 463)
   defining Unicode char U+01D0 (decimal 464)
   defining Unicode char U+01D1 (decimal 465)
   defining Unicode char U+01D2 (decimal 466)
   defining Unicode char U+01D3 (decimal 467)
   defining Unicode char U+01D4 (decimal 468)
   defining Unicode char U+01E2 (decimal 482)
   defining Unicode char U+01E3 (decimal 483)
   defining Unicode char U+01E6 (decimal 486)
   defining Unicode char U+01E7 (decimal 487)
   defining Unicode char U+01E8 (decimal 488)
   defining Unicode char U+01E9 (decimal 489)
   defining Unicode char U+01EA (decimal 490)
   defining Unicode char U+01EB (decimal 491)
   defining Unicode char U+01F0 (decimal 496)
   defining Unicode char U+01F4 (decimal 500)
   defining Unicode char U+01F5 (decimal 501)
   defining Unicode char U+0218 (decimal 536)
   defining Unicode char U+0219 (decimal 537)
   defining Unicode char U+021A (decimal 538)
   defining Unicode char U+021B (decimal 539)
   defining Unicode char U+0232 (decimal 562)
   defining Unicode char U+0233 (decimal 563)
   defining Unicode char U+1E02 (decimal 7682)
   defining Unicode char U+1E03 (decimal 7683)
   defining Unicode char U+200C (decimal 8204)
   defining Unicode char U+2010 (decimal 8208)
   defining Unicode char U+2011 (decimal 8209)
   defining Unicode char U+2012 (decimal 8210)
   defining Unicode char U+2013 (decimal 8211)
   defining Unicode char U+2014 (decimal 8212)
   defining Unicode char U+2015 (decimal 8213)
   defining Unicode char U+2018 (decimal 8216)
   defining Unicode char U+2019 (decimal 8217)
   defining Unicode char U+201A (decimal 8218)
   defining Unicode char U+201C (decimal 8220)
   defining Unicode char U+201D (decimal 8221)
   defining Unicode char U+201E (decimal 8222)
   defining Unicode char U+2030 (decimal 8240)
   defining Unicode char U+2031 (decimal 8241)
   defining Unicode char U+2039 (decimal 8249)
   defining Unicode char U+203A (decimal 8250)
   defining Unicode char U+2423 (decimal 9251)
   defining Unicode char U+1E20 (decimal 7712)
   defining Unicode char U+1E21 (decimal 7713)
)
Now handling font encoding OT1 ...
... processing UTF-8 mapping file for font encoding OT1

(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu
File: ot1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
   defining Unicode char U+00A0 (decimal 160)
   defining Unicode char U+00A1 (decimal 161)
   defining Unicode char U+00A3 (decimal 163)
   defining Unicode char U+00AD (decimal 173)
   defining Unicode char U+00B8 (decimal 184)
   defining Unicode char U+00BF (decimal 191)
   defining Unicode char U+00C5 (decimal 197)
   defining Unicode char U+00C6 (decimal 198)
   defining Unicode char U+00D8 (decimal 216)
   defining Unicode char U+00DF (decimal 223)
   defining Unicode char U+00E6 (decimal 230)
   defining Unicode char U+00EC (decimal 236)
   defining Unicode char U+00ED (decimal 237)
   defining Unicode char U+00EE (decimal 238)
   defining Unicode char U+00EF (decimal 239)
   defining Unicode char U+00F8 (decimal 248)
   defining Unicode char U+0131 (decimal 305)
   defining Unicode char U+0141 (decimal 321)
   defining Unicode char U+0142 (decimal 322)
   defining Unicode char U+0152 (decimal 338)
   defining Unicode char U+0153 (decimal 339)
   defining Unicode char U+0174 (decimal 372)
   defining Unicode char U+0175 (decimal 373)
   defining Unicode char U+0176 (decimal 374)
   defining Unicode char U+0177 (decimal 375)
   defining Unicode char U+0218 (decimal 536)
   defining Unicode char U+0219 (decimal 537)
   defining Unicode char U+021A (decimal 538)
   defining Unicode char U+021B (decimal 539)
   defining Unicode char U+2013 (decimal 8211)
   defining Unicode char U+2014 (decimal 8212)
   defining Unicode char U+2018 (decimal 8216)
   defining Unicode char U+2019 (decimal 8217)
   defining Unicode char U+201C (decimal 8220)
   defining Unicode char U+201D (decimal 8221)
)
Now handling font encoding OMS ...
... processing UTF-8 mapping file for font encoding OMS

(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu
File: omsenc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
   defining Unicode char U+00A7 (decimal 167)
   defining Unicode char U+00B6 (decimal 182)
   defining Unicode char U+00B7 (decimal 183)
   defining Unicode char U+2020 (decimal 8224)
   defining Unicode char U+2021 (decimal 8225)
   defining Unicode char U+2022 (decimal 8226)
)
Now handling font encoding OMX ...
... no UTF-8 mapping file for font encoding OMX
Now handling font encoding U ...
... no UTF-8 mapping file for font encoding U
   defining Unicode char U+00A9 (decimal 169)
   defining Unicode char U+00AA (decimal 170)
   defining Unicode char U+00AE (decimal 174)
   defining Unicode char U+00BA (decimal 186)
   defining Unicode char U+02C6 (decimal 710)
   defining Unicode char U+02DC (decimal 732)
   defining Unicode char U+200C (decimal 8204)
   defining Unicode char U+2026 (decimal 8230)
   defining Unicode char U+2122 (decimal 8482)
   defining Unicode char U+2423 (decimal 9251)
))
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty
Package: amssymb 2013/01/14 v3.01 AMS font symbols

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\@emptytoks=\toks16
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 106.
))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2017/09/02 v2.17a AMS math features
\@mathmargin=\skip43

For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2000/06/29 v2.01 AMS text

(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks17
\ex@=\dimen103
))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen104
)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2016/03/08 v2.02 operator names
)
\inf@bad=\count87
LaTeX Info: Redefining \frac on input line 213.
\uproot@=\count88
\leftroot@=\count89
LaTeX Info: Redefining \overline on input line 375.
\classnum@=\count90
\DOTSCASE@=\count91
LaTeX Info: Redefining \ldots on input line 472.
LaTeX Info: Redefining \dots on input line 475.
LaTeX Info: Redefining \cdots on input line 596.
\Mathstrutbox@=\box26
\strutbox@=\box27
\big@size=\dimen105
LaTeX Font Info:    Redeclaring font encoding OML on input line 712.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 713.
\macc@depth=\count92
\c@MaxMatrixCols=\count93
\dotsspace@=\muskip10
\c@parentequation=\count94
\dspbrk@lvl=\count95
\tag@help=\toks18
\row@=\count96
\column@=\count97
\maxfields@=\count98
\andhelp@=\toks19
\eqnshift@=\dimen106
\alignsep@=\dimen107
\tagshift@=\dimen108
\tagwidth@=\dimen109
\totwidth@=\dimen110
\lineht@=\dimen111
\@envbody=\toks20
\multlinegap=\skip44
\multlinetaggap=\skip45
\mathdisplay@stack=\toks21
LaTeX Info: Redefining \[ on input line 2817.
LaTeX Info: Redefining \] on input line 2818.
)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
Package: color 2016/07/10 v1.1e Standard LaTeX Color (DPC)

(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package color Info: Driver file: dvips.def on input line 147.

(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/dvips.def
File: dvips.def 2017/06/20 v3.1d Graphics/color driver for dvips
)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def
File: dvipsnam.def 2016/06/17 v3.0m Driver-dependent file (DPC,SPQR)
))
No file 790b8db3bc7b0b621b608359f87d79b4103c5cdd.aux.
\openout1 = `790b8db3bc7b0b621b608359f87d79b4103c5cdd.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Try loading font information for U+msa on input line 9.
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info:    Try loading font information for U+msb on input line 9.

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
! Missing } inserted.
<inserted text>
                }
l.11 \end{displaymath}

?
[1

] (./790b8db3bc7b0b621b608359f87d79b4103c5cdd.aux) )
Here is how much of TeX's memory you used:
 1714 strings out of 494918
 19521 string characters out of 6180725
 65391 words of memory out of 5000000
 5048 multiletter control sequences out of 15000+600000
 8285 words of font info for 32 fonts, out of 8000000 for 9000
 14 hyphenation exceptions out of 8191
 27i,9n,26p,254b,112s stack positions out of 5000i,500n,10000p,200000b,80000s

Output written on 790b8db3bc7b0b621b608359f87d79b4103c5cdd.dvi (1 page, 612 byt
es).
[root@dragon tmp]#
...
Рейтинг: 0 / 0
Не работают Latex формулы
    #68420
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Умник^практик [игнорируется] 

Вроде бы исправил
picturepicture
picturepicture
picturepicture
...
Рейтинг: 1 / 0
Нравится: Док
Не работают Latex формулы
    #69071
basename
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Вот дедофункция по обработке latex формулы в картинку.

То есть, при вызове, структура, теги, не знаю, как правильно называется, уже формируется и во внутрь вставляется формула. Соответственно, достаточно просто математическую формулу, не оформляя полностью документ.
Код: PHP
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
//-------------------------------------------------------------------
function create_latex_png($formula, $density, $out_file)
{
    $hash = sha1(serialize(array('formula' => $formula, 'density' => $density)));

    $temp_dir = APPLICATION_ROOT . "tmp/";
    //$packages = array('amssymb,amsmath', 'color', 'amsfonts', 'amssymb', 'pst-plot');
    $packages = array('amssymb,amsmath', 'color', 'amsfonts', 'amssymb');

    $tex = '\documentclass[12pt]{article}' . "\n";

    $tex .= '\usepackage[utf8]{inputenc}' . "\n";

    // Packages
    foreach ($packages as $package) {
        $tex .= '\usepackage{' . $package . "}\n";
    }

    $tex .= '\begin{document}' . "\n";
    $tex .= '\pagestyle{empty}' . "\n";
    $tex .= '\begin{displaymath}' . "\n";

    $tex .= $formula . "\n";

    $tex .= '\end{displaymath}' . "\n";
    $tex .= '\end{document}' . "\n";

    if (file_put_contents($temp_dir . $hash . ".tex", $tex) === false) {
        throw new \Exception('Failed to create tex file!');
    }

    ////$command = 'cd ' . $temp_dir . '; ' . '/usr/bin/latex' . ' ' . $hash . '.tex < /dev/null |grep ^!|grep -v Emergency > ' . $temp_dir . $hash . '.err 2> /dev/null 2>&1';
    $command = 'cd ' . $temp_dir . '; ' . 'export HOME=/home/apache; /usr/bin/latex' . ' ' . $hash . '.tex < /dev/null | grep ^! | grep -v Emergency > ' . $temp_dir . $hash . '.err > /dev/null 2>&1';
    //debug_message($command);
    if (shell_exec($command) === null) {
        //throw new \Exception('Unable to compile LaTeX formula!');
    }

    if (!file_exists($temp_dir . $hash . '.dvi')) {
        throw new \Exception('Unable to compile LaTeX formula!');
    }

    $command = '/usr/bin/dvipng' . " -q -T tight -D " . $density . ' -o ' . $out_file . ' ' . $temp_dir . $hash . '.dvi 2>&1';

    if (shell_exec($command) === null) {
        throw new \Exception('Unable to convert the DVI file to PNG!');
    }

    if (!file_exists($out_file)) {
        throw new \Exception('Unable to convert the DVI file to PNG!');
    }

    @shell_exec('rm -f ' . $temp_dir . $hash . '.* 2>&1');
} // create_latex_png
//-------------------------------------------------------------------
Первоночальна дедострока закомментирована и я её немного подправил

Во-первых, непонятна эта конструкция 2> /dev/null 2>&1, когда достаточно > /dev/null 2>&1
Во-вторых, не все окружения в линуксах корреткно интерпретируют конструкции с конвеййером без отступов

Почему не работаk Latex

При запуске программа latex проверяет наличие или создаёт каталог со своими фалами в домашней директории пользователя, от которого запущена. Так как код выполняется веб-сервером, то соответственно запускается от пользователя apache, у которого логин фейковый, без шелла и в свою директорию он дсотупа не имеет. Соответсвенно, я создал директорию, выдал права и принудительно указал при вызове HOME=/home/apache; при этом, предварительно натравил latex на tex файл от вользователя apache, чтобы он создал необходимые файлы.
Код: BASH
1.
su apache -s /bin/bash -c "export HOME=/home/apache; cd /tmp; /usr/bin/latex test.tex"
Код: PHP
1.
2.
    ////$command = 'cd ' . $temp_dir . '; ' . '/usr/bin/latex' . ' ' . $hash . '.tex < /dev/null |grep ^!|grep -v Emergency > ' . $temp_dir . $hash . '.err 2> /dev/null 2>&1';
    $command = 'cd ' . $temp_dir . '; ' . 'export HOME=/home/apache; /usr/bin/latex' . ' ' . $hash . '.tex < /dev/null | grep ^! | grep -v Emergency > ' . $temp_dir . $hash . '.err > /dev/null 2>&1';
Я не помню, чтобы у деда кто-то пользовался этими формулами, но вроде по заявлению деды у него всё работало корректно. Возможно в другом линупсе как-то по-другому.

остаётся загадкой, каким образом создалась проверочная формула.
...
Рейтинг: 0 / 0
16 сообщений из 16, страница 1 из 1
Форумы / Вопросы по форуму [закрыт для гостей] / Не работают Latex формулы
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали тему (1): Анонимы (1)
Читали форум (3): Анонимы (1), serpstatbot bot, Yandex Bot 1 мин.
Пользователи онлайн (39): Анонимы (24), serpstatbot bot, IT-Клоп, Ифрит, sergey11, Yandex Bot, Разум вселенной 1 мин., Неуловимый Джо 1 мин., s62 2 мин., Green 2 мин., Гарыныч 2 мин., Сталкер 2 мин., cat2 3 мин., Biene Maja 4 мин., Ветер 6 мин., anonymous 8 мин.
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]