Skip to content

Commit

Permalink
Fixes for the documentation (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
sostock authored Jun 13, 2020
1 parent 1b03d35 commit 41bf6eb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
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

0 comments on commit 41bf6eb

Please sign in to comment.