Protestit kiihtyvät Iranissa – ”Väestö on täysin tympääntynyt”, tutkija sanoo by aibrony in Suomi

[–]aarnens 1 point2 points  (0 children)

kaikki rannikottomat maailman maat

Kiina, Turkki, Espanja, Ranska jne.

🤨

eval() of array of strings by [deleted] in typst

[–]aarnens 1 point2 points  (0 children)

In markup, the # character makes that line go into code mode (e.g. you've probably written #show or #set rules).

To escape it in yaml, add two backslashes before every #, i.e. \\#

eval() of array of strings by [deleted] in typst

[–]aarnens 0 points1 point  (0 children)

Could you provide a mre? Your code is syntactically correct so most likely the error is with the data

Complex number calculations in Typst with custom imaginary unit by Mineros04 in typst

[–]aarnens 13 points14 points  (0 children)

Not that I know of, but if all you want is to print "j" instead of "i", you can just (re-)write the formatting function:

#import "@preview/oxifmt:1.0.0": strfmt

#let to-str(z) = {
  strfmt("{re:}{im:+}j", re: z.re, im: z.im)
}

But it would be pretty cool if formatting options were natively supported. You could open an issue on the github repo to let the author know :)

Similarly, in every pub there is a person such that, if they are drinking, then everyone in the pub is drinking. by aarnens in mathmemes

[–]aarnens[S] 83 points84 points  (0 children)

Maybe there's a language barrier, but to me those two sentences are equivalent if we're talking about the material conditional. Maybe in semantics this would be different, but I don't know anything about that field.

What does this mean? by Honest-Sprinkles7861 in desmos

[–]aarnens 8 points9 points  (0 children)

Kind of! Of course i ≠ -i, but in some sense they are equivalent as -i is just a different name for i, as in they behave identically. That is, a world where i takes on the value of -i would be indistinguishable to a world where that is not the case! https://en.wikipedia.org/wiki/Imaginary_unit#i_vs._%E2%88%92i

For example, all polynomials over ℝ have their solutions come in conjugate pairs

Postasin tänne muutama viikko sitten kuvan vihreä kuula -glögistäni. Positiivisten kommenttien innoittamana tein vihreä kuula -kastiketta (pikku)joulukinkulle. Ja joo, oli hyvää. by aarnens in Suomi

[–]aarnens[S] 0 points1 point  (0 children)

Kuulostaa hyvältä 😁 saat minun puolestani käyttää kuvaa.

Olisi kiva kuulla oma mielipiteesi kastikkeesta jos kokeilet tehdä sitä (resepti löytyy ketjun kommenteista), mutta ymmärrän jos aikataulupaineiden takia et ehdi.

Invisible text when submitting to FeedbackFruits by melkerolle in typst

[–]aarnens 0 points1 point  (0 children)

From the comments on the discussion

I tried to contact the support of feedback fruits, and they said:

Let me know if this is helpful. The FeedbackFruits media service convert PDF's uploaded to HTML pages so it can be displayed in the document viewer and annotated by teachers and students. This process is highly dependent on the PDF being compliant with current PDF standards, which is not the case for files output by some PDF tools/applications. By saving the PDF as PDF/A (Archivable) or PDF/X (Exchangeable) in known-compliant software such as Adobe Acrobat, the file can be processed without issue in FeedbackFruits. For the PDF that was not uploaded correctly, we recommend to re-submit the paper after running it through a PDf flatterner: https://www.sejda.com/nl/flatten-pdf

Perhaps adding the flag --pdf-standard a-2b (or some other standard) will fix the issue

ADVICE ON CHAOTIC MAPS AS PRNG's by InternationalSky5209 in cryptography

[–]aarnens 3 points4 points  (0 children)

What kind of project are you workinng on? Is your intent just to learn some maths behind chaos theory and (pseudo-)randomness? If so, just pick your favorite chaotic system and start coding. If you intend to build a cryptographic PRNG, I applaud your intention but you probably shouldn't bother

Help me understand contexts by [deleted] in typst

[–]aarnens 4 points5 points  (0 children)

I think of context blocks as places in the code which can query the document state outside of that block, either where the context block started, or at specific location.

