-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Please add an \args for \define #1000
Comments
Just write it in Lua. It's not that hard. Do your programming in a programming language and your content in a content language. |
Perhaps but it is quite a trivial case to want to pass arguments from a parent define to a child |
For example, a whole module to make blue links seems overkill, as does inline scripts :-) |
Sure, but by now you probably have a whole collection of handy custom commands, so just add it to that. :-) |
The Lua code for this is only slightly more verbose than your macro version, and LOTS more flexible. The possible permutations we'd have to cover if we tried to add more frills to the macro define function are endless ... and kind of pointless when Lua already has all the possibilities covered. SILE.registerCommand("Href", function (options, content)
SILE.call("color", { color = "#000099" }, function ()
SILE.call("href", options, content)
end)
end) I kind of agree with Simon here ... I don't want to make SILE's TeXlike mode a Turing complete language like TeX. It's a markup language with a few frills. Use Lua for programming. |
Maybe the url package should itself have a color option. What do you think? :-) |
Yes it could, but the logical way to do that would be with a default option of some kind so that, say, the shade of blue could be changed universally rather than in every invocation. We have a couple different clunky attempts at accomplishing this for ether cases (e.g. setting footnote fonts or styling TOC entries), but these could all use an overhaul before we go adding a bunch more hooks. |
Right, because in the PDF output there's no way to tell what's a URL. By default, XeLaTeX puts hideous red boxes around everything... Better than nothing, but I think blue is best. I actually am not even sure doing nothing is a sane default, in retrospect. |
Oh and by the way guys, feel free to hate me, but I'm going to make a package for this. I'm going to call it |
Doing nothing is a sane default because by default we're optimizing for print ... where hrefs don't do anything anyway and color without meaning can be distracting (who wants their TOC's all colored in pint?). Sure for screen optimized PDFs other settings would be fine, and a color option for href would be a fine addition. Feel free to do whatever in your own packages. The whole point of SILE being extensible and written in Lua was to enable people to tinker with its internals. |
I don't know. Optimizing for print? Is that itself a sane default? ;-) If you're optimizing for print by default then \href should be adding a footnote with the full URL...I don't know that doing nothing is ever sane. |
This would allow such helpful commands as...
The text was updated successfully, but these errors were encountered: