0

I would question how do I solve the following problem. This is a stylistic package where I needed to create a condition. I have made a choice of work as semestral, bachelor. When selecting semestral thesis to display only the author and supervisor. In the case of bachelor thesis is to show the author, supervisor and opponent. If there is no opponent yet specified in the header must also be displayed in the case bachelor thesis. Below you can see the result in the case of semestral and bachelor thesis.

This is a code:

\ifx\akt@type\type@semestral
\else
& \\%
{\slshape \csname opponenttext@\orig@lang\endcsname:}     & \@Opponent \\%
\fi


(\opponent@lastname\relax)-if opponent is not specify
(opponenttext)-show Opponent.
(@Opponent)-name of opponent.
\akt@type\type@semestral-semestral thesis
\akt@type\type@bachelor-bachelor thesis

I think it could be done way with two conditions, such as: 
if (\opponent@lastname\relax  or \akt@type\type@semestral) 
<DO NOT SHOW OPPONENT> 
else 
<SHOW OPPONENT>.

I do not know how to look the exact form of the condition. Can you help me?

First image is semestral thesis, it is ok, condition work, if it is a semestral thesis, opponent is not showed. Second image is bachelor thesis, where is specified a opponent (Lionel Messi for example) and it is showed. Third (last) image is bachelor thesis, where is not specified the opponent in the header, but is is showed.

Semestral thesis

Bachelor thesis-showed

Bachelor thesis-do not showed

  • 2
    Can you provide a full document instead of fragments only? At the moment, it's a little bit unclear to me –  Dec 25 '15 at 22:37
  • It is too long and it is also in czech language, i just need to know, how to wrote a condition with two conditions. I think this should work, but I do not know how to write correctly in latex. \ifx\akt@type\type@semestral or \opponent@lastname\relax \else & \\% {\slshape \csname opponenttext@\orig@lang\endcsname:} & \@Opponent \\% \fi – Jakub Oškera Dec 25 '15 at 22:41
  • I doubt there will be much help then, besides you have already asked basically the same question (two-condition \if) two days ago and it was closed as duplicated –  Dec 25 '15 at 22:45
  • Yes I know, but I never found a command to write it. It was enough just to create a condition with or. What should be the condition stated in previous comments. – Jakub Oškera Dec 25 '15 at 22:49
  • But how? I don't understand how to write in this case. – Jakub Oškera Dec 25 '15 at 22:52
  • Question asked about this by the OP mentioned by @ChristianHupfer above is here. – cfr Dec 25 '15 at 22:55
  • 1
    Well, which of the solutions suggested did you try? What happened? Note that we really need a minimal example if you are having trouble implementing an answer as we can't show you how to taylor that to your problem without a clear statement of the code which constitutes that problem. We do not want or need your whole document. We want the smallest possible document you can create which we can copy-paste-compile to reproduce the problem you want help with. – cfr Dec 25 '15 at 22:57
  • See also http://tex.stackexchange.com/questions/5894/latex-conditional-expression?lq=1. – cfr Dec 25 '15 at 22:58
  • Does this have anything at all to do with Beamer? Do you really specifically want a tex-core solution? (Probably not but maybe you do want a plain TeX solution?) – cfr Dec 25 '15 at 23:15

1 Answers1

1

It is, frankly, hard to be very helpful without an example. This answer is untested because I obviously cannot test it without more information. So it may not work at all or it may not do what it is supposed to do or it may do what it is supposed to do but not what you want it to do or it may cause complications, dial out for pizza at your expense or insist on calling NASA and asking for help leaving the planet.

Do you just want something like this? This is what it seems as if you probably want, difficult though it is to tell.

\ifx\akt@type\type@semestral
\else
  \ifx\opponent@lastname\relax
  \else
    & \\%
    {\slshape \csname opponenttext@\orig@lang\endcsname:}     & \@Opponent \\%
  \fi
\fi

Here's a simple illustration of the above strategy:

\documentclass{article}
\newif\iffruit
\newcommand*\classifyme{%
  \iffruit\relax
  \else
    \ifx\myseason\relax
    \else
      : A vegetable available in \myseason.
    \fi
  \fi
  \global\let\myseason\relax\fruitfalse
}
\begin{document}
Strawberry\fruittrue\classifyme

Peach\fruittrue\def\myseason{summer}\classifyme

Runner beans\fruitfalse\classifyme

Sweetcorn\fruitfalse\def\myseason{autumn}\classifyme

\end{document}

seasonal non-fruits

cfr
  • 198,882