empheq 패키지를 사용한 정의되지 않은 제어 시퀀스

empheq 패키지를 사용한 정의되지 않은 제어 시퀀스

저는 이 커뮤니티와 TeX에 처음 들어왔습니다. 패키지 와 함께 TeX 파일에 몇 가지 방정식을 추가하려고 합니다 empheq. 패키지 설치에 문제가 있다고 가정하고 Kile KDE 편집기를 사용하고 있습니다.

사용된 패키지는 다음과 같습니다.

     %% packages
    \usepackage[T1]{fontenc}
    \usepackage[utf8x]{inputenc}
    \usepackage{float}
    \usepackage{amsfonts,amssymb} % needed for math fonts
    %\usepackage[ruled,vlined,linesnumbered,resetcount,algochapter]{algorithm2e}
    \usepackage{amsmath} % needed for command eqref
    %\usepackage{mathtools}
    %\usepackage{algorithm}
    %\usepackage{algorithmic}
    %\usepackage{algorithmic}
    \usepackage{longtable}
    \usepackage{lmodern}
    %\usepackage{bookmark}
    %\usepackage{algpseudocode}
    %\usepackage{algcompatible}
    %
    \usepackage[greek,english]{babel}
    \usepackage{alphabeta}

    \usepackage[
        unicode
        ,colorlinks=true
        ,breaklinks
        %,greek
        ]{hyperref} % needed for creating hyperlinks in the document, the option colorlinks=true gets rid of the %awful %boxes, breaklinks breaks lonkg links (list of figures), and ngerman sets everything for german as %default hyperlinks %language
    %\usepackage[utf8]{inputenc}
    %\usepackage{bookmark}
    \usepackage{algpseudocode}

    %\usepackage[hyphenbreaks]{breakurl} % benötigt für das Brechen von URLs in Literaturreferenzen, hyphenbreaks auch bei %links, die über eine Seite gehen (mit hyphenation).
    \usepackage{xcolor}
    %\definecolor{c1}{rgb}{0,0,1} % blue
    %\definecolor{c2}{rgb}{0,0.3,0.9} % light blue
    %\definecolor{c3}{rgb}{0.3,0,0.9} % red blue%
    \hypersetup{
      colorlinks=True,
        linkcolor=blue, % internal links    
        citecolor=green!0.3!blue!0.9,
      urlcolor=red!0.3!blue!0.9} % external links/urls

    \usepackage{alphabeta}
