Tag Info

New answers tagged

14

\documentclass{article} \usepackage{lipsum} \begin{document} \directlua{function last_line(h) ll=node.slide(h) newh = node.remove(h,ll) callback.register("post_linebreak_filter",nil) tex.setbox(0,ll) return h end } \directlua{callback.register("post_linebreak_filter", last_line)} \lipsum[3] \begin{center} \fbox{\unhbox0} \end{center} \end{document}


7

You can use traditional TeX programming in LuaTeX too. An you don't need to use the boxing and unboxing for your task. You can try: \def\centerlastline#1{\par {\leftskip=0pt plus1fil \rightskip=0pt plus-1fil \parfillskip=0pt plus2fil \noindent #1\par}% } \centerlastline{\lipsum[3]}


11

After too many hours of failed attempts I got a working solution. The problem was in setting correct values to glue nodes. Documentation on this is unfortunately lacking, so I spent too much time hacking node dumps, but this lead to nowhere. \documentclass{article} \usepackage{lipsum} \usepackage{luatexbase} % we will use node attributes to start/stop ...


4

As the error message shows the file is trying to do \catcode \endlinechar 5 to normalize end of line handling while looking in an EPS file for BoundIngBox comments It (I) wasn't expecting you to have done \endlinechar=-1\relax so this ends up trying to set the catcode of character -1 which produces the error you show. I assume you can do ...


4

My example shows how to do this task without any LaTeX packages. Suppose, we have the file names.csv in the format shown in Kumars answer. % in preamble: \newread\infile \def\printletters #1 {\bgroup \endlinechar=-1 \openin\infile=#1 \read\infile to\tmp \printlettersA } \def\printlettersA{\ifeof\infile \egroup \else \read\infile to\tmp ...


2

Shamelessly parasitic on Harish Kumar's data, this solution uses textmerg for the merge: \documentclass[a4paper]{article} \usepackage[T1]{fontenc} \usepackage{textmerg}% \usepackage{filecontents} \begin{filecontents*}{names.dat} Mr Sreeram P. 12 Mr Rajaram K. 20 Mr Dhanraj Julien 35 Ms Lalitha S. ...


8

Here is a starting point using datatool. I won't discuss the design of the check (layout) as it is a candidate for a separate question. \documentclass{article} \usepackage[a4paper,textheight=5in,left=1in,right=1in]{geometry} %% 5in only for demo \usepackage{xcolor}% \usepackage{adjustbox} % \usepackage{filecontents} \begin{filecontents*}{names.csv} ...



Top 50 recent answers are included