Back to Main page

How do I find a question file for a particular topic among all the questions that have already been written?


Short answer:

Peruse the question index, or use the grep text searching utility to locate the question file by word-search.


Long answer:

Suppose you are compiling your own worksheet, and need a question dealing with the topic of negative resistance. Of course, you could write your own question file, but the whole point of this website is to provide pre-written resources for you, to save you time and effort in developing your own worksheets.

There is a text listing of nearly all the existing questions which you may look through to find a particular type of question. The topics are arranged alphabetically, with the file numbers showing which questions the topics belong to. Many question files have multiple index markers, making it easier for you to find what you want.

Another way to locate the question(s) you want is to use a great little computer utility program named grep. This is a UNIX tool, but there are versions available for free to run on Microsoft DOS/Windows operating systems as well. It is a command-line text searching program, displaying any lines of text that contain the word of phrase you are looking for, for the files you told it to search.

To use grep to search for any question files containing the phrase "negative resistance", first go to the directory where all the question files are located. Then type this (telling the computer to search all files with names ending in ".tex" for the text string "negative resistance"):


grep "negative resistance" *.tex


The result, when I executed this command on my own computer on December 31, 2003, was this:


00092.tex:What is {\it negative resistance}?

00092.tex:Not only do many gas-discharge devices exhibit negative resistance over certain portions of their operating range, but many semiconductor devices do as well.


Note how grep returns the file name containing the matching lines, and also displays the lines themselves. It appears that the only question file containing the phrase "negative resistance" is 00092.tex.

Beware the fact that grep searches in a very literal manner. Whatever is placed between the quotation marks will be what is searched for, no more and no less. I recommend repeating searches with the first letter capitalized ("Negative resistance", for example), to be sure you don't miss any question files beginning sentences with your phrase.

Suppose now that you wish to see what this question file looks like in its compiled form, within a worksheet. You know that it must be included in at least one of the pre-compiled worksheets, but which one? To find out, use grep again to search all the sequence files for the number "00092":


grep 00092 *.seq


The results returned on my computer are as follows:


ohm.seq:00092.tex \

ohm_law.seq:00092.tex \


It appears there are two worksheets making use of the same question file: "ohm" and "ohm_law". PDF versions of both these worksheets are located in the "output" subdirectory.


Back to Main page