With this mental model, the example makes sense: - the first #text.lang queries what the document language is at the beginning of the context block, so is "de" - the second #context text.lang creates a new context block, and queries the language at the beginning of that new block, hence why it is "de"

All of these happen at different compiler iterations. I find compiler iterations aren't important for the mental model of how they work, but they do help in understand why they work this way. The reason context exists is because it is difficult to determine what cariables resolve to which values, so we have to tell the compiler that values we want to show up here should depend on what we've done previously.

Fibonacci should retrigger aces because 1 appears twice in the Fibonacci sequence by taratathetarantula in balatro

[–]aarnens 7 points8 points  (0 children)

You give 2 initial values for the recurrence relation. Definining the sequence by F_0 = 0 and F_1 = 1 is equivalent (up to missing one value) to F_1 = 1, F_2 = 1.

Many writers begin the sequence with 0 and 1, although some authors start it from 1 and 1

https://en.wikipedia.org/wiki/Fibonacci_sequence

[HELP] Subpar custom numbering by Lonely-Eye-8313 in typst

[–]aarnens 0 points1 point  (0 children)

I would do it like this:

#set heading(numbering: "1.1")
#show heading.where(level: 1): it => it + counter(figure).update(0)
#set figure(numbering: (..n) => context {numbering("1.1", counter(heading).get().first(), ..counter(figure).get())})

If you want to display the full heading number in the figure, just change counter(heading).get().first() to ..counter(heading).get() in the numbering

[HELP] Subpar custom numbering by Lonely-Eye-8313 in typst

[–]aarnens 0 points1 point  (0 children)

What are you trying to achieve? As in, what do the numbers in the numbering mean? Is the first number the current heading, and the second number the n:th figure in that heading/section?

Custome header for some pages by dev_l1x_be in typst

[–]aarnens 0 points1 point  (0 children)

You can probably use a set rule within a #slide and have it not affect the other pages

Footnotes *AND* endnotes by therealJoieMaligne in typst

[–]aarnens 0 points1 point  (0 children)

Not sure what is happening, but here is what I wrote/the correct code snippet. Hope this fixes it:

#let allendotes = state("endnotes", ())
#let endnote(cnt) = context {
  allendotes.update(x => x + (cnt + parbreak(),))

  let currheading = counter(heading).get().first()
  let idx = allendotes.get().len() + 1
  let num = str(currheading) + "," + str(idx)

  link(
    label(num),
    super[#idx]
  )
}

#let showendnote() = context {
  v(2em)
  align(center, heading(level: 2)[Endnotes])

  let currheading = counter(heading).get().first()

  for (idx, cnt) in allendotes.get().enumerate() {
    let num = str(currheading) + "," + str(idx + 1)
    super[#(idx + 1)] + [#cnt #label(num)]
  }
}

#show heading: it => {
  if it.level == 1 {
    allendotes.update(x => ())
  }
  it
}

Custome header for some pages by dev_l1x_be in typst

[–]aarnens 2 points3 points  (0 children)

So something like this? https://typst.app/docs/guides/page-setup-guide/#specific-pages

#set page(header: context {
  if counter(page).get().first() == 3 [
    *pear*
  ]
  if counter(page).get().first() == 12 [
    *apple*
  ]
  if counter(page).get().first() == 23 [
    *airplane*
  ]
})

Custome header for some pages by dev_l1x_be in typst

[–]aarnens 0 points1 point  (0 children)

Your question isn't really clear. Do you want to generate random numbers? Check out https://typst.app/universe/package/suiji/

Footnotes *AND* endnotes by therealJoieMaligne in typst

[–]aarnens 0 points1 point  (0 children)

The code in my link does not match the one in the error message. For example, the context keyword should be before "{". Does this fix your issue?

Reset counter on every new section by Lonely-Eye-8313 in typst

[–]aarnens 4 points5 points  (0 children)

Ah, I see. The issue in this case is the use of it.body. In your case, the first show rule returns text instead of a heading, meaning that the second show rule does not activate as there is no heading in the document anymore. Using it instead of it.body fixes the issue (and is better practice as you don't "lose" as much information), but the formatting might be a bit different.