-
Notifications
You must be signed in to change notification settings - Fork 11
Just a few things #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,3 +55,6 @@ docs/_build/ | |
|
|
||
| # PyBuilder | ||
| target/ | ||
|
|
||
| # Ignore vim swap files | ||
| *.swp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,8 @@ | |
|
|
||
| \begin{{document}} | ||
|
|
||
| {authorcontent} | ||
|
|
||
| {titlecontent} | ||
|
|
||
| {sectioninputs} | ||
|
|
@@ -168,6 +170,10 @@ def build_authorea_latex(localdir, builddir, latex_exec, bibtex_exec, outname, | |
| titlestr = f.read() | ||
| titlecontent.append(r'\title{' + titlestr + '}') | ||
|
|
||
| authorcontent = "" | ||
| with open(os.path.join(localdir, 'authors.tex')) as f: | ||
| authorcontent = r'\author{' + get_input_string('authors', get_in_path(localdir, builddir, pathtype)) + '}' | ||
|
|
||
| sectioninputs = [] | ||
| with open(os.path.join(localdir, 'layout.md')) as f: | ||
| for l in f: | ||
|
|
@@ -177,8 +183,8 @@ def build_authorea_latex(localdir, builddir, latex_exec, bibtex_exec, outname, | |
| elif ls in ('posttitle.tex', 'title.tex', 'preamble.tex', 'header.tex'): | ||
| pass # skip any that have been processed above | ||
| elif ls in ('abstract.tex'): | ||
| # add abstract to title content | ||
| titlecontent.append(r'\begin{abstract}' + get_input_string('abstract', get_in_path(localdir, builddir, pathtype)) + '\end{abstract}') | ||
| # add abstract to section input | ||
| sectioninputs.append(get_input_string('abstract', get_in_path(localdir, builddir, pathtype))) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you'll need to be more careful with this. In at least some situations, authorea articles are not expected to have \begin{abstract} \end{abstract} sections. So maybe the thing to do is to just read the abstract file into a string, and then look through in for the presence of |
||
| elif ls.endswith('.html') or ls.endswith('.htm'): | ||
| pass # html files aren't latex-able | ||
| elif ls.startswith('figures'): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by this: why are you opening the file? It should be sufficient just to do the
get_input_stringline below, as then LaTeX will drop the content in there instead of you needing to access the file.So perhaps instead you want this to be
if os.path.exists(os.path.join(localdir, 'authors.tex')):? Then if the files is present it will be used, but otherwise just the empty string from above will get in?