<jupyter_start><jupyter_text>Publications markdown generator for academicpagesTakes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html)). The core python code is also in `publications.py`. Run either from the `markdown_generator` folder after replacing `publications.tsv` with one containing your data.TODO: Make this work with BibTex and other databases of citations, rather than Stuart's non-standard TSV format and citation style.  Data formatThe TSV needs to have the following columns: pub_date, title, venue, excerpt, citation, site_url, and paper_url, with a header at the top. - `excerpt` and `paper_url` can be blank, but the others must have values. - `pub_date` must be formatted as YYYY-MM-DD.- `url_slug` will be the descriptive part of the .md file and the permalink URL for the page about the paper. The .md file will be `YYYY-MM-DD-[url_slug].md` and the permalink will be `https://[yourdomain]/publications/YYYY-MM-DD-[url_slug]`This is how the raw file looks (it doesn't look pretty, use a spreadsheet or other program to edit and create).<jupyter_code>#  !cat publications.csv<jupyter_output><empty_output><jupyter_text>Import pandasWe are using the very handy pandas library for dataframes.<jupyter_code>import pandas as pd<jupyter_output><empty_output><jupyter_text>Import TSVPandas makes this easy with the read_csv function. We are using a TSV, so we specify the separator as a tab, or `\t`.I found it important to put this data in a tab-separated values format, because there are a lot of commas in this kind of data and comma-separated values can get messed up. However, you can modify the import statement, as pandas also has read_excel(), read_json(), and others.<jupyter_code>conv = {'publi_id': lambda x: str(x), 'page': lambda x: str(x), 'arxiv_id': lambda x: str(x)}
publications = pd.read_csv("publications.csv", sep=";", header=0, converters=conv)#, engine ='python')
publications<jupyter_output><empty_output><jupyter_text>Escape special charactersYAML is very picky about how it takes a valid string, so we are replacing single and double quotes (and ampersands) with their HTML encoded equivilents. This makes them look not so readable in raw format, but they are parsed and rendered nicely.<jupyter_code>html_escape_table = {
    "&": "&amp;",
    '"': "&quot;",
    "'": "&apos;"
    }

def html_escape(text):
    """Produce entities within text."""
    return "".join(html_escape_table.get(c,c) for c in text)<jupyter_output><empty_output><jupyter_text>Creating the markdown filesThis is where the heavy lifting is done. This loops through all the rows in the TSV dataframe, then starts to concatentate a big string (```md```) that contains the markdown for each type. It does the YAML metadata first, then does the description for the individual page.<jupyter_code>import os
for row, item in publications.iterrows():
    
    md_filename = str(item.pub_date) + "-" + item.url_slug + ".md"
    html_filename = str(item.pub_date) + "-" + item.url_slug
#     md_filename = item.url_slug + ".md"
#     html_filename = item.url_slug
    year = item.pub_date[:4]
    
    pub_number = str(row+1)
    
    if (item.venue=='preprint'):
        citation = '"' + item.title + '", ' + item.authors + \
        ', <i>arXiv:' + item.arxiv_id + '</i>' + \
        ' (' + str(year) + ').'
    else:
        citation = '"' + item.title + '", ' + item.authors + \
        ', <i>' + item.venue + '</i> <b>' + \
        str(item.volume) + '</b>, ' + str(item.page) \
        + ' (' + str(year) + ').'
        
    
    ## YAML variables
    
    md = "---\ntitle: \""   + item.title + '"\n'
    
    md += """collection: publications"""
    
    md += """\npermalink: /publication/""" + html_filename
    
    md += "\nurlslug: '" + item.url_slug + "'"
    
    if len(str(item.excerpt)) > 5:
        md += "\nexcerpt: '" + html_escape(item.excerpt) + "'"
    
    md += "\ndate: " + str(item.pub_date) 
    
    md += "\nauthors: '" + item.authors + "'"
    
    md += "\nvenue: '" + html_escape(item.venue) + "'"
    
    md += "\nvolume: '" + str(item.volume) + "'"
    
    md += "\npage: '" + str(item.page) + "'"
    
    if (item.paper_url=='/'):
        md += "\npaperurl: 'https://arxiv.org/abs/" + item.arxiv_id + "'"
    else:
        md += "\npaperurl: '" + item.paper_url + "'"
    
    md += "\narxivid: '" + item.arxiv_id + "'"
        
    md += "\npubnumber: " + pub_number
    
    md += "\ncitation: '" + html_escape(citation) + "'"
    
    md += "\n---"
    
    ## Markdown description for individual page
        
#     if len(str(item.excerpt)) > 5:
#         md += "\n" + html_escape(item.excerpt) + "\n"
    
#     if len(str(item.paper_url)) > 5:
#         md += "\n[Download paper here](" + item.paper_url + ")\n" 

#     md += '\nRecommended citation:"' + item.title + '", ' + item.authors + \
#     ', <i>' + item.venue + '</i>, <b>' + \
#     str(item.volume) + '</b>, ' + str(item.page) \
#     + ' (' + str(year) + '). ' + [item.paper_url](item.paper_url)

    if (item.venue != 'preprint'):
        md += '\n[Published version <i class="fa fa-external-link-alt fa-xs" aria-hidden="true"></i>](' + item.paper_url + ")\n" 
        md += '[[pdf] <i class="fa fa-download fa-xs" aria-hidden="true"></i>](http://charlieduclut.github.io/files/' + item.url_slug + ".pdf)\n<br/>"
        md += '\n[arXiv version <i class="fa fa-external-link-alt fa-xs" aria-hidden="true"></i>](https://arxiv.org/abs/' + str(item.arxiv_id) + ")\n"
    else:
        md += '\n[arXiv version <i class="fa fa-external-link-alt fa-xs" aria-hidden="true"></i>](https://arxiv.org/abs/' + str(item.arxiv_id) + ")\n" 
        md += '[[pdf] <i class="fa fa-download fa-xs" aria-hidden="true"></i>](http://charlieduclut.github.io/files/' + item.url_slug + ".pdf)\n<br/>"
    
    
     
    md_filename = os.path.basename(md_filename)
       
    with open("../_publications/" + md_filename, 'w') as f:
        f.write(md)<jupyter_output><empty_output><jupyter_text>These files are in the publications directory, one directory below where we're working from.<jupyter_code>!ls ../_publications/
!cat ../_publications/2013-06-04-duclut2013hysteresis.md
!cat ../_publications/2021-03-30-duclut2021nonlinear.md<jupyter_output>---
title: "Nonlinear rheology of cellular networks"
collection: publications
permalink: /publication/2021-03-30-duclut2021nonlinear
urlslug: 'duclut2021nonlinear'
excerpt: 'Morphogenesis depends crucially on the complex rheological properties of cell tissues and on their ability to maintain mechanical integrity while rearranging at long times. In this paper, we study the rheology of polygonal cellular networks described by a vertex model in the presence of fluctuations. We use a triangulation method to decompose shear into cell shape changes and cell rearrangements. Considering the steady-state stress under constant shear, we observe nonlinear shear-thinning behavior at all magnitudes of the fluctuations, and an even stronger nonlinear regime at lower values of the fluctuations. We successfully capture this nonlinear rheology by a mean-field model that describes the tissue in terms of cell elongation and cell rearrangements. We furthermore introduce anisotropic active stresses in[...]
StarcoderdataJupyterStructuredCleanDedup