How do I output entries by their category?
It might be quicker to turn it around: first get all the entries you need, then group those by their category:

{% set entries = craft.entries.section('people').find() %}

{% for category, catEntries in entries | group('categoryFieldHandle.first().title') %}
    &lt;h1&gt;{{ category }}&lt;/h1&gt;
    {% for entry in catEntries %}
        &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
    {% endfor %}
{% endfor %}