4

I write bridge diagram with LaTeX. Source file is in PBN format. Hand is for exampe QT2 98 J962 AKJ6. How this string change to \pika Q102\srdce 98 \karo J962 \tref AKJ6 ?

To begin \pika, first space \srdce , second space \karo and last space \tref and T is change to 10

Samples of diagram is on page http://new.bridgekosice.sk/bridzove-diagramy-vykrelene-pomocou-tex:

Source code for next diagram wittout parameters is

\begin{tabular}{|lll|}
\hline
Board 1 & \quad\pika Q102 &  \\

Deals: North& \quad\srdce 98 &   \\

Vul: none & \quad\karo J962 &  \\

& \quad\tref AKJ6  &  \\

\pika AJ54       & \multirow{4}{1}{\mstul}     & \pika K76       \\
\srdce 76        &                                    & \srdce AKQ52     \\
\karo A85         &                                    & \karo  Q107     \\

\tref  8432             &  & \tref 95 \\

\multirow{3}{1}{ \begin{tabular}{ccc} & 11 \\ & \,9 \quad\, 14 \\ & 6 \end{tabular}} & \quad\pika 983 &  \\

& \quad\srdce J1043 &  \\

& \quad\karo K43 &  \\

& \quad\tref Q107 &  \\

\hline
\end{tabular}

I can this write with

\bgdiagram{board}{n}{e}{s}{w}{visible}

where parameters is: board - number of board n,e,s,w - north,east,south,west hand visible - 1111 all hand are visible, 1010 only north and south hand are visible

enter image description here

  • Welcome to TeX.SX! You may have a look on our starter guide. – texenthusiast May 8 '13 at 18:03
  • @texenthusiast Why should one do that ? It still implies a mistake. ;) – percusse May 8 '13 at 18:11
  • 1
    Shouldn't it rather be \srdce 98 instead of \srdce J962 (in your first sentence)? – Xavier May 8 '13 at 18:26
  • 1
    Also, what is the question? :) – Xavier May 8 '13 at 18:27
0
Let us assume that you can add `\1` at the beginning of a line. Then

\documentclass{article}

\begin{document}

\def\pika{{$\spadesuit$}}
\def\srdce{{$\heartsuit$}}
\def\karo{{$\diamondsuit$}}
\def\trefl{{$\clubsuit$}}
\catcode`\T=13
\defT{10}
\def\1#1 #2 #3 #4 {\pika #1 \srdce #2 \karo #3 \trefl #4 }


\1QT2 98 J962 AKJ6 

\end{document}

enter image description here

Warning: It changes the meaning of the letter T!

  • On my page with wordpress and QuickLaTeX it is no work. Write Error mesage: Not allowed command sequence – Tibor Menyhért May 8 '13 at 20:13
  • @TiborMenyhért QuickLaTeX offers only a subset of commands aviable in LaTeX, in particular pure TeX tricks might be impossible. It is possible to rearrange my macro to produce string acceptable by QuickLaTeX, but rather outside WWW page. – Przemysław Scherwentke May 9 '13 at 0:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.