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

make pdf_rendering work #7

Closed
petermeissner opened this issue Jan 4, 2018 · 5 comments
Closed

make pdf_rendering work #7

petermeissner opened this issue Jan 4, 2018 · 5 comments

Comments

@petermeissner
Copy link
Owner

No description provided.

@Christian-T
Copy link

Christian-T commented Oct 11, 2020

Hello Peter and thanks for your nice function :)
I'd like to use it for a small project; however I did not manage to get the pdf_rendering to work. I found out the following functions should be a bit different (need to access private method of cw object via cw$.enclos_env$private$...). Furthermore I couldn't find the function cw_words_add_id(). Could you provide me with it?

cw_glue_puzzle <- function(cw){
   glue::glue(
     .open = "<R>",
     .close = "</R>",
     columns = cw$.__enclos_env__$private$columns,
     rows    = cw$.__enclos_env__$private$rows,
   "
 \\definecolor{gray}{gray}{.95}
 \\PuzzleDefineColorCell{g}{gray}
 \\begin{Puzzle}{<R>columns</R>}{<R>rows</R>}
 <R>
 cw_glue_table(cw$letters)
 </R>
 \\end{Puzzle}
 ")
 }


 cw_glue_solution <- function(cw){
   glue::glue(
     .open="<R>",
     .close="</R>",
 "\\newpage
 \\PuzzleSolution
 \\begin{Puzzle}{<R>cw$.__enclos_env__$private$columns</R>}{<R>cw$.__enclos_env__$private$rows</R>}
 <R>cw_glue_table(cw$letters)</R>
 \\end{Puzzle}
 \\end{document}
 "
   )
 }

@petermeissner
Copy link
Owner Author

Hey, thanks for writing in.

I am having a hard time understanding your question. Can you make it more readable (help me help you) - e.g. format code as code, have a look here: https://docs.github.com/en/free-pro-team@latest/github/writing-on-github/basic-writing-and-formatting-syntax?

Anyhow, most likely the answer is no. No, pdf rendering is not working that is why this issue still is open and I currently have no time/plans to make it work - sorry.

@Christian-T
Copy link

Hi, thanks for your quick reply. Sorry for the bad structure; I formatted it as code now. I meant that firstly your methods cw_glue_puzzle() and cw_glue_solution() did not work for me, but with the above mentioned code, they do work. cw is a R6 object, that has some public and some private methods, and rows and columns are private, which is why we (at least I) need to access it via this complicated cw$.enclos_env$private$...-part. Secondly, your function cw_glue_clues() refers to another function called cw_words_add_id() which seems to add an id column ;) . However, I could not find this function in your repo; maybe you have stored it locally somewhere?

If pdf rendering will not work, could you hint me what to do with the json code, to get a nicely formatted crossword? Do I need to paste it on a webpage? Unfortunately, I am not familiar with json.
Thanks in advance!

@petermeissner
Copy link
Owner Author

petermeissner commented Oct 13, 2020 via email

@petermeissner
Copy link
Owner Author

Also, please do your homework.

The official example from the documentation does already provide the information you are trying to forcefully extract from the crossword object, see ?Crossword , section Examples.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants