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

Importing Pocket stuff Could Error: "not convert database value "a:1:{i:0;s:26:"M. J" to Doctrine Type array" #3873

Open
de-ramon opened this issue Feb 4, 2019 · 16 comments

Comments

@de-ramon
Copy link

de-ramon commented Feb 4, 2019

Hi,

I just installed wallabag on a shared hoster (mysql 5.7.21-nmm1-log utf8mb4_unicode_ci / PHP 7.1) using ssh like here:
https://doc.wallabag.org/de/admin/installation/installation.html

wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package

# This file is auto-generated during the composer install
parameters:
    database_driver: pdo_mysql
    database_driver_class: null
    database_host: 127.0.0.1
    database_port: null
    database_name: d02dxxx
    database_user: d02dxxx
    database_password: 1234 :-)
    database_path: null
    database_table_prefix: wallabag_
    database_socket: null
    database_charset: utf8mb4
    domain_name: https://rddddddd
    mailer_transport: smtp
    mailer_host: 127.0.0.1
    mailer_user: null
    mailer_password: null
    locale: de
    secret: ovmpmAWXRCabNl--
    twofactor_auth: true
    twofactor_sender: no-reply@wallabag.org
    fosuser_registration: true
    fosuser_confirmation: true
    from_email: no-reply@wallabag.org
    rss_limit: 50
    rabbitmq_host: localhost
    rabbitmq_port: 5672
    rabbitmq_user: guest
    rabbitmq_password: guest
    rabbitmq_prefetch_count: 10
    redis_scheme: tcp
    redis_host: localhost
    redis_port: 6379
    redis_path: null
    redis_password: null

Importing my Pocket stuff starts and then:

https://rdltr.afadfads/import/pocket/callback
500: Internal Server Error
Could not convert database value "a:1:{i:0;s:26:"M. J" to Doctrine Type array

Is my charset ok?
database_charset: utf8mb4

thx,
de_ramon

@j0k3r
Copy link
Member

j0k3r commented Feb 4, 2019

Your charset is fine.
What's in path/to/wallabag/var/log/prod.log?

@de-ramon
Copy link
Author

de-ramon commented Feb 4, 2019

Last entry:

