Graphics, Figures & Tables\pdfliteral inside table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Ahmed Sokar
Posts: 4
Joined: Wed Jul 27, 2016 9:43 am

\pdfliteral inside table

Post by Ahmed Sokar »

I want to write dotted words inside a table.

But using \pdfliteral inside a table, ruins the formation of the table.

Does anybody have a solution?

Code: Select all

 \documentclass[12pt,oneside,a4paper]{memoir}
\begin{document}
\begin{table}[]\centering
        \begin{tabular}{|c|c|c|c|}
            \hline
            \pdfliteral{q 1 Tr .5 w [0.5 0.5] 0d}{arg1}\pdfliteral{Q}&d&d&d\\\hline
            \_\_\_\_ &\_\_\_\_ &\_\_\_\_ &\_\_\_\_\\\hline
            \_\_\_\_ &\_\_\_\_ &\_\_\_\_ &\_\_\_\_\\\hline
            \_\_\_\_ &\_\_\_\_ &\_\_\_\_ &\_\_\_\_\\\hline
        \end{tabular}
    \end{table}
\end{document}
Capture.JPG
Capture.JPG (20.37 KiB) Viewed 2787 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

\pdfliteral inside table

Post by Stefan Kottwitz »

Hi Ahmed!

With pdfTeX version 1.30.0 or later, you can the optional page argument. So that literal code refers to the origin (bottom-left corner of the page) and can be enclosed with q Q.

Working code:

Code: Select all

\documentclass[12pt,oneside,a4paper]{memoir}
\begin{document}
\begin{table}[]\centering
        \begin{tabular}{|c|c|c|c|}
            \hline
            \pdfliteral page{q 1 Tr .5 w [0.5 0.5] 0d}{arg1}\pdfliteral page{Q}&d&d&d\\\hline
            \_\_\_\_ &\_\_\_\_ &\_\_\_\_ &\_\_\_\_\\\hline
            \_\_\_\_ &\_\_\_\_ &\_\_\_\_ &\_\_\_\_\\\hline
            \_\_\_\_ &\_\_\_\_ &\_\_\_\_ &\_\_\_\_\\\hline
        \end{tabular}
    \end{table}
\end{document}
table.png
table.png (5.3 KiB) Viewed 2782 times
Stefan
LaTeX.org admin
Post Reply