\usepackage{algorithm, algcompatible}
\usepackage{empheq, nccmath} 
    %\usepackage{cite}          % needed for cite
    \usepackage[nottoc]{tocbibind}      % needed for displaying bibliography and other in the table of contents
    \usepackage[numbers, authoryear]{natbib}    % needed for cite and abbrvnat bibliography style
    \usepackage{graphicx}           % needed for \includegraphics 
    \usepackage{bigstrut}           % needed for the command \bigstrut
    \usepackage{enumerate}          % needed for some options in enumerate
    %\usepackage{todonotes}         % needed for todos
    %\usepackage{makeidx}           % needed for creating an index
    %\makeindex
    \newcommand\Mycite[1]{%
      \citeauthor{#1}~[\citeyear{#1}]}

이것은 주요 TeX 스크립트입니다:

\documentclass[a4paper, 12pt, openany]{book}

    \input{settings/packages}
    %\usepackage{algorithm, algcompatible}
    %\usepackage{empheq, nccmath} 
    \algnewcommand\INPUT{\item[\textbf{Input:}]}%
    \algnewcommand\OUTPUT{\item[\textbf{Output:}]}%

    %\input{settings/page}
    \graphicspath{{Images/}}
    \DeclareMathOperator*{\argmax}{argmax}
    %\makeglossaries

    %\input{settings/macros}
    %\newcommand{\imp}[1]{\underline{\textit{#1}}}
    %\input{Contents/abbreviations}
    \bibliographystyle{abbrvnat}
    %\setcitestyle{}
    %\setcounter{page}{4} 
    % Main document Below
    \begin{document}

    \pagestyle{empty}
    %\input{Contents/title_page} 
    \input{abstractGR}
    %\input{abstractEn}

    \pagestyle{plain}
    %\setotherlanguage{greek}
    %\selectlanguage{greek}
    \listoffigures
    \listoftables
    \tableofcontents
    \raggedbottom
    %\flushbottom
    %\clearpage\phantomsection
    %\selectlanguage{english}

    \pagebreak
    %\printglossary[type=\acronymtype,title=Abbreviations]
    % Insert dedication
    \vspace*{10cm}
    \centering{\large{\emph{\textgreek{ Στην Οικογενειά μου...} }}}
    \vfill
    \pagebreak

    \raggedright
    %\pagestyle{plain}
    %\input{chapters/introduction}
    %\input{chapters/modelSelection}
    %\input{chapters/post_process}
    %\chapter{}
    %\input{chapters/experiments}
    %\input{chapters/conclusion}
    %\appendix
    %\addtocontents{toc}{\contentsline{chapter}{\numberline{}APP}{}{}}
    %\addtocontents{toc}{\protect\contentsline{chapter}{Appendix}{}}
    %\input{chapters/appendix}
    %\addtocontents{toc}{\protect\contentsline{chapter}{\protect\numberline{}Appendix}{}{chapter*.\thepage}}

        %\newpage
        %\chapter{Introduction}

        \medskip
        %\citet*{*}
        %\cite{latexcompanion}
        %\bibliography{thesis}

        %\printindex

    \end{document}

다음을 포함하는 abstractGR.tex 파일empheq

\chapter*{\centering \textgreek{Περίληψη}}
%\addtocontents{toc}{\protect\contentsline{chapter}{\protect\numberline{}\textgreek{Περίληψη (Ελληνικά)}}{}{chapter*.%\thepage}}
%\addcontentsline{toc}{chapter}{Abstract (Greek)}
\textgreek{Η παρούσα διπλωματική εξετάζει το πρόβλημα της αναγνώρισης αντικειμένων από εικόνες, των οποίων τα πίξελ είναι ταξινομημένα σε μια από τις 19 κατηγορίες. Η εργασία χρησιμοποιεί μια βάση δεδομένων που αποτελείται από 19 διαφορετικές κατηγοριές αντικειμένων η οποία έχει δημιουργηθεί με χρήση κάμερας τοποθετημένη στο εμπρόσθιο μέρος του αυτοκινήτου. Οι εικόνες έχουν απαθανατιστεί από 50 διαφορετικές πόλεις της Ευρώπης σε διάφορες εποχές και καιρικές συνθήκες.\\

Με την χρήση πληροφορίας από εικόνες κατασκευάζουμε έναν ταξινομηττή ο οποίος μπορεί να αναγνωρίσει την κατηγορία αντικειμένων που ανήκει το κάθε πίξελ στην εικόνα ως συνάρτηση του μεγέθους των pixel αλλά και της δομής που απεικονίζουν. Για την ταξινόμηση χρησιμοποιήσαμε 2 πανομοιότυπα μοντέλα πλήρως συνελικτικών νευρωνικών δικτύων (}FCNNs\textgreek{) σε συνδυασμό με 2 διαφορετικά μοντέλα μετά επεξεργασίας. Το πρώτο μοντέλο κάνει χρήση του Μέσου Φίλτρου(}Median Filter\textgreek{), ενώ το δεύτερο κάνει χρήση μιας παραλλαγής του στατιστικού μοντέλου }CRF. \textgreek{Για την εικονοποίηση των παραπάνω αποτελεσμάτων υλοποιήθηκε λογισμικό που απεικονίζει τα αποτελέσματα των μεθόδων. Για την κατασκευή των παραπάνω μοντέλων γίνεται χρήση των βιβλιοθηκών }Scikit-learn, Keras \textgreek{ και} Tensorflow, \textgreek{ ενώ για την υλοποίηση του λογισμικού εικονοποίησης έγινε η χρήση της βιβλιοθήκης} pyQt.


\chapter*{\centering Abstract}
%\addtocontents{toc}{\protect\contentsline{chapter}{\protect\numberline{}Abstract (English)}{}{chapter*.\thepage}}

This thesis focuses the problem of recognizing objects from images whose images are classified in one of the 19 categories. The job uses a database consisting of 19 different categories of objects created using a camera located on the front of the car. Images have been recorded in 50 different European cities in different seasons and weather conditions.

Using information from images, we construct a classifier that can recognize the category of objects belonging to each image of the image as a function of the size of the pixels and the structure they represent. For classification, we used 2 identical Fully Convolutional Neural Networks in combination with 2 different models after editing. The first model uses Median Filter), while the latter uses a variation of the CRF statistical model. To illustrate the above results, we have implemented software that illustrates the results of the methods. To build the above models, we use Scikit-learn, Keras and Tensorflow, while using pyQt libraries.

\begin{empheq}{align} 
    \mathit{Loss(P,Q)} &= - \frac{1}{N} \sum_{x}^{N} P(x)\times 
    \log(Q(x)) \times \alpha_{\mathit{coefficients}}\\
    \nabla\times\overline{E}\notag
     &= -\frac{\partial\overline{B}}{\partial t}-\bar J_{\text{mi}} 
\end{empheq}

호출 은 위 장의 empheq장에 있습니다 . 패키지를 에서 로 옮기면 매력처럼 작동합니다.abstractGR.texpackages.texmain.tex

답변1

업데이트: 문서 수업 책이 잘 작동합니다.

\documentclass{book}
\usepackage{empheq}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}
    \begin{empheq}[left=\empheqlbrace]{align}
    \mathit{Loss(P,Q)} &= - \frac{1}{N} \sum_{x}^{N} P(x)\times 
    \log(Q(x)) \times \alpha_{\mathit{coefficients}}\\
    \nabla\times\overline{E}\notag
     &= -\frac{\partial\overline{B}}{\partial t}-\bar J_{\text{mi}} 
\end{empheq}
\end{document} 

여기에 이미지 설명을 입력하세요

{\mathit{coefficients}나는 @Zarko에서 훔쳐서 IMHO가 더 좋아 보이기 때문에 교체 \bar했습니다 .\overline

두 번째 업데이트: 코드에 여러 옵션 충돌이 있습니다. 나는 내 컴퓨터에서 결코 실행할 수 없었던 바벨과 그리스어와 관련된 문제를 제외하고 모두 해결했다고 생각합니다. 예를 들어, 링크 등의 색상을 설정하기 위해 Definecolor가 필요하지 않습니다.

\documentclass{book}
%% packages
\usepackage{amsfonts,amssymb} % needed for math fonts
\usepackage{empheq, nccmath}
\usepackage{amsmath} % needed for command eqref
\usepackage{longtable}
\usepackage{lmodern}
\usepackage{xcolor}
\usepackage[unicode,
    ,colorlinks=true
    ,breaklinks
%    ,greek
    ]{hyperref}
\usepackage{bookmark}
\hypersetup{
  colorlinks=true,
  linkcolor=blue,
  citecolor=green!0.3!blue!0.9
  urlcolor=red!0.3!blue!0.9}
%\usepackage[greek,english]{babel}
\usepackage{alphabeta}
%%%
% \usepackage{} 
%\usepackage[utf8]{inputenc}
\usepackage{algpseudocode}
\usepackage{algorithm}
%\usepackage[hyphenbreaks]{breakurl} % benötigt für das Brechen von URLs in Literaturreferenzen, hyphenbreaks auch bei %links, die über eine Seite gehen (mit hyphenation).
 % needed for creating hyperlinks in the document, the option colorlinks=true gets rid of the %awful %boxes, breaklinks breaks lonkg links (list of figures), and ngerman sets everything for german as %default hyperlinks %language
% \definecolor{c1}{rgb}{0,0,1} % blue
% \definecolor{c2}{rgb}{0,0.3,0.9} % light blue
% \definecolor{c3}{rgb}{0.3,0,0.9} % red blue
% \hypersetup{
%     linkcolor={c1}, % internal links
%     citecolor={c2}, % citations
%     urlcolor={c3} % external links/urls
% }

%

\usepackage{alphabeta}
\usepackage[numbers, authoryear]{natbib}    % needed for cite and abbrvnat bibliography style
\usepackage[nottoc]{tocbibind}      % needed for displaying bibliography and other in the table of contents
\usepackage{graphicx}           % needed for \includegraphics 
\usepackage{bigstrut}           % needed for the command \bigstrut
\usepackage{enumerate}          % needed for some options in enumerate
% \newcommand\Mycite[1]{%
%   \citeauthor{#1}~[\citeyear{#1}]}
% 

    \begin{document}        
    \begin{empheq}[left=\empheqlbrace]{align}
            \mathit{Loss(P,Q)} = - \frac{1}{N} \sum_{x}^{N} P(x)\times log(Q(x)) \times \alpha_{coefficients}
            \nabla\times\bar E &= -\frac{\partial\bar B}{\partial t}-\bar J_{\text{mi}} 
        \end{empheq}
    \end{document}


    \documentclass{book}
\usepackage{empheq}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}
    \begin{empheq}[left=\empheqlbrace]{align}
    \mathit{Loss(P,Q)} &= - \frac{1}{N} \sum_{x}^{N} P(x)\times 
    \log(Q(x)) \times \alpha_{\mathit{coefficients}}\\
    \nabla\times\overline{E}\notag
     &= -\frac{\partial\overline{B}}{\partial t}-\bar J_{\text{mi}} 
\end{empheq}
\end{document} 

여기에 이미지 설명을 입력하세요

@Zarko가 두려워서 여기서 방정식을 마사지하지 않았습니다 ;-)

답변2

옵션 없이 처음에 hyperref로드할 때 옵션 충돌이 발생 하고 로드되므로 나중에 하이퍼참조를 로드할 때 오류가 발생합니다.bookmarkhyperref

이동하여 문제를 해결하면 옵션 이 없는 bookmarks오류가 발생합니다 . 마지막으로 첫 번째 옵션으로 환경을 전달해야 하는 문서에 오류가 있습니다 .hyperrefgreekempheq

   \documentclass{book}
 %% packages
%\usepackage{xgreek}
%\usepackage[utf8]{inputenc}
\usepackage{amsfonts,amssymb} % needed for math fonts
\usepackage{empheq, nccmath}
%\usepackage[ruled,vlined,linesnumbered,resetcount,algochapter]{algorithm2e}
\usepackage{amsmath} % needed for command eqref
%\usepackage{mathtools}
%\usepackage{algorithm}
%\usepackage{algorithmic}
%\usepackage{algpseudocode}
%\usepackage{algcompatible}
%\usepackage{algorithmic}
%\usepackage[toc, appendix]{appendix}
\usepackage{longtable}
%\usepackage[utf8]{inputenc}
%\usepackage[acronym]{glossaries}
%%% Testt
%\usepackage[LGR,T1]{fontenc}
\usepackage{lmodern}

%
\usepackage[greek,english]{babel}
\usepackage{alphabeta}
%\usepackage[utf8]{inputenc}
%%%
\usepackage{algpseudocode}
\usepackage{algorithm}
\usepackage[
     unicode,
    ,colorlinks=true
    ,breaklinks
%    ,greek
    ]{hyperref} % needed for creating hyperlinks in the document, the option colorlinks=true gets rid of the %awful %boxes, breaklinks breaks lonkg links (list of figures), and ngerman sets everything for german as %default hyperlinks %language
%\usepackage[utf8]{inputenc}
\usepackage{bookmark}

\usepackage{empheq}
%\usepackage[hyphenbreaks]{breakurl} % benötigt für das Brechen von URLs in Literaturreferenzen, hyphenbreaks auch bei %links, die über eine Seite gehen (mit hyphenation).
\usepackage{xcolor}
\definecolor{c1}{rgb}{0,0,1} % blue
\definecolor{c2}{rgb}{0,0.3,0.9} % light blue
\definecolor{c3}{rgb}{0.3,0,0.9} % red blue
\hypersetup{
    linkcolor={c1}, % internal links
    citecolor={c2}, % citations
    urlcolor={c3} % external links/urls
}

%

\usepackage{alphabeta}
%\usepackage{cite}          % needed for cite
\usepackage[numbers, authoryear]{natbib}    % needed for cite and abbrvnat bibliography style
\usepackage[nottoc]{tocbibind}      % needed for displaying bibliography and other in the table of contents
\usepackage{graphicx}           % needed for \includegraphics 
%\usepackage{longtable}             % needed for long tables over pages
\usepackage{bigstrut}           % needed for the command \bigstrut
\usepackage{enumerate}          % needed for some options in enumerate
%\usepackage{todonotes}         % needed for todos
%\usepackage{makeidx}           % needed for creating an index
%\makeindex
\newcommand\Mycite[1]{%
  \citeauthor{#1}~[\citeyear{#1}]}
    \begin{document}        
    \begin{empheq}{align}%[left=\empheqlbrace]%{align}
            \mathit{Loss(P,Q)} = - \frac{1}{N} \sum_{x}^{N} P(x)\times log(Q(x)) \times \alpha_{coefficients}
            \nabla\times\bar E &= -\frac{\partial\bar B}{\partial t}-\bar J_{\text{mi}} 
        \end{empheq}
    \end{document}

답변3

\documentclass[a4paper,11pt]{book}
\usepackage{empheq, amssymb}

\usepackage[ unicode, ,colorlinks=true ,breaklinks % ,greek % <--- 내 설치가 mee를 지원하지 않습니다 ]{hyperref}

\begin{document}
    \begin{empheq}[left=\empheqlbrace]{align}
\mathit{Loss}(P,Q)  & = - \frac{1}{N} \sum_{x}^{N} P(x)\times \log(Q(x)) \times \alpha_{\mathit{coefficients}}  \\
\nabla\times\bar{E} & = - \frac{\partial\bar{B}}{\partial t}-\bar{J}_{\mathrm{mi}}
    \end{empheq}
\end{document}
\end{empheq}

준다

여기에 이미지 설명을 입력하세요

이것이 당신이 찾고 있는 것인가요?

코드 조각에 오류가 있습니다:

  • emheq방정식의 형식을 정의하는 수학 스타일을 정의해야 했습니다(`align˙, 주석 처리함).
  • 첫 번째 방정식 후에는 잊어 버렸습니다.\\
  • 첫 번째 방정식의 등호 앞에 앰퍼샌드가 누락된 것 같습니다.
  • 더 정확한 것은 \bar{E}˛then \bar Eetc
  • 대신 \text{mi}맞다\mathrm{mi}

편집하다: 위의 mwe hyperrefxelatex.

관련 정보