...
[2019-02-04 13:35:20] graby.DEBUG: ...3 elements added to body {"len":3} []
[2019-02-04 13:35:20] graby.DEBUG: Success ? 1 {"is_success":true} []
[2019-02-04 13:35:20] graby.DEBUG: Filtering HTML to remove XSS [] []
[2019-02-04 13:35:20] graby.DEBUG: Returning data (most interesting ones): [array] {"data":{"status":200,"html":"<div class=\"post-text\" itemprop=\"text\"><p>My apologies if this is already answered somewhere (typical opening I suppose) but here goes. I've modified code from the thread <a href=\"https://tex.stackexchange.com/questions/47924/creating-playing-cards-using-tikz\">Creating playing cards using TikZ</a> for the purposes of my needs. Now what I am attempting to do is</p>\n<ol><li>put a 'back' on the card so when I print on cardstock the front and the back of the card lines up correctly: aka double sided</li>\n<li>put more than a single card on a single page.</li>\n</ol><p>I've been at this for two long and finally broke down to ask the question. The code below generates the face of the card. I'd like to repeat the same face on the back side of the card where I am able to change formats, styles, images, node locations, etc., and basically just have a back to the card with same dimensions and aligns properly with the correct card.</p>\n<pre>\\documentclass[a4paper]{article}\n\\usepackage{graphicx}\n\\usepackage{color}\n\\usepackage{amsmath, amssymb}\n\\usepackage{tikz}\n    \\usetikzlibrary{patterns}\n    \\usetikzlibrary{shadows}\n    \\usetikzlibrary{positioning}\n \\usepackage{pifont}\n \\usepackage{fourier-orns}\n \\definecolor{titlebg}{rgb}{30, 30 , 30}\n\\begin{document}\n    \\newcommand{\\icon}{$\\alpha$}\n    \\newcommand{\\cardtype}{cardtype}\n    \\newcommand{\\cardtitle}{cardtitle}\n    \\newcommand{\\cost}{cost}\n    \\newcommand{\\flavortext}{flavortext}\n    \\newcommand{\\cardcontent}{cardcontent}\n    \\newcommand{\\cardid}{cardid}\n    \\newcommand{\\cardimg}{img/test.jpg}\n %   TikZ/PGF Settings für die Karten\n \\pgfmathsetmacro{\\cardwidth}{6pt}\n \\pgfmathsetmacro{\\cardheight}{9pt}\n \\pgfmathsetmacro{\\imagewidth}{\\cardwidth*.9}\n \\pgfmathsetmacro{\\imageheight}{0.75*\\cardheight}\n \\pgfmathsetmacro{\\stripwidth}{0.7pt}\n \\pgfmathsetmacro{\\strippadding}{0.2pt}\n \\pgfmathsetmacro{\\textpadding}{0.1pt}\n \\pgfmathsetmacro{\\titley}{\\cardheight-\\strippadding-1.5*\\textpadding-0.5*\\stripwidth}\n %   Formen der einzelnen Kartenelemente/-bestandteile\n \\def\\shapeCard{(0,0) rectangle (\\cardwidth, \\cardheight)}\n  \\def\\shapeLeftStripLong{(\\strippadding,-0.2) rectangle (\\strippadding+\\stripwidth,\\cardheight-\\strippadding-\\strippadding-1)}\n \\def\\shapeLeftStripShort{(\\strippadding,\\cardheight-\\strippadding-1) rectangle (\\strippadding+\\stripwidth,\\cardheight+0.2)}\n \\def\\shapeRightStripShort{(\\cardwidth-\\stripwidth-\\strippadding,\\cardheight-\\strippadding-1) rectangle (\\cardwidth-\\strippadding,\\cardheight+0.2)}\n \\def\\shapeTitleArea{(2*\\strippadding+\\stripwidth,\\cardheight-\\strippadding) rectangle (\\cardwidth-2*\\strippadding-\\stripwidth,\\cardheight-2*\\stripwidth)}\n \\def\\shapeContentArea{(2*\\strippadding+\\stripwidth,0.5*\\cardheight) rectangle (\\cardwidth+0.2,-0.2)}\n \\tikzstyle{cardcorners}=[rounded corners=0.25cm]\n   \\begin{tikzpicture}\n%debug grid and point locations\n    \\filldraw[color=red!60, fill=black!100, very thick](0, 0) circle (0.1) node[color = black!100, anchor = east]{ origin};\n    \\filldraw[color=red!60, fill=red!100, very thick](6,0) circle (0.1) node[color = black!100, anchor = west]{card width};\n    \\filldraw[color=red!60, fill=red!100, very thick](6,9) circle (0.1) node[color = black!100, anchor = west]{card width, card height};\n    \\filldraw[color=black!60, fill=red!100, very thick](0,9) circle (0.1) node[color = black!100, anchor = north]{card height};\n    %\\draw [step=.5, help lines] (0,0) grid (\\cardwidth,\\cardheight);\n%begin card creation\n        % draw card boundries and clip corners\n        \\draw[lightgray,cardcorners] \\shapeCard;\n          \\clip[cardcorners] \\shapeCard;\n         % card image: placed first so other nodes will stack on top of this one\n                              \\tikzstyle{cardimage}=[ path picture={\n                                                                        \\node[below=-1.5mm] at (0.5*\\cardwidth,\\cardheight) {\n                                                                        \\includegraphics[width=\\imagewidth cm]{#1}\n                                                                        };\n                                                                    } \n                                                            ]\n                             \\newcommand{\\cardbackground}[1]{\n                                    \\draw[cardcorners, cardimage=#1] \\shapeCard;\n                                }\n                             \\cardbackground{ \\cardimg }        \n         % card type strip\n        \\fill[red!100, rounded corners=0.1cm, drop shadow = {opacity = 5, color = black} ] \\shapeLeftStripLong node[rotate = 90, above left, font=\\LARGE] {  \\color{white}\\uppercase{ \\cardtype }};\n          % card icon strip\n        \\begin{scope}           \n        \\fill[red!100, rounded corners=0.1cm, drop shadow = {opacity=5, color = black}  ] \\shapeLeftStripShort node[ rotate=0,  above, yshift = -8.5, font = \\LARGE ] at (0.5*\\strippadding+0.5*\\stripwidth, \\titley){ \\color{white}\\uppercase{ \\icon }};\n        \\end{scope}\n         % card cost \n         \\begin{scope}\n            \\fill[red!100, rounded corners=0.1cm, drop shadow = {opacity=5, color = black}  ] \\shapeRightStripShort node[ rotate=0, above, yshift = -8.5, font=\\LARGE] \n            at  (\\cardwidth - 0.5*\\stripwidth - 1.5*\\strippadding, \\titley) \n            {  \\color{white}\\uppercase{ \\cost }};\n        \\end{scope}\n         % card title strip\n            \\fill[ color = black, opacity = .75, rounded corners=0.1cm  ] \\shapeTitleArea node[ text width=3.75cm, rotate=0, font=\\normalsize] at (0.5*\\cardwidth,\\titley) { \\begin{center} \\color{white!100}\\uppercase{\\normalsize \\cardtitle }  \\end{center} };\n        % card content\n            % card content: flavor text\n                \\node[below right, text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] at (2*\\strippadding+\\stripwidth+\\textpadding,0.5*\\cardheight-\\textpadding) { \\textit{ \\scriptsize \\flavortext  } };\n            %card content: card effect\n                %line above text\n                        \\draw[ultra thin, &lt;-&gt;] (25*\\strippadding+\\stripwidth+\\textpadding, 3.5) -- (2*\\strippadding+\\stripwidth+\\textpadding, 3.5);     \n                \\node[below right, text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] at (2*\\strippadding+\\stripwidth+\\textpadding,3.5) {\n                        \\vspace{0.05cm}\n                        {\\normalsize \\cardcontent }\n                    };                      \n        % card-ID\n            %line above text\n            \\draw[ultra thin, &lt;-&gt;] (25*\\strippadding+\\stripwidth+\\textpadding, 0.4) -- (2*\\strippadding+\\stripwidth+\\textpadding, 0.4);     \n            \\node[above right, text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] at (2*\\strippadding+\\stripwidth+\\textpadding, 0.05) {\n                     \\begin{flushright}  {\\tiny \\cardid }   \\end{flushright} \n                       };               \n\\end{tikzpicture}\n\\end{document}\n\n</pre>\n<p>[edit2] I want this on the back of the card....same code as before but without the fancy nodes and shapes</p>\n<pre>\n  \\begin{tikzpicture}\n%debug grid and point locations\n%   \\filldraw[color=red!60, fill=black!100, very thick](0, 0) circle (0.1) node[color = black!100, anchor = east]{ origin};\n%   \\filldraw[color=red!60, fill=red!100, very thick](6,0) circle (0.1) node[color = black!100, anchor = west]{card width};\n%   \\filldraw[color=red!60, fill=red!100, very thick](6,9) circle (0.1) node[color = black!100, anchor = west]{card width, card height};\n%   \\filldraw[color=black!60, fill=red!100, very thick](0,9) circle (0.1) node[color = black!100, anchor = north]{card height};\n    %\\draw [step=.5, help lines] (0,0) grid (\\cardwidth,\\cardheight);\n%begin card creation\n        % draw card boundries and clip corners\n        \\draw[lightgray,cardcorners] \\shapeCard;\n          \\clip[cardcorners] \\shapeCard;\n         % card image: placed first so other nodes will stack on top of this one\n                              \\tikzstyle{cardimage}=[ path picture={\n                                                                        \\node[below=-1.5mm] at (0.5*\\cardwidth,\\cardheight) {\n                                                                        \\includegraphics[width=\\imagewidth cm]{#1}\n                                                                        };\n                                                                    } \n                                                            ]\n                             \\newcommand{\\cardbackground}[1]{\n                                    \\draw[cardcorners, cardimage=#1] \\shapeCard;\n                                }\n    %                        \\cardbackground{ \\cardimg }        \n         % card type strip\n%           \\fill[red!100, rounded corners=0.1cm, drop shadow = {opacity = 5, color = black} ] \\shapeLeftStripLong node[rotate = 90, above left, font=\\LARGE] {  \\color{white}\\uppercase{ \\cardtype }};\n          % card icon strip\n%       \\begin{scope}           \n%       \\fill[red!100, rounded corners=0.1cm, drop shadow = {opacity=5, color = black}  ] \\shapeLeftStripShort node[ rotate=0,  above, yshift = -8.5, font = \\LARGE ] at (0.5*\\strippadding+0.5*\\stripwidth, \\titley){ \\color{white}\\uppercase{ \\icon }};\n%       \\end{scope}\n         % card cost \n%        \\begin{scope}\n        %   \\fill[red!100, rounded corners=0.1cm, drop shadow = {opacity=5, color = black}  ] \\shapeRightStripShort node[ rotate=0, above, yshift = -8.5, font=\\LARGE] \n%           at  (\\cardwidth - 0.5*\\stripwidth - 1.5*\\strippadding, \\titley) \n%           {  \\color{white}\\uppercase{ \\cost }};\n%       \\end{scope}\n         % card title strip\n        \\fill[ color = black, opacity = .75, rounded corners=0.1cm  ] \\shapeTitleArea node[ text width=3.75cm, rotate=0, font=\\normalsize] at (0.5*\\cardwidth,\\titley) { \\begin{center} \\color{white!100}\\uppercase{\\normalsize \\cardtitle }  \\end{center} };\n        % card content\n            % card content: flavor text\n        %       \\node[below right, text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] at (2*\\strippadding+\\stripwidth+\\textpadding,0.5*\\cardheight-\\textpadding) { \\textit{ \\scriptsize \\flavortext  } };\n            %card content: card effect\n                %line above text\n            %           \\draw[ultra thin, ] (25*\\strippadding+\\stripwidth+\\textpadding, 3.5) -- (2*\\strippadding+\\stripwidth+\\textpadding, 3.5);     \n                \\node[below right, text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] at (2*\\strippadding+\\stripwidth+\\textpadding,3.5) {\n                        \\vspace{0.05cm}\n                        {\\normalsize \\cardcontent }\n                    };                      \n        % card-ID\n            %line above text\n    %       \\draw[ultra thin, ] (25*\\strippadding+\\stripwidth+\\textpadding, 0.4) -- (2*\\strippadding+\\stripwidth+\\textpadding, 0.4);     \n    %       \\node[above right, text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] at (2*\\strippadding+\\stripwidth+\\textpadding, 0.05) {\n    %                \\begin{flushright}  {\\tiny \\cardid }   \\end{flushright} \n    %                  };               \n         \\end{tikzpicture}\n</pre>\n<p><img src=\"https://i.stack.imgur.com/JXSBD.png\" alt=\"cardface\" /></p>\n<p><img src=\"https://i.stack.imgur.com/X9JmO.png\" alt=\"card back example\" /></p>\n<p>this is how I'd like to see a page...the outline of the 9 cards is present so each print will have 9 faces and on the other side of the paper you will have their respective 9 backs. I was able to get the multiple card layouts but still not sure if this is the way to go considering the issues with attempting to get the back backs in the correct position.</p>\n<p><img src=\"https://i.stack.imgur.com/Fwq7g.png\" alt=\"multicardlayout\" /></p>\n<p>the code to get the multiple cards per page is here where i would create an actual function to call this script for me to keep the code cleaner than it currently is.</p>\n<pre>\n  \\begin{tikzpicture}\n%debug grid and point locations\n%   \\filldraw[color=red!60, fill=black!100, very thick](0, 0) circle (0.1) node[color = black!100, anchor = east]{ origin};\n%   \\filldraw[color=red!60, fill=red!100, very thick](6,0) circle (0.1) node[color = black!100, anchor = west]{card width};\n%   \\filldraw[color=red!60, fill=red!100, very thick](6,9) circle (0.1) node[color = black!100, anchor = west]{card width, card height};\n%   \\filldraw[color=black!60, fill=red!100, very thick](0,9) circle (0.1) node[color = black!100, anchor = north]{card height};\n    %\\draw [step=.5, help lines] (0,0) grid (\\cardwidth,\\cardheight);\n%begin card creation\n        % draw card boundries and clip corners\n        \\draw[lightgray,cardcorners] \\shapeCard;\n        \\begin{scope}\n          \\clip[cardcorners] \\shapeCard;\n         % card image: placed first so other nodes will stack on top of this one\n                              \\tikzstyle{cardimage}=[ path picture={\n                                                                        \\node[below=-1.5mm] at (0.5*\\cardwidth,\\cardheight) {\n                                                                        \\includegraphics[width=\\imagewidth cm]{#1}\n                                                                        };\n                                                                    } \n                                                            ]\n                             \\newcommand{\\cardbackground}[1]{\n                                    \\draw[cardcorners, cardimage=#1] \\shapeCard;\n                                }\n                             \\cardbackground{ \\cardimg }        \n         % card type strip\n            \\fill[red!100, rounded corners=0.1cm, drop shadow = {opacity = 5, color = black} ] \\shapeLeftStripLong node[rotate = 90, above left, font=\\LARGE] {  \\color{white}\\uppercase{ \\cardtype }};\n          % card icon strip\n        \\begin{scope}           \n        \\fill[red!100, rounded corners=0.1cm, drop shadow = {opacity=5, color = black}  ] \\shapeLeftStripShort node[ rotate=0,  above, yshift = -8.5, font = \\LARGE ] at (0.5*\\strippadding+0.5*\\stripwidth, \\titley){ \\color{white}\\uppercase{ \\icon }};\n        \\end{scope}\n         % card cost \n         \\begin{scope}\n            \\fill[red!100, rounded corners=0.1cm, drop shadow = {opacity=5, color = black}  ] \\shapeRightStripShort node[ rotate=0, above, yshift = -8.5, font=\\LARGE] \n            at  (\\cardwidth - 0.5*\\stripwidth - 1.5*\\strippadding, \\titley) \n            {  \\color{white}\\uppercase{ \\cost }};\n        \\end{scope}\n         % card title strip\n            \\fill[ color = black, opacity = .75, rounded corners=0.1cm  ] \\shapeTitleArea node[ text width=3.75cm, rotate=0, font=\\normalsize] at (0.5*\\cardwidth,\\titley) { \\begin{center} \\color{white!100}\\uppercase{\\normalsize \\cardtitle }  \\end{center} };\n        % card content\n            % card content: flavor text\n                \\node[below right, text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] at (2*\\strippadding+\\stripwidth+\\textpadding,0.5*\\cardheight-\\textpadding) { \\textit{ \\scriptsize \\flavortext  } };\n            %card content: card effect\n                %line above text\n                        \\draw[ultra thin, ] (25*\\strippadding+\\stripwidth+\\textpadding, 3.5) -- (2*\\strippadding+\\stripwidth+\\textpadding, 3.5);     \n                \\node[below right, text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] at (2*\\strippadding+\\stripwidth+\\textpadding,3.5) {\n                        \\vspace{0.05cm}\n                        {\\normalsize \\cardcontent }\n                    };                      \n        % card-ID\n            %line above text\n            \\draw[ultra thin, ] (25*\\strippadding+\\stripwidth+\\textpadding, 0.4) -- (2*\\strippadding+\\stripwidth+\\textpadding, 0.4);     \n            \\node[above right, text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] at (2*\\strippadding+\\stripwidth+\\textpadding, 0.05) {\n                     \\begin{flushright}  {\\tiny \\cardid }   \\end{flushright} \n                       };               \n             \\end{scope}\n             % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %\n             % % card back\n             \\draw[lightgray,cardcorners]  ( \\cardwidth+0.5,0) rectangle (2*\\cardwidth, \\cardheight);\n             \\draw[lightgray,cardcorners]  (2* \\cardwidth+0.5,0) rectangle (3*\\cardwidth, \\cardheight);\n         \\end{tikzpicture}\n         \\\\\n            \\begin{tikzpicture}\n                \\begin{scope}\n                      \\clip[cardcorners] \\shapeCard;\n                        \\draw[lightgray,cardcorners] (0,0) rectangle (\\cardwidth, \\cardheight);\n                \\end{scope}                  \n                         \\draw[lightgray,cardcorners] ( \\cardwidth+0.5,0) rectangle (2*\\cardwidth, \\cardheight);\n                         \\draw[lightgray,cardcorners] (2* \\cardwidth+0.5,0) rectangle (3*\\cardwidth, \\cardheight);\n                     \\end{tikzpicture}\n         \\\\\n            \\begin{tikzpicture}\n                                                \\draw[lightgray,cardcorners] (0,0) rectangle (\\cardwidth, \\cardheight);\n                                                 \\draw[lightgray,cardcorners] ( \\cardwidth+0.5,0) rectangle (2*\\cardwidth, \\cardheight);\n                                                 \\draw[lightgray,cardcorners] (2* \\cardwidth+0.5,0) rectangle (3*\\cardwidth, \\cardheight);\n                             \\end{tikzpicture}\n</pre></div><h2 data-answercount=\"1\">1 Answer 1</h2><div class=\"post-text\" itemprop=\"text\"><p><code>LaTeX</code> considers every <code>tickpicture</code> like a character, so you only need to place corresponding front and back cards on same place at front and back sides of a page. <code>geometry</code> package can help to adjust margins for even and odd pages, and also for saving trees ;-)</p>\n<p>In following code I've \"cleaned\" a little bit your code (much more can be done) and declared two new commands <code>\\frontcard</code> and <code>\\backcard</code>. Both have an optional parameter where all <code>\\renewcommands</code> can be declared for defining card contents. I'm not satisfied with this solution, but I'll left as an exercise to find a better one.</p>\n<p>With these commands, all cards can be arranged on a <code>\\tabular</code> where front and back cards can be organized. The result looks like:</p>\n<p><img src=\"https://i.stack.imgur.com/fvNvr.png\" alt=\"enter image description here\" /></p>\n<pre>\\documentclass[a4paper]{article}\n\\usepackage{graphicx}\n%\\usepackage{color}\n\\usepackage{amsmath, amssymb}\n\\usepackage{tikz}\n\\usetikzlibrary{patterns, shadows, positioning}\n\\usepackage{pifont}\n\\usepackage{fourier-orns}\n\\usepackage[hmargin=1mm,vmargin=5mm]{geometry}\n\\definecolor{titlebg}{rgb}{30, 30 , 30}\n\\newcommand{\\icon}{$\\alpha$}\n\\newcommand{\\cardtype}{cardtype}\n\\newcommand{\\cardtitle}{cardtitle}\n\\newcommand{\\cost}{cost}\n\\newcommand{\\flavortext}{flavortext}\n\\newcommand{\\cardcontent}{cardcontent}\n\\newcommand{\\cardid}{cardid}\n\\newcommand{\\cardimg}{frog.jpg}\n%   TikZ/PGF Settings für die Karten\n\\pgfmathsetmacro{\\cardwidth}{6pt}\n\\pgfmathsetmacro{\\cardheight}{9pt}\n\\pgfmathsetmacro{\\imagewidth}{\\cardwidth*.9}\n\\pgfmathsetmacro{\\imageheight}{0.75*\\cardheight}\n\\pgfmathsetmacro{\\stripwidth}{0.7pt}\n\\pgfmathsetmacro{\\strippadding}{0.2pt}\n\\pgfmathsetmacro{\\textpadding}{0.1pt}\n\\pgfmathsetmacro{\\titley}{\\cardheight-\\strippadding-1.5*\\textpadding-0.5*\\stripwidth}\n %   Formen der einzelnen Kartenelemente/-bestandteile\n\\def\\shapeCard{(0,0) rectangle (\\cardwidth, \\cardheight)}\n\\def\\shapeLeftStripLong{(\\strippadding,-0.2) rectangle \n    (\\strippadding+\\stripwidth,\\cardheight-\\strippadding-\\strippadding-1)}\n\\def\\shapeLeftStripShort{(\\strippadding,\\cardheight-\\strippadding-1) rectangle \n    (\\strippadding+\\stripwidth,\\cardheight+0.2)}\n\\def\\shapeRightStripShort{(\\cardwidth-\\stripwidth-\\strippadding,\n    \\cardheight-\\strippadding-1) rectangle (\\cardwidth-\\strippadding,   \n    \\cardheight+0.2)}\n\\def\\shapeTitleArea{(2*\\strippadding+\\stripwidth,\\cardheight-\\strippadding) \n    rectangle (\\cardwidth-2*\\strippadding-\\stripwidth,\\cardheight-2*\\stripwidth)}\n\\def\\shapeContentArea{(2*\\strippadding+\\stripwidth,0.5*\\cardheight) rectangle \n    (\\cardwidth+0.2,-0.2)}\n\\tikzset{%\n    cardcorners/.style={rounded corners=0.25cm},\n    cardimage/.style={path picture={\n         \\node[below=-1.5mm] at (0.5*\\cardwidth,\\cardheight) {\n             \\includegraphics[width=\\imagewidth cm]{#1}};}},\n    strips/.style={red!100, rounded corners=0.1cm, \n         drop shadow={opacity=1,color=black}},\n    strip font/.style={font=\\LARGE, text=white}\n}\n\\newcommand{\\cardbackground}[1]{\n    \\draw[cardcorners, cardimage=#1] \\shapeCard;}\n\\newcommand{\\frontcard}[1][]{#1\n\\begin{tikzpicture}\n%%debug grid and point locations\n%    \\filldraw[color=red!60, fill=black!100, very thick](0, 0) circle (0.1) node[color = black!100, anchor = east]{ origin};\n%    \\filldraw[color=red!60, fill=red!100, very thick](6,0) circle (0.1) node[color = black!100, anchor = west]{card width};\n%    \\filldraw[color=red!60, fill=red!100, very thick](6,9) circle (0.1) node[color = black!100, anchor = west]{card width, card height};\n%    \\filldraw[color=black!60, fill=red!100, very thick](0,9) circle (0.1) node[color = black!100, anchor = north]{card height};\n%    %\\draw [step=.5, help lines] (0,0) grid (\\cardwidth,\\cardheight);\n%begin card creation\n    % draw card boundries and clip corners\n     \\draw[lightgray,cardcorners] \\shapeCard;\n     \\clip[cardcorners] \\shapeCard;\n     % card image: placed first so other nodes will stack on top of this one\n     \\cardbackground{\\cardimg}        \n     % card type strip\n     \\fill[strips] \\shapeLeftStripLong node[rotate = 90, above left, strip font] \n         {\\uppercase{\\cardtype}};\n     % card icon strip\n%     \\begin{scope}           \n        \\fill[strips] \\shapeLeftStripShort node[rotate=0, above, yshift=-8.5, \n            strip font] at (0.5*\\strippadding+0.5*\\stripwidth, \\titley)\n                {\\uppercase{ \\icon }};\n%     \\end{scope}\n     % card cost \n%     \\begin{scope}\n         \\fill[strips] \\shapeRightStripShort node[rotate=0, above, yshift=-8.5,\n             strip font] \n             at  (\\cardwidth - 0.5*\\stripwidth - 1.5*\\strippadding, \\titley) \n             {\\uppercase{ \\cost }};\n%     \\end{scope}\n     % card title strip\n     \\fill[color = black, opacity = .75, rounded corners=0.1cm] \n         \\shapeTitleArea node[text width=3.75cm, font=\\normalsize, \n         text=white, align=center] at (0.5*\\cardwidth,\\titley) \n         {\\uppercase{\\cardtitle}};\n     % card content\n     % card content: flavor text\n     \\node[below right, font=\\itshape\\scriptsize,\n     text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] \n     at (2*\\strippadding+\\stripwidth+\\textpadding,0.5*\\cardheight-\\textpadding) \n     {\\flavortext};\n     %card content: card effect\n     %line above text\n     \\draw[ultra thin, &lt;-&gt;] (25*\\strippadding+\\stripwidth+\\textpadding, 3.5) --\n         (2*\\strippadding+\\stripwidth+\\textpadding, 3.5);     \n     \\node[below right, font=\\normalsize,\n     text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] \n     at (2*\\strippadding+\\stripwidth+\\textpadding,3.5) \n     {\\vspace{0.05cm}{ \\cardcontent }};                      \n     % card-ID\n     %line above text\n     \\draw[ultra thin, &lt;-&gt;] (25*\\strippadding+\\stripwidth+\\textpadding, 0.4) -- \n         (2*\\strippadding+\\stripwidth+\\textpadding, 0.4);     \n     \\node[above right, font=\\tiny, align=right,\n     text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] \n     at (2*\\strippadding+\\stripwidth+\\textpadding, 0.05) \n     { \\cardid };               \n\\end{tikzpicture}}\n\\newcommand{\\backcard}[1][]{#1\n\\begin{tikzpicture}\n%begin card creation\n    % draw card boundries and clip corners\n    \\draw[lightgray,cardcorners] \\shapeCard;\n    \\clip[cardcorners] \\shapeCard;\n     % card title strip\n     \\fill[color = black, opacity = .75, rounded corners=0.1cm] \n         \\shapeTitleArea node[text width=3.75cm, font=\\normalsize, \n         text=white, align=center] at (0.5*\\cardwidth,\\titley) \n         {\\uppercase{\\cardtitle}};\n     \\node[below right, font=\\normalsize,\n     text width=(\\cardwidth-2*\\strippadding-\\stripwidth-2*\\textpadding-0.3)*1cm] \n     at (2*\\strippadding+\\stripwidth+\\textpadding,3.5) \n     {\\vspace{0.05cm}{ \\cardcontent }};                      \n\\end{tikzpicture}}\n\\begin{document}\n\\begin{tabular}{ccc}\n\\frontcard[\\renewcommand{\\cardcontent}{\\LARGE 1}] &amp;\n\\frontcard[\\renewcommand{\\cardcontent}{\\LARGE 2}] &amp;\n\\frontcard[\\renewcommand{\\cardcontent}{\\LARGE 3}] \\\\\n\\frontcard[\\renewcommand{\\cardcontent}{\\LARGE 4}] &amp;\n\\frontcard[\\renewcommand{\\cardcontent}{\\LARGE 5}] &amp;\n\\frontcard[\\renewcommand{\\cardcontent}{\\LARGE 6}] \\\\\n\\frontcard[\\renewcommand{\\cardcontent}{\\LARGE 7}] &amp;\n\\frontcard[\\renewcommand{\\cardcontent}{\\LARGE 8}] &amp;\n\\frontcard[\\renewcommand{\\cardcontent}{\\LARGE 9}] \n\\end{tabular}\n\\begin{tabular}{ccc}\n\\backcard[\\renewcommand{\\cardcontent}{\\LARGE 3}] &amp;\n\\backcard[\\renewcommand{\\cardcontent}{\\LARGE 2}] &amp;\n\\backcard[\\renewcommand{\\cardcontent}{\\LARGE 1}] \\\\\n\\backcard[\\renewcommand{\\cardcontent}{\\LARGE 6}] &amp;\n\\backcard[\\renewcommand{\\cardcontent}{\\LARGE 5}] &amp;\n\\backcard[\\renewcommand{\\cardcontent}{\\LARGE 4}] \\\\\n\\backcard[\\renewcommand{\\cardcontent}{\\LARGE 9}] &amp;\n\\backcard[\\renewcommand{\\cardcontent}{\\LARGE 8}] &amp;\n\\backcard[\\renewcommand{\\cardcontent}{\\LARGE 7}] \n\\end{tabular}\n\\end{document}\n\n</pre></div>","title":"tikz pgf - print double sided playing cards - TeX - LaTeX Stack Exchange","language":null,"date":null,"authors":[],"url":"https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards","content_type":"text/html","open_graph":{"og_type":"website","og_url":"https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards","og_site_name":"TeX - LaTeX Stack Exchange","og_image":"https://cdn.sstatic.net/Sites/tex/img/apple-touch-icon@2.png?v=eaf26b461720","og_title":"print double sided playing cards","og_description":"My apologies if this is already answered somewhere (typical opening I suppose) but here goes. I've modified code from the thread Creating playing cards using TikZ for the purposes of my needs.  Now..."},"native_ad":false,"all_headers":{"cache-control":"private","content-type":"text/html; charset=utf-8","x-frame-options":"SAMEORIGIN","x-request-guid":"2792014a-8522-4ed1-ab24-d925afc6f3da","strict-transport-security":"max-age=15552000","content-security-policy":"upgrade-insecure-requests","accept-ranges":"bytes, bytes","content-length":"161427","date":"Mon, 04 Feb 2019 12:35:20 GMT","via":"1.1 varnish","age":"0","connection":"keep-alive","x-served-by":"cache-fra19134-FRA","x-cache":"MISS","x-cache-hits":"0","x-timer":"S1549283720.436814,VS0,VE104","vary":"Fastly-SSL","x-dns-prefetch-control":"off","set-cookie":"prov=37d59e6e-09e7-8037-4f6b-073bd8fff8c2; domain=.stackexchange.com; expires=Fri, 01-Jan-2055 00:00:00 GMT; path=/; HttpOnly"}}} []
[2019-02-04 13:35:20] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Types\ConversionException: "Could not convert database value "a:1:{i:0;s:26:"M. J" to Doctrine Type array" at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php line 46 {"exception":"[object] (Doctrine\\DBAL\\Types\\ConversionException(code: 0): Could not convert database value \"a:1:{i:0;s:26:\"M. J\" to Doctrine Type array at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php:46)"} []
[2019-02-04 13:35:20] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

@j0k3r
Copy link
Member

j0k3r commented Feb 4, 2019

Could you share more logs from that file? All content from what you just give until the previous line which should be Graby is ready to fetch.
It looks like it's an url that generate that error.

@de-ramon
Copy link
Author

de-ramon commented Feb 4, 2019

Excuse me, here the logfile as requested:

[2019-02-04 13:35:20] graby.DEBUG: Graby is ready to fetch [] []
[2019-02-04 13:35:20] graby.DEBUG: . looking for site config for tex.stackexchange.com in primary folder {"host":"tex.stackexchange.com"} []
[2019-02-04 13:35:20] graby.DEBUG: ... found site config .stackexchange.com.txt {"host":".stackexchange.com.txt"} []
[2019-02-04 13:35:20] graby.DEBUG: Appending site config settings from global.txt [] []
[2019-02-04 13:35:20] graby.DEBUG: . looking for site config for global in primary folder {"host":"global"} []
[2019-02-04 13:35:20] graby.DEBUG: ... site config for global already loaded in this request {"host":"global"} []
[2019-02-04 13:35:20] graby.DEBUG: Cached site config with key: .stackexchange.com {"key":".stackexchange.com"} []
[2019-02-04 13:35:20] graby.DEBUG: . looking for site config for global in primary folder {"host":"global"} []
[2019-02-04 13:35:20] graby.DEBUG: ... site config for global already loaded in this request {"host":"global"} []
[2019-02-04 13:35:20] graby.DEBUG: Appending site config settings from global.txt [] []
[2019-02-04 13:35:20] graby.DEBUG: Cached site config with key: tex.stackexchange.com.merged {"key":"tex.stackexchange.com.merged"} []
[2019-02-04 13:35:20] graby.DEBUG: Fetching url: https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards {"url":"https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards"} []
[2019-02-04 13:35:20] graby.DEBUG: Trying using method "get" on url "https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards" {"method":"get","url":"https://tex.stackexchange.com/questions/243740/print-double-sided-
playing-cards"} []
[2019-02-04 13:35:20] graby.DEBUG: Use default user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.92 Safari/535.2" for url "https://tex.stackexchange.com/questions/243740/print-double-side
d-playing-cards" {"user-agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.92 Safari/535.2","url":"https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards"} []
[2019-02-04 13:35:20] graby.DEBUG: Use default referer "http://www.google.co.uk/url?sa=t&source=web&cd=1" for url "https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards" {"referer":"http://www.google.co.uk/url?sa=
t&source=web&cd=1","url":"https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards"} []
[2019-02-04 13:35:20] graby.DEBUG: Data fetched: [array] {"data":{"effective_url":"https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards","body":"(only length for debug): 161427","headers":"text/html; charset=utf-
8","all_headers":{"cache-control":"private","content-type":"text/html; charset=utf-8","x-frame-options":"SAMEORIGIN","x-request-guid":"2792014a-8522-4ed1-ab24-d925afc6f3da","strict-transport-security":"max-age=15552000","content-security-p
olicy":"upgrade-insecure-requests","accept-ranges":"bytes, bytes","content-length":"161427","date":"Mon, 04 Feb 2019 12:35:20 GMT","via":"1.1 varnish","age":"0","connection":"keep-alive","x-served-by":"cache-fra19134-FRA","x-cache":"MISS",
"x-cache-hits":"0","x-timer":"S1549283720.436814,VS0,VE104","vary":"Fastly-SSL","x-dns-prefetch-control":"off","set-cookie":"prov=37d59e6e-09e7-8037-4f6b-073bd8fff8c2; domain=.stackexchange.com; expires=Fri, 01-Jan-2055 00:00:00 GMT; path=
/; HttpOnly"},"status":200}} []
[2019-02-04 13:35:20] graby.DEBUG: Treating as UTF-8 {"encoding":"utf-8"} []
[2019-02-04 13:35:20] graby.DEBUG: Opengraph data: [array] {"ogData":{"og_type":"website","og_url":"https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards","og_site_name":"TeX - LaTeX Stack Exchange","og_image":"ht
tps://cdn.sstatic.net/Sites/tex/img/apple-touch-icon@2.png?v=eaf26b461720","og_title":"print double sided playing cards","og_description":"My apologies if this is already answered somewhere (typical opening I suppose) but here goes. I've m
odified code from the thread Creating playing cards using TikZ for the purposes of my needs.  Now..."}} []
[2019-02-04 13:35:20] graby.DEBUG: Looking for site config files to see if single page link exists [] []
[2019-02-04 13:35:20] graby.DEBUG: Returning cached and merged site config for tex.stackexchange.com {"host":"tex.stackexchange.com"} []
[2019-02-04 13:35:20] graby.DEBUG: No "single_page_link" config found [] []
[2019-02-04 13:35:20] graby.DEBUG: Attempting to extract content [] []
[2019-02-04 13:35:20] graby.DEBUG: Returning cached and merged site config for tex.stackexchange.com {"host":"tex.stackexchange.com"} []
[2019-02-04 13:35:20] graby.DEBUG: Strings replaced: 0 (find_string and/or replace_string) {"count":0} []
[2019-02-04 13:35:20] graby.DEBUG: Attempting to parse HTML with libxml {"parser":"libxml"} []
[2019-02-04 13:35:20] graby.DEBUG: Body size after Readability: 97866 {"length":97866} []
[2019-02-04 13:35:20] graby.DEBUG: Trying //title for title {"pattern":"//title"} []
[2019-02-04 13:35:20] graby.DEBUG: title matched: tikz pgf - print double sided playing cards - TeX - LaTeX Stack Exchange {"title":"tikz pgf - print double sided playing cards - TeX - LaTeX Stack Exchange"} []
[2019-02-04 13:35:20] graby.DEBUG: ...XPath match: {pattern} ["pattern","//title"] []
[2019-02-04 13:35:20] graby.DEBUG: Trying //meta[@property="article:published_time"]/@content for date {"pattern":"//meta[@property=\"article:published_time\"]/@content"} []
[2019-02-04 13:35:20] graby.DEBUG: Trying //html[@lang]/@lang for language {"pattern":"//html[@lang]/@lang"} []
[2019-02-04 13:35:20] graby.DEBUG: Trying //meta[@name="DC.language"]/@content for language {"pattern":"//meta[@name=\"DC.language\"]/@content"} []
[2019-02-04 13:35:20] graby.DEBUG: Stripping 26 empty a elements {"length":26} []
[2019-02-04 13:35:20] graby.DEBUG: Trying //div[@id='question']//div[contains(@class,'post-text')] | //div[@id='answers-header']//h2 | //div[contains(@class,'accepted-answer')]//div[contains(@class,'post-text')] for body (content length: 95595) {"pattern":"//div[@id='question']//div[contains(@class,'post-text')] | //div[@id='answers-header']//h2 | //div[contains(@class,'accepted-answer')]//div[contains(@class,'post-text')]","content_length":95595} []
[2019-02-04 13:35:20] graby.DEBUG: XPath: found "3" with //div[@id='question']//div[contains(@class,'post-text')] | //div[@id='answers-header']//h2 | //div[contains(@class,'accepted-answer')]//div[contains(@class,'post-text')] [] []
[2019-02-04 13:35:20] graby.DEBUG: 3 body elems found {"nb":3} []
[2019-02-04 13:35:20] graby.DEBUG: ...pruning content [] []
[2019-02-04 13:35:20] graby.DEBUG: ...pruning content [] []
[2019-02-04 13:35:20] graby.DEBUG: ...pruning content [] []
[2019-02-04 13:35:20] graby.DEBUG: ...3 elements added to body {"len":3} []

@j0k3r
Copy link
Member

j0k3r commented Feb 4, 2019

This is weird. It looks like it fail when importing https://tex.stackexchange.com/questions/243740/print-double-sided-playing-cards but I do not have any issue with it.
Could you try to save that link only using your wallabag to see if it generates the same error?

@de-ramon
Copy link
Author

de-ramon commented Feb 4, 2019

Seems to be the same problem adding the ULR via wallabagger:

[2019-02-04 15:16:09] request.INFO: Matched route "api_patch_entries". {"route":"api_patch_entries","route_parameters":{"_controller":"Wallabag\\ApiBundle\\Controller\\EntryRestController::patchEntriesAction","_format":"json","entry":"202","_route":"api_patch_entries"},"request_uri":"https://rdltr.schnaggelt.es/api/entries/202.json","method":"PATCH"} []
[2019-02-04 15:16:09] app.DEBUG: Restricted access config enabled? {"enabled":0} []
[2019-02-04 15:16:09] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Types\ConversionException: "Could not convert database value "a:1:{i:0;s:26:"M. J" to Doctrine Type array" at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php line 46 {"exception":"[object] (Doctrine\\DBAL\\Types\\ConversionException(code: 0): Could not convert database value \"a:1:{i:0;s:26:\"M. J\" to Doctrine Type array at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php:46)"} []
[2019-02-04 15:16:14] request.INFO: Matched route "api_patch_entries". {"route":"api_patch_entries","route_parameters":{"_controller":"Wallabag\\ApiBundle\\Controller\\EntryRestController::patchEntriesAction","_format":"json","entry":"202","_route":"api_patch_entries"},"request_uri":"https://rdltr.schnaggelt.es/api/entries/202.json","method":"PATCH"} []
[2019-02-04 15:16:14] app.DEBUG: Restricted access config enabled? {"enabled":0} []
[2019-02-04 15:16:14] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Types\ConversionException: "Could not convert database value "a:1:{i:0;s:26:"M. J" to Doctrine Type array" at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php line 46 {"exception":"[object] (Doctrine\\DBAL\\Types\\ConversionException(code: 0): Could not convert database value \"a:1:{i:0;s:26:\"M. J\" to Doctrine Type array at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php:46)"} []
[2019-02-04 15:16:16] request.INFO: Matched route "api_patch_entries". {"route":"api_patch_entries","route_parameters":{"_controller":"Wallabag\\ApiBundle\\Controller\\EntryRestController::patchEntriesAction","_format":"json","entry":"202","_route":"api_patch_entries"},"request_uri":"https://rdltr.schnaggelt.es/api/entries/202.json","method":"PATCH"} []
[2019-02-04 15:16:16] app.DEBUG: Restricted access config enabled? {"enabled":0} []

BUT:
Using the javascript method works!

@de-ramon
Copy link
Author

de-ramon commented Feb 4, 2019

Deleted this url above in pocket and restarted import....
guess what:
againg a latex page :-|
https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex

[2019-02-04 15:27:39] graby.DEBUG: Graby is ready to fetch [] []
[2019-02-04 15:27:39] graby.DEBUG: . looking for site config for olivierpieters.be in primary folder {"host":"olivierpieters.be"} []
[2019-02-04 15:27:39] graby.DEBUG: Appending site config settings from global.txt [] []
[2019-02-04 15:27:39] graby.DEBUG: . looking for site config for global in primary folder {"host":"global"} []
[2019-02-04 15:27:39] graby.DEBUG: ... site config for global already loaded in this request {"host":"global"} []
[2019-02-04 15:27:39] graby.DEBUG: Cached site config with key: olivierpieters.be {"key":"olivierpieters.be"} []
[2019-02-04 15:27:39] graby.DEBUG: . looking for site config for global in primary folder {"host":"global"} []
[2019-02-04 15:27:39] graby.DEBUG: ... site config for global already loaded in this request {"host":"global"} []
[2019-02-04 15:27:39] graby.DEBUG: Appending site config settings from global.txt [] []
[2019-02-04 15:27:39] graby.DEBUG: Cached site config with key: olivierpieters.be.merged {"key":"olivierpieters.be.merged"} []
[2019-02-04 15:27:39] graby.DEBUG: Fetching url: https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex {"url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-04 15:27:39] graby.DEBUG: Trying using method "get" on url "https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex" {"method":"get","url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-i
n-latex"} []
[2019-02-04 15:27:39] graby.DEBUG: Use default user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.92 Safari/535.2" for url "https://olivierpieters.be/blog/2017/02/11/designing-a-business-c
ard-in-latex" {"user-agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.92 Safari/535.2","url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-04 15:27:39] graby.DEBUG: Use default referer "http://www.google.co.uk/url?sa=t&source=web&cd=1" for url "https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex" {"referer":"http://www.google.co.uk/url?sa=t&s
ource=web&cd=1","url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-04 15:27:39] graby.DEBUG: Data fetched: [array] {"data":{"effective_url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex","body":"(only length for debug): 41917","headers":"text/html","all_headers":{"
server":"nginx/1.14.0 (Ubuntu)","date":"Mon, 04 Feb 2019 14:27:39 GMT","content-type":"text/html","content-length":"41917","last-modified":"Thu, 31 Jan 2019 07:23:39 GMT","connection":"keep-alive","etag":"\"5c52a27b-a3bd\"","content-securi
ty-policy":"default-src 'self'; script-src 'self'  https://cdn.olivierpieters.be https://stats.olivierpieters.be; style-src 'self' https://cdn.olivierpieters.be; img-src 'self' https://images.olivierpieters.be https://cdn.olivierpieters.be
 https://stats.olivierpieters.be https://api.mapbox.com https://api.tiles.mapbox.com; font-src 'self' https://cdn.olivierpieters.be; object-src 'none';","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-opti
ons":"nosniff","strict-transport-security":"max-age=31536000; includeSubDomains; preload","access-control-allow-origin":"*","accept-ranges":"bytes"},"status":200}} []
[2019-02-04 15:27:39] graby.DEBUG: Treating as UTF-8 {"encoding":"utf-8"} []
[2019-02-04 15:27:39] graby.DEBUG: Opengraph data: [array] {"ogData":[]} []
[2019-02-04 15:27:39] graby.DEBUG: Looking for site config files to see if single page link exists [] []
[2019-02-04 15:27:39] graby.DEBUG: Returning cached and merged site config for olivierpieters.be {"host":"olivierpieters.be"} []
[2019-02-04 15:27:39] graby.DEBUG: No "single_page_link" config found [] []
[2019-02-04 15:27:39] graby.DEBUG: Attempting to extract content [] []
[2019-02-04 15:27:39] graby.DEBUG: Returning cached and merged site config for olivierpieters.be {"host":"olivierpieters.be"} []
[2019-02-04 15:27:39] graby.DEBUG: Strings replaced: 0 (find_string and/or replace_string) {"count":0} []
[2019-02-04 15:27:39] graby.DEBUG: Attempting to parse HTML with libxml {"parser":"libxml"} []
[2019-02-04 15:27:39] graby.DEBUG: Body size after Readability: 27138 {"length":27138} []
[2019-02-04 15:27:39] graby.DEBUG: Trying //meta[@property="og:title"]/@content for title {"pattern":"//meta[@property=\"og:title\"]/@content"} []
[2019-02-04 15:27:39] graby.DEBUG: Trying //meta[@property="article:published_time"]/@content for date {"pattern":"//meta[@property=\"article:published_time\"]/@content"} []
[2019-02-04 15:27:39] graby.DEBUG: Trying //html[@lang]/@lang for language {"pattern":"//html[@lang]/@lang"} []
[2019-02-04 15:27:39] graby.DEBUG: Trying //meta[@name="DC.language"]/@content for language {"pattern":"//meta[@name=\"DC.language\"]/@content"} []
[2019-02-04 15:27:39] graby.DEBUG: Stripping 5 empty a elements {"length":5} []
[2019-02-04 15:27:39] graby.DEBUG: Using Readability [] []
[2019-02-04 15:27:39] graby.DEBUG: Detected title: Designing a Business Card in LaTeX {"title":"Designing a Business Card in LaTeX"} []
[2019-02-04 15:27:39] graby.DEBUG: Detecting body [] []
[2019-02-04 15:27:39] graby.DEBUG: Pruning content [] []
[2019-02-04 15:27:39] graby.DEBUG: Success ? 1 {"is_success":true} []
[2019-02-04 15:27:39] graby.DEBUG: Filtering HTML to remove XSS [] []
[2019-02-04 15:27:39] graby.DEBUG: Returning data (most interesting ones): [array] {"data":{"status":200,"html":"<p>In 2017, I will graduate from <a target=\"_blank\" href=\"https://www.ugent.be\">Ghent University</a>. This means starting 
a professional career, either in academia or in industry. One of the first things that came to mind was that I needed a good curriculum vitæ, and a business card. I <a href=\"https://olivierpieters.be/curriculum-vitae/\">already have the f
ormer</a>, but I still needed a business card. Consequently, I looked a bit online and was not all that impressed by the tools people used to design them. I did not want to change some template everybody’s using, but do my own thing. And s
uddenly, I realised: what better tool than LaTeX to make it!</p><p>I know, I already hear some saying “why not use the online tools?” or “Photoshop?”. I picked LaTeX because I want to have a platform independent implementation and because 
why not? I really like making LaTeX documents, so this seemed like something other than creating long documents.</p><p>So, how are we going to create it? First, we’ll make a template for the front and back sides. Then, we will modify this 
to our needs and have a perfectly formatted and aligned business card.</p><div class=\"tldr\"><p>Checkout the <a href=\"https://github.com/opieters/business-card\" target=\"_blank\">GitHub repository</a>.</p></div><p>Before we start creati
ng our business card, we first need to make some design choices. This includes fonts and colours we are going to use. We will employ custom fonts, so the XeLaTeX compiler is needed. I’ve chosen for the <a target=\"_blank\" href=\"https://g
ithub.com/mozilla/Fira\">Fira font from Mozilla</a>. Make sure you have the font (or change the code of course) correctly installed on your system before continuing. You will also need to install <a target=\"_blank\" href=\"http://fontawes
ome.io\">FontAwesome</a> on your system. More on that later.</p><p>To make our card a bit more attractive, we are also going to add some colour. These are the three colours we will use here:</p><div class=\"row colour_palette\"><p>#2F3142<
/p><p>#474A65</p><p>#357F2D</p></div><p>They are not really eye-popping, but I don’t think that’s needed either. The two darker colours will be used for the text and the green one for small divider lines. To select these, I really like to 
use <a target=\"_blank\" href=\"http://www.colorhexa.com/\">ColorHexa</a> (a colour picker).</p><p>Now, it’s time to start writing some LaTeX. This is the minimal template we’ll use for the design:</p><div class=\"highlight\"><pre class=\"
language-latex\" data-lang=\"latex\">% !TEX TS-program = xelatex\n\\documentclass[10pt,oneside,final]{article}\n\\usepackage{tikz}\n\\begin{document}\n  \\thispagestyle{empty}\n  \\vspace*{\\fill}\n  \\begin{center}\n    \\begin{tikzpictur
e}\n      % definition of the actual layout\n    \\end{tikzpicture}\n  \\end{center}\n  \\vspace*{\\fill}\n\\end{document}\n</pre></div><p>We use the <code>article</code> class, load TikZ, center the picture and vertically align the TikZ e
nvironment using <code>\\vspace*{\\fill}</code>. We also remove the page numbers with <code>\\thispagestyle{empty}</code>. We will need some additional commands that set predefined margins to zero. However, first we will defined that card size.</p><p>There are lots of business card sizes. Here, we will use the format most used in the US and Canada: 3.5x2 inches. In other countries, the size may differ. Check yours on <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Business_card#Dimensions\">Wikipedia</a>.</p><p>We set the proper size using the <code>geometry</code> package:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% set all margins to 0 and set business card size\n\\usepackage[paperwidth=2in,paperheight=3.5in,margin=0cm,noheadfoot]{geometry}\n</pre></div><p>We also removed the header and footer and all possible margins to fully use the card.</p><p>We also have to set the default baseline size and the distance between header and text of the page to zero. Just in case, we will also remove the paragraph indents (this is not really needed):</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\setlength{\\baselineskip}{0cm} % between baselines\n\\setlength{\\topskip}{0pt}      % between header and text\n\\usepackage{parskip}           % remove paragraph indents\n</pre></div><p>Now, <code>\\vspace*{\\fill}</code> will indeed result in a perfectly centred <code>tikzpicture</code>.</p><p>Since we want to load custom fonts (XeLaTeX ❤️), we will also load these two packages:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\usepackage{fontspec}          % load external fonts\n\\usepackage{fontawesome}       % icon font\n</pre></div><p>FontAwesome is loaded by the <code>fontawesome</code> package. As a result, it needs to be installed on your system as well. This packages defines all sorts of icons that can be inserted by means of <code>\\fa&lt;name&gt;</code> where <code>&lt;name&gt;</code> is a description fot the icon. An anchor is for instanstace inserted by typing <code>\\faAnchor</code>.</p><p>We load the font of choice:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% load external font\n\\setmainfont[Numbers={OldStyle,Monospaced}]{Fira Sans}\n\\setsansfont{Fira Sans}\n\\setmonofont{Fira Mono}\n</pre></div><p>If you want to use more than one font, it’s easiest to do this by defining a new font family:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\newfontfamily\\anotherfont[&lt;features&gt;]{&lt;name&gt;}\n</pre></div><p>Changing the font is easy now: just add <code>\\anotherfont</code> where the font should be applied. A long how-to that explains all about fonts in different flavours of (La)TeX can be found <a target=\"_blank\" href=\"http://tex.stackexchange.com/questions/25249/how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document\">here</a>.</p><p>Now, it’s time to load our drawing package TikZ’s libraries and define our colours:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% load and configure tikz libraries\n\\usetikzlibrary{matrix,positioning,calc}\n\\usepackage{xcolor}                        % more colour options\n\\definecolor{seplinecolour}{HTML}{357f2d}  % green\n\\definecolor{iconcolour}{HTML}{2f3142}     % dark\n\\definecolor{textcolour}{HTML}{2f3142}     % dark\n\\definecolor{jobtitlecolour}{HTML}{474a65} % light dark\n</pre></div><p>The above colour commands only define new colours. We still need to use them. The darkest one will be used for the text in stead of pure black. Pure black is has a very high contrast with the white background, that’s why we are using a slightly lighter colour. To avoid having to change the colour multiple times, we can modify the global text colour with the following command (<a target=\"_blank\" href=\"http://tex.stackexchange.com/questions/26549/how-do-i-globally-set-the-text-color-in-xelatex\">source</a>):</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% change global colour\n\\makeatletter\n\\newcommand{\\globalcolor}[1]{%\n  \\color{#1}\\global\\let\\default@color\\current@color\n}\n\\makeatother\n\\AtBeginDocument{\\globalcolor{textcolour}}\n</pre></div><p>Hard coding the spacing between different elements is quicker for the initial design, but it’s much slower for fine tuning it at the end. So, we’ll immediately use length variables to hold our spacing definitions. Here’s a template. We will use this to define length variables for the font and back sides.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% define some lengths for internal spacing\n\\newlength{\\somelength}\n\\setlength{\\somelength}{2cm}\n</pre></div><p>By now, the preamble contains all the global variables for both the front and back sides. Additionally, we also have laid out the basics for the document contents. Let’s start adding the actual content!</p><h2 id=\"front-side\">Front Side</h2><div class=\"row\"><div class=\"eight columns\"><p>The front side is obviously the most important side, since it'll contain your name, job title, contact information, etc. Before starting on the actual layout, we need to get an idea on the layout we want to create. For inspiration, one can always search sites such as <a target=\"_blank\" href=\"https://www.pinterest.com/search/pins/?q=business%20card\">Pinterest</a> to find interesting designs and modify these to make them your own. Be aware of licensing on the content you are using though!</p><p>Here, we'll not make a too complicated card. The general layout will be a stacked one where we will separate each section with a small line. It will look somewhat like this figure.</p><p>Because we're working with these stacked-like structure, we can work with the very convenient `matrix` construct from TikZ. This basically allows to group nodes and drawings in a table-like structure. The syntax is very straightforward if you're familiar with TikZ and tabular.</p></div><div class=\"four columns\"><figure id=\"business-card-outline\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-outline.svg\" alt=\"business card front\" class=\"frame centre-element max-300px-wide\" /></figure></div></div><p>Here’s an example taken from the TikZ manual:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\matrix[fill=red!20] (label) at (2,1) {\n    \\draw (0,0) circle (4mm);   &amp; \\node[rotate=10] {Hello};        \\\\\n    \\draw (0.2,0) circle (2mm); &amp; \\fill[red]   (0,0) circle (3mm); \\\\\n};\n</pre></div><p>As can be seen in the above example, a matrix behaves like a node, having a location, an optional location reference and a label that contains our grid. Each cell has its own coordinate space, and will be aligned as a table. This means the row separator is <code>\\\\</code> and the column separator is <code>&amp;</code>.</p><p>Before starting the actual implementation, we will define some spacing variables. These will come in handy later on.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% define some lengths for internal spacing\n\\newlength{\\seplinewidth}    \\setlength{\\seplinewidth}{2cm}\n\\newlength{\\seplineheight}   \\setlength{\\seplineheight}{1pt}\n\\newlength{\\seplinedistance} \\setlength{\\seplinedistance}{0.3cm}\n</pre></div><p>Now applying this design to our business card, we obtain the following name and title section:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\matrix[every node/.style={anchor=center,font=\\huge},anchor=center] (name) {\n  \\node{John}; \\\\\n  \\node{Doe}; \\\\\n  \\node{\\color{jobtitlecolour}\\normalsize\\textit{job title}}; \\\\\n};\n</pre></div><p>This adds the given name, surname and job title in a single column and applies the same options to each of them. The options are set using <code>every node/.style</code>, this is more convenient that doing adding these per node (e.g. <code>\\node[anchor=center,font=\\huge]{John};</code>). Finally, we also set the anchor of the matrix-node to its centre (not really needed, but this might be convenient in some situations).</p><p>Now, a small side note on the job title. We added some additional commands to its label to change the formatting. First, we changed the font colour from the default one to a the <code>jobtitlecolour</code> colour (defined above). This makes the name and title sections stand better apart. Furthermore, we also changed to font size from <code>\\huge</code> to <code>\\normalsize</code> or <code>10pt</code>.</p><p>Next, let’s add the bar to separate the identity section from the contact section by means of a horizontal bar. We will use our predefined spacing lengths to specify the length between the identity node, the bar and the contact information maxtrix node (see below).</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\node[below=\\seplinedistance of name] (hl1) {};\n\\draw[line width=\\seplineheight,color=seplinecolour] (hl1)++(-\\seplinewidth/2,0)\n  -- ++(\\seplinewidth,0);\n</pre></div><p>First, we define a helper node <code>hl1</code>. This node will be located <code>\\seplinedistance</code> below the souther anchor of our identity node (<code>name</code>). Then, we use this to draw the line. <code>(hl1)++(-\\seplinewidth/2,0)</code> creates an unnamed node that is located <code>\\seplinewidth/2</code> to the left of <code>hl1</code>. Then we start drawing the line (<code>--</code>) till we reach the next node. This is again a relative unnamed node located <code>\\seplinewidth</code> to the right of the <em>previous</em> node (i.e. our other unnamed node). Consequently, it will be located <code>\\seplinewidth/2</code> to the right of <code>hl1</code>.</p><p>The contact information matrix-node looks like this:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\matrix [below=\\seplinedistance of hl1,\n         column 1/.style={anchor=center,color=iconcolour},\n         column 2/.style={anchor=west}] (contact) {\n  \\node{\\faGlobe}; &amp; \\node{johndoe.com};\\\\\n  \\node{\\faEnvelope}; &amp;\\node{me@johndoe.com};\\\\\n  \\node{\\faPhone}; &amp;\\node{+1 781 555 1212}; \\\\\n  \\node{\\faGithub}; &amp;\\node{johndoe}; \\\\\n};\n</pre></div><p>Again, we use relative spacing to get the distances right. This time however, we are using the different options depending on the column the nodes are located in. This is needed to properly align everything.</p><p>We also need to add a separator to separate the the contact information section from our next section: the interests section. The code is almost identical to the previous separator line:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\node[below=\\seplinedistance of contact] (hl2) {};\n\\draw[line width=\\seplineheight,color=seplinecolour] (hl2)++(-\\seplinewidth/2,0)\n  -- ++(\\seplinewidth,0);\n</pre></div><div class=\"row\"><div class=\"eight columns\"><p>Lastly, the interests section. We will use graphical symbols to depict some of out major interests or passions. These can be arranged into a two rows or one, depending on the amount you want to include. Here, I've picked five icons and they work best if used in a single row.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% interests\n\\matrix [below=\\seplinedistance of hl2,\n         every node/.style={anchor=center,font=\\LARGE}]\n         (interests) {\n  \\node{\\faCode}; &amp; \\node{\\faCoffee}; &amp;\n  \\node{\\faLock}; &amp; \\node{\\faWrench}; &amp;\n  \\node{\\faCameraRetro}; \\\\\n};\n</pre></div><p>After combining all of this, we obtain the final result.</p></div><div class=\"four columns\"><figure id=\"business-card-front\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-front.svg\" alt=\"business card front\" class=\"frame\" /></figure></div></div><h2 id=\"back-side\">Back Side</h2><p>The front side is the more important one, but leaving the back side blank is a missed opportunity. Why not add an image, logo or QR-code? Here, we’ll add a QR-code and logo to add more useful information. Again, we will start from the basic template we created in the first section.</p><p>To add external images and the QR-code, we need to load these additional packages:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\usepackage{graphics}        % load images\n\\usepackage[nolinks]{qrcode} % create QR codes\n</pre></div><p>Of course, it’s also possible to include an externally generated QR-code, but make sure it is a vector image. Otherwise, it might not be sharp enough for printing.</p><p>The lengths and colours below define the styling options. Notice that we are using pure black in this case for the text. This is to make sure the contrast in the QR-code is qas high as possible.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\newlength{\\qrheight}   \\setlength{\\qrheight}{1in}\n\\newlength{\\edgemargin} \\setlength{\\edgemargin}{0.2in}\n\\newlength{\\logowith}   \\setlength{\\logowith}{0.5in}\n\\definecolor{bordercolour}{HTML}{357f2d}  % green\n\\definecolor{textcolour}{HTML}{000000}    % black\n\\makeatletter\n\\newcommand{\\globalcolor}[1]{%\n  \\color{#1}\\global\\let\\default@color\\current@color\n}\n\\makeatother\n\\AtBeginDocument{\\globalcolor{textcolour}}\n</pre></div><p>That’s it for the preamble. Now, let’s more to the actual contents. Again, we are using a <code>tikzpicture</code> to draw everything on the card. But this time, we are going to use that are not relative to the picture alone. To this end, we need to add these options to our <code>tikzpicture</code> environment: <code>remember picture,overlay,</code>. This will make it possible to use <code>current page.center</code> during positioning.<br />To add some colour to the back side, we are going to draw a border frame in green and fill it with a light green colour that is derived from the green border colour:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\draw[fill=bordercolour!30,draw=bordercolour] (current page.center)\n  ++(-\\paperwidth/2+\\edgemargin,\\paperheight/2-\\edgemargin) rectangle\n  ++(\\paperwidth-2*\\edgemargin,-\\paperheight+2*\\edgemargin);\n</pre></div><p>To add a logo, we can use the following snippet:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% logo\n\\draw (current page.center)\n  ++(0,\\paperheight/2-\\edgemargin-\\paperwidth/2+\\edgemargin+\\logowith/2)\n  node (helper logo) {};\n\\node[anchor=north] at (helper logo) {\\includegraphics[width=\\logowith]{figures/logo}};\n</pre></div><p>This will include the logo image file from the <code>figures/</code> directory with a width of <code>\\logowith</code>. It is assumed that the image dimensions are the same.</p><p>The final thing to add is the QR-code. A QR-code can contain various types of data such as images, text, but also a <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/VCard\">vCard</a>. A vCard is a standardised format for business cards and enables people to instanty add you to their contacts. It’s more powerful than including a link to a curriculum vitae in my opinion.</p><p>A vCard example:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% qr code\n\\draw (current page.center)\n  ++(0,-\\paperheight/2+\\edgemargin+\\paperwidth/2-\\edgemargin-\\qrheight/2)\n  node (helper qr) {};\n\\node[anchor=south] at (helper qr)\n  {\\qrcode[level=M,height=\\qrheight]{BEGIN:VCARD\nVERSION:3.0\nN:John;Doe;;Mr.\nFN:Mr. John Doe\nTITLE:CEO Doe Enterprises\nORG:Doe Enterprises\nPHOTO;VALUE=URI;TYPE=JPEG:https://johndoe.com/path/to/jpeg/image.jpeg\nTEL;TYPE=MOBILE:+1 781 555 1212\nEMAIL:me@johndoe.com\nURL:https://johndoe.com\nREV:2017-29-01T13:52:43Z\nBDAY:19880310\nADR;TYPE=WORK,PREF:;;2 Some Avenue;Anytown;SF;11111;USA\nEND:VCARD}};\n</pre></div><div class=\"row\"><div class=\"eight columns\"><p>The above code illustrated a basic vCard. If you want the QR-code to be less dense, remove the data or change the QR-code level. This level controls the amount of redundancy in the QR-code. `L`, `M`, `Q` and `H` are the different levels from lowest to highest redundancy. Here we've chosen for the default `M`-level since that's a good trade off between data density and redundancy. The meaning of the different vCard properties is <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/VCard#Properties\">well explained on Wikipedia</a>.</p><p>Once all the code is added and compiled at least twice (on the first run it is possible not everything is positioned correctly), this should be the final result.</p></div><div class=\"four columns\"><figure id=\"business-card-back\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-back.svg\" alt=\"business card back\" class=\"frame\" /></figure></div></div><h2 id=\"final-result\">Final Result</h2><div class=\"row\"><div class=\"four columns\"><figure id=\"business-card-front-result\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-front.svg\" alt=\"business card front\" class=\"frame\" /></figure></div><div class=\"four columns\"><figure id=\"business-card-back-result\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-back.svg\" alt=\"business card back\" class=\"frame\" /></figure></div><div class=\"four columns\"><p>This is what the final card looks like. It's pretty simple code and results in a nice looking business card in my opinion. You can download the full code from the <a target=\"_blank\" href=\"https://github.com/opieters/business-card\">GitHub repo</a>.</p></div></div>","title":"Designing a Business Card in LaTeX","language":null,"date":null,"authors":[],"url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex","content_type":"text/html","open_graph":[],"native_ad":false,"all_headers":{"server":"nginx/1.14.0 (Ubuntu)","date":"Mon, 04 Feb 2019 14:27:39 GMT","content-type":"text/html","content-length":"41917","last-modified":"Thu, 31 Jan 2019 07:23:39 GMT","connection":"keep-alive","etag":"\"5c52a27b-a3bd\"","content-security-policy":"default-src 'self'; script-src 'self'  https://cdn.olivierpieters.be https://stats.olivierpieters.be; style-src 'self' https://cdn.olivierpieters.be; img-src 'self' https://images.olivierpieters.be https://cdn.olivierpieters.be https://stats.olivierpieters.be https://api.mapbox.com https://api.tiles.mapbox.com; font-src 'self' https://cdn.olivierpieters.be; object-src 'none';","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","strict-transport-security":"max-age=31536000; includeSubDomains; preload","access-control-allow-origin":"*","accept-ranges":"bytes"}}} []
[2019-02-04 15:27:39] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Types\ConversionException: "Could not convert database value "a:1:{i:0;s:26:"M. J" to Doctrine Type array" at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php line 46 {"exception":"[object] (Doctrine\\DBAL\\Types\\ConversionException(code: 0): Could not convert database value \"a:1:{i:0;s:26:\"M. J\" to Doctrine Type array at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php:46)"} []
[2019-02-04 15:27:39] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

@j0k3r
Copy link
Member

j0k3r commented Feb 4, 2019

What's the javascript method?

Could you change error to debug at https://github.com/wallabag/wallabag/blob/master/app/config/config_prod.yml#L18
Then clear the cache (rm -rf var/cache/*) and retry?
You should have more logs

@de-ramon
Copy link
Author

de-ramon commented Feb 5, 2019

Hi jok3r,

the javascript method is to me the bookmarklet (https://doc.wallabag.org/en/user/articles/save.html#by-using-a-bookmarklet)....
So I tried to add the URL https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex via bookmarklet and IT didn't work, didn't even start to do something? Using firefox addon wallabagger it worked... Strange....

Here the log entry for https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex with debug settings Pocket import:

[2019-02-05 06:46:24] graby.DEBUG: Graby is ready to fetch [] []
[2019-02-05 06:46:24] graby.DEBUG: . looking for site config for olivierpieters.be in primary folder {"host":"olivierpieters.be"} []
[2019-02-05 06:46:24] graby.DEBUG: Appending site config settings from global.txt [] []
[2019-02-05 06:46:24] graby.DEBUG: . looking for site config for global in primary folder {"host":"global"} []
[2019-02-05 06:46:24] graby.DEBUG: ... site config for global already loaded in this request {"host":"global"} []
[2019-02-05 06:46:24] graby.DEBUG: Cached site config with key: olivierpieters.be {"key":"olivierpieters.be"} []
[2019-02-05 06:46:24] graby.DEBUG: . looking for site config for global in primary folder {"host":"global"} []
[2019-02-05 06:46:24] graby.DEBUG: ... site config for global already loaded in this request {"host":"global"} []
[2019-02-05 06:46:24] graby.DEBUG: Appending site config settings from global.txt [] []
[2019-02-05 06:46:24] graby.DEBUG: Cached site config with key: olivierpieters.be.merged {"key":"olivierpieters.be.merged"} []
[2019-02-05 06:46:24] graby.DEBUG: Fetching url: https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex {"url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-05 06:46:24] graby.DEBUG: Trying using method "get" on url "https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex" {"method":"get","url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-05 06:46:24] graby.DEBUG: Use default user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.92 Safari/535.2" for url "https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex" {"user-agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.92 Safari/535.2","url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-05 06:46:24] graby.DEBUG: Use default referer "http://www.google.co.uk/url?sa=t&source=web&cd=1" for url "https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex" {"referer":"http://www.google.co.uk/url?sa=t&source=web&cd=1","url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-05 06:46:24] graby.DEBUG: Data fetched: [array] {"data":{"effective_url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex","body":"(only length for debug): 41917","headers":"text/html","all_headers":{"server":"nginx/1.14.0 (Ubuntu)","date":"Tue, 05 Feb 2019 05:46:24 GMT","content-type":"text/html","content-length":"41917","last-modified":"Thu, 31 Jan 2019 07:23:39 GMT","connection":"keep-alive","etag":"\"5c52a27b-a3bd\"","content-security-policy":"default-src 'self'; script-src 'self'  https://cdn.olivierpieters.be https://stats.olivierpieters.be; style-src 'self' https://cdn.olivierpieters.be; img-src 'self' https://images.olivierpieters.be https://cdn.olivierpieters.be https://stats.olivierpieters.be https://api.mapbox.com https://api.tiles.mapbox.com; font-src 'self' https://cdn.olivierpieters.be; object-src 'none';","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","strict-transport-security":"max-age=31536000; includeSubDomains; preload","access-control-allow-origin":"*","accept-ranges":"bytes"},"status":200}} []
[2019-02-05 06:46:24] graby.DEBUG: Treating as UTF-8 {"encoding":"utf-8"} []
[2019-02-05 06:46:24] graby.DEBUG: Opengraph data: [array] {"ogData":[]} []
[2019-02-05 06:46:24] graby.DEBUG: Looking for site config files to see if single page link exists [] []
[2019-02-05 06:46:24] graby.DEBUG: Returning cached and merged site config for olivierpieters.be {"host":"olivierpieters.be"} []
[2019-02-05 06:46:24] graby.DEBUG: No "single_page_link" config found [] []
[2019-02-05 06:46:24] graby.DEBUG: Attempting to extract content [] []
[2019-02-05 06:46:24] graby.DEBUG: Returning cached and merged site config for olivierpieters.be {"host":"olivierpieters.be"} []
[2019-02-05 06:46:24] graby.DEBUG: Strings replaced: 0 (find_string and/or replace_string) {"count":0} []
[2019-02-05 06:46:24] graby.DEBUG: Attempting to parse HTML with libxml {"parser":"libxml"} []
[2019-02-05 06:46:24] graby.DEBUG: Body size after Readability: 27138 {"length":27138} []
[2019-02-05 06:46:24] graby.DEBUG: Trying //meta[@property="og:title"]/@content for title {"pattern":"//meta[@property=\"og:title\"]/@content"} []
[2019-02-05 06:46:24] graby.DEBUG: Trying //meta[@property="article:published_time"]/@content for date {"pattern":"//meta[@property=\"article:published_time\"]/@content"} []
[2019-02-05 06:46:24] graby.DEBUG: Trying //html[@lang]/@lang for language {"pattern":"//html[@lang]/@lang"} []
[2019-02-05 06:46:24] graby.DEBUG: Trying //meta[@name="DC.language"]/@content for language {"pattern":"//meta[@name=\"DC.language\"]/@content"} []
[2019-02-05 06:46:24] graby.DEBUG: Stripping 5 empty a elements {"length":5} []
[2019-02-05 06:46:24] graby.DEBUG: Using Readability [] []
[2019-02-05 06:46:24] graby.DEBUG: Detected title: Designing a Business Card in LaTeX {"title":"Designing a Business Card in LaTeX"} []
[2019-02-05 06:46:24] graby.DEBUG: Detecting body [] []
[2019-02-05 06:46:24] graby.DEBUG: Pruning content [] []
[2019-02-05 06:46:24] graby.DEBUG: Success ? 1 {"is_success":true} []
[2019-02-05 06:46:24] graby.DEBUG: Filtering HTML to remove XSS [] []
[2019-02-05 06:46:24] graby.DEBUG: Returning data (most interesting ones): [array] {"data":{"status":200,"html":"<p>In 2017, I will graduate from <a target=\"_blank\" href=\"https://www.ugent.be\">Ghent University</a>. This means starting a professional career, either in academia or in industry. One of the first things that came to mind was that I needed a good curriculum vitæ, and a business card. I <a href=\"https://olivierpieters.be/curriculum-vitae/\">already have the former</a>, but I still needed a business card. Consequently, I looked a bit online and was not all that impressed by the tools people used to design them. I did not want to change some template everybody’s using, but do my own thing. And suddenly, I realised: what better tool than LaTeX to make it!</p><p>I know, I already hear some saying “why not use the online tools?” or “Photoshop?”. I picked LaTeX because I want to have a platform independent implementation and because why not? I really like making LaTeX documents, so this seemed like something other than creating long documents.</p><p>So, how are we going to create it? First, we’ll make a template for the front and back sides. Then, we will modify this to our needs and have a perfectly formatted and aligned business card.</p><div class=\"tldr\"><p>Checkout the <a href=\"https://github.com/opieters/business-card\" target=\"_blank\">GitHub repository</a>.</p></div><p>Before we start creating our business card, we first need to make some design choices. This includes fonts and colours we are going to use. We will employ custom fonts, so the XeLaTeX compiler is needed. I’ve chosen for the <a target=\"_blank\" href=\"https://github.com/mozilla/Fira\">Fira font from Mozilla</a>. Make sure you have the font (or change the code of course) correctly installed on your system before continuing. You will also need to install <a target=\"_blank\" href=\"http://fontawesome.io\">FontAwesome</a> on your system. More on that later.</p><p>To make our card a bit more attractive, we are also going to add some colour. These are the three colours we will use here:</p><div class=\"row colour_palette\"><p>#2F3142</p><p>#474A65</p><p>#357F2D</p></div><p>They are not really eye-popping, but I don’t think that’s needed either. The two darker colours will be used for the text and the green one for small divider lines. To select these, I really like to use <a target=\"_blank\" href=\"http://www.colorhexa.com/\">ColorHexa</a> (a colour picker).</p><p>Now, it’s time to start writing some LaTeX. This is the minimal template we’ll use for the design:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% !TEX TS-program = xelatex\n\\documentclass[10pt,oneside,final]{article}\n\\usepackage{tikz}\n\\begin{document}\n  \\thispagestyle{empty}\n  \\vspace*{\\fill}\n  \\begin{center}\n    \\begin{tikzpicture}\n      % definition of the actual layout\n    \\end{tikzpicture}\n  \\end{center}\n  \\vspace*{\\fill}\n\\end{document}\n</pre></div><p>We use the <code>article</code> class, load TikZ, center the picture and vertically align the TikZ environment using <code>\\vspace*{\\fill}</code>. We also remove the page numbers with <code>\\thispagestyle{empty}</code>. We will need some additional commands that set predefined margins to zero. However, first we will defined that card size.</p><p>There are lots of business card sizes. Here, we will use the format most used in the US and Canada: 3.5x2 inches. In other countries, the size may differ. Check yours on <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Business_card#Dimensions\">Wikipedia</a>.</p><p>We set the proper size using the <code>geometry</code> package:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% set all margins to 0 and set business card size\n\\usepackage[paperwidth=2in,paperheight=3.5in,margin=0cm,noheadfoot]{geometry}\n</pre></div><p>We also removed the header and footer and all possible margins to fully use the card.</p><p>We also have to set the default baseline size and the distance between header and text of the page to zero. Just in case, we will also remove the paragraph indents (this is not really needed):</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\setlength{\\baselineskip}{0cm} % between baselines\n\\setlength{\\topskip}{0pt}      % between header and text\n\\usepackage{parskip}           % remove paragraph indents\n</pre></div><p>Now, <code>\\vspace*{\\fill}</code> will indeed result in a perfectly centred <code>tikzpicture</code>.</p><p>Since we want to load custom fonts (XeLaTeX ❤️), we will also load these two packages:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\usepackage{fontspec}          % load external fonts\n\\usepackage{fontawesome}       % icon font\n</pre></div><p>FontAwesome is loaded by the <code>fontawesome</code> package. As a result, it needs to be installed on your system as well. This packages defines all sorts of icons that can be inserted by means of <code>\\fa&lt;name&gt;</code> where <code>&lt;name&gt;</code> is a description fot the icon. An anchor is for instanstace inserted by typing <code>\\faAnchor</code>.</p><p>We load the font of choice:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% load external font\n\\setmainfont[Numbers={OldStyle,Monospaced}]{Fira Sans}\n\\setsansfont{Fira Sans}\n\\setmonofont{Fira Mono}\n</pre></div><p>If you want to use more than one font, it’s easiest to do this by defining a new font family:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\newfontfamily\\anotherfont[&lt;features&gt;]{&lt;name&gt;}\n</pre></div><p>Changing the font is easy now: just add <code>\\anotherfont</code> where the font should be applied. A long how-to that explains all about fonts in different flavours of (La)TeX can be found <a target=\"_blank\" href=\"http://tex.stackexchange.com/questions/25249/how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document\">here</a>.</p><p>Now, it’s time to load our drawing package TikZ’s libraries and define our colours:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% load and configure tikz libraries\n\\usetikzlibrary{matrix,positioning,calc}\n\\usepackage{xcolor}                        % more colour options\n\\definecolor{seplinecolour}{HTML}{357f2d}  % green\n\\definecolor{iconcolour}{HTML}{2f3142}     % dark\n\\definecolor{textcolour}{HTML}{2f3142}     % dark\n\\definecolor{jobtitlecolour}{HTML}{474a65} % light dark\n</pre></div><p>The above colour commands only define new colours. We still need to use them. The darkest one will be used for the text in stead of pure black. Pure black is has a very high contrast with the white background, that’s why we are using a slightly lighter colour. To avoid having to change the colour multiple times, we can modify the global text colour with the following command (<a target=\"_blank\" href=\"http://tex.stackexchange.com/questions/26549/how-do-i-globally-set-the-text-color-in-xelatex\">source</a>):</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% change global colour\n\\makeatletter\n\\newcommand{\\globalcolor}[1]{%\n  \\color{#1}\\global\\let\\default@color\\current@color\n}\n\\makeatother\n\\AtBeginDocument{\\globalcolor{textcolour}}\n</pre></div><p>Hard coding the spacing between different elements is quicker for the initial design, but it’s much slower for fine tuning it at the end. So, we’ll immediately use length variables to hold our spacing definitions. Here’s a template. We will use this to define length variables for the font and back sides.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% define some lengths for internal spacing\n\\newlength{\\somelength}\n\\setlength{\\somelength}{2cm}\n</pre></div><p>By now, the preamble contains all the global variables for both the front and back sides. Additionally, we also have laid out the basics for the document contents. Let’s start adding the actual content!</p><h2 id=\"front-side\">Front Side</h2><div class=\"row\"><div class=\"eight columns\"><p>The front side is obviously the most important side, since it'll contain your name, job title, contact information, etc. Before starting on the actual layout, we need to get an idea on the layout we want to create. For inspiration, one can always search sites such as <a target=\"_blank\" href=\"https://www.pinterest.com/search/pins/?q=business%20card\">Pinterest</a> to find interesting designs and modify these to make them your own. Be aware of licensing on the content you are using though!</p><p>Here, we'll not make a too complicated card. The general layout will be a stacked one where we will separate each section with a small line. It will look somewhat like this figure.</p><p>Because we're working with these stacked-like structure, we can work with the very convenient `matrix` construct from TikZ. This basically allows to group nodes and drawings in a table-like structure. The syntax is very straightforward if you're familiar with TikZ and tabular.</p></div><div class=\"four columns\"><figure id=\"business-card-outline\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-outline.svg\" alt=\"business card front\" class=\"frame centre-element max-300px-wide\" /></figure></div></div><p>Here’s an example taken from the TikZ manual:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\matrix[fill=red!20] (label) at (2,1) {\n    \\draw (0,0) circle (4mm);   &amp; \\node[rotate=10] {Hello};        \\\\\n    \\draw (0.2,0) circle (2mm); &amp; \\fill[red]   (0,0) circle (3mm); \\\\\n};\n</pre></div><p>As can be seen in the above example, a matrix behaves like a node, having a location, an optional location reference and a label that contains our grid. Each cell has its own coordinate space, and will be aligned as a table. This means the row separator is <code>\\\\</code> and the column separator is <code>&amp;</code>.</p><p>Before starting the actual implementation, we will define some spacing variables. These will come in handy later on.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% define some lengths for internal spacing\n\\newlength{\\seplinewidth}    \\setlength{\\seplinewidth}{2cm}\n\\newlength{\\seplineheight}   \\setlength{\\seplineheight}{1pt}\n\\newlength{\\seplinedistance} \\setlength{\\seplinedistance}{0.3cm}\n</pre></div><p>Now applying this design to our business card, we obtain the following name and title section:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\matrix[every node/.style={anchor=center,font=\\huge},anchor=center] (name) {\n  \\node{John}; \\\\\n  \\node{Doe}; \\\\\n  \\node{\\color{jobtitlecolour}\\normalsize\\textit{job title}}; \\\\\n};\n</pre></div><p>This adds the given name, surname and job title in a single column and applies the same options to each of them. The options are set using <code>every node/.style</code>, this is more convenient that doing adding these per node (e.g. <code>\\node[anchor=center,font=\\huge]{John};</code>). Finally, we also set the anchor of the matrix-node to its centre (not really needed, but this might be convenient in some situations).</p><p>Now, a small side note on the job title. We added some additional commands to its label to change the formatting. First, we changed the font colour from the default one to a the <code>jobtitlecolour</code> colour (defined above). This makes the name and title sections stand better apart. Furthermore, we also changed to font size from <code>\\huge</code> to <code>\\normalsize</code> or <code>10pt</code>.</p><p>Next, let’s add the bar to separate the identity section from the contact section by means of a horizontal bar. We will use our predefined spacing lengths to specify the length between the identity node, the bar and the contact information maxtrix node (see below).</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\node[below=\\seplinedistance of name] (hl1) {};\n\\draw[line width=\\seplineheight,color=seplinecolour] (hl1)++(-\\seplinewidth/2,0)\n  -- ++(\\seplinewidth,0);\n</pre></div><p>First, we define a helper node <code>hl1</code>. This node will be located <code>\\seplinedistance</code> below the souther anchor of our identity node (<code>name</code>). Then, we use this to draw the line. <code>(hl1)++(-\\seplinewidth/2,0)</code> creates an unnamed node that is located <code>\\seplinewidth/2</code> to the left of <code>hl1</code>. Then we start drawing the line (<code>--</code>) till we reach the next node. This is again a relative unnamed node located <code>\\seplinewidth</code> to the right of the <em>previous</em> node (i.e. our other unnamed node). Consequently, it will be located <code>\\seplinewidth/2</code> to the right of <code>hl1</code>.</p><p>The contact information matrix-node looks like this:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\matrix [below=\\seplinedistance of hl1,\n         column 1/.style={anchor=center,color=iconcolour},\n         column 2/.style={anchor=west}] (contact) {\n  \\node{\\faGlobe}; &amp; \\node{johndoe.com};\\\\\n  \\node{\\faEnvelope}; &amp;\\node{me@johndoe.com};\\\\\n  \\node{\\faPhone}; &amp;\\node{+1 781 555 1212}; \\\\\n  \\node{\\faGithub}; &amp;\\node{johndoe}; \\\\\n};\n</pre></div><p>Again, we use relative spacing to get the distances right. This time however, we are using the different options depending on the column the nodes are located in. This is needed to properly align everything.</p><p>We also need to add a separator to separate the the contact information section from our next section: the interests section. The code is almost identical to the previous separator line:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\node[below=\\seplinedistance of contact] (hl2) {};\n\\draw[line width=\\seplineheight,color=seplinecolour] (hl2)++(-\\seplinewidth/2,0)\n  -- ++(\\seplinewidth,0);\n</pre></div><div class=\"row\"><div class=\"eight columns\"><p>Lastly, the interests section. We will use graphical symbols to depict some of out major interests or passions. These can be arranged into a two rows or one, depending on the amount you want to include. Here, I've picked five icons and they work best if used in a single row.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% interests\n\\matrix [below=\\seplinedistance of hl2,\n         every node/.style={anchor=center,font=\\LARGE}]\n         (interests) {\n  \\node{\\faCode}; &amp; \\node{\\faCoffee}; &amp;\n  \\node{\\faLock}; &amp; \\node{\\faWrench}; &amp;\n  \\node{\\faCameraRetro}; \\\\\n};\n</pre></div><p>After combining all of this, we obtain the final result.</p></div><div class=\"four columns\"><figure id=\"business-card-front\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-front.svg\" alt=\"business card front\" class=\"frame\" /></figure></div></div><h2 id=\"back-side\">Back Side</h2><p>The front side is the more important one, but leaving the back side blank is a missed opportunity. Why not add an image, logo or QR-code? Here, we’ll add a QR-code and logo to add more useful information. Again, we will start from the basic template we created in the first section.</p><p>To add external images and the QR-code, we need to load these additional packages:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\usepackage{graphics}        % load images\n\\usepackage[nolinks]{qrcode} % create QR codes\n</pre></div><p>Of course, it’s also possible to include an externally generated QR-code, but make sure it is a vector image. Otherwise, it might not be sharp enough for printing.</p><p>The lengths and colours below define the styling options. Notice that we are using pure black in this case for the text. This is to make sure the contrast in the QR-code is qas high as possible.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\newlength{\\qrheight}   \\setlength{\\qrheight}{1in}\n\\newlength{\\edgemargin} \\setlength{\\edgemargin}{0.2in}\n\\newlength{\\logowith}   \\setlength{\\logowith}{0.5in}\n\\definecolor{bordercolour}{HTML}{357f2d}  % green\n\\definecolor{textcolour}{HTML}{000000}    % black\n\\makeatletter\n\\newcommand{\\globalcolor}[1]{%\n  \\color{#1}\\global\\let\\default@color\\current@color\n}\n\\makeatother\n\\AtBeginDocument{\\globalcolor{textcolour}}\n</pre></div><p>That’s it for the preamble. Now, let’s more to the actual contents. Again, we are using a <code>tikzpicture</code> to draw everything on the card. But this time, we are going to use that are not relative to the picture alone. To this end, we need to add these options to our <code>tikzpicture</code> environment: <code>remember picture,overlay,</code>. This will make it possible to use <code>current page.center</code> during positioning.<br />To add some colour to the back side, we are going to draw a border frame in green and fill it with a light green colour that is derived from the green border colour:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\draw[fill=bordercolour!30,draw=bordercolour] (current page.center)\n  ++(-\\paperwidth/2+\\edgemargin,\\paperheight/2-\\edgemargin) rectangle\n  ++(\\paperwidth-2*\\edgemargin,-\\paperheight+2*\\edgemargin);\n</pre></div><p>To add a logo, we can use the following snippet:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% logo\n\\draw (current page.center)\n  ++(0,\\paperheight/2-\\edgemargin-\\paperwidth/2+\\edgemargin+\\logowith/2)\n  node (helper logo) {};\n\\node[anchor=north] at (helper logo) {\\includegraphics[width=\\logowith]{figures/logo}};\n</pre></div><p>This will include the logo image file from the <code>figures/</code> directory with a width of <code>\\logowith</code>. It is assumed that the image dimensions are the same.</p><p>The final thing to add is the QR-code. A QR-code can contain various types of data such as images, text, but also a <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/VCard\">vCard</a>. A vCard is a standardised format for business cards and enables people to instanty add you to their contacts. It’s more powerful than including a link to a curriculum vitae in my opinion.</p><p>A vCard example:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% qr code\n\\draw (current page.center)\n  ++(0,-\\paperheight/2+\\edgemargin+\\paperwidth/2-\\edgemargin-\\qrheight/2)\n  node (helper qr) {};\n\\node[anchor=south] at (helper qr)\n  {\\qrcode[level=M,height=\\qrheight]{BEGIN:VCARD\nVERSION:3.0\nN:John;Doe;;Mr.\nFN:Mr. John Doe\nTITLE:CEO Doe Enterprises\nORG:Doe Enterprises\nPHOTO;VALUE=URI;TYPE=JPEG:https://johndoe.com/path/to/jpeg/image.jpeg\nTEL;TYPE=MOBILE:+1 781 555 1212\nEMAIL:me@johndoe.com\nURL:https://johndoe.com\nREV:2017-29-01T13:52:43Z\nBDAY:19880310\nADR;TYPE=WORK,PREF:;;2 Some Avenue;Anytown;SF;11111;USA\nEND:VCARD}};\n</pre></div><div class=\"row\"><div class=\"eight columns\"><p>The above code illustrated a basic vCard. If you want the QR-code to be less dense, remove the data or change the QR-code level. This level controls the amount of redundancy in the QR-code. `L`, `M`, `Q` and `H` are the different levels from lowest to highest redundancy. Here we've chosen for the default `M`-level since that's a good trade off between data density and redundancy. The meaning of the different vCard properties is <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/VCard#Properties\">well explained on Wikipedia</a>.</p><p>Once all the code is added and compiled at least twice (on the first run it is possible not everything is positioned correctly), this should be the final result.</p></div><div class=\"four columns\"><figure id=\"business-card-back\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-back.svg\" alt=\"business card back\" class=\"frame\" /></figure></div></div><h2 id=\"final-result\">Final Result</h2><div class=\"row\"><div class=\"four columns\"><figure id=\"business-card-front-result\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-front.svg\" alt=\"business card front\" class=\"frame\" /></figure></div><div class=\"four columns\"><figure id=\"business-card-back-result\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-back.svg\" alt=\"business card back\" class=\"frame\" /></figure></div><div class=\"four columns\"><p>This is what the final card looks like. It's pretty simple code and results in a nice looking business card in my opinion. You can download the full code from the <a target=\"_blank\" href=\"https://github.com/opieters/business-card\">GitHub repo</a>.</p></div></div>","title":"Designing a Business Card in LaTeX","language":null,"date":null,"authors":[],"url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex","content_type":"text/html","open_graph":[],"native_ad":false,"all_headers":{"server":"nginx/1.14.0 (Ubuntu)","date":"Tue, 05 Feb 2019 05:46:24 GMT","content-type":"text/html","content-length":"41917","last-modified":"Thu, 31 Jan 2019 07:23:39 GMT","connection":"keep-alive","etag":"\"5c52a27b-a3bd\"","content-security-policy":"default-src 'self'; script-src 'self'  https://cdn.olivierpieters.be https://stats.olivierpieters.be; style-src 'self' https://cdn.olivierpieters.be; img-src 'self' h
```ttps://images.olivierpieters.be https://cdn.olivierpieters.be https://stats.olivierpieters.be https://api.mapbox.com https://api.tiles.mapbox.com; font-src 'self' https://cdn.olivierpieters.be; object-src 'none';","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","strict-transport-security":"max-age=31536000; includeSubDomains; preload","access-control-allow-origin":"*","accept-ranges":"bytes"}}} []
[2019-02-05 06:46:24] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Types\ConversionException: "Could not convert database value "a:1:{i:0;s:26:"M. J" to Doctrine Type array" at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php line 46 {"exception":"[object] (Doctrine\\DBAL\\Types\\ConversionException(code: 0): Could not convert database value \"a:1:{i:0;s:26:\"M. J\" to Doctrine Type array at /www/htdocs/w00e8b2d/rdltr.schnaggelt.es/2.3.6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php:46)"} []
[2019-02-05 06:46:24] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []
[2019-02-05 06:46:24] request.INFO: Matched route "fos_js_routing_js". {"route":"fos_js_routing_js","route_parameters":{"_controller":"fos_js_routing.controller:indexAction","

Adding site via wallabagger:


[2019-02-05 07:10:44] app.DEBUG: Restricted access config enabled? {"enabled":0} []
[2019-02-05 07:10:44] graby.DEBUG: Graby is ready to fetch [] []
[2019-02-05 07:10:44] graby.DEBUG: . looking for site config for olivierpieters.be in primary folder {"host":"olivierpieters.be"} []
[2019-02-05 07:10:44] graby.DEBUG: Appending site config settings from global.txt [] []
[2019-02-05 07:10:44] graby.DEBUG: . looking for site config for global in primary folder {"host":"global"} []
[2019-02-05 07:10:44] graby.DEBUG: ... found site config global.txt {"host":"global.txt"} []
[2019-02-05 07:10:44] graby.DEBUG: Cached site config with key: olivierpieters.be {"key":"olivierpieters.be"} []
[2019-02-05 07:10:44] graby.DEBUG: . looking for site config for global in primary folder {"host":"global"} []
[2019-02-05 07:10:44] graby.DEBUG: ... found site config global.txt {"host":"global.txt"} []
[2019-02-05 07:10:44] graby.DEBUG: Appending site config settings from global.txt [] []
[2019-02-05 07:10:44] graby.DEBUG: Cached site config with key: global {"key":"global"} []
[2019-02-05 07:10:44] graby.DEBUG: Cached site config with key: olivierpieters.be.merged {"key":"olivierpieters.be.merged"} []
[2019-02-05 07:10:44] graby.DEBUG: Fetching url: https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex {"url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-05 07:10:44] graby.DEBUG: Trying using method "get" on url "https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex" {"method":"get","url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-05 07:10:44] graby.DEBUG: Use default user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.92 Safari/535.2" for url "https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex" {"user-agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.92 Safari/535.2","url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-05 07:10:44] graby.DEBUG: Use default referer "http://www.google.co.uk/url?sa=t&source=web&cd=1" for url "https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex" {"referer":"http://www.google.co.uk/url?sa=t&source=web&cd=1","url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex"} []
[2019-02-05 07:10:44] graby.DEBUG: Data fetched: [array] {"data":{"effective_url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex","body":"(only length for debug): 41917","headers":"text/html","all_headers":{"server":"nginx/1.14.0 (Ubuntu)","date":"Tue, 05 Feb 2019 06:10:44 GMT","content-type":"text/html","content-length":"41917","last-modified":"Thu, 31 Jan 2019 07:23:39 GMT","connection":"keep-alive","etag":"\"5c52a27b-a3bd\"","content-security-policy":"default-src 'self'; script-src 'self'  https://cdn.olivierpieters.be https://stats.olivierpieters.be; style-src 'self' https://cdn.olivierpieters.be; img-src 'self' https://images.olivierpieters.be https://cdn.olivierpieters.be https://stats.olivierpieters.be https://api.mapbox.com https://api.tiles.mapbox.com; font-src 'self' https://cdn.olivierpieters.be; object-src 'none';","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","strict-transport-security":"max-age=31536000; includeSubDomains; preload","access-control-allow-origin":"*","accept-ranges":"bytes"},"status":200}} []
[2019-02-05 07:10:44] graby.DEBUG: Treating as UTF-8 {"encoding":"utf-8"} []
[2019-02-05 07:10:44] graby.DEBUG: Opengraph data: [array] {"ogData":[]} []
[2019-02-05 07:10:44] graby.DEBUG: Looking for site config files to see if single page link exists [] []
[2019-02-05 07:10:44] graby.DEBUG: Returning cached and merged site config for olivierpieters.be {"host":"olivierpieters.be"} []
[2019-02-05 07:10:44] graby.DEBUG: No "single_page_link" config found [] []
[2019-02-05 07:10:44] graby.DEBUG: Attempting to extract content [] []
[2019-02-05 07:10:44] graby.DEBUG: Returning cached and merged site config for olivierpieters.be {"host":"olivierpieters.be"} []
[2019-02-05 07:10:44] graby.DEBUG: Strings replaced: 0 (find_string and/or replace_string) {"count":0} []
[2019-02-05 07:10:44] graby.DEBUG: Attempting to parse HTML with libxml {"parser":"libxml"} []
[2019-02-05 07:10:44] graby.DEBUG: Body size after Readability: 27138 {"length":27138} []
[2019-02-05 07:10:44] graby.DEBUG: Trying //meta[@property="og:title"]/@content for title {"pattern":"//meta[@property=\"og:title\"]/@content"} []
[2019-02-05 07:10:44] graby.DEBUG: Trying //meta[@property="article:published_time"]/@content for date {"pattern":"//meta[@property=\"article:published_time\"]/@content"} []
[2019-02-05 07:10:44] graby.DEBUG: Trying //html[@lang]/@lang for language {"pattern":"//html[@lang]/@lang"} []
[2019-02-05 07:10:44] graby.DEBUG: Trying //meta[@name="DC.language"]/@content for language {"pattern":"//meta[@name=\"DC.language\"]/@content"} []
[2019-02-05 07:10:44] graby.DEBUG: Stripping 5 empty a elements {"length":5} []
[2019-02-05 07:10:44] graby.DEBUG: Using Readability [] []
[2019-02-05 07:10:44] graby.DEBUG: Detected title: Designing a Business Card in LaTeX {"title":"Designing a Business Card in LaTeX"} []
[2019-02-05 07:10:44] graby.DEBUG: Detecting body [] []
[2019-02-05 07:10:44] graby.DEBUG: Pruning content [] []
[2019-02-05 07:10:44] graby.DEBUG: Success ? 1 {"is_success":true} []
[2019-02-05 07:10:44] graby.DEBUG: Filtering HTML to remove XSS [] []
[2019-02-05 07:10:44] graby.DEBUG: Returning data (most interesting ones): [array] {"data":{"status":200,"html":"<p>In 2017, I will graduate from <a target=\"_blank\" href=\"https://www.ugent.be\">Ghent University</a>. This means starting a professional career, either in academia or in industry. One of the first things that came to mind was that I needed a good curriculum vitæ, and a business card. I <a href=\"https://olivierpieters.be/curriculum-vitae/\">already have the former</a>, but I still needed a business card. Consequently, I looked a bit online and was not all that impressed by the tools people used to design them. I did not want to change some template everybody’s using, but do my own thing. And suddenly, I realised: what better tool than LaTeX to make it!</p><p>I know, I already hear some saying “why not use the online tools?” or “Photoshop?”. I picked LaTeX because I want to have a platform independent implementation and because why not? I really like making LaTeX documents, so this seemed like something other than creating long documents.</p><p>So, how are we going to create it? First, we’ll make a template for the front and back sides. Then, we will modify this to our needs and have a perfectly formatted and aligned business card.</p><div class=\"tldr\"><p>Checkout the <a href=\"https://github.com/opieters/business-card\" target=\"_blank\">GitHub repository</a>.</p></div><p>Before we start creating our business card, we first need to make some design choices. This includes fonts and colours we are going to use. We will employ custom fonts, so the XeLaTeX compiler is needed. I’ve chosen for the <a target=\"_blank\" href=\"https://github.com/mozilla/Fira\">Fira font from Mozilla</a>. Make sure you have the font (or change the code of course) correctly installed on your system before continuing. You will also need to install <a target=\"_blank\" href=\"http://fontawesome.io\">FontAwesome</a> on your system. More on that later.</p><p>To make our card a bit more attractive, we are also going to add some colour. These are the three colours we will use here:</p><div class=\"row colour_palette\"><p>#2F3142</p><p>#474A65</p><p>#357F2D</p></div><p>They are not really eye-popping, but I don’t think that’s needed either. The two darker colours will be used for the text and the green one for small divider lines. To select these, I really like to use <a target=\"_blank\" href=\"http://www.colorhexa.com/\">ColorHexa</a> (a colour picker).</p><p>Now, it’s time to start writing some LaTeX. This is the minimal template we’ll use for the design:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% !TEX TS-program = xelatex\n\\documentclass[10pt,oneside,final]{article}\n\\usepackage{tikz}\n\\begin{document}\n  \\thispagestyle{empty}\n  \\vspace*{\\fill}\n  \\begin{center}\n    \\begin{tikzpicture}\n      % definition of the actual layout\n    \\end{tikzpicture}\n  \\end{center}\n  \\vspace*{\\fill}\n\\end{document}\n</pre></div><p>We use the <code>article</code> class, load TikZ, center the picture and vertically align the TikZ environment using <code>\\vspace*{\\fill}</code>. We also remove the page numbers with <code>\\thispagestyle{empty}</code>. We will need some additional commands that set predefined margins to zero. However, first we will defined that card size.</p><p>There are lots of business card sizes. Here, we will use the format most used in the US and Canada: 3.5x2 inches. In other countries, the size may differ. Check yours on <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Business_card#Dimensions\">Wikipedia</a>.</p><p>We set the proper size using the <code>geometry</code> package:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% set all margins to 0 and set business card size\n\\usepackage[paperwidth=2in,paperheight=3.5in,margin=0cm,noheadfoot]{geometry}\n</pre></div><p>We also removed the header and footer and all possible margins to fully use the card.</p><p>We also have to set the default baseline size and the distance between header and text of the page to zero. Just in case, we will also remove the paragraph indents (this is not really needed):</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\setlength{\\baselineskip}{0cm} % between baselines\n\\setlength{\\topskip}{0pt}      % between header and text\n\\usepackage{parskip}           % remove paragraph indents\n</pre></div><p>Now, <code>\\vspace*{\\fill}</code> will indeed result in a perfectly centred <code>tikzpicture</code>.</p><p>Since we want to load custom fonts (XeLaTeX ❤️), we will also load these two packages:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\usepackage{fontspec}          % load external fonts\n\\usepackage{fontawesome}       % icon font\n</pre></div><p>FontAwesome is loaded by the <code>fontawesome</code> package. As a result, it needs to be installed on your system as well. This packages defines all sorts of icons that can be inserted by means of <code>\\fa&lt;name&gt;</code> where <code>&lt;name&gt;</code> is a description fot the icon. An anchor is for instanstace inserted by typing <code>\\faAnchor</code>.</p><p>We load the font of choice:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% load external font\n\\setmainfont[Numbers={OldStyle,Monospaced}]{Fira Sans}\n\\setsansfont{Fira Sans}\n\\setmonofont{Fira Mono}\n</pre></div><p>If you want to use more than one font, it’s easiest to do this by defining a new font family:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\newfontfamily\\anotherfont[&lt;features&gt;]{&lt;name&gt;}\n</pre></div><p>Changing the font is easy now: just add <code>\\anotherfont</code> where the font should be applied. A long how-to that explains all about fonts in different flavours of (La)TeX can be found <a target=\"_blank\" href=\"http://tex.stackexchange.com/questions/25249/how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document\">here</a>.</p><p>Now, it’s time to load our drawing package TikZ’s libraries and define our colours:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% load and configure tikz libraries\n\\usetikzlibrary{matrix,positioning,calc}\n\\usepackage{xcolor}                        % more colour options\n\\definecolor{seplinecolour}{HTML}{357f2d}  % green\n\\definecolor{iconcolour}{HTML}{2f3142}     % dark\n\\definecolor{textcolour}{HTML}{2f3142}     % dark\n\\definecolor{jobtitlecolour}{HTML}{474a65} % light dark\n</pre></div><p>The above colour commands only define new colours. We still need to use them. The darkest one will be used for the text in stead of pure black. Pure black is has a very high contrast with the white background, that’s why we are using a slightly lighter colour. To avoid having to change the colour multiple times, we can modify the global text colour with the following command (<a target=\"_blank\" href=\"http://tex.stackexchange.com/questions/26549/how-do-i-globally-set-the-text-color-in-xelatex\">source</a>):</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% change global colour\n\\makeatletter\n\\newcommand{\\globalcolor}[1]{%\n  \\color{#1}\\global\\let\\default@color\\current@color\n}\n\\makeatother\n\\AtBeginDocument{\\globalcolor{textcolour}}\n</pre></div><p>Hard coding the spacing between different elements is quicker for the initial design, but it’s much slower for fine tuning it at the end. So, we’ll immediately use length variables to hold our spacing definitions. Here’s a template. We will use this to define length variables for the font and back sides.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% define some lengths for internal spacing\n\\newlength{\\somelength}\n\\setlength{\\somelength}{2cm}\n</pre></div><p>By now, the preamble contains all the global variables for both the front and back sides. Additionally, we also have laid out the basics for the document contents. Let’s start adding the actual content!</p><h2 id=\"front-side\">Front Side</h2><div class=\"row\"><div class=\"eight columns\"><p>The front side is obviously the most important side, since it'll contain your name, job title, contact information, etc. Before starting on the actual layout, we need to get an idea on the layout we want to create. For inspiration, one can always search sites such as <a target=\"_blank\" href=\"https://www.pinterest.com/search/pins/?q=business%20card\">Pinterest</a> to find interesting designs and modify these to make them your own. Be aware of licensing on the content you are using though!</p><p>Here, we'll not make a too complicated card. The general layout will be a stacked one where we will separate each section with a small line. It will look somewhat like this figure.</p><p>Because we're working with these stacked-like structure, we can work with the very convenient `matrix` construct from TikZ. This basically allows to group nodes and drawings in a table-like structure. The syntax is very straightforward if you're familiar with TikZ and tabular.</p></div><div class=\"four columns\"><figure id=\"business-card-outline\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-outline.svg\" alt=\"business card front\" class=\"frame centre-element max-300px-wide\" /></figure></div></div><p>Here’s an example taken from the TikZ manual:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\matrix[fill=red!20] (label) at (2,1) {\n    \\draw (0,0) circle (4mm);   &amp; \\node[rotate=10] {Hello};        \\\\\n    \\draw (0.2,0) circle (2mm); &amp; \\fill[red]   (0,0) circle (3mm); \\\\\n};\n</pre></div><p>As can be seen in the above example, a matrix behaves like a node, having a location, an optional location reference and a label that contains our grid. Each cell has its own coordinate space, and will be aligned as a table. This means the row separator is <code>\\\\</code> and the column separator is <code>&amp;</code>.</p><p>Before starting the actual implementation, we will define some spacing variables. These will come in handy later on.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% define some lengths for internal spacing\n\\newlength{\\seplinewidth}    \\setlength{\\seplinewidth}{2cm}\n\\newlength{\\seplineheight}   \\setlength{\\seplineheight}{1pt}\n\\newlength{\\seplinedistance} \\setlength{\\seplinedistance}{0.3cm}\n</pre></div><p>Now applying this design to our business card, we obtain the following name and title section:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\matrix[every node/.style={anchor=center,font=\\huge},anchor=center] (name) {\n  \\node{John}; \\\\\n  \\node{Doe}; \\\\\n  \\node{\\color{jobtitlecolour}\\normalsize\\textit{job title}}; \\\\\n};\n</pre></div><p>This adds the given name, surname and job title in a single column and applies the same options to each of them. The options are set using <code>every node/.style</code>, this is more convenient that doing adding these per node (e.g. <code>\\node[anchor=center,font=\\huge]{John};</code>). Finally, we also set the anchor of the matrix-node to its centre (not really needed, but this might be convenient in some situations).</p><p>Now, a small side note on the job title. We added some additional commands to its label to change the formatting. First, we changed the font colour from the default one to a the <code>jobtitlecolour</code> colour (defined above). This makes the name and title sections stand better apart. Furthermore, we also changed to font size from <code>\\huge</code> to <code>\\normalsize</code> or <code>10pt</code>.</p><p>Next, let’s add the bar to separate the identity section from the contact section by means of a horizontal bar. We will use our predefined spacing lengths to specify the length between the identity node, the bar and the contact information maxtrix node (see below).</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\node[below=\\seplinedistance of name] (hl1) {};\n\\draw[line width=\\seplineheight,color=seplinecolour] (hl1)++(-\\seplinewidth/2,0)\n  -- ++(\\seplinewidth,0);\n</pre></div><p>First, we define a helper node <code>hl1</code>. This node will be located <code>\\seplinedistance</code> below the souther anchor of our identity node (<code>name</code>). Then, we use this to draw the line. <code>(hl1)++(-\\seplinewidth/2,0)</code> creates an unnamed node that is located <code>\\seplinewidth/2</code> to the left of <code>hl1</code>. Then we start drawing the line (<code>--</code>) till we reach the next node. This is again a relative unnamed node located <code>\\seplinewidth</code> to the right of the <em>previous</em> node (i.e. our other unnamed node). Consequently, it will be located <code>\\seplinewidth/2</code> to the right of <code>hl1</code>.</p><p>The contact information matrix-node looks like this:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\matrix [below=\\seplinedistance of hl1,\n         column 1/.style={anchor=center,color=iconcolour},\n         column 2/.style={anchor=west}] (contact) {\n  \\node{\\faGlobe}; &amp; \\node{johndoe.com};\\\\\n  \\node{\\faEnvelope}; &amp;\\node{me@johndoe.com};\\\\\n  \\node{\\faPhone}; &amp;\\node{+1 781 555 1212}; \\\\\n  \\node{\\faGithub}; &amp;\\node{johndoe}; \\\\\n};\n</pre></div><p>Again, we use relative spacing to get the distances right. This time however, we are using the different options depending on the column the nodes are located in. This is needed to properly align everything.</p><p>We also need to add a separator to separate the the contact information section from our next section: the interests section. The code is almost identical to the previous separator line:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\node[below=\\seplinedistance of contact] (hl2) {};\n\\draw[line width=\\seplineheight,color=seplinecolour] (hl2)++(-\\seplinewidth/2,0)\n  -- ++(\\seplinewidth,0);\n</pre></div><div class=\"row\"><div class=\"eight columns\"><p>Lastly, the interests section. We will use graphical symbols to depict some of out major interests or passions. These can be arranged into a two rows or one, depending on the amount you want to include. Here, I've picked five icons and they work best if used in a single row.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% interests\n\\matrix [below=\\seplinedistance of hl2,\n         every node/.style={anchor=center,font=\\LARGE}]\n         (interests) {\n  \\node{\\faCode}; &amp; \\node{\\faCoffee}; &amp;\n  \\node{\\faLock}; &amp; \\node{\\faWrench}; &amp;\n  \\node{\\faCameraRetro}; \\\\\n};\n</pre></div><p>After combining all of this, we obtain the final result.</p></div><div class=\"four columns\"><figure id=\"business-card-front\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-front.svg\" alt=\"business card front\" class=\"frame\" /></figure></div></div><h2 id=\"back-side\">Back Side</h2><p>The front side is the more important one, but leaving the back side blank is a missed opportunity. Why not add an image, logo or QR-code? Here, we’ll add a QR-code and logo to add more useful information. Again, we will start from the basic template we created in the first section.</p><p>To add external images and the QR-code, we need to load these additional packages:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\usepackage{graphics}        % load images\n\\usepackage[nolinks]{qrcode} % create QR codes\n</pre></div><p>Of course, it’s also possible to include an externally generated QR-code, but make sure it is a vector image. Otherwise, it might not be sharp enough for printing.</p><p>The lengths and colours below define the styling options. Notice that we are using pure black in this case for the text. This is to make sure the contrast in the QR-code is qas high as possible.</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\newlength{\\qrheight}   \\setlength{\\qrheight}{1in}\n\\newlength{\\edgemargin} \\setlength{\\edgemargin}{0.2in}\n\\newlength{\\logowith}   \\setlength{\\logowith}{0.5in}\n\\definecolor{bordercolour}{HTML}{357f2d}  % green\n\\definecolor{textcolour}{HTML}{000000}    % black\n\\makeatletter\n\\newcommand{\\globalcolor}[1]{%\n  \\color{#1}\\global\\let\\default@color\\current@color\n}\n\\makeatother\n\\AtBeginDocument{\\globalcolor{textcolour}}\n</pre></div><p>That’s it for the preamble. Now, let’s more to the actual contents. Again, we are using a <code>tikzpicture</code> to draw everything on the card. But this time, we are going to use that are not relative to the picture alone. To this end, we need to add these options to our <code>tikzpicture</code> environment: <code>remember picture,overlay,</code>. This will make it possible to use <code>current page.center</code> during positioning.<br />To add some colour to the back side, we are going to draw a border frame in green and fill it with a light green colour that is derived from the green border colour:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">\\draw[fill=bordercolour!30,draw=bordercolour] (current page.center)\n  ++(-\\paperwidth/2+\\edgemargin,\\paperheight/2-\\edgemargin) rectangle\n  ++(\\paperwidth-2*\\edgemargin,-\\paperheight+2*\\edgemargin);\n</pre></div><p>To add a logo, we can use the following snippet:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% logo\n\\draw (current page.center)\n  ++(0,\\paperheight/2-\\edgemargin-\\paperwidth/2+\\edgemargin+\\logowith/2)\n  node (helper logo) {};\n\\node[anchor=north] at (helper logo) {\\includegraphics[width=\\logowith]{figures/logo}};\n</pre></div><p>This will include the logo image file from the <code>figures/</code> directory with a width of <code>\\logowith</code>. It is assumed that the image dimensions are the same.</p><p>The final thing to add is the QR-code. A QR-code can contain various types of data such as images, text, but also a <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/VCard\">vCard</a>. A vCard is a standardised format for business cards and enables people to instanty add you to their contacts. It’s more powerful than including a link to a curriculum vitae in my opinion.</p><p>A vCard example:</p><div class=\"highlight\"><pre class=\"language-latex\" data-lang=\"latex\">% qr code\n\\draw (current page.center)\n  ++(0,-\\paperheight/2+\\edgemargin+\\paperwidth/2-\\edgemargin-\\qrheight/2)\n  node (helper qr) {};\n\\node[anchor=south] at (helper qr)\n  {\\qrcode[level=M,height=\\qrheight]{BEGIN:VCARD\nVERSION:3.0\nN:John;Doe;;Mr.\nFN:Mr. John Doe\nTITLE:CEO Doe Enterprises\nORG:Doe Enterprises\nPHOTO;VALUE=URI;TYPE=JPEG:https://johndoe.com/path/to/jpeg/image.jpeg\nTEL;TYPE=MOBILE:+1 781 555 1212\nEMAIL:me@johndoe.com\nURL:https://johndoe.com\nREV:2017-29-01T13:52:43Z\nBDAY:19880310\nADR;TYPE=WORK,PREF:;;2 Some Avenue;Anytown;SF;11111;USA\nEND:VCARD}};\n</pre></div><div class=\"row\"><div class=\"eight columns\"><p>The above code illustrated a basic vCard. If you want the QR-code to be less dense, remove the data or change the QR-code level. This level controls the amount of redundancy in the QR-code. `L`, `M`, `Q` and `H` are the different levels from lowest to highest redundancy. Here we've chosen for the default `M`-level since that's a good trade off between data density and redundancy. The meaning of the different vCard properties is <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/VCard#Properties\">well explained on Wikipedia</a>.</p><p>Once all the code is added and compiled at least twice (on the first run it is possible not everything is positioned correctly), this should be the final result.</p></div><div class=\"four columns\"><figure id=\"business-card-back\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-back.svg\" alt=\"business card back\" class=\"frame\" /></figure></div></div><h2 id=\"final-result\">Final Result</h2><div class=\"row\"><div class=\"four columns\"><figure id=\"business-card-front-result\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-front.svg\" alt=\"business card front\" class=\"frame\" /></figure></div><div class=\"four columns\"><figure id=\"business-card-back-result\" class=\"centre-element max-300px-wide\"><img src=\"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex/business-card-back.svg\" alt=\"business card back\" class=\"frame\" /></figure></div><div class=\"four columns\"><p>This is what the final card looks like. It's pretty simple code and results in a nice looking business card in my opinion. You can download the full code from the <a target=\"_blank\" href=\"https://github.com/opieters/business-card\">GitHub repo</a>.</p></div></div>","title":"Designing a Business Card in LaTeX","language":null,"date":null,"authors":[],"url":"https://olivierpieters.be/blog/2017/02/11/designing-a-business-card-in-latex","content_type":"text/html","open_graph":[],"native_ad":false,"all_headers":{"server":"nginx/1.14.0 (Ubuntu)","date":"Tue, 05 Feb 2019 06:10:44 GMT","content-type":"text/html","content-length":"41917","last-modified":"Thu, 31 Jan 2019 07:23:39 GMT","connection":"keep-alive","etag":"\"5c52a27b-a3bd\"","content-security-policy":"default-src 'self'; script-src 'self'  https://cdn.olivierpieters.be https://stats.olivierpieters.be; style-src 'self' https://cdn.olivierpieters.be; img-src 'self' https://images.olivierpieters.be https://cdn.olivierpieters.be https://stats.olivierpieters.be https://api.mapbox.com https://api.tiles.mapbox.com; font-src 'self' https://cdn.olivierpieters.be; object-src 'none';","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","strict-transport-security":"max-age=31536000; includeSubDomains; preload","access-control-allow-origin":"*","accept-ranges":"bytes"}}} []
[2019-02-05 07:10:44] app.DEBUG: DownloadImagesSubscriber: disabled. 

May I send you the complete log file? Don't want to post here all URLs for privacy reasons...

thx,
ramon

@j0k3r
Copy link
Member

j0k3r commented Feb 5, 2019

You can come to chat on Gitter, it might be easier.

@aemaeth2501
Copy link

Did this issue resolve ? I face the same issue after moving my wallabag instance to another server (MySQLdump export/import)

@j0k3r
Copy link
Member

j0k3r commented Mar 19, 2019

Not yet fixed.
Did you manage to found which url generated that error?
What version of MySQL are you using?

@aemaeth2501
Copy link

The URL is : https://xb8.github.io/1dollarbypass.html
I have absolutely no issue adding it to Wallabag manually (or through Android and Chrome plugin).
The issue is that I use APIs to add content to wallabag from my personnal wiki (backup purposes) and the error happens while adding to using those API.

Regarding the process, I installed a fresh wallabag on my new server, dumped the mysql db on the old one and imported it on the new. I see articles saved previsouly without any issues, and can add some more, except using APIs.

mySQL version are:

  • Old server:5.7.25-0ubuntu0.16.04.2 (Ubuntu)
  • New one: 5.7.25-0ubuntu0.16.04.2 (Ubuntu)
    The same actually.

@aemaeth2501
Copy link

Can database encoding cause this? I'll double check tomorrow because it's the only difference that could exist between the two instance (today I migrated the entire codebase to ensure the issue is not a version mismatch).

@brdobrdo
Copy link

Same here. Can't fetch articles. Can't autofill API after reinstall on android device. Can't export articles from server. Same error.

@virtadpt
Copy link

Same. Been seeing this for close to two years now.

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

No branches or pull requests

5 participants