Academic-Writing-Check icon indicating copy to clipboard operation
Academic-Writing-Check copied to clipboard

href causes typography error

Open MartinThoma opened this issue 9 years ago • 5 comments

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.

MartinThoma avatar Nov 06 '14 15:11 MartinThoma

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?

devd avatar Nov 06 '14 15:11 devd

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

MartinThoma avatar Nov 06 '14 15:11 MartinThoma

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

devd avatar Nov 06 '14 15:11 devd

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 :-)

MartinThoma avatar Nov 06 '14 15:11 MartinThoma

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 :)

devd avatar Nov 06 '14 15:11 devd