Перейти к содержимому

Undefined control sequence latex что это

  • автор:

Ошибка в LaTex ! Undefined control sequence.

При компиляции выдает ошибку: ! Undefined control sequence. \DeclareUnicodeCharacter и так ругается на все строки ниже. На других компьютерах собирает файл нормально. Помогите исправить, пожалуйста. В LaTex 2й день, так что подробно.

\usepackage[english,russian] \usepackage \usepackage

\usepackage[pdftex] \usepackage \usepackage \usepackage \usepackage \usepackage \linespread \pagestyle \usepackage

(государственный университет) \flqq МФТИ\frqq\\

Факультет \\ Кафедра \\ \end

godseffiana
19.05.18 13:20:16 MSK

Какая кодировка у самого текста? UTF-8? В смысле unicode?

Наводящий вопрос: Какой операционной системой пользуешься? В каком редакторе текст набираешь?

Evgueni ★★★★★
( 19.05.18 13:46:37 MSK )
Ответ на: комментарий от Evgueni 19.05.18 13:46:37 MSK

Кодировка \usepackage[cp1251]. Система Win7, набираю в редакторе Texmaker, далее компилирую в PDFLaTex/

godseffiana
( 19.05.18 13:58:49 MSK ) автор топика
Ответ на: комментарий от Evgueni 19.05.18 13:46:37 MSK

Смущает то, что это свежая система и только загруженный тех, а он не попросил не единой дозагрузки файла. Возможно в этом дело.

godseffiana
( 19.05.18 14:05:58 MSK ) автор топика
Ответ на: комментарий от godseffiana 19.05.18 13:58:49 MSK

А точно cp1251? Я не очень в курсе какое там в win7 сейчас тысячелетие, что до сих пор используется 8ми битная кодировка, но по моим воспоминаниям Texmaker по умолчанию вроде как utf-8 предполагает.

То, что было в посте собирается без проблем (я поменял cp1251 на utf-8). Естественно нужно добавить \end и \end, которые почему-то выпущены.

Evgueni ★★★★★
( 19.05.18 14:06:10 MSK )
Последнее исправление: Evgueni 19.05.18 14:08:07 MSK (всего исправлений: 1)

Ответ на: комментарий от godseffiana 19.05.18 14:05:58 MSK

Не очень понимаю что значит дозагрузка файла. Если не очень разбираетесь, то лучше ставить сразу _весь_ дистрибутив чтобы не нужны были никакие дозагрузки.

Evgueni ★★★★★
( 19.05.18 14:07:39 MSK )
Ответ на: комментарий от Evgueni 19.05.18 14:07:39 MSK

Я о дозагрузке пакетов при первом запуске

godseffiana
( 19.05.18 14:21:10 MSK ) автор топика

Before compiling your first document, you must set the encoding used by the editor («Configure Texmaker» -> «Editor» -> «Editor Font Encoding»).

Убедитесь, что там выставлена та же кодировка, что и в теле документа.

Evgueni ★★★★★
( 19.05.18 14:21:23 MSK )
Ответ на: комментарий от Evgueni 19.05.18 14:07:39 MSK

