Git Product home page Git Product logo

Comments (11)

ergl avatar ergl commented on September 25, 2024 1

My first idea would be to use a combination of inset-left and friends to manually position the header. I see there are options like anchor-from-parent, anchor-to, etc; but I haven't used them, so I don't know how they work.

Below is a sample of how I would go about replicating the letter you mention:

#lang quadwriter

'(q [(footer-display "false") (page-margin-left "2cm")]
    (q [(inset-left "12cm")]
        "Albert Einstein"
        '(line-break)
        "Old Grove Rd."
        '(line-break)
        "Nassau Point"
        '(line-break)
        "Peconic, Long Island"
        '(para-break)
        "August, 2nd, 1939")
    '(para-break)
    (q 
        "F.D. Roosevelt,"
        '(line-break)
        "President of the United States,"
        '(line-break)
        "White House"
        '(line-break)
        "Washington, D.C.")

    '(para-break)
    (q [(inset-top "1cm")] "Sir:")
    '(para-break)
    (q [(hyphenate "true") (line-wrap "kp")]
       (q [(first-line-indent "40")]
        "Some recent work by E. Fermi and L. Szilard, which has been communicated to me in manuscript, ...")))

And this is how it looks:

quad-letter

from pollen-users.

ergl avatar ergl commented on September 25, 2024 1

As for your other problem, you're right that using inset-left is not sufficient. I'd use the column-count attribute for that. Sadly, it's only a section-level attribute, so you can not have different parts in a page with different columns.

Right now I don't if it's possible to emulate that layout with quad. Hopefully Matthew or others can chime in with ideas.

from pollen-users.

mbutterick avatar mbutterick commented on September 25, 2024 1

@sorawee Despite the soothing presence of Comic Sans, that’s actually a complicated layout. In general placing things side-by-side is difficult. I am currently working on a #lang résumé based on quadwriter with a similar problem. What I did is use a negative space-after value on the first line, equal to the height of the line, to move the remaining lines upward vertically. So I make this, using inset-left:

First line
                     Second line
                     Third line

And then with the negative space-after on the first line, I make it look like this:

First line           Second line
                     Third line

from pollen-users.

mbutterick avatar mbutterick commented on September 25, 2024 1

Right now I’m just trying to reach the typesetting capability of the 1960s. You’re way out in the ’90s.

from pollen-users.

sorawee avatar sorawee commented on September 25, 2024

Thanks. That is very helpful.

If you don't mind, here's my next question. I also would like to be able to do this but the above solution doesn't seem suffice.

Let's ignore the images. The core issue is that in the above solution, the block with inset-left must have nothing on the left. That is, it must be on a new line. However, in the above example, there's a phrase "Home is" on the same line as the block with inset-left (which contains checkboxes). The solution above would fail: the checkbox would starts right after "Home is" without any inset. Do you have any workaround or solution for this?

from pollen-users.

sorawee avatar sorawee commented on September 25, 2024

@ergl: btw, if I understand correctly, you should not write ' in '(para-break). Racket would expand it into (quote (para-break)) which is incorrect. It just happens that quad ignores bogus tag name, so the result looks valid.

from pollen-users.

ergl avatar ergl commented on September 25, 2024

You're right, I got confused, the ' in both '(para-break) and '(line-break) should be removed.

from pollen-users.

ergl avatar ergl commented on September 25, 2024

Is there any particular limitation as to why column-count can only be used at the page level? I'm sure there are more complicated layouts that maybe could be solved by scoping columns to parts of a page.

from pollen-users.

mbutterick avatar mbutterick commented on September 25, 2024

No reason for that limitation (other than making my life simpler, for a week). I’ve been coming around to the idea that it would be useful to allow section breaks to happen within a page.

from pollen-users.

mbutterick avatar mbutterick commented on September 25, 2024

(Or more likely, create a new break level that represents an arbitrary vertical territory in the document, and allow column-count to apply at that lower level. It is useful to have a section consistently denote a set of whole pages.)

from pollen-users.

otherjoel avatar otherjoel commented on September 25, 2024

Isn't table layout what we really want?

from pollen-users.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.