flynx / photobook

LaTeX class for making photo books.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thanks !!! And new feature proposal...

nbremond77 opened this issue · comments

Hello,
Very good idea ! Thanks a lot for this new class. I'm a photographer and I always dreamed of making professionnal photo books in Linux, using Latex, without spending hours and hours...

Reading the documentation, I have not fully understand (yet) how to easely make pages (or double pages) with multiples photos and captions on the same page.
Would it be possible to add au bunch of page templates to the photobook class, with different page layouts like :

  • A page template with 2 pictures side by side, verticaly, or horizontaly
  • A page template with 2 pictures in diagonal (left-Top and right-bottom, and the opposite) ,
  • idem with 3, 4, 5, 6 and more pictures in a page...
  • etc...
    Do you think it is feasible ? Thanks !

Hi,

The main set of templates in photobook grew out of several book projects I worked on, and the main idea was not to include every possible template in the library but rather provide a set of tools to enable anyone to relatively simply build their own, but, you are right, there were no examples either in the class nor in the ./examples/ (fixed) directory of multi-image pages.

I'd say it is both possible and very simple, here is a horizontal two image page with captions example:

\begin{pagecell}%
	\begin{cell}{\bleed, 0mm}{0.5\cellwidth}{\cellheight}%
		% you can play around with `\imagecell{..}` and `\captioncell{..}` options ;)
		\imagecell[fit]{\captioncell[over]{Right caption}}{some-image}%
	\end{cell}
	\begin{cell}{0.5\cellwidth + \bleed, 0mm}{0.5\cellwidth}{\cellheight}%
		\imagecell[fit]{\captioncell[under]{Right caption}}{some-other-image}%
	\end{cell}
\end{pagecell}

Also see the full/buildable example here:
https://github.com/flynx/photobook/blob/main/examples/two-image-page.tex

This example is a bit naïve as it ignores the gutter and caption offsets.

But, IMHO you should not typeset individual pages in a book unless you are creating something really small, like a zine or a brochure, or every page's layout needs to be different in some way, it is more practical to instead create macros to define your specific layout(s), be it for pages or spreads and use those, this will help you focus on page/spread sequencing.

Also, it is quite possible to build really complex pages in Latex and if you plan to have allot of those I would recommend investing the time in templating them for your project, however tweaking such pages can be a pain, especially if you plan them not to be exactly the same, so if you need several such pages and do not need to functionally generate them from a script it could be simpler to lay them out in something like Scribus/InkScape/Illustrator/... and simply import the resulting pdf's either as an "image" or as a full page into your Latex layout.


P.S. I'm planning to start work on a manual with both use-case examples and tips on the general book production but have not gotten around to it yet.... the current documentation is more of a basic reference.

P.P.S. "without spending hours and hours..." -- you know, no matter how much I try, I've not had a single serious book project that I've spent less than several months on, yet, regardless if it's a team project or I'm the only one working on it, most of them take about a year, and the thing that slows things down is never the technical, so I hope you can make it without spending hours and hours and it would be fun to see how you do =)

You can also use tabular combined with photobooks' cells....

Have not used it myself yet but if things get too complicated I might write a wrapper to make things simpler.

See:
https://en.wikibooks.org/wiki/LaTeX/Tables

And:
https://tex.stackexchange.com/questions/122786/align-16-small-images-in-a-4-x-4-grid

Hello, thanks a lot for all these information. I better understand now how to build custom pages. And you are right, it's better to prepare few page templates and use them along the book. And this will improve consistence in the layout of the book, making it more professional I guess.
I was able to compile your example with no issue. A user manual will be greatly appreciated when you'll have time to work on it.

Thanks for the "tabular" trick that can help indeed.
I have a question: The caption seems to be limited to one single line of text.
How do you proceed to have a several lines text, like a long description, model name, photographer credits, etc... optionally with formatting, on the side, the top or the bottom of a photo ? Using Textcell ?

This might also be useful, have a look at:
https://github.com/flynx/photobook/tree/main/examples/spread%20generation

...it's part of the system I use to automate the page sequencing (the full thing will get released after the current book I'm working on is done).

OK, so I'm closing the issue for now, if you see a common enough case/layout or have an Idea, do not hesitate to either re-open it or write a new one =)

Cheers!

Thanks. Cheers.

"The caption seems to be limited to one single line of text." -- the caption is internally a minipage env so everything should be working, but for some reason the line does not break...

as a temporary solution wrap the contents in another minipage while I investigate:

\captioncell[under]{%
    \begin{minipage}{\cellwidth}%
        Long caption text...
    \end{minipage}}

P.S. textcell is a cell covering the page text block, it will not help you here, it's designed to typeset something in the shape of a full page text block.