я поменяла кодировку на utf-8 и у меня появилась теперь такая ошибка ! LaTeX Error: File `utf-8.def’ not found.Type X to quit or to proceed,or enter new name. (Default extension: def)Enter file name:! Emergency stop. \endinput

godseffiana
( 19.05.18 14:24:29 MSK ) автор топика
Ответ на: комментарий от godseffiana 19.05.18 14:21:10 MSK

. А зачем? Такое ощущение, что вы устанавливаете что-то очень и очень странное. Всё должно лежать у вас на диске.

Evgueni ★★★★★
( 19.05.18 14:24:30 MSK )
Ответ на: комментарий от godseffiana 19.05.18 14:24:29 MSK

Извиняюсь. Поставьте utf8 (без тире).

Evgueni ★★★★★
( 19.05.18 14:25:12 MSK )

Evgueni ★★★★★
( 19.05.18 14:26:44 MSK )
Ответ на: комментарий от Evgueni 19.05.18 14:25:12 MSK

Если без тире, то вот что выдает ! Missing ) inserted for expression.( ��

godseffiana
( 19.05.18 14:26:57 MSK ) автор топика
Ответ на: комментарий от godseffiana 19.05.18 14:26:57 MSK

Давайте файл целиком. А лучше пройдите указанный мной выше тьюториал.

Evgueni ★★★★★
( 19.05.18 14:29:13 MSK )
Ответ на: комментарий от Evgueni 19.05.18 14:29:13 MSK
godseffiana
( 19.05.18 14:41:53 MSK ) автор топика
Ответ на: комментарий от godseffiana 19.05.18 14:41:53 MSK

Я закомментировал только вставку картинок, потому что их не было.

Текст имеет кодировку cp1251, так что поменяйте utf8 обратно на то, что было.

Проблема скорее всего в том, что и как вы на win7 установили. Тут к сожалению мои телепатические способности отказывают. Могу только посоветовать прибить то, что у вас сейчас там стоит и поставить современный дистрибутив полностью (не жадничать с местом), например TeX Live: https://tug.org/texlive/acquire-netinstall.html

Возможно вам удастся настроить то, что у вас есть сейчас, но как это сделать я не знаю, так как в моём случае установка начиналась и заканчивалась, как правило, командой

> apt install texlive-full 

Evgueni ★★★★★
( 19.05.18 14:53:37 MSK )
Последнее исправление: Evgueni 19.05.18 14:56:16 MSK (всего исправлений: 3)

Undefined control sequence

This error appears when L a T e X does not understand one of the commands you have used.

Common Examples

Typo in a command:

The most common causes of such an error are simple typos. An example of such a typo is shown below, where you accidentally pressed Z instead of a when writing \alpha

A typo when writing $\alpha$ could be $\Zlpha$ 

This will give an error message of

main.tex, line 10

Undefined control sequence.

\Zlpha l.10 A typo when writing $\alpha$ could be $\Zlpha $ The control sequence at the end of the top line of your error message was never \def’ed. If you have misspelled it (e.g., `\hobx’), type `I’ and the correct spelling (e.g., `I\hbox’). Otherwise just continue, and I’ll forget about whatever was undefined. [1

These errors are easily spotted by humans but can cause LaTeX to get confused as to what is being asked.

Forgetting to load a package:

Another cause of such an error is when a specific package is needed to use a certain command, but it is accidentally forgotten in the preamble. An example of this would be

I want to include a space after the word \LaTeX\xspace but I have forgotten to load the xspace package.

In this example, the document will fail to compile as L a T e X doesn’t recognize the \xspace command. This is not a typo, as \xspace is a perfectly fine command. The problem is that you have forgotten to include \usepackage in the preamble. When this line is included, the error message will disappear as LaTeX now knows how to interpret the \xspace command.

Backslash used in wrong place:

Another cause of an Undefined Control Sequence error is a backslash used inappropriately. This can happen particularly when writing file links as shown below.

An error will be generated if you write a file path as C:\Users\Files 

The issue is that when LaTeX sees a backslash \ , it interprets what follows as a command. Here, there is no such command as \Users, so you will get an Undefined Control Sequence error. To avoid this, when writing text you should write a backslash as \backslash . For writing long file paths and urls, it may sometimes be more convenient to use the url package rather than writing \backslash every time.

  • Documentation Home
  • Learn LaTeX in 30 minutes

Overleaf guides

  • Creating a document in Overleaf
  • Uploading a project
  • Copying a project
  • Creating a project from a template
  • Using the Overleaf project menu
  • Including images in Overleaf
  • Exporting your work from Overleaf
  • Working offline in Overleaf
  • Using Track Changes in Overleaf
  • Using bibliographies in Overleaf
  • Sharing your work with others
  • Using the History feature
  • Debugging Compilation timeout errors
  • How-to guides
  • Guide to Overleaf’s premium features

LaTeX Basics

  • Creating your first LaTeX document
  • Choosing a LaTeX Compiler
  • Paragraphs and new lines
  • Bold, italics and underlining
  • Lists
  • Errors

Mathematics

  • Mathematical expressions
  • Subscripts and superscripts
  • Brackets and Parentheses
  • Matrices
  • Fractions and Binomials
  • Aligning equations
  • Operators
  • Spacing in math mode
  • Integrals, sums and limits
  • Display style in math mode
  • List of Greek letters and math symbols
  • Mathematical fonts
  • Using the Symbol Palette in Overleaf

Figures and tables

  • Inserting Images
  • Tables
  • Positioning Images and Tables
  • Lists of Tables and Figures
  • Drawing Diagrams Directly in LaTeX
  • TikZ package

References and Citations

  • Bibliography management with bibtex
  • Bibliography management with natbib
  • Bibliography management with biblatex
  • Bibtex bibliography styles
  • Natbib bibliography styles
  • Natbib citation styles
  • Biblatex bibliography styles
  • Biblatex citation styles

Languages

  • Multilingual typesetting on Overleaf using polyglossia and fontspec
  • Multilingual typesetting on Overleaf using babel and fontspec
  • International language support
  • Quotations and quotation marks
  • Arabic
  • Chinese
  • French
  • German
  • Greek
  • Italian
  • Japanese
  • Korean
  • Portuguese
  • Russian
  • Spanish

Document structure

  • Sections and chapters
  • Table of contents
  • Cross referencing sections, equations and floats
  • Indices
  • Glossaries
  • Nomenclatures
  • Management in a large project
  • Multi-file LaTeX projects
  • Hyperlinks

Formatting

  • Lengths in L a T e X
  • Headers and footers
  • Page numbering
  • Paragraph formatting
  • Line breaks and blank spaces
  • Text alignment
  • Page size and margins
  • Single sided and double sided documents
  • Multiple columns
  • Counters
  • Code listing
  • Code Highlighting with minted
  • Using colours in LaTeX
  • Footnotes
  • Margin notes

Fonts

  • Font sizes, families, and styles
  • Font typefaces
  • Supporting modern fonts with X Ǝ L a T e X

Presentations

Commands

Field specific

  • Theorems and proofs
  • Chemistry formulae
  • Feynman diagrams
  • Molecular orbital diagrams
  • Chess notation
  • Knitting patterns
  • CircuiTikz package
  • Pgfplots package
  • Typesetting exams in LaTeX
  • Knitr
  • Attribute Value Matrices

Class files

  • Understanding packages and class files
  • List of packages and class files
  • Writing your own package
  • Writing your own class

Advanced TeX/LaTeX

Научный форум dxdy

Gnuplot и LaTeX, ошибка ! Undefined control sequence.

Gnuplot и LaTeX, ошибка ! Undefined control sequence.
20.03.2018, 00:15

(строю из файла DistAnalysisHyst.dat график)
казалось бы все замечательно должно быть, но мне выкидывает ошибку при компиляции (вернее ряд ошибок)
! Undefined control sequence. \CYRR \gplfronttext
! Undefined control sequence. \cyrlje \gplfronttext
и т.п.

при том ошибки в файле . -fig1.tex

замечу, так было не всегда, раньше работало, но вот переустановил систему и началось (установку вроде проводил осознанно, миктех, техмэйкер, гнуплот, в настройках прописал pdflatex -synctex=1 —enable-write18 -interaction=nonstopmode %.tex)

жду мнения экспертов, что это может быть, как лечиться

Общий форум

после перезда с хостинга на выделенный сервер перестали отображаться формулы, ну ладно, думаю пакеты надо поставить, поставил, в настройках фильтра:

Path of latex binary filter_tex_pathlatex
Значение по умолчанию: /usr/bin/latex
Path of dvips binary filter_tex_pathdvips
Значение по умолчанию: /usr/bin/dvips
Path of convert binary filter_tex_pathconvert
Значение по умолчанию: /usr/bin/convert
вроде как все норм
с преабулами тоже по рекомендациям все нормально:
Преамбула LaTeX filter_tex_latexpreamble

Менял на дефолтные, никаких изменений.

Вот так с данными настройками отображается простейшая формула(Знаки $$ намеренно упустил):

выполнил filter/tex/texdebug.php п4 и п5

п4 отображется в атаче

Checking executables

latex executable (/usr/bin/tex) is readable
dvips executable (/usr/bin/dvips) is readable
convert executable (/usr/bin/convert) is readable

base filename for expression is ‘db2c39f297252dc0db1fb26bf1cb69f9’

Processing TeX expression:

f(x)=\int_<-\infty>^x~e^dt
$ /usr/bin/tex --interaction=nonstopmode /home/moodle/moodledata/temp/latex/db2c39f297252dc0db1fb26bf1cb69f9.tex OUTPUT: This is TeX, Version 3.1415926 (TeX Live 2009/Debian) (/home/moodle/moodledata/temp/latex/db2c39f297252dc0db1fb26bf1cb69f9.tex ! Undefined control sequence. l.1 \documentclass [12pt] ! Undefined control sequence. l.2 \usepackage [utf-8] ! Undefined control sequence. l.3 \usepackage ! Undefined control sequence. l.4 \usepackage ! Undefined control sequence. l.5 \RequirePackage ! Undefined control sequence. l.6 \usepackage [english,russian]\pagestyle ! Undefined control sequence. l.6 \usepackage[english,russian]\pagestyle ! Undefined control sequence. l.7 \begin Overfull \hbox (0.85716pt too wide) in paragraph at lines 1--9 []\tenrm [12pt]article [utf-8]inputenc ams-math ams-fonts ams-math,amssymb,late xsym [en-glish,russian]babelempty| [1] ) (see the transcript file for additional information) Output written on db2c39f297252dc0db1fb26bf1cb69f9.dvi (1 page, 652 bytes). Transcript written on db2c39f297252dc0db1fb26bf1cb69f9.log. RETURN CODE: 1
$ /usr/bin/dvips -E /home/moodle/moodledata/temp/latex/db2c39f297252dc0db1fb26bf1cb69f9.dvi -o /home/moodle/moodledata/temp/latex/db2c39f297252dc0db1fb26bf1cb69f9.ps OUTPUT: RETURN CODE: 0
$ /usr/bin/convert -density 240 -trim /home/moodle/moodledata/temp/latex/db2c39f297252dc0db1fb26bf1cb69f9.ps /home/moodle/moodledata/temp/latex/db2c39f297252dc0db1fb26bf1cb69f9.png OUTPUT: RETURN CODE: 0


Где я что упускаю?

Moodle 1.9.12
Система
Linux 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux Debian 6.0

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *