Example #1
0
  public void render(Title title, Section section, int lvl, LatexPreamble latexPreamble) {
    logger.trace("Render title");
    if (title.isSetNumbering()) {
      logger.warn("Ignoring numbring");
    }

    txt.add("");

    StringBuffer sb = new StringBuffer();
    sb.append("\\").append(latexPreamble.getSectionHeaderName(lvl));
    sb.append("{").append(TxtTitleFactory.build(title)).append("}");
    txt.add(sb.toString());

    if (section.isSetId()) {
      txt.add("\\label{" + section.getId() + "}");
    }
  }
Example #2
0
 public static synchronized Section getRenderer(Section section, String id)
     throws ExlpXpathNotFoundException, ExlpXpathNotUniqueException {
   Section result = null;
   for (Object o : section.getContent()) {
     if (o instanceof Section) {
       Section child = (Section) o;
       if (child.getId().equals(id)) {
         if (result != null) {
           throw new ExlpXpathNotUniqueException(
               "No unique " + Section.class.getSimpleName() + " for id=" + id);
         }
         result = child;
       }
     }
   }
   if (result == null) {
     throw new ExlpXpathNotFoundException(
         "No " + Section.class.getSimpleName() + " found for id=" + id);
   }
   return result;
 }