GeneralLatex Command Error

LaTeX specific issues not fitting into one of the other forums of this category.
gzah
Posts: 7
Joined: Sat Jul 11, 2020 6:09 pm

Latex Command Error

Post by gzah »

Could you kindly help me?

When I am trying to include bookmarks in my dissertation, this error seems to always crop up, when including packages bookmark and hyperref :
0 if tex.enableprimitives then
tex.enableprimitives(
'pdf@',
'primitive',
'ifprimitive', 'pdfdraftmode','draftmode'
)
tex.enableprimitives(", 'luaescapestring')
end
Thanks a lot

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Latex Command Error

Post by Stefan Kottwitz »

Welcome to the forum!

I don't see LaTeX code nor used packages, and there's no error message. Perhaps provide more information?

Stefan
LaTeX.org admin
gzah
Posts: 7
Joined: Sat Jul 11, 2020 6:09 pm

Latex Command Error

Post by gzah »

So when I am including

Code: Select all

\usepackage[openbookmarks=true]{hyperref}
\usepackage{bookmark}
Then this message or text, is displayed on the front page.

Could you kindly guide me on what is best to do please ?

Thanks a lot
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Latex Command Error

Post by Stefan Kottwitz »

gzah wrote:Then this message or text, is displayed on the front page.
Which message? LaTeX error messages are long and refere to the code line.

And, can you post the .log file here, as attachment?

Stefan
LaTeX.org admin
gzah
Posts: 7
Joined: Sat Jul 11, 2020 6:09 pm

Latex Command Error

Post by gzah »

There is no error message from the compiler.

On the front page of my dissertation, it includes a new page with the following text :
0 if tex.enableprimitives then
tex.enableprimitives(
'pdf@',
'primitive',
'ifprimitive', 'pdfdraftmode','draftmode'
)
tex.enableprimitives(", 'luaescapestring')
end
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Latex Command Error

Post by Stefan Kottwitz »

That is actually code from the `pdftexcmds.sty` file, part of:

Code: Select all

\ifluatex
  \ifnum\luatexversion<36 %
    \def\pdftexcmds@directlua{\directlua0 }%
  \else
    \let\pdftexcmds@directlua\directlua
  \fi
  \begingroup
    \newlinechar=10 %
    \endlinechar=\newlinechar
    \pdftexcmds@directlua{%
      if tex.enableprimitives then
        tex.enableprimitives(
          'pdf@',
          {'primitive', 'ifprimitive', 'pdfdraftmode'}
        )
        tex.enableprimitives('', {'luaescapestring'})
      end
    }%
  \endgroup %
\fi
That should never be printed in a document.

Can you post you document preamble, that is, the code until \begin{document} plus the first code before your own text comes?

Stefan
LaTeX.org admin
gzah
Posts: 7
Joined: Sat Jul 11, 2020 6:09 pm

Latex Command Error

Post by gzah »

Code: Select all

\documentclass[12pt, a4paper]{report}

%%these packages are not really necessary if you dont need the code and proofs environments
%%so if you like you can delete from here till the next comment
%%note that there are some examples below which obviously won't work once you remove this part
\usepackage{verbatim}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{syntax}
\usepackage{fyp}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{algpseudocode}
\usepackage{algorithm}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{geometry}
\usepackage{setspace}
\usepackage{enumerate}
\usepackage{stmaryrd}
\usepackage{ragged2e}
\newcommand{\myGray}[1]{\textcolor{gray}{#1}}
\usepackage[labelfont=bf]{caption}
\usepackage[openbookmark=true]{hyperref}
\usepackage{bookmark}
%%this environment is useful if you have code snippets
\newenvironment{code}
{\footnotesize\verbatim}{\endverbatim\normalfont}

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

%%the following environments are useful to present proofs in your thesis
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\theoremstyle{definition}%plain}
\newtheorem{example}{Example}[section]
\theoremstyle{definition}%remark}
\newtheorem{proposition}{Proposition}[section]
\theoremstyle{definition}%remark}
\newtheorem{lemma}{Lemma}[section]
\theoremstyle{definition}%remark}
\newtheorem{corollary}{Corollary}[section]
\theoremstyle{definition}%remark}
\newtheorem{theorem}{Theorem}[section]
%%you can delete till here if you dont need the code and proofs environments

%\setlength{\headheight}{5pt}
%\setlength{\voffset}{-2 in}
%\setlength{\hoffset}{-0.5 in}
%\setlength{\textwidth}{460 pt}
%\setlength{\textheight}{800 pt}
\setlength{\parindent}{2.5em}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Latex Command Error

Post by Stefan Kottwitz »

That code looks ok except that I never saw a package called fyp.

Do you use that? If not, then remove the line

\usepackage{fyp}

Stefan
LaTeX.org admin
gzah
Posts: 7
Joined: Sat Jul 11, 2020 6:09 pm

Latex Command Error

Post by gzah »

It is a package provided by the University for formatting.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Latex Command Error

Post by Stefan Kottwitz »

Ok, then it may be in the way you are compiling the document.

Do you get a .log file that you can post? That contains debugging information.

Stefan
LaTeX.org admin
Post Reply