 			ide.$scope.$broadcast("flush-changes")
 
 			options.rootDocOverride_id = getRootDocOverride_id()
+
+			$scope.$apply()
 
 			sendCompileRequest(options)
 				.then (response) ->

					$scope.pdf.error = true
					$scope.pdf.view = 'errors'
				.finally () ->
					$scope.recompiledAt = Date.now()

		# This needs to be public.
		ide.$scope.recompile = $scope.recompile

	"libs/bib-log-parser"
	"services/log-hints-feedback"
], (App, Ace, HumanReadableLogs, BibLogParser) ->
	AUTO_COMPILE_MAX_WAIT = 5000
	# We add a 1 second debounce to sending user changes to server if they aren't
	# collaborating with anyone. This needs to be higher than that, and allow for
	# client to server latency, otherwise we compile before the op reaches the server
	# and then again on ack.
	AUTO_COMPILE_DEBOUNCE = 2000

	App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, logHintsFeedback, localStorage) ->
		# enable per-user containers by default
