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

smart quotes throughout #30

Open
iandennismiller opened this issue Apr 23, 2019 · 6 comments
Open

smart quotes throughout #30

iandennismiller opened this issue Apr 23, 2019 · 6 comments
Labels
enhancement New feature or request guru LaTeX Guru tasks proofer Proof-reading, type-setting, and fixes
Projects

Comments

@iandennismiller
Copy link
Owner

LaTeX uses specific markup for quotes. Throughout most of the original DOJ document, quotes are detected as " - and this should be replaced by the LaTeX equivalent.

@iandennismiller iandennismiller added the enhancement New feature or request label Apr 23, 2019
@iandennismiller iandennismiller added this to To do in Revise Apr 23, 2019
@gramasaurous
Copy link

I have tested a quickfix for this based on an answer in this stackoverflow: quotes in latex

Essentially adds a global macro to replace quotes "" with the proper LaTeX format (``''):

Adding this to the end of includes.tex:

% global smartquotes
\newif\ifquoteopen
\catcode`\"=\active % lets you define `"` as a macro
\DeclareRobustCommand*{"}{%
   \ifquoteopen
     \quoteopenfalse ''%
   \else
     \quoteopentrue ``%
   \fi
}

On a cursory glance through the generated documents after a make all it seems to do the trick. The only other option I can think of is a global find-and-replace based off some regex to find beginning quotes and replace them with `` and ending quotes and replace them with ''.

Example:

mueller_report_smartquotes

@gramasaurous
Copy link

If this seems to be a reasonable approach - I can issue a PR!

@iandennismiller
Copy link
Owner Author

That's a clever solution! My thinking was stuck in sed mode ... but I like this solution because it's so easy to audit.
I do have an extension to request, though. Quotes are represented with three separate glyphs: ASCII quote and Unicode open/close quotes. I am pretty sure the source contains instances of all of these.
Any chance you could incorporate a fix for all 3?

@iandennismiller iandennismiller moved this from To do to In progress in Revise May 31, 2019
@gramasaurous
Copy link

Hmmm you're right - I hadn't considered that other glyphs might be used to depict quotations.

For the sake of consistency, I think it might be cleaner to sed-replace all instances of “|” (unicode open/close quote) with the ascii quote character. This way the single macro will work everywhere - and all quotes throughout the doc will be rendered in the same manner. This will be a huge change to the source though so may be difficult to catch errors/inconsistencies. Can be persuaded this isn't a good way to go.

@iandennismiller
Copy link
Owner Author

I've made this sort of change in the past; it simply is what it is. I am not concerned about the number of lines changed.

However, at that point, I would advocate for directly adding the smart quotes with sed instead of using a macro. That way, the source code could be directly inspected and it would deterministically render in the output.

Plus, it would be satisfying to grep for all the old glyphs and verify that they were all changed when there are no results produced.

Thoughts?

@iandennismiller iandennismiller added guru LaTeX Guru tasks proofer Proof-reading, type-setting, and fixes labels Jun 1, 2019
@ascherer
Copy link
Contributor

I've replaced all single and double quotes (straight and UTF-8) with TeX's opening and closing quotation marks, sprinkling in some \thinspaces where necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request guru LaTeX Guru tasks proofer Proof-reading, type-setting, and fixes
Projects
Revise
  
In progress
Development

No branches or pull requests

3 participants