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

href causes typography error #11

Open
MartinThoma opened this issue Nov 6, 2014 · 5 comments
Open

href causes typography error #11

MartinThoma opened this issue Nov 6, 2014 · 5 comments

Comments

@MartinThoma
Copy link

The usage of

\href{http://google.com}{google.com}

and similar causes the tool to find a 'typography error'. I don't think that should be the case.

@devd
Copy link
Owner

devd commented Nov 6, 2014

Isn't href just hyperlink (e.g., it can refer to other areas of the document) and you still need a \url so that it breaks at the right places?

@MartinThoma
Copy link
Author

Href lets you add hyperlinks. The pattern is

\href{<the hyperlink>}{<the printed text>}

where the second argument is treated like normal text. See http://tex.stackexchange.com/a/111701/5645

@devd
Copy link
Owner

devd commented Nov 6, 2014

whoops, you are right. I will try to fix it sometime; patches welcome though :)

@MartinThoma
Copy link
Author

I would patch it if I could, but I don't know how to write (and much less how to read) perl. (Your script seems quite easy to read in contrast to many perl scripts I've seen, though)

I am thinking about re-developing your script in Python. But at the moment I have too much work (2 days left for my bachelor's thesis.)

Thank you for your script! Especially the "duplicate word" feature helped me :-)

@devd
Copy link
Owner

devd commented Nov 6, 2014

The script is a bunch of regexes really. As long as you know regexes, it should be easy.

https://github.com/devd/Academic-Writing-Check/blob/master/checkwriting#L302
is the check you need to modify. $regex is just a regex for URLs. The regex in line 325 just needs to be modified: right now, it special cases \url as "ok don't warn"; just change that to match "\url and \href"
I think changing

s/(\\url\{[^}]*\})|

to

s/((?:\\url|\\href)\{[^}]*\})|

is enough. But it is the testing etc that takes time :)

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