I recently downloaded Basic MiKTeX 2.9.4813..

I'm trying to find on the MiKTeX dir a file containing a list of all general keywords for LaTeX languages but can't find any...

Could you help me?

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. What do you mean by 'keyword'? Do you want a list of programs included in MikTeX or a list of commands (like \title{...}) available? (Try putting texdoc latexcheat into the command line.) – Sean Allred Dec 30 '13 at 12:05
  • Hi, I'm working on a project to develop a LaTeX compiler and want to identify if the user wrote a keyword so I can mark it in a specific color. For that I'm searching for a file containing all keywords.. – Nir B Dec 30 '13 at 12:18
  • 1
    You're not going to find one—use regular expressions: \\[@A-z]*\*? – Sean Allred Dec 30 '13 at 12:22
  • 1
    Here we go again: tex.stackexchange.com/questions/4201/… :) – Paulo Cereda Dec 30 '13 at 12:32
  • 1
    @NirB no there is no way, the tokenization and keywords (as you call them) may be changed arbitrarily within the document: thereis no fixed grammar. – David Carlisle Dec 30 '13 at 12:56

Within TeX systems, it is always possible to define new commands:

\def\somemacro\with#1\weird#2,#3\delimiters{#1, #2, #3}
\newcommand \somenewcommand[1] {some expansion using #1}
% ... the following with `xparse` and `expl3` as appropriate
\NewDocumentCommand \SomeCrazyCommand {m m o O{default} u{(} t! r][}{...}
% ... used as \SomeCrazyCommand{...}{...}[what?] this is arg 5(!]and 6[%end
\cs_new:Nn \you_can't_even_rely_on_the_hash:NnN {something~ with~ #1,~ #2~, and~ #3}

The only mostly constant thing is what counts as a command: it consists of a backslash (\) introducing either one symbol or a string of letters, thus the regular expression \\(.|[A-z@]*\*?]). (@ is often used as a letter in LaTeX internal macros. Also, many LaTeX commands have starred variants.)

Trying to compile such a list would be difficult, but you can take a look at the AUCTeX project for Emacs—within the style files exist convenient lists of commands for particular packages.

  • 1
    In pure TeX you can only define a new command with \def. \newcommand is a LaTeX command. ;) – someonr Dec 30 '13 at 12:36
  • @someonr Or \ExplSyntaxOn \use:c { some_weird_arg_based_command_#1 },\cs_new:Nn \@@_internal_package_macro:Nnx \ExplSyntaxOff… the list goes on. TeX's Turing completeness throws a wrench in just about every hopeful parser. – Sean Allred Dec 30 '13 at 12:39
  • 2
    For a stress test look up xii.tex on CTAN, ctan.org/tex-archive/macros/plain/contrib/xii – daleif Dec 30 '13 at 12:40
  • @daleif Didn't David Carlisle write this? tex.stackexchange.com/questions/104248 – Sean Allred Dec 30 '13 at 12:41
  • 4
    who, me :-) ??? – David Carlisle Dec 30 '13 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.