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

Fixes for the documentation #356

Merged
merged 1 commit into from
Jun 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/src/extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ explicitly forbid any attempt to convert to SI units.

One can achieve this by defining new dimensions with the [`@dimension`](@ref) or
[`@derived_dimension`](@ref) macros. The trick is to define dimensions that display
suggestively like physical dimensions, like 𝐋*, 𝐓* etc., but are distinct as far
suggestively like physical dimensions, like `𝐋*`, `𝐓*` etc., but are distinct as far
as Julia's type system is concerned. Then, you can use [`@refunit`](@ref) to
base units for these new dimensions without reference to SI. The result will be
that attempted conversion between the hypothetical unit system and SI will fail
with a `DimensionError`, so be sure you provide some hints in how your
new dimensions are displayed to avoid confusing users. It would be confusing
to throw a `DimensionError` when attempting to convert between lengths which are
incompatible in the sense of the previous paragraph, when both lengths display their
dimension as 𝐋.
dimension as `𝐋`.
4 changes: 2 additions & 2 deletions docs/src/logarithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ end
mdtable(tab, latex=false, head=head, side=side)
```

‡: `1/Hz * 3dB` could be allowed, technically, but we throw an error its unclear if a
quantity is a root-power or power quantity:
‡: `1/Hz * 3dB` could be allowed, technically, but we throw an error if it's unclear whether
a quantity is a root-power or power quantity:

```jldoctest
julia> u"1/Hz" * u"3dB"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/trouble.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ julia> π/2*u"rad"+90u"°"

## Broken display of dimension characters in the REPL

On some terminals with some fonts, dimension characters such as 𝐌 are displayed as an
On some terminals with some fonts, dimension characters such as `𝐌` are displayed as an
empty box. Setting a wider font spacing in your terminal settings can solve this problem.

## I have a different problem
Expand Down
2 changes: 1 addition & 1 deletion src/units.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ a few different methods, since we have `FreeUnits`, `ContextUnits`, and `FixedUn
Collect [`Unitful.Unit`](@ref) objects from the type parameter of the
[`Unitful.Units`](@ref) objects. For identical units including SI prefixes
(i.e. cmm), collect powers and sort uniquely by the name of the `Unit`.
(i.e. `cm``m`), collect powers and sort uniquely by the name of the `Unit`.
The unique sorting permits easy unit comparisons.
Examples:
Expand Down
10 changes: 5 additions & 5 deletions src/user.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ end
Not called directly by the user. Given a unit symbol and a unit's name,
will define units for each possible SI power-of-ten prefix on that unit.
Example: `@prefixed_unit_symbols m Meter 𝐋 (1.0,1)` results in nm, cm, m, km, ...
Example: `@prefixed_unit_symbols m Meter 𝐋 (1.0,1)` results in `nm`, `cm`, `m`, `km`, ...
all getting defined in the calling namespace.
"""
macro prefixed_unit_symbols(symb,name,dimension,basefactor)
Expand Down Expand Up @@ -276,10 +276,10 @@ end
"""
preferunits(u0::Units, u::Units...)
This function specifies the default fallback units for promotion.
Units provided to this function must have a pure dimension of power 1, like 𝐋 or 𝐓
but not 𝐋/𝐓 or 𝐋^2. The function will complain if this is not the case. Additionally,
Units provided to this function must have a pure dimension of power 1, like `𝐋` or `𝐓`
but not `𝐋/𝐓` or `𝐋^2`. The function will complain if this is not the case. Additionally,
the function will complain if you provide two units with the same dimension, as a
courtesy to the user. Finally, you cannot use affine units such as °C with this function.
courtesy to the user. Finally, you cannot use affine units such as `°C` with this function.
Once [`Unitful.upreferred`](@ref) has been called or quantities have been promoted,
this function will appear to have no effect.
Expand Down Expand Up @@ -479,7 +479,7 @@ different modules, then the symbol found in the most recently registered module
will be used.
Note that what goes inside must be parsable as a valid Julia expression.
In other words, u"N m" will fail if you intended to write u"N*m".
In other words, `u"N m"` will fail if you intended to write `u"N*m"`.
Examples:
Expand Down