Thanks a lot for you help. I'am sill trying different options and configurations, but so far I was able to generate a simple books that looks really professional.

I you have some time to provide a FAQ or a short preliminary hands-on user manual, it will be greatly appreciated.

Also could you please add IMAGE1 to IMAGE9 (or more) and CAPTION1 to CAPTION9 (or more) to the "make-images.sh" script in order to allow to make templates with more than 2 images ? Thanks.

Adding multiple images/captions to the script is not trivial in it's current form, I'll have to think about it....
BTW, out of curiosity, do you have allot of these multi-image pages?
...for what I do I have never needed (yet) to place more than a couple of images on a page, I'm curious =)

As to the manual, I'm working on a relatively comprehensive photo-book specific "book" covering everything from using spot colors for offset printing to different binding methods and the calculations needed (done by photobook) to correctly account for all/most of the details and pitfalls... this I'm definitely not going to be able to finish quickly. But doing a shot starter guide is a good idea, I'll plan one out and see how quickly I can make one within the next couple of days.
As to the FAQ, photobook came out of my work and so far my "questions" are few, far between and usually quite complex... jokes aside, so far there are too few users to accumulate an FAQ, so I'd be glad to hear your questions and we'll see where we go from there =)

P.S. I just gave a talk on the subject, and uploaded the slides/book today, so you can use that as an example, though it's not a typical "photo book" it still uses allot of photobook:
https://github.com/flynx/photobook/tree/main/talks/20230225%20-%20Presentation%20at%20Orlov's

Thanks for your reply.
Concerning the script, I'll think about it also on my side...
As for multiple photo on a page, it could be useful for a travel photo-book where we may want to tell a little story on a double page with several smaller pictures... or also for the photo summary at the end of an art book with a thumbnail of each picture and a legend/caption with he author name, and maybe the page number like an index...

The manual you are working on is a great idea. I understand it takes time...

The idea of the FAQ was just a quick txt (or tex) file to collect the questions users (like me) ask and your answers, in order to not have to repeat them several times... but the starter guide can do the same. It is a good idea I think.

Concerning the questions I have and maybe you could address in your started guide, here are some of them I am thinking about:

  • What are the rules for directory structure and naming/numbering the (text, captions and image) files for the spread "make-images.sh" script to work properly ?
  • How to add a (black or color) border or shadow to images ?
  • How to add a text anywhere on the page, on the top of any image or text ?
  • When using the ImageSpreadL macro for example, how to adjust the width of the caption zone on the right ? Using the Scale tweak ?
  • How to build our own jacket, cover, ... ? So far the examples only show how to make a template PDF, but I don't understand how to write the book's title, author, etc... on these templates in order to print them...

Again, I appreciate a lot what you have done. It's a great idea.

Adding multiple images/captions to the script is not trivial in it's current form, I'll have to think about it.... BTW, out of curiosity, do you have allot of these multi-image pages? ...for what I do I have never needed (yet) to place more than a couple of images on a page, I'm curious =)

As to the manual, I'm working on a relatively comprehensive photo-book specific "book" covering everything from using spot colors for offset printing to different binding methods and the calculations needed (done by photobook) to correctly account for all/most of the details and pitfalls... this I'm definitely not going to be able to finish quickly. But doing a shot starter guide is a good idea, I'll plan one out and see how quickly I can make one within the next couple of days. As to the FAQ, photobook came out of my work and so far my "questions" are few, far between and usually quite complex... jokes aside, so far there are too few users to accumulate an FAQ, so I'd be glad to hear your questions and we'll see where we go from there =)

P.S. I just gave a talk on the subject, and uploaded the slides/book today, so you can use that as an example, though it's not a typical "photo book" it still uses allot of photobook: https://github.com/flynx/photobook/tree/main/talks/20230225%20-%20Presentation%20at%20Orlov's

I'll have a closer look at Orlov's tex file to understand better what photobook can do !

Since legends/indexes are present in a book once, and are almost always a bit of an excuse for the designer to show off, I've never considered them a candidate for a generic template, and always made them by hand.... but that is just my experience.

I quite understand the function of a FAQ, and I agree with you here, I was referring that with the current user base (the initial release was this September), and essentially not advertisement other than the CTAN mailing list, the "frequently" here is literally measured in ones and twos.... but I am keeping track =)

Now to the questions...

What are the rules for directory structure and naming/numbering the (text, captions and image) files for the spread "make-images.sh" script to work properly ?

This is in part layed out in the first comment in the script:
https://github.com/flynx/photobook/blob/main/scripts/make-images.sh#L6
and an example structure here:
https://github.com/flynx/photobook/tree/main/examples/spread%20generation

