Skip to content

Commit

Permalink
include all the text into the PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Oct 20, 2023
1 parent 28f6041 commit dbabb33
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions api/preprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,14 @@ def extract_paragraphs_with_citations(notebook):
for cell in notebook['cells']:
if cell['cell_type'] == 'markdown':
# Extract citations based on the appropriate pattern
matches = extract_citations(cell['source'], r'\[@([^[\]]*)\]')
#matches = extract_citations(cell['source'], r'\[@([^[\]]*)\]')
# If there are citations, store the current paragraph and its section
if matches:
if current_paragraph:
paragraphs_with_citations.append({'section': current_section, 'paragraph': current_paragraph})
current_paragraph = ''
current_paragraph += cell['source']
current_section = cell.get('metadata', {}).get('section', '')
#if matches:
if current_paragraph:
paragraphs_with_citations.append({'section': current_section, 'paragraph': current_paragraph})
current_paragraph = ''
current_paragraph += cell['source']
current_section = cell.get('metadata', {}).get('section', '')
# Add the last paragraph if it has citations
if current_paragraph:
paragraphs_with_citations.append({'section': current_section, 'paragraph': current_paragraph})
Expand Down

0 comments on commit dbabb33

Please sign in to comment.