Skip to content
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

Make production vs. external build-process more interchangeable #16

Open
3 of 6 tasks
chbrown opened this issue Feb 9, 2017 · 1 comment
Open
3 of 6 tasks

Make production vs. external build-process more interchangeable #16

chbrown opened this issue Feb 9, 2017 · 1 comment

Comments

@chbrown
Copy link
Member

chbrown commented Feb 9, 2017

Right now, for most of the production process, there are two major configuration differences between development and production builds:

  1. Font: Times in development (or Computer Roman), because Lucida is a commercially licensed font.
    • The lucida class option is only used in production.
  2. Bibliography compiler: usually BibTeX in development, since most people already have it set up or find it easier to use than BibLaTeX (BibLaTeX is the future but honestly it's not very stable so I don't blame them)
    • In production, the biblatex class option is added, and...
    • The single BibTeX \bibliography{myfile} is replaced with \printbibliography, along with a adding \addbibresource{myfile.bib} to the preamble.

Sometimes when we send document sources back to the author for revisions, we forget to switch the production flags off. This is unfortunate, because neither of these cases degrade gracefully when 1) Lucida, or 2) the required BibLaTeX styles / compiler, are not available.

  1. Recovering when Lucida is missing is close — we can simply set \@times to true in the \IfFileExists{lucimatx.sty}{}{ ... here ... } else clause in sp.cls, in addition to the current fallback of logging a warning saying "Requested fonts not present"

  2. Recovering from BibLaTeX is going to be harder. It's easy to define fake BibLaTeX API commands that call out to the BibTeX commands, but harder to go the other way around, since BibLaTeX insists on knowing what files are in going to be in the bibliography before the preamble ends.
    So I propose that we change the template + instructions to use \addbibresource{} and \printbibliography commands instead of the usual single BibTeX \bibliography{} command, and add shims for those commands to the \else side of the \if@biblatex conditional in sp.cls. My initial hack of a solution looks like this:

     \def\@bibresource{\relax}
     \newcommand{\addbibresource}[1]{\gdef\@bibresource{#1}}
     \newcommand{\printbibliography}{\bibliography{\@bibresource}}
    

I'm not sure how to check for BibLaTeX+biber and that the required bbx/cbx files are around when biblatex is used, and give some legible warning if anything is missing, but that would be nice in terms of user experience.

Even more simply, I'd like to propose that we replace the [lucida] and [biblatex] class options by hooking into the standard [final] option, which would effectively set both of those to true and degrade gracefully, but with blaring warnings, if it can't import and use them properly.

Then all we would have to do when turning around LaTeX sources would be to remove the final option, and even if we forgot to do that, it would just add a couple warnings to the author's logs, instead of breaking completely.

Checklist:

  • Fallback to Times when Lucida is not available. (1923755)
  • Fallback to BibTeX when BibLaTeX (well, the biblatex-sp-unified.bbx file) is not available. (633fb34)
  • Support BibLaTeX syntax/API when in BibTeX mode. (de9979b)
  • Update templates and documentation to use BibLaTeX syntax/API.
    • \bibliography{...} will continue to work when in BibTeX mode, so it's fully backward compatible as long as users haven't defined their own \addbibresource or \printbibliography commands (which would be weird).
  • Log warning and fall back to BibTeX when BibLaTeX is requested and biblatex-sp-unified.bbx is installed but the biber backend can't be found or BibLaTeX fails for some other reason.
  • Make the [final] class option imply BibLaTeX and Lucida (since it's less dangerous now to set those).
@fintelkai
Copy link
Contributor

Sounds like a good plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants