Sorting across blocks (to get prev/next links)
You can get all of the works entries related to your contents Matrix field like so:

{% set works = craft.entries({
    relatedTo: { sourceElement: issue, field: 'contents.works' }
}) %}


They will most likely be out of order though. We can control that with the order parameter.

If you enable Dev Mode and look at the resulting SQL query in your browser console, you will see these two tables getting joined into it:

LEFT JOIN `craft_relations` `sources1` ON (sources1.targetId = elements.id)
LEFT JOIN `craft_matrixblocks` `target_matrixblocks1` ON target_matrixblocks1.id = sources1.sourceId


So we can pass in an order param that tells MySQL to order the entries by the block order first and their relation order second:

{% set works = craft.entries({
    relatedTo: { sourceElement: issue, field: 'contents.works' },
    order: 'target_matrixblocks1.sortOrder, sources1.sortOrder'
}) %}


Now you’ve got all of the Works entries in the proper order, and you can pass them into getPrev() and getNext():

{% set prevEntry = entry.getPrev(works) %}
{% set nextEntry = entry.getNext(works) %}