0

This question already has an answer here:

I have used this \pdfstrcmp as in the following to set the different

\makeatletter
\newcommand{\setappendix}{Appendix~\thechapter}
\newcommand{\setchapter}{Chapter~\thechapter~} 
\titleformat{\chapter}[display]{\sffamily\huge\bfseries \color{sec}}{}{0.5ex} %
{\ifnum\pdfstrcmp{\@currenvir}{appendices}=0
    \setappendix
    \else
    \setchapter
    \fi 
    \filleft \\%
     \titlerule[1pt]
    \vspace{1ex}%
    #1\filleft\\
    \vspace{1ex}%
    \titlerule[3pt]}
   \makeatother

But I dont know for what reason, though it gives the desire output, it gives me the following popup in texstudio unrecongnized command. enter image description here

Shall I ignore the popup?

If I dont, will it create any issues?

I am running pdflatex with Miktex 2.9 in Windows 10 machine (and using biber as backend with biblatex).

MWE:

\documentclass[oneside]{book}

\usepackage[explicit]{titlesec}
\usepackage[titletoc]{appendix}

\makeatletter
\newcommand{\setappendix}{Appendix~\thechapter}
\newcommand{\setchapter}{Chapter~\thechapter~} 
\titleformat{\chapter}[display]{\sffamily\huge\bfseries}{}{0.5ex} %
{\ifnum\pdfstrcmp{\@currenvir}{appendices}=0
    \setappendix
    \else
    \setchapter
    \fi 
    \filleft \\%
    \titlerule[1pt]
    \vspace{1ex}%
    #1\filleft\\
    \vspace{1ex}%
    \titlerule[3pt]}

\makeatother

\begin{document}

\chapter{This is usual Chapter}

\begin{appendices}
\chapter{This is appendix}
\end{appendices}


\end{document}

marked as duplicate by TeXnician, Bobyandbob, Troy, moewe, Stefan Pinnow May 10 '18 at 11:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Because the developers of TeXStudio forgot or didn't consider to include it among the know commands. Do it yourself. – egreg May 10 '18 at 6:44
  • 2
    Your editor is just like a pair of glasses. If you have a spot on your glasses, you don't think the apple in front of you has a spot. You can ignore it, unless LaTeX throws an error. – Johannes_B May 10 '18 at 6:45
  • 1
    You have to worry about something if and only if it comes up in the .log file (as error or slightly less serious as warning). This is just your editor telling you it doesn't know a command. You only need to worry if TeX tells you it doesn't know the command in the .log file after an attempt to compile your document. – moewe May 10 '18 at 8:48
  • @egreg Thank you for the answer and the confirmation. Kindly add the comment as answer and so I can accept it so that the question may serve its purpose. – David May 10 '18 at 10:46