Lyx: newcommand for defining variables












1














I'm trying to recreate a template for Lyx that's similar to the Kona Script Letter V2, as seen below.



enter image description here



In short, I was hoping to have a list of newcommands in the PreAmble that define things like Sender Name or Sender Address.



newcommand{SenderName}[1]
newcommand{SenderAddress}[1]


The Lyx User would define these newcommand similarly to what's seen below by way of a .module file with a bunch of Style definitions like this:



Style Sender_Name
Category MyLetter
LatexType Command
Align Left
Margin Dynamic
LabelType Static
LabelString "Sender Name: "
LabelFont
Color Blue
TopSep 1.0
BottomSep 1.0
LatexName SenderName
End


This fails spectacularly because when I try to enter a Sender Name on a lyx file, I believe this comes after the PreAmble, and thus an error is created where newcommand{SenderName}[1] sees an empty arg being entered.



Is there any way around this? I'm trying to make a template completely Lyx-dependent, not requiring any knowledge of LaTeX or TeX.










share|improve this question



























    1














    I'm trying to recreate a template for Lyx that's similar to the Kona Script Letter V2, as seen below.



    enter image description here



    In short, I was hoping to have a list of newcommands in the PreAmble that define things like Sender Name or Sender Address.



    newcommand{SenderName}[1]
    newcommand{SenderAddress}[1]


    The Lyx User would define these newcommand similarly to what's seen below by way of a .module file with a bunch of Style definitions like this:



    Style Sender_Name
    Category MyLetter
    LatexType Command
    Align Left
    Margin Dynamic
    LabelType Static
    LabelString "Sender Name: "
    LabelFont
    Color Blue
    TopSep 1.0
    BottomSep 1.0
    LatexName SenderName
    End


    This fails spectacularly because when I try to enter a Sender Name on a lyx file, I believe this comes after the PreAmble, and thus an error is created where newcommand{SenderName}[1] sees an empty arg being entered.



    Is there any way around this? I'm trying to make a template completely Lyx-dependent, not requiring any knowledge of LaTeX or TeX.










    share|improve this question

























      1












      1








      1







      I'm trying to recreate a template for Lyx that's similar to the Kona Script Letter V2, as seen below.



      enter image description here



      In short, I was hoping to have a list of newcommands in the PreAmble that define things like Sender Name or Sender Address.



      newcommand{SenderName}[1]
      newcommand{SenderAddress}[1]


      The Lyx User would define these newcommand similarly to what's seen below by way of a .module file with a bunch of Style definitions like this:



      Style Sender_Name
      Category MyLetter
      LatexType Command
      Align Left
      Margin Dynamic
      LabelType Static
      LabelString "Sender Name: "
      LabelFont
      Color Blue
      TopSep 1.0
      BottomSep 1.0
      LatexName SenderName
      End


      This fails spectacularly because when I try to enter a Sender Name on a lyx file, I believe this comes after the PreAmble, and thus an error is created where newcommand{SenderName}[1] sees an empty arg being entered.



      Is there any way around this? I'm trying to make a template completely Lyx-dependent, not requiring any knowledge of LaTeX or TeX.










      share|improve this question













      I'm trying to recreate a template for Lyx that's similar to the Kona Script Letter V2, as seen below.



      enter image description here



      In short, I was hoping to have a list of newcommands in the PreAmble that define things like Sender Name or Sender Address.



      newcommand{SenderName}[1]
      newcommand{SenderAddress}[1]


      The Lyx User would define these newcommand similarly to what's seen below by way of a .module file with a bunch of Style definitions like this:



      Style Sender_Name
      Category MyLetter
      LatexType Command
      Align Left
      Margin Dynamic
      LabelType Static
      LabelString "Sender Name: "
      LabelFont
      Color Blue
      TopSep 1.0
      BottomSep 1.0
      LatexName SenderName
      End


      This fails spectacularly because when I try to enter a Sender Name on a lyx file, I believe this comes after the PreAmble, and thus an error is created where newcommand{SenderName}[1] sees an empty arg being entered.



      Is there any way around this? I'm trying to make a template completely Lyx-dependent, not requiring any knowledge of LaTeX or TeX.







      macros lyx documentclass-writing lyx-layouts modules






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      JalepJalep

      366




      366






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469456%2flyx-newcommand-for-defining-variables%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469456%2flyx-newcommand-for-defining-variables%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Lallio

          Unable to find Lightning Node

          Futebolista