Hi all, I just found out about the flashcards (http://www.ctan.org/tex-archive/macros/latex/contrib/flashcards) latex package and started using it in lyx. I used the layout file from http://www.physik.fu-berlin.de/~mhoffman/latex/flashcards/ as a start. I added some list envoirments, which work quite well. Now I'm looking for a way to put a cardtitle from within lyx. In Latex it would look like the following: \begin{flashcard}[cardtitle]{Testfront} testback \end{flashcard}
I thought about using short title but couldn't figure out how to use it. so I created an command which should redefine \cardtitle and put that into an enviroment. this works for the first occourance, but not inside the flashcard enviroment. There is some sort of scope problem... The old title is reset when leaving the environment. So I'm looking for a solution to set the cardtitle. Any help on how to leave the local scope in an envoirment or any other way to change the cardtitle from within lyx would really be welcome. I attached a (german) example. Beginning with card 4 the title should be test and not Mechanik. Thanks Jonathan
vordiplom.lyx
Description: application/lyx
#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[flashcards]{flashcards}
# flashcards textclass definition file. flashcards.cls
# Max Hoffmann [EMAIL PROTECTED]
# thanks to Juergen Spitzmueller for the ugly hack
Input stdlists.inc
Input stdcounters.inc
Format 2
ClassOptions
Other "uni,frame"
End
DefaultStyle Rueckseite
Preamble
\newcommand{\cardtitle}{}
\newcommand{\cardno}{\stepcounter{card}Karte \thecard}
\newcommand{\flashcardfoot}{\cardno}
\AtBeginDocument{\newcounter{card}}
\cardfrontstyle{headings}
\cardfrontfoot{\footnotesize{\flashcardfoot}}
\cardfrontfootstyle{left}
EndPreamble
SecNumDepth 0
TocDepth 0
Style Rueckseite
BottomSep 1
LatexName dummy
ParIndent MM
ParSkip 0.4
AlignPossible Block, Left, Right, Center
End
Style Titel/Gebiet
TopSep 2
Font
Size Small
EndFont
LaTexType Command
LatexName setcardtitle
LabelType Static
LabelString "Titel/Gebiet der Karte:"
Margin Dynamic
LabelSep xxx
Preamble
\newcommand{\setcardtitle}[1]{\renewcommand{\cardtitle}{#1}}
EndPreamble
End
Style Karteikarte
BottomSep 1
Font
Size Large
EndFont
#Ugly Hack!
LaTexType Command
LateXName begin{flashcard}[\cardtitle]
Preamble
%\AtEndDocument{\end{flashcard}}
EndPreamble
LabelType Static
LabelString "Karteikarte:"
Margin Dynamic
LeftMargin Karteikarte:xx
LabelSep xx
# LeftMargin 2
End
Style NextKarteikarte
TopSep 2
BottomSep 1
Font
Size Large
EndFont
LaTexType Command
LateXName end{flashcard}\begin{flashcard}[\cardtitle]
LabelType Static
LabelString "Karteikarte:"
Margin Dynamic
LeftMargin Karteikarte:xx
LabelSep xx
End
Style Ende
LatexType Command
LatexName end{flashcard}
KeepEmpty 1
End
