try it like this
<?php if( have_rows('subpage_publications') ): ?>
<div class="publications">
<h3>Publications</h3>
<ul>
<?php while ( have_rows('subpage_publications') ) : the_row(); ?>
<li>
<a href="<?php the_sub_field('document'); ?>">
<?php the_sub_field('document_name'); ?>
</a>
</li>
<?php endwhile; ?>
</ul>
</div>
<?php endif; ?>