I'm not very keen on "strict rules" so I write most of the code to be as flexible and as adaptable to the user's workflow.

How to add a (black or color) border or shadow to images?

There are several libs that do this but in the current architecture they are not supported, I'll see what can be done about this, you can write this as a feature request/issue....
Borders and other things supported by graphicx's \includegraphics{..} should be simple, but if you want proper shadows with blur and spread that's a different game and I do not see how to implement them in a general manner other than placing the image over another shadow image with alpha (but note that alpha channels in images can be an issue on some printers).

How to add a text anywhere on the page, on the top of any image or text ?

you have cell/cell* (absolutely positioned cells) and zinlinecell/zinlinecell* (a cell that does not takeup any space in the document, i.e. tat draws over other stuff) you can put anything in them and position them anywhere on a page... but note that if the text overflows the cell dimensions it will either clip or overflow....
(have not yet figured out how to designe an API to let the user control where the overflow should go)

When using the ImageSpreadL macro for example, how to adjust the width of the caption zone on the right ? Using the Scale tweak ?

You have several choices here:

  • crop the image to correct proportions
  • use the "tweaking" macros: \tweakimagescale{..}/\tweakimageoffsettop{..}/\tweakimageoffsetleft{..}

if you want to explicitly define a cell for text with explicit width and force the image to automatically adapt to it, then that is also simple, using the spreadtopages env and create two cells one for text and one for the image, if you want full bleed images the image cell should be larger than the page by \bleed on three sides and then simply drop an image cell in there in an appropriate mode
example:
https://github.com/flynx/photobook/blob/main/examples/custom-spread.tex
(while writing this example I found a bug, seems that textblock* does not behave well with savebos's, need to investigate this further)

How to build our own jacket, cover, ... ? So far the examples only show how to make a template PDF, but I don't understand how to write the book's title, author, etc... on these templates in order to print them...

This is both trivial and indeed not documented, create a document with layoutmode=jacket and use frontcover, backcover, spine, vspine, frontflap and/or backflap to place content at specific cells or you are free to fill the page freeform or a combination of both....
see:
https://github.com/flynx/photobook/blob/main/examples/jacket.tex

Also note that the jacket/cover/... cells do not account for bleeds, so you need to account for them manually.... I think I should add an automatic way to deal with this =)

while writing this example I found a bug, seems that textblock* does not behave well with savebos's, need to investigate this further

This is a funny one, textblock in absolute mode does not play well with sbox, will need to discuss this with the upstream, and potentially this would require a partial rewrite, this leads to cell/cell* not being usable in save boxes including all the spreadtopages env and friends....

This is not a big deal as we can use 'inlinecell' and shift things manually within spreadtopagess.

As a fix in photobook I'm investigating these approaches:

  • Do a separate implementation of cell/cell* within spreadtopages/spreadtopages*/...
  • play with absolute/relative modes within save cells
  • "It's not a bug, it's a feature" -- add a note about this to the docs, this needs experimenting...

UPDATE: fixed via #2

Hello, thanks a lot for all your answers. I was out this weekend, and I had no much time to look into it. maybe I'll have more time this week.
In the mean time, I wrote a first draft of a Python script to generate the Latex code from templates, with some additional feature like managing plenty of images, captions and texts in the templates and pre-processing the images to add shadow and borders using python Pilllow or CV2 libraries. I'll send you this first draft by email soon... and later on, a working example. Best regards.

I had to spend some time to design a simple enough way to both stay compatible with the current format (I'd try and keep compatibility with my ongoing projects) and at the same time keep things trivial to use. I just finished an experimental implementation, and I'm planning on integrating it into the main script in the next 1-3 days -- you can see the code in the script already here:
https://github.com/flynx/photobook/blob/main/scripts/make-images.sh#L246

Basically I'm parsing the template for text and image "slots" (done), then populating them from the spread directory contents (not integrated)...

Architecture-wise, I was consciously avoiding bringing in extra dependencies (Python in this case) into the mix as it would instantly make things more complex and less portable, both in setup and in long-term maintenance, this is not insignificant as I'm supporting Windows, Android, BSD and a couple of Linux flavors, and some users just stepped of InDesign, so any extra dep can have quite a cost -- currently all you need is a recent enough LaTeX toolchain and everything will work, with no extra steps (give or take: shell on windwos ;) ).

I'm not saying "no", it would be quite interesting to see what you have done, primarily on the API/workflow level, and since I was not planning on integrating any image processing, that part might be useful, how to integrate it is a different question, we'll have to see =)

And Thanks!)

...and as a side note, did you notice the generated (by default) <block-name>.image-list file (to turn it on/off use \writeimagelisttrue / \writeimagelistfalse resp.)?
Since you are doing pre/post processing, this might get useful ;)