Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
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
show 6 more comments

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
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
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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